# Counting Number of Holes in an Image of Cheese

I've been assigned a project that involves writing a script to detect the number of holes in an image of cheese. My background in AI is quite limited, so I was wondering if anyone could give me a good starting point. I'm aware that Python is the best language for this sort of stuff, so I was wondering which ML model would be most effective at solving this issue. Our main project is using a .NET framework, so I need to make sure that it can be run from C# (I believe you can wrap the finished model in a REST API). Assume it's a supervised learning model, but feel free to suggest an unsupervised model as well.

Any help would be greatly appreciated.

Cheers

The number of holes detected would be limited to the number of holes visible in the image (I mean obviously!:P). So you cannot count the holes for example at the back of the cheese since they wont be visible.

With that being said this is a problem which requires a CNN (Convolution Neural Network). You could train an object detection model to detect the holes in the image. Then simply add them up. This is the most straightforward/easy way to solve your problem. Try using YoloV5 as this is an easy model to train and is also state of art!

• Thanks for your help. I will look into this model. Dec 5, 2023 at 15:41

I haven't found any research about cheese hole counting, but this problem resembles counting people in a crowd or blood cells to me. There is a plethora of scientific papers about that and a few approaches you can use.:

1. You can use the YOLO approach to identify holes first, and then count them. A well-cited example for blood cell counting:

Alam, M. M., & Islam, M. T. (2019). Machine learning approach of automatic identification and counting of blood cells. Healthcare technology letters, 6(4), 103-108.

1. Regression - you can attempt to use CNN to predict an exact number of holes. A friend of mine used it for counting people in the crowd, but let's grab a piece of literature you can read about it:

Patwal, A., Diwakar, M., Tripathi, V., & Singh, P. (2023). Crowd counting analysis using deep learning: A critical review. Procedia Computer Science, 218, 2448-2458.

1. Density estimation - something interesting I hadn't known and stumbled across in the second article - you can try to predict a map of the density of holes upon the image.

I hope you find there a method suitable for your project :)

• Thanks for all the reference papers. I will read through them when I get the chance. Much appreciated. Dec 5, 2023 at 15:41