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 : enter image description here

Here are the kind of results I want to get from the algorithm :enter image description here

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 1


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]

example image show identified 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]

convex hull mesh of 6

Where's Waldo?

HighlightImage[img, hull6]

image with highlighted region 6 convex hull mesh

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.