Keras28Models Package for Transfer Learning

Keras28 Models This is my Python package for easy build deep learning applications by using transfer learning pre trainined 28 models in easy few line code. to avoid wasting time scripting in your deep learning

photo from dasca.org splash

Note

The training of the Keras28Models Package will be on Google Colab because it was previously prepared for all training libraries deep learning and away from the problems of installation troublesome libraries. and i’m using and test it for chest X-Ray Pneumonia dataset from kaggle .step by step and u must load kaggle.json API For your account to get and full access X-Ray images dataset…i will explain it in small script to load it

step-1

load and install package in colab

!pip install Keras28Models==0.1.0

Step-2

load and install kaggle libraries and module

!pip install -q kaggle

Step-3

load kaggle.json from API account to access full dataset

! mkdir ~/.kaggle
! cp kaggle.json ~/.kaggle/
!chmod 600 ~/.kaggle/kaggle.json

Step-4

load dataset from kaggle

!kaggle datasets download -d paultimothymooney/chest-xray-pneumonia

Step-5

unzip compressed dataset from zip file

!unzip /content/chest-xray-pneumonia.zip

Step-6

load keras28models library to training your custom dataset in quickly script code and few Initialization parameter for training models.

from keras28models import models28 as k28m
batch_size=32 # batch size for custom dataset
train_path=’/content/chest_xray/chest_xray/train’ # path for training dataset
valid_path=’/content/chest_xray/chest_xray/val’ # path for validation dataset
num_class=2 # class number here for chest x-ray diseses NORMAL or PNEUMONIA
epochs=2 #epoch number for traiing

Step-7

call function to training dataset into 28 models in one code

k28m.models_fgs28(batch_size,train_path,valid_path,num_class,epochs)

full script

from keras28models import models28 as k28m
batch_size=32
train_path=’/content/chest_xray/chest_xray/train’
valid_path=’/content/chest_xray/chest_xray/val’
num_class=2
epochs=2
k28m.models_fgs28(batch_size,train_path,valid_path,num_class,epochs)
spreadsheet file contain model name ,model parameters and validation accuracy
graph for all models Accuracy vs Model Size

Developer Programmer, in Python and deep learning. IOT Microcontroller Developer iraqprogrammer.wordpress.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store