4
$\begingroup$

I have two groups of images, each one with 1000 samples.

The speckle pattern, in this context, is the same as a random pattern or "white noise" image. So these images are fundamentally different.

In group one, each figure is generated by considering a random function that returns something similar to a speckle pattern (see fig. 1). In group two we follow the same procedure as group 1, but we plot a small point above that can be positioned anywhere and with any color (see fig. 2).

I want to classify both groups and I already tried to do it with simple neural networks, but I have been unsuccessful.

What is the best technique for this kind of problems?

Fig. 1:

enter image description here

Fig. 2:

enter image description here

$\endgroup$
3
  • $\begingroup$ Isn't it a challenge of a feature selection? If you calculate for each pixel the number of adjacent pixels with the same color and takes the maximum value as a feature of the image, you'll get a small number for teh group 1 and higher number for the group 2. $\endgroup$ Commented Mar 1, 2018 at 17:30
  • $\begingroup$ Do you want the answer to specifically uses neural networks? Or are other approaches acceptable (such as the rule based approaches mentioned)? If you are open to any technique, that could change people's answers, rather than if you're only interested in neural network techniques. You also mention "any color for the small point in group 2, this includes all possible gray values, is that correct? $\endgroup$
    – prijatelj
    Commented Mar 1, 2018 at 22:54
  • $\begingroup$ The final goal of this work is to be used with photos of metalic surfaces taken with a color camera. So the ideal is to be used with CNN. $\endgroup$
    – nunodsousa
    Commented Mar 2, 2018 at 10:34

4 Answers 4

5
$\begingroup$

Have you tried rule-based approaches?

Based on your example, I can think of two ways:

  • For each picture, get a list of all RGB values it contains. The first contains only grays (which have RGB values (x, x, x)), the second one contains color (so some pixel with RGB value (x, y, z), where $x \neq y$ or $y \neq z$). Or - if that is faster - convert all pictures to gray scale and check if the converted picture is identical to the original.
  • Scan the image for areas (larger than one pixel) with identical colors. If your dots are large enough and the background noise is uncorrelated for neighboring pixels, it is very likely that these areas are the dots you are looking for.
$\endgroup$
1
  • 1
    $\begingroup$ I would add, this should have 99.998% accuracy (assuming my maths is correct). 255 possible pure greys, out of 255^3 possible colours. $\endgroup$ Commented Mar 1, 2018 at 23:36
2
$\begingroup$

You're going to have to do some experimenting to figure out what is 'best', but I would recommend starting with a convolutional neural network.

Since you're only detecting a very small difference, though, the pixel values themselves should give you a good indication of where the colour is, and whether there is colour at all. I'm a bit surprised that a simpler architecture hasn't given you any luck.

$\endgroup$
2
  • $\begingroup$ I'm not sure CNN is the right approach here. First of all, with only 1000 samples to learn from, your classify is likely to be weak. Secondly, since there are no features to extract from the image per se, you can easily achieve this using a rules based approach as others have answered below. $\endgroup$
    – Sledge
    Commented Mar 1, 2018 at 20:28
  • $\begingroup$ Fair point @Sledge, I missed the '1000 examples' part in the question. In my defence, CNNs are the de facto starting method for image classification. $\endgroup$ Commented Mar 2, 2018 at 1:12
2
$\begingroup$

Based on the given Example

If they are literally the same everywhere except in a small region, just subtract image 1 from image 2 to find the differences...

And then we can check the positive and negative values where they are differing by a considerable margin to classify them

This Will (Probably) Work...

$\endgroup$
1
  • 1
    $\begingroup$ No, the speckle pattern, in this context, is the same as a random pattern or "white noise" image. So these images are fundamentally different. $\endgroup$
    – nunodsousa
    Commented Mar 1, 2018 at 17:27
0
$\begingroup$

I found the answer in the paper linked above. The authors use a CNN to solve the problem. I will post the code.

https://link.springer.com/article/10.1007/s00170-017-0882-0

$\endgroup$
1
  • $\begingroup$ Hi, I am trying to solve a similar problem. Did the CNN implementation in the paper you linked helped in your case? $\endgroup$
    – Matthias
    Commented Feb 9, 2021 at 20:12

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.