Dataset Needed: All Country Flags With Names (PDF or Structured Format)

Hi everyone,

I’m currently working on a small computer vision project focused on flag classification and multi-class image recognition. The goal is to train a CNN model to accurately identify different national flags and map them to their respective country names.

For this, I’m looking for a well-structured resource containing all country flags with names in the world (PDF or labeled dataset format). Ideally, the dataset should include:

  • High-resolution flag images
  • Official country names (preferably aligned with United Nations member states)
  • Clean labeling for supervised learning
  • Consistent image dimensions (or at least easy to preprocess)
  • Alphabetical or indexed organization

If a ready-made PDF exists, I can convert it into structured image-label pairs. Otherwise, I’d appreciate guidance on reliable sources for downloading standardized flag datasets.

If anyone has experience building a similar flag classifier or working with multi-class datasets (150–200+ classes), I’d love to hear about preprocessing strategies, augmentation techniques, or model architecture recommendations.

Thanks in advance for any suggestions!

If you want a standard flag dataset, there are lots of APIs available online - you can use python’s requests library or urllib to automatically download all of them!

(This is the first result on google when I searched for “country flags api”)

Thanks so much for the detailed breakdown ! CareCredit