Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2024 Oct 14;14(20):2286.
doi: 10.3390/diagnostics14202286.

Early Cervical Cancer Diagnosis with SWIN-Transformer and Convolutional Neural Networks

Affiliations

Early Cervical Cancer Diagnosis with SWIN-Transformer and Convolutional Neural Networks

Foziya Ahmed Mohammed et al. Diagnostics (Basel). .

Abstract

Introduction: Early diagnosis of cervical cancer at the precancerous stage is critical for effective treatment and improved patient outcomes. Objective: This study aims to explore the use of SWIN Transformer and Convolutional Neural Network (CNN) hybrid models combined with transfer learning to classify precancerous colposcopy images. Methods: Out of 913 images from 200 cases obtained from the Colposcopy Image Bank of the International Agency for Research on Cancer, 898 met quality standards and were classified as normal, precancerous, or cancerous based on colposcopy and histopathological findings. The cases corresponding to the 360 precancerous images, along with an equal number of normal cases, were divided into a 70/30 train-test split. The SWIN Transformer and CNN hybrid model combines the advantages of local feature extraction by CNNs with the global context modeling by SWIN Transformers, resulting in superior classification performance and a more automated process. The hybrid model approach involves enhancing image quality through preprocessing, extracting local features with CNNs, capturing the global context with the SWIN Transformer, integrating these features for classification, and refining the training process by tuning hyperparameters. Results: The trained model achieved the following classification performances on fivefold cross-validation data: a 94% Area Under the Curve (AUC), an 88% F1 score, and 87% accuracy. On two completely independent test sets, which were never seen by the model during training, the model achieved an 80% AUC, a 75% F1 score, and 75% accuracy on the first test set (precancerous vs. normal) and an 82% AUC, a 78% F1 score, and 75% accuracy on the second test set (cancer vs. normal). Conclusions: These high-performance metrics demonstrate the models' effectiveness in distinguishing precancerous from normal colposcopy images, even with modest datasets, limited data augmentation, and the smaller effect size of precancerous images compared to malignant lesions. The findings suggest that these techniques can significantly aid in the early detection of cervical cancer at the precancerous stage.

Keywords: SWIN Transformer; cancer screening; cervical cancer; colposcopy images; convolutional neural networks (CNN); early diagnosis; histopathology; hybrid models; medical image classification; precancerous lesions; transfer learning.

PubMed Disclaimer

Conflict of interest statement

Author Seid Muhie was employed by Enkoy LLC, the remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Figures

Figure 1
Figure 1
(a) Colposcopy images from each of the normal, precancerous, and cancer groups. (b) Provisional diagnosis vs. cancer status: The provisional diagnosis during colposcopy, which relies on the clinician’s initial visual and clinical assessment, is important for categorizing cervical lesions as normal, precancerous, or cancerous. An analysis of the provided dataset highlights specific provisional diagnoses associated with each final cancer status. For cases ultimately confirmed as normal, the most frequent provisional diagnosis was “Type 1 Transition Zone (TZ); normal.” In precancerous cases, “Types 1, 2, and 3 TZ; HSIL” and “Type 1 TZ; LSIL” were commonly noted. For cancer cases, “Type 3 TZ; suspicion of invasive squamous cell carcinoma” was the predominant provisional diagnosis.
Figure 2
Figure 2
Histopathology vs. cancer diagnosis: A histopathological analysis was used to determine the final diagnosis of cervical lesions identified during colposcopy. In normal cases, histopathology was often not performed, suggesting that the colposcopy assessment alone was sufficient. When histopathology was performed, findings such as CIN1 or the absence of dysplasia supported the normal diagnosis. Precancerous cases were characterized by moderate to severe dysplasia (CIN2, CIN3), low-grade squamous intraepithelial lesions (LSILs), and high-grade squamous intraepithelial lesions (HSILs), indicating varying degrees of abnormality with potential progression to cancer. Cancer cases were confirmed by histopathological evidence of invasive adenocarcinoma, squamous cell carcinoma, or adenocarcinoma in situ. These findings highlight the role of histopathology in accurately diagnosing and categorizing cervical lesions, guiding appropriate patient management and treatment strategies.
Figure 3
Figure 3
An architectural flowchart illustrating the integrated process where the SWIN Transformer architecture and CNN are combined into a hybrid model for the binary classification of colposcopy images. This diagram highlights the seamless interaction between the two components, demonstrating how they work together to enhance the accuracy of image classification. The CNN and SWIN Transformer processes are parallel, and both outputs are integrated before classification. This flowchart includes specific steps within the SWIN Transformer architecture (swin_base_patch4_window7_224), such as patch partitioning, embedding, window-based self-attention, and merging, before integrating with the CNN outputs. After integration, the process flows through classification, post-processing, and final output generation. Detailed steps and the Python code are available at https://github.com/Foziyaam/SWIN-Transformer-and-CNN-for-Cervical-Cancer.
Figure 4
Figure 4
Summary statistics—overall case diagnosis distribution: This summary statistics provides an overview of the distribution of colposcopy cases by diagnosis, Swede score distribution, and HPV status distribution, encapsulating the key aspects of the clinical findings. The distribution of overall case diagnoses indicates a predominance of non-cancer cases, with a significant portion of precancerous and some cancer cases.
Figure 5
Figure 5
Distribution of cancer diagnoses by HPV status and transformation zone. These are 196 cases, since one of the cases does not have HPV test results.
Figure 6
Figure 6
Correlation between Swede scores and cancer diagnosis. (a) Normal cases have the lowest-to-no Swede scores and precancerous moderate, while cancer cases have very high Swede scores. (b) Swede scores were significantly correlated with cancer diagnosis (r = 0.3 and p = 2e−05) and negatively correlated with normal diagnosis (r = 0.2 and p = 9e−04) while there was no significant correlation with the precancerous diagnosis.
Figure 7
Figure 7
(a) Training loss across epochs; fivefold cross-validation metrics (red curve is the smoothing of the actual curve—the black line): (b) validation ROC curve for the validation set; (c) confusion matrix for the validation set. Validation sensitivity, 0.86; specificity, 0.90; positive predictive value (precision), 0.92; negative predictive value, 0.81; accuracy, 0.87; F1 score, 0.88; and AUC, 0.94.
Figure 8
Figure 8
Performance of the trained model on the first test data (precancerous vs. normal): (a) ROC curve for test set 1 (precancerous versus normal); (b) confusion matrix for the performance of the model on test set 1 (precancerous vs. normal group). The values of the model’s performance metrics include sensitivity, 0.75; specificity, 0.75; positive predictive value, 0.76; negative predictive value, 0.74; accuracy, 0.75; F1 score, 0.75; and AUC, 0.80. The performance was tested using the same hyperparameters that were used for training: batch size = 32, epochs = 30, learning rate = 5e−05, weight decay = 5e−02, and gamma = 0.8.
Figure 9
Figure 9
Performance of the second test set (images from cancer and normal cases): (a) ROC curve for test set 2 (cancer versus normal); (b) confusion matrix for the performance of the model on test set 2 (cancer vs. normal). Values of the important metrics include sensitivity, 0.72; specificity, 0.80; positive predictive value, 0.85; negative predictive value, 0.65; accuracy, 0.75; F1, 0.78; and AUC, 0.82. The same hyperparameters were used for this evaluation as well.

Similar articles

Cited by

References

    1. WHO World Health Organization Cervical Cancer: Key Facts. [(accessed on 29 August 2024)]. Available online: https://www.who.int/news-room/fact-sheets/detail/cervical-cancer.
    1. International Agency for Research on Cancer (IARC) New Estimates of the Number of Cervical Cancer Cases and Deaths That Could Be Averted in Low-Income and Lower-Middle-Income Countries by Scale-up of Screening and Vaccination Activities. 2024. [(accessed on 24 April 2024)]. Available online: https://www.iarc.who.int/news-events/new_estimates_cervical_cancer_cases...
    1. Ferlay J., Ervik M., Lam F., Colombet M., Mery L., Piñeros M., Znaor A., Soerjomataram I., Bray F. Global Cancer Observatory: Cancer Today 2019. [(accessed on 10 August 2024)]. Available online: https://publications.iarc.fr/Databases/Iarc-Cancerbases/Cancer-Today-Pow....
    1. Arbyn M., Weiderpass E., Bruni L., de Sanjosé S., Saraiya M., Ferlay J., Bray F. Estimates of Incidence and Mortality of Cervical Cancer in 2018: A Worldwide Analysis. Lancet Glob. Health. 2020;8:e191–e203. doi: 10.1016/S2214-109X(19)30482-6. - DOI - PMC - PubMed
    1. Mohammed F.A., Tune K.K., Jett M., Muhie S. Cervical Cancer Stages, Human Papillomavirus Integration, and Malignant Genetic Mutations: Integrative Analysis of Datasets from Four Different Cohorts. Cancers. 2023;15:5595. doi: 10.3390/cancers15235595. - DOI - PMC - PubMed

LinkOut - more resources