Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 2.26 KB

File metadata and controls

33 lines (24 loc) · 2.26 KB

Image Classification and Data Augmentation

Fastai Library or API

  • Fast.ai is the first deep learning library to provide a single consistent interface to all the most commonly used deep learning applications for vision, text, tabular data, time series, and collaborative filtering.
  • Fast.ai is a deep learning library which provides practitioners with high-level components that can quickly and easily provide state-of-the-art results in standard deep learning domains, and provides researchers with low-level components that can be mixed and matched to build new approaches.

Data Augmentation

  • Data augmentation is a strategy that enables practitioners to significantly increase the diversity of data available for training models, without actually collecting new data. Data augmentation techniques such as cropping, padding, and horizontal flipping are commonly used to train large neural networks.

Preparing the Model

  • I have used Fastai API to train the Model. It seems quite challenging to understand the code if you have never encountered with Fast.ai API before. One important note for anyone who has never used Fastai API before is to go through Fastai Documentation. And if you are using Fastai in Jupyter Notebook then you can use doc(function_name) to get the documentation instantly.

Dataset

untar_data(URLs.PETS)

Data Augmentation with Fastai

  • Data augmentation is a strategy that enables practitioners to significantly increase the diversity of data available for training models, without actually collecting new data. Data augmentation techniques such as cropping, padding, and horizontal flipping are commonly used to train large neural networks.
get_transforms(max_rotate=20, max_zoom=1.3, max_lighting=0.4, max_warp=0.4,
                      p_affine=1., p_lighting=1.)

Convolutional Neural Network with Fastai

cnn_learner(data, models.resnet34, metrics=error_rate, bn_final=True)