## 4 Dataset Acquisition
### Image Preprocessing  
The dataset employed in this investigation is derived from multiple sources, generated by disparate equipment and technicians, culminating in images with distinct attributes such as size, contrast, brightness, and framing. To enhance the learning process of the proposed methodology, we have instituted a preprocessing phase aimed at standardizing certain characteristics of the radiographs. Figure 8 delineates the effects of this preprocessing on the original images in both incidences, demonstrating the transformation of the raw data into a more uniform and analyzable format. This rigorous approach ensures the robustness of our method against variations inherent in the data-collection process, thereby increasing the reliability and reproducibility of our results.  
The implemented preprocessing protocol encompasses three crucial phases: (1) utilization of the Otsu threshold [38] for the elimination of the peripheral region, preserving only the region of interest with pertinent data; (2) application of zero-padding for the conversion of the image proportions into a square shape, centralizing the image and preventing distortions during the resizing to the standard input dimensions of the CNN used (299 \(\times\) 299); (3) employment of U-Net for the segmentation of tokens, followed by the application of the Fast Marching Method (FMM) [39] to fill the segmented region. Figure 8 illustrates the results of these phases for both frontal and lateral incidences (As shown in Figure 8, the frontal view contained a metallic token, resulting in the generation of a segmentation mask by U-Net. In contrast, the lateral view did not have the token, leading to the absence of a segmentation mask generated by U-Net).  
In the radiograph-acquisition process, metallic tokens containing institutional and patient metadata are frequently incorporated into the final image, as exemplified in Figure 3. These tokens, as indicated by [20; 40; 41], can engender bias in CNN learning. To address this, we employed U-Net for token segmentation, leveraging its proven generalizability in complex medical imaging scenarios with limited samples [42]. The efficacy of U-Net, demonstrated by an accuracy of 0.991, a Dice index of 0.902, and a Jaccard index of 0.806 in a study by [20], validates its application in our dataset, characterized by diverse token attributes.  
The images in our dataset exhibit distinct characteristics as they were obtained from various hospitals across all regions of Brazil, using different equipment and technicians. In particular, Polydactyly X-rays can have low contrast, which led us to employ a post-processing step aimed at improving the contrast quality of these images.  
In X-rays, less dense bones and tissues have smooth borders, making anomaly detection difficult [13]. To overcome this limitation, we enhanced the contrast of the images by applying the Contrast Limited Adaptive Histogram Equalization (CLAHE) method. This method divides the images into blocks, equalizing them based on the histogram of these regions. If there is noise in the region, the contrast limitation prevents its propagation [43].  
Figure 7: Word cloud representing the 150 most frequent words in the dataset.  
In Figure 8, it can be observed that the enhanced contrast by CLAHE makes the bones of the feet more evident.  
The image preprocessing aims to improve certain aspects that require refinement, such as standardization and sample uniformity. For instance, zero-padding is applied to make the image format square, preventing distortions during resizing. Resizing is employed to adjust the images to the input standard of the Inception-V3 CNN, ensuring consistency in processing and preventing the model from focusing on minor details that are not relevant to the analysis. Additionally, preprocessing addresses the heterogeneity of the dataset by standardizing characteristics such as the image size and format, making the dataset more suitable for the planned pipeline and improving the model's robustness and generalization.