I'm new to AI but would still like to try and get a project off the ground. I've read a lot about ML/DL the past few days but I just can't figure out if my problem can be solved with ML/DL. What I'm trying to do looks like a classification job to me but maybe isn't.

I have 100s of images of compacted soil samples, on these images there may be multiple layers visible. I will include a picture below, this sample had a sticker on it, normally they don't. On the image there are 3 layers, separated above and under the sticker. With every image there is data (xml file) available on the size of the layer(s) and the type of soil in that layer, which costs a lot of time to produce, so I want to automate this classification in the future. The data files contains info like:

    type 004
    type 003

If there would be just one layer, the AI could learn what these layers look like and sort them in the right soil class. But I don't know if my problem can be solved with AI as there could be 1, 2, 3 or 4 different layers (classes) on one image and I haven't seen any examples on classification where there can be multiple classes in one image. As AI is quite a steep learning curve I would like to know if my problem is suited for ML/DL before I spend more of my nights reading for something that might not work. I've read numerous websites and a few short books but can't find an answer to my questions.

Can ML/DL solve my multi-class single-image classification problem and which strategy should I read into?

enter image description here

  • $\begingroup$ I don't understand what a layer is in your image that you're showing us. I only see a black and white image with some patterns that look like Perlin noise. So, can you clarify what a layer is here? Also, what do you mean by "sticker" here? Do you mean the big rectangular thing? $\endgroup$
    – nbro
    Feb 4, 2021 at 21:16
  • $\begingroup$ Hey @nbro thnx for commenting, as specified in my question there are 3 layers and thus 2 separation lines, these lines can be seen with the naked eye just a little above the upper side of the rectangle, and a little above the underside of the rectangle, and yes, the rectangle is the sticker. The 'Perlin noise' is the soil composition and its the data I'm trying to analyse. I will try to get a second image that I can make a little clearer with some CV. $\endgroup$
    – user44299
    Feb 5, 2021 at 8:57

1 Answer 1


A simple sanity-check on whether an image classifier can perform a task in theory is:

Can a human expert, using the same image plus a list of catgeories that they are familiar with, perform the same task?

It is important you only consider the contents of the image (or in general the data you are prepared to supply to the classifier) and the expert's general knowledge. The expert is not allowed to collect more data for instance, or interact with the sample other than maybe take a few measurements on the pixels.

This sanity check doesn't tell you how hard the problem is. It also does rule out problems that are very hard or impossible for humans but actually quite easy for computers. However, it is a good start because nowadays single-purpose computer vision classifier tasks often rate similarly to or better than humans performing the same task. You are effectively checking "is the data I need for the inference actually in the image?"

Multi-class classifiers are possible in several ways. One way would be to have separate heads to the neural network to classify each layer, and maybe a layer present binary flag to allow for varying numbers of layers. This is similar to an architecture called YOLO which classifies 0 or 1 objects and their locations over multiple grid squares within an image. Your architecture would need to be different to YOLO, but you could use a lot of the ideas from it, such as having an output with multiple multi-class classifiers, one for each soil layer.

I have 100s of images of compacted soil samples

One issue you will face is that you would need a very large number of labelled images in order to train a neural network with cutting-edge performance for this task from scratch. So you will want to look into transfer learning, which involves taking an existing image classifier trained on e.g. ImageNet and adapting it to your problem before training with your smaller dataset.

The small amount of sample image data you have will be a major limiting factor in your case. Sadly no-one can tell you before you attempt the project whether you have enough for a deep learning approach. That is probably where your largest risk of failure is.

  • $\begingroup$ Thank you for this very informative answer, @Neil Slater! You've given me some to think about! cheers $\endgroup$
    – user44299
    Feb 4, 2021 at 10:02

You must log in to answer this question.