# How to find out bad images?

I have a task to find out bad visuals from given video. Let's define bad images in the video as per the human brain -:

Images which don't contain subject in detail,
are too noisy or too many ads and subscription
letter or underexposed
or overexposed could be called as bad images.
The possibilities of bad images could be greater than this, but this
is just getting started.


Dataset is [collection of videos] labels is [good:0,bad:1]

Do you have some sort of a dataset where you have labels of images with good visuals and bad visuals? Without it, the definition of finding bad visuals seems under-defined to me.

Tracing ads/subscriptions could probably be done by using Hough transform (I think that all of them have rectangular bounding boxes). Overexposed images can found by comparing the image brightness histogram with some threshold value. "Images which don't contain subject in detail" - you need to use some detection model for this.

• your answer is misleading my question, algorithm or method is independent of a dataset, already stated it is a video file. FYI, Hough Transformation will never work unless there is defined XML file for that. – TheExorcist Dec 3 '18 at 12:15

I'm not sure if you have already done this, but your first task would be to use a library such as OpenCV to extract all frames from the video (i.e. all possible images).

Once this has been done, you need to create training and test data which would indicate whether a visual is "bad" or not.

For example, suppose you have extracted 10,000 frames from the video.

You could then use 5,000 of those images (as an example), with half of those classified as "good" visuals, with the other half being classified as "bad".

For instance:

• Training set 1: 2,000 good images
• Test set 1: 500 good images
• Training set 2: 2,000 bad images
• Test set 2: 500 bad images

Then, once the CNN (convolutional neural network) has been adequately trained with a high training and validation accuracy, the remaining images can either be classified as 1 = good, 0 = bad. The idea is that you will have already trained the model to differentiate between good and bad images based on their characteristics.

• You are right, but that works only in case of when a certain number of bad images are picked via human visuals and move forward. However, I was looking for something more intelligent. The genesis step should be intelligent enough to pick up the bad ones and trained itself. Randomly choosing the images could lead to wrong conclusion, I guess. – TheExorcist Dec 6 '18 at 5:13
• Well, the main issue you'll encounter is that without prior training, the model doesn't necessarily know what features are "good" or "bad", so at the very least it will require partitioning some training images so the model can at least distinguish between features. After that point, it may be possible to automate selection going forward. – Michael Grogan Dec 7 '18 at 19:07