VISION TRANSFORMER - BASED CLASSIFICATION OF CERVICAL CANCER IMAGES

Authors

DOI:

https://doi.org/10.24191/mjoc.v11i2.8766

Keywords:

Cervical Cancer, Cytology Image Classification, Deep Learning, DeiT, Swin Transformer, CrossViT, SIPaKMeD Dataset

Abstract

Cervical cancer is a significant health concern as it is one of the most fatal causes of cancer deaths in women. Detection at an early stage is vital, but conventional diagnostic procedures via Pap smears relies heavily on manual cytopathology inspection, a process prone to human fatigue, diagnostic subjectivity, and severe practitioner shortages in low-resource medical environments. To address these challenges, this study presents an automated cervical cancer image classification framework utilizing advanced Vision Transformer (ViT) architectures. Three ViT variants: Data-efficient Image Transformer (DeiT), Swin Transformer, and Cross-Attention Multi-Scale Vision Transformer (CrossViT) were fine-tuned and evaluated on the benchmark SIPaKMeD dataset comprising five distinct cervical cell classes: superficial-intermediate, parabasal, koilocytotic, dyskeratotic, and metaplastic. Data balance was maintained using a dynamic WeightedRandomSampler combined with image augmentations. Experimental results demonstrate that DeiT achieved the highest classification performance with an accuracy of 95.22% and a weighted average F1-score of 0.9522, outperforming CrossViT (94.82%) and Swin Transformer (93.83%). DeiT was the most accurate with 95.22%, and Swin Transformer and CrossViT clocked 93.83% and 94.82%, respectively. The optimal model was integrated into an interactive web-based interface built with Streamlit, demonstrating single-image inference latency of ~38 ms on GPU and ~142 ms on CPU. These findings confirm that Vision Transformers provide a highly accurate and scalable decision-support mechanism for automated cervical cancer screening. The work in the future will include expanding the pool of images in the dataset with a variety of cervical images, resolving class imbalance by employing methods such as GAN-based augmentation, and using hybrid architectures to improve results. Additional confirmation on other sample databases will also be required to ascertain the robustness of the system in real world solutions.

References

Alquran, H., Alsalatie, M., Mustafa, W. A., Abdi, R. A., & Ismail, A. R. (2022). Cervical Net: A novel cervical cancer classification using feature fusion. Bioengineering, 9(10), 578. https://doi.org/10.3390/bioengineering9100578

Ali, A. M., Benjdira, B., Koubaa, A., El-Shafai, W., Khan, Z., & Boulila, W. (2023). Vision transformers in image restoration: A survey. Sensors, 23(5), 2385. https://doi.org/10.3390/s23052385

Bao, S., Ding, H., & Chen, H. (2023). A review of the development of Vision Transformer. In 2023 International Conference on Artificial Intelligence and Automation Control (AIAC) (pp. 352-356). IEEE. https://doi.org/10.1109/AIAC61660.2023.00008

Chen, C.-F. R., Fan, Q., & Panda, R. (2021). CrossViT: Cross-attention multi-scale Vision Transformer for image classification. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (pp. 357-366). https://openaccess.thecvf.com/content/ICCV2021/html/Chen_CrossViT_Cross-Attention_Multi-Scale_Vision_Transformer_for_Image_Classification_ICCV_2021_paper.html

Dasari, S., Wudayagiri, R., & Valluru, L. (2015). Cervical cancer: Biomarkers for diagnosis and treatment. Clinica Chimica Acta, 445, 7-11. https://doi.org/10.1016/j.cca.2015.03.005

Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., & Houlsby, N. (2021). An image is worth 16x16 words: Transformers for image recognition at scale. International Conference on Learning Representations (ICLR). https://research.google/pubs/an-image-is-worth-16x16-words-transformers-for-image-recognition-at-scale/

Ferri, F. F. (2025). Ferri's clinical advisor 2025. Elsevier.

Hong, Z., Xiong, J., Yang, H., & Mo, Y. K. (2024). Lightweight low-rank adaptation Vision Transformer framework for cervical cancer detection and cervix type classification. Bioengineering, 11(5), 468. https://doi.org/10.3390/bioengineering11050468

Iyanda, F. K., Tunde, T. A., & Isa, U. (2021). Numerical comparison of Runge-Kutta (RK5) and New Iterative Method (NIM) for solving metastatic cancer model. Malaysian Journal of Computing, 6(1), 758-771. https://doi.org/10.24191/mjoc.v6i1.10359

Khowaja, A., Zou, B., & Kui, X. (2024). Enhancing cervical cancer diagnosis: Integrated attention-transformer system with weakly supervised learning. Image and Vision Computing, 149, 105193. https://doi.org/10.1016/j.imavis.2024.105193

K, A., & B, S. (2024). A deep learning-based approach for cervical cancer classification using 3D CNN and Vision Transformer. Journal of Imaging Informatics in Medicine, 37(1), 280-296. https://doi.org/10.1007/s10278-023-00911-z

Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., & Guo, B. (2021). Swin Transformer: Hierarchical Vision Transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (pp. 10012-10022). IEEE. https://doi.org/10.1109/ICCV48922.2021.00986

Mansur Huang, N. S., Ibrahim, Z., & Mat Diah, N. (2021). Machine learning techniques for early heart failure prediction. Malaysian Journal of Computing, 6(2), 872-884. https://doi.org/10.24191/mjoc.v6i2.13708

Park, C.-H. (2008). False-negative results of conventional Papanicolaou cervical cytology in women with cervical conization. Korean Journal of Gynecologic Oncology, 19(1), 40-46. https://doi.org/10.3802/kjgo.2008.19.1.40

Plissiti, M. E., Dimitrakopoulos, P., Sfikas, G., Nikou, C., Krikoni, O., & Charchanti, A. (2018). SIPaKMeD: A new dataset for feature and image based classification of normal and pathological cervical cells in Pap smear images. In 2018 25th IEEE International Conference on Image Processing (ICIP) (pp. 3144-3148). IEEE. https://doi.org/10.1109/ICIP.2018.8451588

Rahmat, T., Ismail, A., & Aliman, S. (2019). Chest X-ray image classification using Faster R-CNN. Malaysian Journal of Computing, 4(1), 225-236. https://doi.org/10.24191/mjoc.v4i1.6095

Swanson, A. A., & Pantanowitz, L. (2024). The evolution of cervical cancer screening. Journal of the American Society of Cytopathology, 13(1), 10-15. https://doi.org/10.1016/j.jasc.2023.09.007

Touvron, H., Cord, M., Douze, M., Massa, F., Sablayrolles, A., & Jegou, H. (2021). Training data-efficient image transformers & distillation through attention. Proceedings of the 38th International Conference on Machine Learning, 139, 10347-10357. https://proceedings.mlr.press/v139/touvron21a.html

Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., & Polosukhin, I. (2017). Attention is all you need. Advances in Neural Information Processing Systems, 30, 5998-6008. https://proceedings.neurips.cc/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html

Downloads

Published

2026-10-01

Data Availability Statement

The datasets used and/or analysed during the current study are available from the corresponding author on reasonable request.

How to Cite

Juimairi, M. D. A., Mohtar, I. A., Masrom, S., Mohamad, M., & Alfat, L. (2026). VISION TRANSFORMER - BASED CLASSIFICATION OF CERVICAL CANCER IMAGES. Malaysian Journal of Computing, 11(2), 2486-2505. https://doi.org/10.24191/mjoc.v11i2.8766