## 2 Materials and Methods
### Cnn  
The first step towards creating the algorithm is to build a custom CNN model. CNNs are usually used for object detection or classification tasks. When a classification algorithm is given an image, it simply gives us a probability score for each of the classes it is trained to identify. In binary classification, it classifies an image as either positive or negative, depending on the set threshold value. It is possible to split the image into multiple cells, by dividing the image into 9 cells (3 \(\times\) 3), and then the algorithm examines each of the cells separately, highlighting the cell or cells that, according to the algorithm, can be classified as an object of interest, with a probability exceeding our predetermined threshold value. Detection and tracking algorithms work on different principles. The main difference is that detection algorithms recognize an object in an image and define its location with a bounding box. A neural network performs object classification and location determination simultaneously. Convolutional neural network (CNN) architectures vary significantly in their structure, with some models featuring as few as 3 to 8 layers and others utilizing much deeper configurations. Increasing the number of layers generally requires more computational resources. The optimal network depth depends on both the complexity of the task and the characteristics of the dataset. For instance, tasks involving high-resolution or complex images may benefit from deeper networks that capture fine-grained details through additional feature extraction layers. Conversely, simpler tasks may require only a shallow network; an excessively deep model in such cases can lead to overfitting, where the network mistakenly learns noise as relevant features, ultimately reducing performance metrics such as accuracy, precision, and recall. The optimal number of convolutional layers was determined through an iterative experimentation process involving repeated cycles of model training and validation to identify the configuration yielding the most satisfactory performance. In this study, architectures with three, four, and five convolutional layers were evaluated. To monitor and assess model performance during training, key metrics such as training accuracy, training loss, validation accuracy, and validation loss were integrated into the training pipeline. Additionally, several inference tests were conducted to further evaluate the generalization capability of the trained models. Among the tested configurations, the four-layer architecture demonstrated the most balanced performance. While the five-layer model initially appeared to offer superior results based solely on training metrics, further evaluation revealed indications of overfitting. Consequently, the four-layer architecture was deemed more effective overall, despite extracting fewer features. This limitation, however, was associated with an increased occurrence of false positives. To mitigate this issue, the dataset was subsequently refined through the inclusion of additional negative samples, which, although effective in reducing false positives, introduced a degree of class imbalance, which may cause underfitting or overfitting to a certain degree if left unchecked. The CNN architecture can be seen in Figure 4.  
Figure 4: CNN architecture. While we refer to the classification process as \"unsupervised,\" we clarify that this refers to the absence of manual annotation during labeling. The binary classifier is trained using automatically cropped image patches, which are separated into folders representing positive (human-present) and negative (human-absent) classes. These labels are not manually applied to individual samples but are inherited from the context of the original labeled datasets and the automated cropping process. This form of weak supervision avoids the need for bounding box annotations or pixel-level labels and instead relies on high-level image categorization, making the method computationally lighter and scalable while minimizing human involvement.