← Open Source
flyyufelix

cnn_finetune

Fine-tune CNN in Keras.

TutorialsML/AI fundamentalsPython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
941
Stars
399
Forks
+0
This week
1
Contributors
Created 2016-10-12 · Updated 2026-09-16 · #12499 today
Top developers
flyyufelix

flyyufelix/cnn_finetune is ranked 12,499 with 941 stars.

Same-category comparison

flyyufelix/cnn_finetune is ranked 12,499 among these 8 peers; ml4a/ml4a.github.io is ranked 12,509.

Same-category comparison
NameRankMetrics
lansinuote/Huggingface_Toturials12,453
Language:
Jupyter Notebook
Stars:
948
Forks:
247
Description:
bert-base-chinese example.
tdpetrou/Machine-Learning-Books-With-Python12,475
Language:
Jupyter Notebook
Stars:
945
Forks:
569
Description:
Chapter by Chapter notes, exercises and code for a variety of machine learning books using Python.
jocicmarko/ultrasound-nerve-segmentation12,480
Language:
Python
Stars:
944
Forks:
325
Description:
Deep Learning Tutorial for Kaggle Ultrasound Nerve Segmentation competition, using Keras.
youssefHosni/Practical-Machine-Learning12,482
Language:
Jupyter Notebook
Stars:
944
Forks:
202
Description:
Practical machine learning notebook & articles covers the machine learning end to end life cycle.
ml4a/ml4a.github.io12,509
Language:
HTML
Stars:
939
Forks:
157
Description:
machine learning for artists.
Machine-Learning-Tokyo/DL-workshop-series12,527
Language:
Jupyter Notebook
Stars:
936
Forks:
251
Description:
Material used for Deep Learning related workshops for Machine Learning Tokyo (MLT).
ML-course/master12,535
Language:
Jupyter Notebook
Stars:
935
Forks:
366
Description:
A machine learning course using Python, Jupyter Notebooks, and OpenML.
keyvank/femtoGPT12,538
Language:
Rust
Stars:
935
Forks:
69
Description:
Pure Rust implementation of a minimal Generative Pretrained Transformer.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryTutorials
SubcategoryML/AI fundamentals
Stars941
Forks399
Contributors1
Created date2016-10-12
Updated date2026-09-16
Stars in 1 day0
Stars in 7 days0
Rank12,499
Previous rank12,424
Rank change-75
7-day stars rank13,456
Previous 7-day stars rank13,467
7-day stars rank change11
Total stars rank11,684
Previous total stars rank11,666
Total stars rank change-18
README summary

Fine-tune Convolutional Neural Network in Keras with ImageNet Pretrained Models The reason to create this repo is that there are not many online resources that provide sample codes for performing fine-tuning, and that there is not a centralized place where we can easily download ImageNet pretrained models for common ConvNet architectures such as VGG, Inception, ResNet, and DenseNet. This repo serves to fill this gap by providing working examples of fine-tuning on Cifar10 dataset with ImageNet pretrained

models on popular ConvNet implementations. See this for a comprehensive treatment of fine-tuning Deep Learning Models in Keras Usage For illustration purpose, let's say you want to perform fine-tuning with VGG-16. First, download the ImageNet pretrained weights for VGG-16 to the directory. The schema and sample code for fine-tuning on Cifar10 can be found in . Run the file: The code will automatically download Cifar10 dataset and performs fine-tuning with VGG-16. Please be aware

that it might take some time (up to minutes) for the model to compile and load the ImageNet weights. Finetune with your own dataset If you wish to perform fine-tuning on your own dataset, you have to replace the module which loads the Cifar10 dataset with your own load_data() module to load your own dataset.

Frequently asked questions

How many stars and forks are recorded?

flyyufelix/cnn_finetune has 941 stars and 399 forks.

What is the repository rank?

flyyufelix/cnn_finetune is ranked 12,499.

What language and category are recorded?

flyyufelix/cnn_finetune has 941 stars, uses Python and belongs to Tutorials.

Which repository is closest in rank?

flyyufelix/cnn_finetune is compared with ml4a/ml4a.github.io, ranked 12,509 with 939 stars.

README

Fine-tune Convolutional Neural Network in Keras with ImageNet Pretrained Models

The reason to create this repo is that there are not many online resources that provide sample codes for performing fine-tuning, and that there is not a centralized place where we can easily download ImageNet pretrained models for common ConvNet architectures such as VGG, Inception, ResNet, and DenseNet. This repo serves to fill this gap by providing working examples of fine-tuning on Cifar10 dataset with ImageNet pretrained models on popular ConvNet implementations.

See this for a comprehensive treatment of fine-tuning Deep Learning Models in Keras

Usage

For illustration purpose, let's say you want to perform fine-tuning with VGG-16. First, download the ImageNet pretrained weights for VGG-16 to the imagenet_models directory. The schema and sample code for fine-tuning on Cifar10 can be found in vgg16.py. Run the file:

python vgg16.py

The code will automatically download Cifar10 dataset and performs fine-tuning with VGG-16. Please be aware that it might take some time (up to minutes) for the model to compile and load the ImageNet weights.

Finetune with your own dataset

If you wish to perform fine-tuning on your own dataset, you have to replace the module which loads the Cifar10 dataset with your own load_data() module to load your own dataset.

X_train, Y_train, X_valid, Y_valid = load_data()

In particular, the following image preprocessing step have to be performed to get the format of the dataset compatible with the pretrained models:

# For Tensorflow 
# Switch RGB to BGR order 
x = x[:, :, :, ::-1]  

# Subtract ImageNet mean pixel 
x[:, :, :, 0] -= 103.939
x[:, :, :, 1] -= 116.779
x[:, :, :, 2] -= 123.68

# For Theano
# Switch RGB to BGR order 
x = x[:, ::-1, :, :]

# Subtract ImageNet mean pixel 
x[:, 0, :, :] -= 103.939
x[:, 1, :, :] -= 116.779
x[:, 2, :, :] -= 123.68

ImageNet Pretrained Models

Network Theano Tensorflow
VGG-16 model (553 MB) -
VGG-19 model (575 MB) -
GoogLeNet (Inception-V1) model (54 MB) -
Inception-V3 model (95 MB) -
Inception-V4 model (172 MB) model (172 MB)
ResNet-50 model (103 MB) model (103 MB)
ResNet-101 model (179 MB) model (179 MB)
ResNet-152 model (243 MB) model (243 MB)
DenseNet-121 model (32 MB) model (32 MB)
DenseNet-169 model (56 MB) model (56 MB)
DenseNet-161 model (112 MB) model (112 MB)

Requirements

  • Keras 1.2.2 2.0.5
  • Theano 0.8.2 or TensorFlow 0.12.0 1.2.1

Updates

  • Keras 2.0.5 and TensorFlow 1.2.1 are supported
Nearby in the ranking
Similar items