A set of models which allow easy creation of Keras models to be used for classification purposes. Also contains modules which offer implementations of recent papers.
Implementation of Squeeze and Excite networks in Keras. Supports ResNet and Inception v3 models currently. Support for Inception v4 and Inception-ResNet-v2 will also come once the paper comes out.
Available at : Squeeze and Excite Networks in Keras
Implementation of Dual Path Networks, which combine the grouped convolutions of ResNeXt with the dense connections of DenseNet into two path
Available at : Dual Path Networks in Keras
Implementation of MobileNet models from the paper MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications in Keras 2.0+.
Contains code for building the MobileNet model (optimized for datasets similar to ImageNet) and weights for the model trained on ImageNet.
Available at : MobileNets in Keras
Implementation of ResNeXt models from the paper Aggregated Residual Transformations for Deep Neural Networks in Keras 2.0+.
Contains code for building the general ResNeXt model (optimized for datasets similar to CIFAR) and ResNeXtImageNet (optimized for the ImageNet dataset).
Available at : ResNeXt in Keras
Implementations of the Inception-v4, Inception - Resnet-v1 and v2 Architectures in Keras using the Functional API. The paper on these architectures is available at "Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning".
The models are plotted and shown in the architecture sub folder. Due to lack of suitable training data (ILSVR 2015 dataset) and limited GPU processing power, the weights are not provided.
Contains : Inception v4, Inception-ResNet-v1 and Inception-ResNet-v2
Available at : Inception v4 in Keras
Implementation of Wide Residual Networks from the paper Wide Residual Networks
It can be used by importing the wide_residial_network script and using the create_wide_residual_network() method. There are several parameters which can be changed to increase the depth or width of the network.
Note that the number of layers can be calculated by the formula : nb_layers = 4 + 6 * N
import wide_residial_network as wrn
ip = Input(shape=(3, 32, 32)) # For CIFAR 10
wrn_28_10 = wrn.create_wide_residual_network(ip, nb_classes=10, N=4, k=10, dropout=0.0, verbose=1)
model = Model(ip, wrn_28_10)
Contains weights for WRN-16-8 and WRN-28-8 models trained on the CIFAR-10 Dataset.
Available at : Wide Residual Network in Keras
Implementation of DenseNet from the paper Densely Connected Convolutional Networks.
- Run the cifar10.py script to train the DenseNet 40 model
- Comment out the model.fit_generator(...) line and uncomment the model.load_weights("weights/DenseNet-40-12-CIFAR10.h5") line to test the classification accuracy.
Contains weights for DenseNet-40-12 and DenseNet-Fast-40-12, trained on CIFAR 10.
Available at : DenseNet in Keras
Implementation of the paper Snapshot Ensembles
The technique is simple to implement in Keras, using a custom callback. These callbacks can be built using the SnapshotCallbackBuilder class in snapshot.py. Other models can simply use this callback builder to other models to train them in a similar manner.
- Download the 6 WRN-16-4 weights that are provided in the Release tab of the project and place them in the weights directory
- Run the train_cifar_10.py script to train the WRN-16-4 model on CIFAR-10 dataset (not required since weights are provided)
- Run the predict_cifar_10.py script to make an ensemble prediction.
Contains weights for WRN-CIFAR100-16-4 and WRN-CIFAR10-16-4 (snapshot ensemble weights - ranging from 1-5 and including single best model)
Available at : Snapshot Ensembles in Keras
Implementation of the paper "Residual Networks of Residual Networks: Multilevel Residual Networks"
To create RoR ResNet models, use the ror.py
script :
import ror
input_dim = (3, 32, 32) if K.image_dim_ordering() == 'th' else (32, 32, 3)
model = ror.create_residual_of_residual(input_dim, nb_classes=100, N=2, dropout=0.0) # creates RoR-3-110 (ResNet)
To create RoR Wide Residual Network models, use the ror_wrn.py
script :
import ror_wrn as ror
input_dim = (3, 32, 32) if K.image_dim_ordering() == 'th' else (32, 32, 3)
model = ror.create_pre_residual_of_residual(input_dim, nb_classes=100, N=6, k=2, dropout=0.0) # creates RoR-3-WRN-40-2 (WRN)
Contains weights for RoR-3-WRN-40-2 trained on CIFAR 10
Available at : Residual Networks of Residual Networks in Keras
A set of models which allow easy creation of Keras models to be used for segmentation tasks.
Implementation of the paper The One Hundred Layers Tiramisu : Fully Convolutional DenseNets for Semantic Segmentation
Simply import the densenet_fc.py script and call the create method:
import densenet_fc as dc
model = dc.create_fc_dense_net(img_dim=(3, 224, 224), nb_dense_block=5, growth_rate=12,
nb_filter=16, nb_layers=4)
A set of scripts which can be used to add advanced functionality to Keras.
Implementation of the paper Training RNNs as Fast as CNNs for Keras 2.0+. SRU is a recurrent unit that can run over 10 times faster than cuDNN LSTM, without loss of accuracy tested on many tasks, when implemented with a custom CUDA kernel.
This is a naive implementation with some speed gains over the generic LSTM cells, however its speed is not yet 10x that of cuDNN LSTMs.
Batch Renormalization algorithm implementation in Keras 1.2.1. Original paper by Sergey Ioffe, Batch Renormalization: Towards Reducing Minibatch Dependence in Batch-Normalized Models.\
Add the batch_renorm.py
script into your repository, and import the BatchRenormalization layer.
Eg. You can replace Keras BatchNormalization layers with BatchRenormalization layers.
from batch_renorm import BatchRenormalization
Implementation of the paper Multiplicative LSTM for sequence modelling for Keras 2.0+. Multiplicative LSTMs have been shown to achieve state-of-the-art or close to SotA results for sequence modelling datasets. They also perform better than stacked LSTM models for the Hutter-prize dataset and the raw wikipedia dataset.
Add the multiplicative_lstm.py
script into your repository, and import the MultiplicativeLSTM layer.
Eg. You can replace Keras LSTM layers with MultiplicativeLSTM layers.
from multiplicative_lstm import MultiplicativeLSTM