Basic_CNNs_TensorFlow2-master
所属分类:人工智能/神经网络/深度学习
开发工具:Python
文件大小:34KB
下载次数:3
上传日期:2020-10-27 08:51:55
上 传 者:
信电尼克杨
说明: 使用TensorFlow框架书写的各主流CNN网络模型,没有数据集,可自行更改,能跑通
(The mainstream CNN network models written by tensorflow framework have no data set and can be changed by themselves and can run through)
文件列表:
LICENSE (1069, 2020-07-11)
configuration.py (1507, 2020-07-11)
dataset (0, 2020-07-11)
evaluate.py (1488, 2020-07-11)
models (0, 2020-07-11)
models\__init__.py (0, 2020-07-11)
models\densenet.py (5997, 2020-07-11)
models\efficientnet.py (10392, 2020-07-11)
models\group_convolution.py (10526, 2020-07-11)
models\inception_modules.py (16691, 2020-07-11)
models\inception_resnet_v1.py (11136, 2020-07-11)
models\inception_resnet_v2.py (9326, 2020-07-11)
models\inception_v4.py (1837, 2020-07-11)
models\mobilenet_v1.py (5460, 2020-07-11)
models\mobilenet_v2.py (6050, 2020-07-11)
models\mobilenet_v3_block.py (2841, 2020-07-11)
models\mobilenet_v3_large.py (4287, 2020-07-11)
models\mobilenet_v3_small.py (3634, 2020-07-11)
models\residual_block.py (3885, 2020-07-11)
models\resnet.py (4266, 2020-07-11)
models\resnext.py (2649, 2020-07-11)
models\resnext_block.py (2481, 2020-07-11)
models\se_resnet.py (5056, 2020-07-11)
models\se_resnext.py (5759, 2020-07-11)
models\shufflenet_v2.py (6307, 2020-07-11)
models\squeezenet.py (3287, 2020-07-11)
original_dataset (0, 2020-07-11)
parse_tfrecord.py (481, 2020-07-11)
predict.py (890, 2020-07-11)
prepare_data.py (2451, 2020-07-11)
saved_model (0, 2020-07-11)
split_dataset.py (3761, 2020-07-11)
test_single_image.py (1048, 2020-07-11)
to_tfrecord.py (2438, 2020-07-11)
... ...
# Basic_CNNs_TensorFlow2
A tensorflow2 implementation of some basic CNNs.
## Networks included:
+ MobileNet_V1
+ MobileNet_V2
+ [MobileNet_V3](https://github.com/calmisential/MobileNetV3_TensorFlow2)
+ [EfficientNet](https://github.com/calmisential/EfficientNet_TensorFlow2)
+ [ResNeXt](https://github.com/calmisential/ResNeXt_TensorFlow2)
+ [InceptionV4, InceptionResNetV1, InceptionResNetV2](https://github.com/calmisential/InceptionV4_TensorFlow2)
+ SE_ResNet_50, SE_ResNet_101, SE_ResNet_152, SE_ResNeXt_50, SE_ResNeXt_101
+ SqueezeNet
+ [DenseNet](https://github.com/calmisential/DenseNet_TensorFlow2)
+ ShuffleNetV2
+ [ResNet](https://github.com/calmisential/TensorFlow2.0_ResNet)
## Other networks
For AlexNet and VGG, see : https://github.com/calmisential/TensorFlow2.0_Image_Classification
For InceptionV3, see : https://github.com/calmisential/TensorFlow2.0_InceptionV3
For ResNet, see : https://github.com/calmisential/TensorFlow2.0_ResNet
## Train
1. Requirements:
+ Python >= 3.6
+ Tensorflow >= 2.3.0rc1
2. To train the network on your own dataset, you can put the dataset under the folder **original dataset**, and the directory should look like this:
```
|——original dataset
|——class_name_0
|——class_name_1
|——class_name_2
|——class_name_3
```
3. Run the script **split_dataset.py** to split the raw dataset into train set, valid set and test set. The dataset directory will be like this:
```
|——dataset
|——train
|——class_name_1
|——class_name_2
......
|——class_name_n
|——valid
|——class_name_1
|——class_name_2
......
|——class_name_n
|—-test
|——class_name_1
|——class_name_2
......
|——class_name_n
```
4. Run **to_tfrecord.py** to generate tfrecord files.
5. Change the corresponding parameters in **config.py**.
6. Run **train.py** to start training.
If you want to train the *EfficientNet*, you should change the IMAGE_HEIGHT and IMAGE_WIDTH to *resolution* in the params, and then run **train.py** to start training.
## Evaluate
Run **evaluate.py** to evaluate the model's performance on the test dataset.
## Different input image sizes for different neural networks
Type |
Neural Network |
Input Image Size (height * width) |
MobileNet |
MobileNet_V1 |
(224 * 224) |
MobileNet_V2 |
(224 * 224) |
MobileNet_V3 |
(224 * 224) |
EfficientNet |
EfficientNet(B0~B7) |
/ |
ResNeXt |
ResNeXt50 |
(224 * 224) |
ResNeXt101 |
(224 * 224) |
SEResNeXt |
SEResNeXt50 |
(224 * 224) |
SEResNeXt101 |
(224 * 224) |
Inception |
InceptionV4 |
(299 * 299) |
Inception_ResNet_V1 |
(299 * 299) |
Inception_ResNet_V2 |
(299 * 299) |
SE_ResNet |
SE_ResNet_50 |
(224 * 224) |
SE_ResNet_101 |
(224 * 224) |
SE_ResNet_152 |
(224 * 224) |
SqueezeNet |
SqueezeNet |
(224 * 224) |
DenseNet |
DenseNet_121 |
(224 * 224) |
DenseNet_169 |
(224 * 224) |
DenseNet_201 |
(224 * 224) |
DenseNet_269 |
(224 * 224) |
ShuffleNetV2 |
ShuffleNetV2 |
(224 * 224) |
ResNet |
ResNet_18 |
(224 * 224) |
ResNet_34 |
(224 * 224) |
ResNet_50 |
(224 * 224) |
ResNet_101 |
(224 * 224) |
ResNet_152 |
(224 * 224) |
## References
1. MobileNet_V1: [Efficient Convolutional Neural Networks for Mobile Vision Applications](https://arxiv.org/abs/1704.04861)
2. MobileNet_V2: [Inverted Residuals and Linear Bottlenecks](https://arxiv.org/abs/1801.04381)
3. MobileNet_V3: [Searching for MobileNetV3](https://arxiv.org/abs/1905.02244)
4. EfficientNet: [EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks](https://arxiv.org/abs/1905.11946)
5. The official code of EfficientNet: https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet
6. ResNeXt: [Aggregated Residual Transformations for Deep Neural Networks](https://arxiv.org/abs/1611.05431)
7. Inception_V4/Inception_ResNet_V1/Inception_ResNet_V2: [Inception-v4, Inception-ResNet and the Impact of Residual Connectionson Learning](https://arxiv.org/abs/1602.07261)
8. The official implementation of Inception_V4: https://github.com/tensorflow/models/blob/master/research/slim/nets/inception_v4.py
9. The official implementation of Inception_ResNet_V2: https://github.com/tensorflow/models/blob/master/research/slim/nets/inception_resnet_v2.py
10. SENet: [Squeeze-and-Excitation Networks](https://arxiv.org/abs/1709.01507)
11. SqueezeNet: [SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size](https://arxiv.org/abs/1602.07360)
12. DenseNet: [Densely Connected Convolutional Networks](https://arxiv.org/abs/1608.06993)
13. https://zhuanlan.zhihu.com/p/37189203
14. ShuffleNetV2: [ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design
](https://arxiv.org/abs/1807.111***)
15. https://zhuanlan.zhihu.com/p/48261931
16. ResNet: [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385)
近期下载者:
相关文件:
收藏者: