# A Development and Validation of an AI Model for Cardiomegaly Detection in Chest X-rays
## 3 Experiments  
### Preprocessing Data  
This study aims to propose that a high-performance model can be created using high-quality data, even with a smaller quantity than in previous studies. Since the study did not receive approval from an Institutional Review Board (IRB), the data were collected from publicly available sources. Clinical radiographers are not legally permitted to diagnose diseases for patients. However, through their experience of performing numerous X-ray examinations, they can intuitively recognize the differences between the lungs of a healthy individual and those of a patient, and they possess the ability to identify diseases. The significance of an AI model lies in its potential as a tool to reduce the interpretation time of cardiomegaly by achieving high accuracy amidst a large volume of X-ray images and a limited number of specialists. Furthermore, since cardiomegaly is identified when the size of the heart on an X-ray image exceeds 50% of the outer chest diameter, it is considered appropriate for radiographers to collect data without the assistance of a physician. Therefore, a radiographer curated the data to secure the target dataset. The National Institutes of Health (NIH) chest X-rays dataset available on Kaggle, an online community for data scientists and machine learning practitioners, was utilized. This dataset consists of a total of 10,000 images of cardiomegaly. However, many elements unnecessary for detecting cardiomegaly were included. Therefore, our radiographer excluded images with anteroposterior (AP) views, support devices, and artifacts visible in the images (e.g., pacemakers, heart surgery scars, spinal surgery artifacts, IV lines obscuring the lung and heart fields). Generally, chest X-rays are performed using the PA view. In a chest PA examination, the patient is standing with their chest facing the cassette. The distance between the X-ray tube and the patient is set at 6 feet to reduce beam divergence and magnification. The patient is instructed to take a deep breath and hold it during the examination. However, for emergency or critically ill patients who cannot stand, a chest AP examination is conducted. In a chest AP examination, the patient's back is positioned against the cassette. Since the distance between the X-ray tube and the patient is shorter in an AP examination compared to a PA examination, the lateral width of the heart may appear larger. Additionally, since patients undergoing an AP examination are often in poor condition, they may not be able to take a deep breath, which can make the lungs appear narrower. In the images we obtained, AP views were marked accordingly. For the reasons mentioned above, AP images were excluded. The selected chest X-rays underwent a data enhancement process to remove unnecessary left markers and crop the images to include only the relevant areas needed for training, thereby securing a high-quality dataset. As a result, a total of 718 images were preprocessed from the 10,000 images of cardiomegaly, resulting in a dataset comprising 368 normal images and 350 cardiomegaly images. This dataset was divided into a 7:3 ratio for training and validation data, with the validation data further split into a 1:1 ratio for test data. An additional 41 images were selected from the previously excluded images to evaluate the model's performance. Subsequently, the images were resized to 224 \(\times\) 224 pixels. Figure 0(a) shows a typical image from the dataset, whereas Figure 0(b) illustrates an example of a cardiomegaly image from the same dataset. Additionally, Figure 0(c) shows an example of an image containing elements unnecessary for determining cardiomegaly.  
Figure 1: Chest X-ray sample images.