All Projects → MG2033 → Shufflenet

MG2033 / Shufflenet

Licence: apache-2.0
ShuffleNet Implementation in TensorFlow

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Shufflenet

Mobilenet V2
A Complete and Simple Implementation of MobileNet-V2 in PyTorch
Stars: ✭ 206 (-45.5%)
Mutual labels:  classification, realtime
Mobilenet
A Clearer and Simpler MobileNet Implementation in TensorFlow
Stars: ✭ 119 (-68.52%)
Mutual labels:  classification, realtime
Aws Mobile Appsync Events Starter React
GraphQL starter application with Realtime and Offline functionality using AWS AppSync
Stars: ✭ 337 (-10.85%)
Mutual labels:  realtime
Socketstream
A framework for Realtime Web Apps
Stars: ✭ 3,567 (+843.65%)
Mutual labels:  realtime
Artificial Adversary
🗣️ Tool to generate adversarial text examples and test machine learning models against them
Stars: ✭ 348 (-7.94%)
Mutual labels:  classification
Adversarial autoencoder
A wizard's guide to Adversarial Autoencoders
Stars: ✭ 339 (-10.32%)
Mutual labels:  classification
Aws Appsync Community
The AWS AppSync community
Stars: ✭ 356 (-5.82%)
Mutual labels:  realtime
Tensorflow Resources
Curated Tensorflow code resources to help you get started with Deep Learning.
Stars: ✭ 330 (-12.7%)
Mutual labels:  classification
Rmdl
RMDL: Random Multimodel Deep Learning for Classification
Stars: ✭ 375 (-0.79%)
Mutual labels:  classification
Open3d Pointnet2 Semantic3d
Semantic3D segmentation with Open3D and PointNet++
Stars: ✭ 342 (-9.52%)
Mutual labels:  classification
Realtime Server
A realtime dedicated game server ( FPS / MOBA ). 一个实时的专用游戏服务器.
Stars: ✭ 358 (-5.29%)
Mutual labels:  realtime
Eureca.io
eureca.io : a nodejs bidirectional RPC that can use WebSocket, WebRTC or XHR fallback as transport layers
Stars: ✭ 341 (-9.79%)
Mutual labels:  realtime
Statoscope
Analyzes webpack stats and shows detailed info about it on the screen.
Stars: ✭ 322 (-14.81%)
Mutual labels:  realtime
Spikenail
A GraphQL Framework for Node.js
Stars: ✭ 358 (-5.29%)
Mutual labels:  realtime
Text Classification Cnn Rnn
CNN-RNN中文文本分类,基于TensorFlow
Stars: ✭ 3,613 (+855.82%)
Mutual labels:  classification
Yolact
A simple, fully convolutional model for real-time instance segmentation.
Stars: ✭ 4,057 (+973.28%)
Mutual labels:  realtime
Telepat Api
This is the Telepat API where HTTP calls are made. CRUD operations are not processed here directly. Messages are sent to the Telepat workers where CRUD operations are being taken care of along with client communication (notifications).
Stars: ✭ 335 (-11.38%)
Mutual labels:  realtime
Syphon Framework
Syphon is a Mac OS X technology to allow applications to share video and still images with one another in realtime, instantly.
Stars: ✭ 341 (-9.79%)
Mutual labels:  realtime
Franc
Natural language detection
Stars: ✭ 3,605 (+853.7%)
Mutual labels:  classification
Gfocal
Generalized Focal Loss: Learning Qualified and Distributed Bounding Boxes for Dense Object Detection, NeurIPS2020
Stars: ✭ 376 (-0.53%)
Mutual labels:  classification

ShuffleNet

An implementation of ShuffleNet introduced in TensorFlow. According to the authors, ShuffleNet is a computationally efficient CNN architecture designed specifically for mobile devices with very limited computing power. It outperforms Google MobileNet by small error percentage at much lower FLOPs.

Link to the original paper: ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices

ShuffleNet Unit



Group Convolutions

The paper uses the group convolution operator. However, that operator is not implemented in TensorFlow backend. So, I implemented the operator using graph operations.

This issue was discussed here: Support Channel groups in convolutional layers #10482

Channel Shuffling



Channel Shuffling can be achieved by applying three operations:

  1. Reshaping the input tensor from (N, H, W, C) into (N, H, W, G, C').

  2. Performing matrix transpose operation on the two dimensions (G, C').

  3. Reshaping the tensor back into (N, H, W, C).

    N: Batch size, H: Feature map height, W: Feature map width, C: Number of channels, G: Number of groups, C': Number of channels / Number of groups

    Note that: The number of channels should be divisible by the number of groups.

Usage

Main Dependencies

Python 3 or above
tensorflow 1.3.0
numpy 1.13.1
tqdm 4.15.0
easydict 1.7
matplotlib 2.0.2

Train and Test

  1. Prepare your data, and modify the data_loader.py/DataLoader/load_data() method.
  2. Modify the config/test.json to meet your needs.

Run

python main.py --config config/test.json

Results

The model have successfully overfitted TinyImageNet-200 that was presented in CS231n - Convolutional Neural Networks for Visual Recognition. I'm working on ImageNet training..

Benchmarking

The paper has achieved 140 MFLOPs using the vanilla version. Using the group convolution operator implemented in TensorFlow, I have achieved approximately 270 MFLOPs. The paper counts multiplication+addition as one unit, so roughly dividing 270 by two, I have achieved what the paper proposes.

To calculate the FLOPs in TensorFlow, make sure to set the batch size equal to 1, and execute the following line when the model is loaded into memory.

tf.profiler.profile(
        tf.get_default_graph(),
        options=tf.profiler.ProfileOptionBuilder.float_operation(), cmd='scope')

TODO

  • Training on ImageNet dataset. In progress...

Updates

  • Inference and training are working properly.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Acknowledgments

Thanks for all who helped me in my work and special thanks for my colleagues: Mo'men Abdelrazek, and Mohamed Zahran.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].