Skip to content

GeorgeCazenavette/imagenet-simple-labels

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simpler human-readable labels for ImageNet Build Status

The file imagenet-simple-labels.json contains simple, short, human-readable labels for the 1000 ImageNet classes.

There are similar files out there with human-readable labels for ImageNet classes (see below for a comparison). The goal of this project is to have simple, short, human-readable, and meaningful labels, without being restricted to choosing one of the synonyms out of the synset for each ImageNet class. These label names were chosen by looking at the synset for each ImageNet class and either choosing one of the synonyms or choosing a new description altogether, based on a couple guiding principles:

  • Using Wikipedia or Google Search for canonicalization
  • Preferring American English over British English
  • Preserving genericized trademarks (e.g. keeping "Band-Aid" rather than replacing it with "adhesive bandage")

Depending on your use case, this may or may not be for you. If you're looking for more "official" labels (such as those that always choose synonyms out of the synsets rather than sometimes using new descriptions), consider some of the alternatives compared below.

Comparison

  • ImageNet original labels. Each of the 1000 ImageNet classes corresponds to a WordNet synset (a set of synonyms). These are the "official" labels. Here is a file with a mapping of class IDs to these labels.
  • Keras labels. Keras uses this data for its human-readable labels. The labels consist of the first synonym from each synset (with spaces replaced with underscores).

Below is a table comparing ImageNet labels and Keras labels with our labels. The table contains hand-picked examples to illustrate differences.

ID ImageNet Keras Simple (this repo)
87 African grey, African gray, Psittacus erithacus African_grey grey parrot
97 drake drake duck
134 crane crane crane (bird)
156 Blenheim spaniel Blenheim_spaniel King Charles Spaniel
383 Madagascar cat, ring-tailed lemur, Lemur catta Madagascar_cat ring-tailed lemur
439 bearskin, busby, shako bearskin military cap
517 crane crane crane (machine)
628 liner, ocean liner liner ocean liner
667 mortarboard mortarboard square academic cap
699 panpipe, pandean pipe, syrinx panpipe pan flute
913 wreck wreck shipwreck
930 French loaf French_loaf baguette

Usage

Below is a Python code sample showing how the label data can be used.

import json

with open('imagenet-simple-labels.json') as f:
    labels = json.load(f)

def class_id_to_label(i):
    return labels[i]

print(class_id_to_label(924)) # prints "guacamole"

License

Public domain.

About

Simpler human-readable labels for ImageNet 🏷

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published