## 2 Methods
### Data Preparation and Image Processing  
The dataset used in this study consisted of 400 dental X-ray images, of which 195 were labeled as requiring an SM and 205 were labeled as not requiring one. The decision to use 400 images was influenced by several factors, including the need to have a balanced representation of both classes (SM needed and SM not needed) and to allow for robust model training and validation. These images were processed to standardize their format and prepare them for training and testing the artificial intelligence model. To ensure a reliable evaluation of the model's performance, the dataset was divided into training and testing subsets, with 80% of the data used for training and 20% reserved for testing. The split was performed in a stratified manner to maintain an equal representation of both labels in each subset.  
The original images in the dataset are generally 2000 \(\times\) 1000 pixels. For CNN image processing, we resized them to \(100\times 100\) pixels with three RGB color channels using Python 12.0 code. The resizing was performed using interpolation methods to maintain aspect ratio and minimize distortion. After that, each image was resized to a resolution of \(100\times 100\) pixels with three color channels (RGB format), ensuring uniformity in dimensions across the entire dataset. This resizing step was critical for the consistency required by the machine learning algorithms, as it ensured that all input data shared the same shape and scale. Following resizing, the images were flattened into one-dimensional numerical arrays. This transformation preserved the pixel intensity values while reducing the spatial complexity of the images, enabling efficient storage and processing. The flattened arrays served as a numerical representation of the images, capturing all the relevant features necessary for the learning process. The labels for the dataset were encoded numerically, with \"0\" representing cases where no SM was needed and \"1\" representing cases where an SM was required. The processed data were divided into training and testing files.  
The training set, represented by \"X_train\", consisted of 320 flattened images (80% of the dataset), while the corresponding labels, \"Y_train\", comprised 165 zeros and 155 ones. Similarly, the testing set, represented by \"X_test\", included 80 flattened images (20% of the dataset), with \"Y_test\" containing 40 zeros and 40 ones. These files were stored in CSV format to ensure compatibility with the machine learning pipeline. By employing this systematic preprocessing pipeline, the study ensured that the dataset was both standardized and appropriately structured for machine learning applications. This approach not only enhanced the model's training efficiency but also improved the reproducibility of the methodology. Instead of relying solely on a separate test set, the model utilized all 400 images to predict the tooth number based on its previous classification outputs. This approach allowed us to assess the model's consistency and accuracy in identifying the correct tooth. Among these, 86 images specifically indicated the need for a space maintainer (predicting teeth number), serving as a focused subset for evaluating prediction accuracy.