<p>For detecting something like a circle, or other geometric shapes, modern machine learning may be a bit overkill.</p>
<p>You should look at Haar Cascades, which you can find implemented in OpenCV. These are the reason cameras have been able to detect faces since the early naughts; They are efficient and easy to train; They are trained by providing positive and negative examples. They also scale better than something like a convolutional neural network; The implementation in OpenCV is made specifically to be able to detect objects of different sizes.</p>
<p>Here is <a href="https://docs.opencv.org/3.4/db/d28/tutorial_cascade_classifier.html" rel="nofollow noreferrer">OpenCVs tutorial</a> to get started.</p>
<hr />
<p>This, of course, assumes that the artifact is of a known geometric shape. If not, you'll probably have to look at convolutional neural networks and anomaly detecting autoencoders.</p>
<p>Object detection with neural networks is generally done with RCNNs; These break up the image into regions using various methods and do object detection on these regions. The most popular algorithm in this family is probably <a href="https://github.com/ultralytics/yolov5" rel="nofollow noreferrer">YOLO</a>, which learns how to break up the image. Many other approaches exist.</p>

CC BY-SA 4.0
2021-11-18T10:59:12.853Z
Thank you! I will certainly look into Haar Cascades and YOLO, as you advised. In general, do I need to study some theory or these can be used directly (configured and fed data)?
John V
CC BY-SA 4.0
2021-11-18T11:24:20.263Z
@JohnV Both have open implementations; So, you can find tutorials online on how to train Cascade classifiers and YOLO using OpenCV and Yolov5, respectively; Follow the links in my answer. Both contain tutorials.
Avatrin
CC BY-SA 4.0
2021-11-18T09:08:51.997Z
2021-11-18T09:27:28.350Z
2021-11-18T09:27:28.350Z
Avatrin
<p>I am familiar only with basic AI/NN concepts but never worked with any libraries/tools as tensor flow. Currently, I have a task for which AI might be ideal: detection of a certain image artifact in a picture (lets say I want to detect a black circular spot of a variable size). Because the spot can be very small or very large, I guess the NN would have to somehow process the whole picture and then proceed in smaller regions? Anyway, for such a task, do I need to learn more about machine learning or there are already tools that I could simply train (e.g. providing &quot;clear&quot; and &quot;stained&quot; image samples in their training sets) without worrying about internal details?</p>

<neural-networks><image-recognition><ai-basics><pattern-recognition>
For a task that searches for an image artifact within a picture, can existing tools can be used or do I need to design the process myself?
John V
# For a task that searches for an image artifact within a picture, can existing tools can be used or do I need to design the process myself?

(Asked by: username_0 on 2021-11-17)

I am familiar only with basic AI/NN concepts but never worked with any libraries/tools as tensor flow. Currently, I have a task for which AI might be ideal: detection of a certain image artifact in a picture (lets say I want to detect a black circular spot of a variable size). Because the spot can be very small or very large, I guess the NN would have to somehow process the whole picture and then proceed in smaller regions? Anyway, for such a task, do I need to learn more about machine learning or there are already tools that I could simply train (e.g. providing "clear" and "stained" image samples in their training sets) without worrying about internal details?

**Tags:** neural-networks, image-recognition, ai-basics, pattern-recognition


---

## 1 answers

### Answer by username_1 on 2021-11-18. Score: 0 | Accepted answer

For detecting something like a circle, or other geometric shapes, modern machine learning may be a bit overkill.

You should look at Haar Cascades, which you can find implemented in OpenCV. These are the reason cameras have been able to detect faces since the early naughts; They are efficient and easy to train; They are trained by providing positive and negative examples. They also scale better than something like a convolutional neural network; The implementation in OpenCV is made specifically to be able to detect objects of different sizes.

Here is [OpenCVs tutorial](https://docs.opencv.org/3.4/db/d28/tutorial_cascade_classifier.html) to get started.

---

This, of course, assumes that the artifact is of a known geometric shape. If not, you'll probably have to look at convolutional neural networks and anomaly detecting autoencoders.

Object detection with neural networks is generally done with RCNNs; These break up the image into regions using various methods and do object detection on these regions. The most popular algorithm in this family is probably [YOLO](https://github.com/ultralytics/yolov5), which learns how to break up the image. Many other approaches exist.

> **Comments:**
> **username_0**: Thank you! I will certainly look into Haar Cascades and YOLO, as you advised. In general, do I need to study some theory or these can be used directly (configured and fed data)?  
> **username_1**: @JohnV Both have open implementations; So, you can find tutorials online on how to train Cascade classifiers and YOLO using OpenCV and Yolov5, respectively; Follow the links in my answer. Both contain tutorials.  

---

