I’m very new to anything related to Machine Learning/AI etc and hope to get some advice.
I’m currently working on a small program with the goal to identify particles on a background substrate.
The images are all gray scale, unfortunately, easier methods that only involve thresholding, canny edge, or hough transforms don’t provide results that are good enough. Therefore, I’m currently using these methods for a first approximation to assist in drawing masks over these particles.
My question is: would you advice on using the original image + masks of let’s assume 1-20 particles in each image. Or should I use cropped-out version with or withour padding to ensure enough background information is present as well? The current program I have apparently accepts both, but I’m not sure if mixing these would create new problems.
What is your use case? Are you intending to train a model to identify your particles? Are
you asking how to better use non-machine-learning techniques to perform semi-automated
labelling of the ground-truth annotated data you need for training?
You haven’t said much about your use case, so I will have to speculate to give a
concrete answer.
Let me assume that your individual particles are separated from one another, that is,
they don’t overlap. If so, you could use semantic segmentation. This means that you
would classify each pixel as particle vs. background. If you then perform connected
components on the particle pixels, each connected component will be a particle,
Let me assume that your particles are smallish so that each particle will be able to fit in
the field of view of a reasonably-sized U-Net. Then you can use a U-Net – a workhorse
for semantic segmentation – as your model.
For training data, you want training images that reasonably represent the images that
you will use your trained model to segment. (Ideally, you would take your training images
from the same population that you will apply your model to.) You then need annotated
ground-truth mask images. These images will be the same shape as the input training
images, but with each pixel labelled as either “background” or “particle.” The simplest
approach – but the most labor intensive – will be to annotate your training data by hand.
In general, the more training data you have, the better. (Unless your training images
are very large and contain a lot of particles, you will need quite a few annotated images
to train your model effectively.)
If this is a practical problem and you don’t have any requirement that you train your own
model, you could look into using a pre-packaged solution. In particular, you might look
at Segment Anything and its associated web site.