Skip to main content
. 2024 Dec 5;14(23):2736. doi: 10.3390/diagnostics14232736
Algorithm 1: The Proposed CAD Algorithm
1 Input → TB Chest X-ray Dataset TBD.
2 Output ← Fine-tuned CAD Model using ViT TB diagnosis.
3 BEGIN
4    STEP 1: Pre-processing of Images
5  FOR EACH CXR image IN the TBD DO
6            Remove noise.
7            Resize 224 × 224 pixels.
8            Scaling pixel to range [0, 1].
9        END FOR
10    STEP 2: Splitting TBD
11      SPLIT TBD INTO
12       Training set → 80% of TBD.
13       Test set → 20% of TBD.
14    STEP 3: Six Models Pre-training
15       FOR EACH DL IN [ViT, DenseNet121, MobileNet, ResNet101V2, Xception] DO
16            Load DL.
17            Pre-train DL on the ImageNet dataset.
18            Extract deep features from CXR images.
19       END FOR
20    STEP 4: Five ML Models Fine-Tunning
21       FOR EACH ML IN [RF, XGB, DT, SVM, and AdaBoost] DO
22            Fine-tune ML on the training set.
23       END FOR
24    STEP 5: Model Evaluation
25       FOR EACH ML IN [RF, XGB, DT, SVM, and AdaBoost] DO
26        Evaluate the effectiveness of ML on the test set of the fine-tuned CAD model.
27       END FOR
28        Keep the accuracy of the fine-tuned CAD model.
29 END