# Extract ROIs - Machine learning - References

I want to try to extract ROIs from certain images using machine learning and neural networks , granted I know nothing about this field and it may not be the best way to do this, but the goal is to compare machine learning based algorithms with other algortihms I have already built.

Here are the type of images I want to work on :

Here are the kind of results I want to get from the algorithm :

Do you have any key words, references, resources on neural networks and machine learning or even premade algorithms to help me start in this endeavour ? (Even better if they are related to Mathematica).

I am looking for tutorials and hands-on approaches, not for long abstract or theoretical considerations.

Thank you.

## 1 Answer

A minimal example:

(*imports image above*)
img = Import["https://i.stack.imgur.com/tqtp0.jpg"];
(*uses erosion to reduce noise, binarizes to black and white, then dilates to expand*)
binarized = Dilation[#, 5] &@Binarize@Erosion[img, 5];
(*identify components; this is one of many possible functions*)
components = ImageForestingComponents[binarized];

(*show the identified components*)
HighlightImage[img, components]


The results of the various component functions is a 2d-array, whose entries identify which component is where (the first row is components[[1]])

One way to use this is to construct the convex hull containing a set of points. For example, let's look at region 6

hull6 = ConvexHullMesh@Position[components, 6]


Where's Waldo?

HighlightImage[img, hull6]


Now that we have defined a region, many geometric properties can be assessed, for example,

Area[hull6]. (*1490*)


For more information, see the Wolfram tutorial video: https://wolfram.com/wolfram-u/introduction-to-image-processing

The image processing guide also contains many helpful examples: https://reference.wolfram.com/language/guide/ImageProcessing.html

• Thanks @Joshua, but I am familiar with this kind of image processing, I am really looking for neural network based ROI recognition. Helpful nonetheless.
– yfs
Sep 13, 2021 at 15:38
• Your post does not make that clear. Please rewrite it so that it is emphasized for potential answer writers. Sep 13, 2021 at 15:40