Data Cleaning for Image Classification

Block = DataBlock(blocks=(ImageBlock, CategoryBlock),      
get_items=get_image_files,
get_y=parent_label,
item_tfms= Pick your transformation here)
Block = Block.new(item_tfms=Resize(128, ResizeMethod.Squish))

Resizing

Here you see how this may systematically restrict information, in every photo, the muzzle of the gun is cut off
item_tfms= resize(x)

Squishing

Eww
Item_tfms = resize(x, ResizeMethod.squish)

Padding

The black bars are added to standardize the image size
item_tfms=Resize(128, ResizeMethod.Pad, pad_mode=’zeros’

Random Resized Crop

One image cropped four different ways as an example
tem_tfms=RandomResizedCrop(128, min_scale=0.3)

Data Augmentation

S**t in S**t out

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Game Output Prediction

TEXT SUMMARISATION PART 2

Linear Algebra for Deep Learning Models on TensorFlow

Predicting S&P 500 short-term stock prices using a low-cost AI model marketplace

AWS AI & Machine Learning Podcast — Episode 12

Google Colab or Kaggle notebook?

My Deep Learning Journey: From Experimentation to Production

Multi-armed Bandits: an alternative to A/B testing

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
Aidan Coco

Aidan Coco

More from Medium

MultiImage Classification & ResNet 50 From Scratch

Dog Breed Classifier using CNN

Building A Convolutional Neural Network With Keras

Deep Learning and Image classification for Beginners