Where Do the Best Features Lie? A Layer-Wise Analysis of Frozen Encoders for Efficient Endoscopic Image Classification
Main Article Content
Abstract
In our quest to advance medical AI, we demonstrate that a pre-trained and frozen Vision Transformer paired with a linear classifier can achieve highly competitive performance in endoscopic image classification. Our central contribution is a systematic, layer-wise analysis that identifies the source of the most powerful features, challenging the common heuristic of using only the final layer. We uncover a distinct "peak-before-the-end" phenomenon, where a late-intermediate layer offers a more generalizable representation for the downstream medical task. On the Kvasir and HyperKvasir benchmarks, our parameter-light approach not only achieves excellent accuracy but also drastically reduces computational overhead. This work provides a practical roadmap for efficiently leveraging the power of general foundation models in clinical environments.
Article Details
References
2. Simadibrata D.M., Lesmana E., Fass R. Role of endoscopy in gastroesophageal reflux disease // Clinical Endoscopy. 2023. Vol. 56, No. 6. P. 681–692.
3. Mathews A.A., Draganov P.V., Yang D. Endoscopic management of colorectal polyps: From benign to malignant polyps // World Journal of Gastrointestinal Endoscopy. 2021. Vol. 13, No. 9. P. 356.
4. Bernatchi I.N., Voidazan S., Petrut M.I., Gabos G., Balasescu M., Nicolau C. Inter-observer variability on the value of endoscopic images for the documentation of upper gastrointestinal endoscopy – our center experience // Acta Marisiensis – Seria Medica. 2023.
5. Ghazi G.G.R.J.J. et al. Sampling error in the diagnosis of colorectal cancer is associated with delay to surgery: a retrospective cohort study // Surgical Endoscopy. 2022. Vol. 36. P. 4893–4902.
6. Khalifa M., Albadawy M. Ai in diagnostic imaging: Revolutionising accuracy and efficiency // Computer Methods and Programs in Biomedicine Update. 2024. Vol. 5. P. 100146.
7. LeCun Y., Bengio Y., Hinton G. Deep learning // Nature. 2015. Vol. 521, No. 7553. P. 436–444.
8. He K., Zhang X., Ren S., Sun J. Deep residual learning for image recognition // 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). 2015. P. 770-778.
9. Dosovitskiy A. et al. An image is worth 16x16 words: Transformers for image recognition at scale // 3rd Conference on Neural Information Processing Systems. 2021.
10. Deng J., Dong W., Socher R., Li L.-J., Li K., Fei-Fei L. Imagenet: A large-scale hierarchical image database // 2009 IEEE Conference on Computer Vision and Pattern Recognition. 2009. P. 248–255.
11. Su S.S. et al. Democratizing protein language models with parameter-efficient fine-tuning // Proceedings of the National Academy of Sciences of the United States of America. 2024. Vol. 121. P. e2405840121.
12. Sanchez-V T.S., Rahimi A., Oktay O., Bharadwaj S. Addressing the exorbitant cost of labeling medical images with active learning // International Conference on Machine Learning and Medical Imaging Analysis.
13. Zhang Z.Z. et al. Active, continual fine tuning of convolutional neural networks for reducing annotation efforts // Medical Image Analysis. 2021. Vol. 71. P. 101997.
14. Pogorelov K. et al. Kvasir: A multi-class image dataset for computer aided gastrointestinal disease detection // Proceedings of the 8th ACM on Multimedia Systems Conference. 2017. P. 164–169.
15. Borgli H. et al. Hyperkvasir, a comprehensive multi-class image and video dataset for gastrointestinal endoscopy // Scientific Data. 2020. Vol. 7, No. 1. P. 283.
16. Huang G., Liu Z., van der Maaten L., Weinberger K.Q. Densely connected convolutional networks // 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). 2018. P. 2261–2269.
17. Shah S.T. et al. Comparison of vision transformers and convolutional neural networks in medical image analysis: A systematic review // Journal of Medical Systems. 2024. Vol. 48, No. 1. P. 84.
18. Rosenthal J.T., Beecy A., Sabuncu M.R. Rethinking clinical trials for medical ai with dynamic deployments of adaptive systems // npj Digital Medicine. 2025. Vol. 8, No. 1. P. 252.
19. Hu E.J. et al. Lora: Low-rank adaptation of large language models // International Conference on Learning Representations. 2021.
20. Farina M., Ahmad U., Taha A., Younes H., Mesbah Y., Yu X., Pedrycz W. Sparsity in transformers: A systematic literature review // Neurocomputing. 2024. Vol. 582. P. 127468.
21. Chen T., Kornblith S., Norouzi M., Hinton G. A simple framework for contrastive learning of visual representations // Proceedings of the 37th International Conference on Machine Learning. 2020. P. 1597–1607.
22. Yan Y.C. et al. Brain tumor intelligent diagnosis based on auto-encoder and u-net feature extraction // PLOS ONE. 2025. Vol. 20, No. 3. P. e0315631.
23. Jawahar B.S.G., Seddah D. What does bert learn about the structure of language? // Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. 2019. P. 3651–3657.
24. Lin M., Chen Q., Yan S. Network in network // 2nd International Conference on Learning Representations, ICLR 2014. 2014.
25. Kingma D.P., Ba J. Adam: A method for stochastic optimization // 5th International Conference on Learning Representations, ICLR 2017. 2017.
26. Siddiqui S., Khan J.A., Algamdi S. Deep ensemble learning for gastrointestinal diagnosis using endoscopic image classification // PeerJ Computer Science. 2025. Vol. 11. P. e2809.
27. Zoph B., Vasudevan V., Shlens J., Le Q.V. Learning transferable architectures for scalable image recognition // 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2018. P. 8697-8705.
28. Tan M., Le Q.V. Efficientnet: Rethinking model scaling for convolutional neural networks // Proceedings of the 36th International Conference on Machine Learning. 2020. P. 6105–6114.
29. Szegedy C., Vanhoucke V., Ioffe S., Shlens J., Wojna Z. Rethinking the inception architecture for computer vision // 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). 2015. P. 2818–2826.
30. Ben-Younes D. et al. Perception encoder: The best visual embeddings are not at the output of the network // The Twelfth International Conference on Learning Representations. 2025.
31. Tishby N., Pereira F.C., Bialek W. The information bottleneck method // 37th Annual Allerton Conference on Communication, Control, and Computing. 2000.
32. van der Maaten L., Hinton G. Visualizing data using t-sne // Journal of Machine Learning Research. 2008. Vol. 9. P. 2579–2605.
33. Kamboj A.K., Gaddam S., Lo S.K., Rezaie A. Irregular z-line: To biopsy or not to biopsy? // Digestive Diseases and Sciences. 2024. Vol. 69, No. 8. P. 2734–2740.

This work is licensed under a Creative Commons Attribution 4.0 International License.
Presenting an article for publication in the Russian Digital Libraries Journal (RDLJ), the authors automatically give consent to grant a limited license to use the materials of the Kazan (Volga) Federal University (KFU) (of course, only if the article is accepted for publication). This means that KFU has the right to publish an article in the next issue of the journal (on the website or in printed form), as well as to reprint this article in the archives of RDLJ CDs or to include in a particular information system or database, produced by KFU.
All copyrighted materials are placed in RDLJ with the consent of the authors. In the event that any of the authors have objected to its publication of materials on this site, the material can be removed, subject to notification to the Editor in writing.
Documents published in RDLJ are protected by copyright and all rights are reserved by the authors. Authors independently monitor compliance with their rights to reproduce or translate their papers published in the journal. If the material is published in RDLJ, reprinted with permission by another publisher or translated into another language, a reference to the original publication.
By submitting an article for publication in RDLJ, authors should take into account that the publication on the Internet, on the one hand, provide unique opportunities for access to their content, but on the other hand, are a new form of information exchange in the global information society where authors and publishers is not always provided with protection against unauthorized copying or other use of materials protected by copyright.
RDLJ is copyrighted. When using materials from the log must indicate the URL: index.phtml page = elbib / rus / journal?. Any change, addition or editing of the author's text are not allowed. Copying individual fragments of articles from the journal is allowed for distribute, remix, adapt, and build upon article, even commercially, as long as they credit that article for the original creation.
Request for the right to reproduce or use any of the materials published in RDLJ should be addressed to the Editor-in-Chief A.M. Elizarov at the following address: amelizarov@gmail.com.
The publishers of RDLJ is not responsible for the view, set out in the published opinion articles.
We suggest the authors of articles downloaded from this page, sign it and send it to the journal publisher's address by e-mail scan copyright agreements on the transfer of non-exclusive rights to use the work.