## 2 Materials and Methods
### Experiment  
The faster R-CNN [18] detector was used for object detection in this study. The Faster R-CNN detector includes a region proposal network (RPN) that generates region proposals directly within the network instead of using external algorithm-like Edge Boxes. The RPN uses anchor boxes for object detection, which have different sizes and ratios compared to the ground truth. Generating region proposals within the network is faster and better tuned to the data. When the intersection over union (IoU) between the ground truth and proposed boxes exceeds a specific threshold, the boxes are recognized as objects without any class label. The RPN stage generates anchor boxes of various sizes and ratios, which are then passed on as region proposals. Each box is assigned a classification score and four coordinates indicating the object's location. Later, the selected region proposals are fed into the next phase, as in a fast R-CNN.  
To reduce overfitting and compensate for the limited number of available datasets, the training data were augmented by randomly flipping each image horizontally and vertically with a probability of 0.5. Additionally, the images were randomly rotated between 0 and 60 degrees before feeding them into the deep learning model. To further enhance the model's robustness regarding periodontal structure and radiographic image color, the images were also augmented by applying random brightness and contrast ranging from 0.9 to 1.1 with respect to the image color.  
The performance of the Faster R-CNN was assessed for robustness using a 5-fold cross-validation approach. For implementation, we used the Detectron2 platform (which was built by Facebook AI research) and COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml, which was written in PyTorch, to train and test the deep learning object detection model on a single Nvidia RTX3080 GPU [19]. The dataset for the train and test was mapped for the COCO format. Additionally, the training data were transformed for the augmentation mentioned above. The Faster R-CNN utilized a pre-trained ResNet-101 architecture and underwent 20,000 iterations of training with a learning rate of 0.001 and optimization using stochastic gradient descent with a momentum value of 0.9 and weight decay of 0.005. A batch size of image and a batch size of ROI heads per image were set to 4 and 128, respectively. The images were resized to 1400 \(\times\) 688 pixels. Every 400 iterations, a model was evaluated on the test dataset, and the best model which showed the highest AP50 during training was saved. The COCO Evaluator was used for measuring the model's performance.  
In order to assess the effectiveness of the faster R-CNN object detection method in identifying periodontally compromised teeth on panoramic radiographs, precision, recall, and average precision (AP) were calculated by comparing the model prediction with the correct answer for each class. This process was repeated for all classes, and the final mean average precision (mAP) was obtained by averaging the AP results. The receiver operating characteristics and the Area Under the Curve (AUC) were also calculated using the Map by using the metrics function of the scikit-learn machine learning framework [20]. Additionally, any bounding box with an IoU value less than 0.5 with the ground truth was considered a false prediction. F1-score was also evaluated in this study as follows:  
* Precision = TP/(TP + FP);
* Recall = TP/(TP + FN);
* F1 Score = (2 \(\times\) (Recall \(\times\) Precision))/(Recall + Precision);
* TP: true positive, FP: false positive, FN: false negative, TN: true negative.