Skip to content

TensorFlow implementation of GoogLeNet and Inception for image classification.

License

Notifications You must be signed in to change notification settings

conan7882/GoogLeNet-Inception

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoogLeNet for Image Classification

Requirements

Implementation Details

  • The GoogLeNet model is defined in src/nets/googlenet.py.
  • Inception module is defined in src/models/inception_module.py.
  • An example of image classification using pre-trained model is in examples/inception_pretrained.py.
  • When testing the pre-trained model, images are rescaled so that the shorter dimension is 224. This is not the same as the original paper which is an ensemle of 7 similar models using 144 224x224 crops per image for testing. So the performance will not be as good as the original paper.

Usage

<<<<<<< HEAD

Download pre-trained model

Download the pre-trained parameters here. This is original from here.

Config path

All directories are setup in example/setup_env.py.

  • PARA_DIR is the path of the pre-trained model.
  • SAVE_DIR is the directory to save graph summary for tensorboard.
  • DATA_DIR is the directory to put testing images.

=======

8b3f57700b6e08b9a2b11efc032ce65e195605da

ImageNet Classification

Preparation

  • Download the pre-trained parameters here. This is original from here.
  • Setup path in examples/inception_pretrained.py: PRETRINED_PATH is the path for pre-trained vgg model. DATA_PATH is the path to put testing images.

Run

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

python inception_pretrained.py --im_name PART-OF-IMAGE-NAME
  • --im_name is the option for image names you want to test. If the testing images are all png files, this can be png. The default setting is .jpg.
  • The output will be the top-5 class labels and probabilities.

Results

Image classification using pre-trained model

  • Top five predictions are shown. The probabilities are shown keeping two decimal places. Note that the pre-trained model are trained on ImageNet.
  • Result of VGG19 for the same images can be found here. The pre-processing of images for both experiments are the same.
Data Source Image Result
COCO 1: probability: 1.00, label: brown bear, bruin, Ursus arctos
2: probability: 0.00, label: ice bear, polar bear
3: probability: 0.00, label: hyena, hyaena
4: probability: 0.00, label: chow, chow chow
5: probability: 0.00, label: American black bear, black bear
COCO 1: probability: 0.79, label: street sign
2: probability: 0.06, label: traffic light, traffic signal, stoplight
3: probability: 0.03, label: parking meter
4: probability: 0.02, label: mailbox, letter box
5: probability: 0.01, label: balloon
COCO 1: probability: 0.94, label: trolleybus, trolley coach
2: probability: 0.05, label: passenger car, coach, carriage
3: probability: 0.00, label: fire engine, fire truck
4: probability: 0.00, label: streetcar, tram, tramcar, trolley
5: probability: 0.00, label: minibus
COCO 1: probability: 0.35, label: burrito
2: probability: 0.17, label: potpie
3: probability: 0.14, label: mashed potato
4: probability: 0.10, label: plate
5: probability: 0.03, label: pizza, pizza pie
ImageNet 1: probability: 1.00, label: goldfish, Carassius auratus
2: probability: 0.00, label: rock beauty, Holocanthus tricolor
3: probability: 0.00, label: puffer, pufferfish, blowfish, globefish
4: probability: 0.00, label: tench, Tinca tinca
5: probability: 0.00, label: anemone fish
Self Collection 1: probability: 0.32, label: Egyptian cat
2: probability: 0.30, label: tabby, tabby cat
3: probability: 0.05, label: tiger cat
4: probability: 0.02, label: mouse, computer mouse
5: probability: 0.02, label: paper towel
Self Collection 1: probability: 1.00, label: streetcar, tram, tramcar, trolley, trolley car
2: probability: 0.00, label: passenger car, coach, carriage
3: probability: 0.00, label: trolleybus, trolley coach, trackless trolley
4: probability: 0.00, label: electric locomotive
5: probability: 0.00, label: freight car

Author

Qian Ge

About

TensorFlow implementation of GoogLeNet and Inception for image classification.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages