Home

Awesome

VGG19-FCN for Image Classification

Requirements

Implementation Details

For testing the pre-trained model

For training from scratch on CIFAR-10

Usage

ImageNet Classification

Preparation

Run

Go to examples/ and put test image in folder DATA_PATH, then run the script:

python vgg_pretrained.py --im_name PART_OF_IMAGE_NAME

Train the network on CIFAR-10

Preparation

Train the model

Go to examples/ and run the script:

python vgg_cifar.py --train \
  --lr LEARNING_RATE \
  --bsize BATCH_SIZE \
  --keep_prob KEEP_PROB_OF_DROPOUT \
  --maxepoch MAX_TRAINING_EPOCH

Evaluate the model

Go to examples/ and put the pre-trained model in SAVE_PATH. Then run the script:

python vgg_cifar.py --eval \
  --load PRE_TRAINED_MODEL_ID

Results

Image classification using pre-trained VGG19 model

Data SourceImageResult
COCO<img src='data/000000000285.jpg' height='200px'>1: probability: 1.00, label: brown bear, bruin <br>2: probability: 0.00, label: American black bear, black bear <br>3: probability: 0.00, label: ice bear, polar bear <br>4: probability: 0.00, label: sloth bear, Melursus ursinus <br>5: probability: 0.00, label: chow, chow chow
COCO<img src='data/000000000724.jpg' height='200px'>1: probability: 0.61, label: street sign<br>2: probability: 0.27, label: traffic light, traffic signal, stoplight<br>3: probability: 0.02, label: mailbox, letter box<br>4: probability: 0.02, label: parking meter<br>5: probability: 0.01, label: pay-phone, pay-station
COCO<img src='data/000000001584.jpg' height='200px'>1: probability: 0.48, label: passenger car, coach, carriage<br>2: probability: 0.36, label: trolleybus, trolley coach, trackless trolley<br>3: probability: 0.10, label: minibus<br>4: probability: 0.02, label: school bus<br>5: probability: 0.01, label: streetcar, tram, tramcar, trolley, trolley car
COCO<img src='data/000000003845.jpg' height='200px'>1: probability: 0.17, label: burrito<br>2: probability: 0.13, label: plate<br>3: probability: 0.10, label: Dungeness crab, Cancer magister<br>4: probability: 0.06, label: mashed potato<br>5: probability: 0.06, label: guacamole
ImageNet<img src='data/ILSVRC2017_test_00000004.jpg' height='200px'>1: probability: 1.00, label: goldfish, Carassius auratus<br>2: probability: 0.00, label: rock beauty, Holocanthus tricolor<br>3: probability: 0.00, label: anemone fish<br>4: probability: 0.00, label: coral reef<br>5: probability: 0.00, label: puffer, pufferfish, blowfish, globefish
Self Collection<img src='data/IMG_4379.jpg' height='200px'>1: probability: 0.33, label: tabby, tabby cat<br>2: probability: 0.20, label: Egyptian cat<br>3: probability: 0.11, label: tiger cat<br>4: probability: 0.03, label: Cardigan, Cardigan Welsh corgi<br>5: probability: 0.02, label: bookcase
Self Collection<img src='data/IMG_7940.JPG' height='200px'>1: probability: 1.00, label: streetcar, tram, tramcarr<br>2: probability: 0.00, label: trolleybus, trolley coach<br>3: probability: 0.00, label: passenger car, coach, carriage<br>4: probability: 0.00, label: electric locomotive<br>5: probability: 0.00, label: minibus

Train the network from scratch on CIFAR-10

learning curve for training set

train_lc

learning curve for testing set

valid_lc

Author

Qian Ge