I'm working on a CNN model that classifies images. After scraping image files from the Internet, I found that many of them didn't look this way as described by the searching keyword (for example keyword='dog' but image not containing a dog). So, I cleaned my dataset manually which was quite labor intensive and time consuming.

Was my approach right or is there any tools or methods by which image data can be cleaned? Actually this sounds quite controversial because this cleaning tool should do the job for what the model are being built - classify the images.


2 Answers 2


I am building on the first part of @Dylan's answer:

For general items like "dogs" pre-trained models are easily available. A good starting point is ImageNet. There are plenty of pre-trained models available for this dataset, e.g. see here for PyTorch. Since ImageNet includes multiple categories for a given item you can check this list to see which indexes correspond to which items and define a mapping (e.g. dogs are classes 151 to 268).

Once you have done that, manually check the cases for which the labels and the transfer model disagree.


One potential approach would have been to use a pretrained model to tag the photos you scraped to see if they contained a picture of a dog or not. Then just to keep things simple use that as a rough filter to see if the individual photo was suitable for your model.

If your task is highly specific it may be extremely difficult to find a pre trained image recognition model: an alternative approach would then be to tag manually your first ~100 records or whatever so they have trust worthy labels. Then, you can augment those images aggressively until you have a reasonable amount, and train a classifier to predict "dog present in picture vs not dog present in picture" Then use that small, simple model as your "rough filter" to decide what images to include in your larger, more complicated modeling dataset.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.