## 4 Proposed Methodology
### The Deep Learning Detections
#### 4.2.1 Yolo8  
YOLO8 (You Only Look Once version 8) is one of the latest iterations in the YOLO series of object detection models, designed for real-time processing and efficiency. The underlying mathematical model of YOLO is based on deep convolutional neural networks (CNNs) and operates using the following key components [26]:  
1. Backbone Network (Feature Extractor):  
Figure 1: Integrated artificial intelligence model for reliable and efficient dental architecture.  
The backbone is a CNN that extracts features from the input image. YOLO8 uses an efficient architecture to balance speed and accuracy. It transforms the input image into a feature map that captures essential spatial information. The feature map output by the backbone CNN is computed as follows in (1).  
\[F=CNN(I) \tag{1}\]  
where \(I\) is the input image as well as \(F\) is the feature map output by the backbone \(CNN\).  
2. Detection Head:  
YOLO divides the input image into an \(\text{S}\times\text{S}\) grid, where each grid cell is responsible for predicting bounding boxes and class probabilities for objects that fall within that region. Each grid cell predicts several bounding boxes, including their coordinates, objectness score (confidence that an object exists in the box), and class probabilities. For each predicted bounding box, YOLO8 outputs the center coordinates of the box, width and height, confidence score, and class probabilities. The bounding box is represented as follows in (2):  
\[bbox=(x,y,w,h) \tag{2}\]  
where \(x,y\) is the center of the bounding box as well as \(w,h\) represent the width and height of the box, respectively. The coordinates are normalized relative to the grid cell.  
The objectness score CCC is predicted by the model to indicate whether an object exists in the bounding box as follows in (3).  
\[C=P(Object)*IOU_{pred}^{truth} \tag{3}\]  
where \(P(object)\) is the probability of an object in the grid cell. \(IOU_{pred}^{truth}\) is the intersection over the union between the predicted box and the ground truth box.  
3. Loss Function:  
YOLO8 uses a custom loss function to optimize the model during training. The loss function typically includes multiple components. The first component is Bounding Box Regression Loss, which measures how well the predicted bounding boxes match the ground truth boxes as follows in (4)  
\[L_{\text{bbox}}=\sum_{i=1}^{n}\bigl{(}\text{smooth}_{L_{1}}(x_{i}-x_{i}^{ \text{true}})+\text{smooth}_{L_{1}}(y_{i}-y_{i}^{\text{true}})+\text{smooth} _{L_{1}}(w_{i}-w_{i}^{\text{true}})+\text{smooth}_{L_{1}}(h_{i}-h_{i}^{\text {true}})\bigr{)} \tag{4}\]  
where smooth \(L_{1}\) is a variation in the standard \(L_{1}\) loss function.  
The second component is confidence loss which measures the objectness score as follows in (5):  
\[L_{\text{conf}}=\sum_{i=1}^{n}\bigl{(}C_{i}-C_{i}^{\text{true}}\bigr{)}^{2} \tag{5}\]  
where \(C_{i}\) typically represents the predicted confidence score for the presence of an object in the \(i\)th bounding box.  
The third component is class prediction loss, which measures the class probabilities as in (6).  
\[L_{\text{class}}=\sum_{i=1}^{n}\sum_{c=1}^{k}\bigl{(}P(c_{i})-P(c_{i}^{\text{ true}})\bigr{)}^{2} \tag{6}\]  
where \(P(c_{i})\) presents the predicted probability that the \(i\)th bounding box belongs to class c. \(P(c_{i}^{\text{true}})\) represents the true probability that the \(i\)th bounding box belongs to class C.  
The last component named Total Loss measures the total loss as a weighted sum of the three losses as in (7).  
\[L_{\text{total}}=\lambda_{\text{bbox}}\mathcal{L}_{\text{bbox}}+\lambda_{\text{ conf}}\mathcal{L}_{\text{conf}}+\lambda_{\text{class}}\mathcal{L}_{\text{class}} \tag{7}\]  
where \(\lambda_{\text{bbox}}\), \(\lambda_{\text{conf}}\) and \(\lambda_{\text{class}}\) are hyperparameters that control the relative importance of each term.