Integration of Squeeze-and-Excitation in Densenet-121 for Classifying Real and AI-Generated Images
DOI:
https://doi.org/10.52436/1.jutif.2025.6.6.5336Keywords:
AI-Generated Image, Attention, Classification, DenseNet-121, Hyperparameter, Squeeze-And-ExcitationAbstract
Recent advancements in generative technologies, such as Generative Adversarial Networks (GANs) and Latent Diffusion Models, have enabled the creation of AI-generated synthetic images that are increasingly indistinguishable from real ones, posing significant challenges for verifying the authenticity of visual content. This study develops a DenseNet-121 model with hyperparameter optimization and the integration of Squeeze-and-Excitation (SE) attention mechanisms at Early, Mid, and Late positions. Experiments were conducted using the CIFAKE dataset with a resolution of 32×32 pixels to compare the baseline Plain model with three SE variants. Hyperparameter optimization was applied to maximize model performance. The results demonstrate that the Plain DenseNet-121 with optimized hyperparameters achieved an accuracy of 98.52%, outperforming the standard configurations reported in previous studies. The integration of SE yielded varied outcomes, where Mid SE attained the highest accuracy of 98.56%, while Early SE (98.45%) and Late SE (98.48%) exhibited greater stability with lower standard deviations. These findings highlight that combining hyperparameter optimization with appropriate SE placement can enhance model performance for classifying real and AI-generated images. Moreover, SE placement at different positions (Early, Mid, Late) has a significant impact on feature representation and generalization in synthetic image classification, which is increasingly important given the growing difficulty of distinguishing real from AI-generated images.
Downloads
References
R. Rijitha, “The Impact Of Social Media Marketing On Consumer Purchase Intention,” 2021. [Online]. Available: https://www.researchgate.net/publication/358730635
X. Ma and X. Fan, “A review of the studies on social media images from the perspective of information interaction,” Apr. 01, 2022, Elsevier Ltd. doi: 10.1016/j.dim.2022.100004.
P. Duszejko, T. Walczyna, and Z. Piotrowski, “Detection of Manipulations in Digital Images: A Review of Passive and Active Methods Utilizing Deep Learning,” Jan. 01, 2025, Multidisciplinary Digital Publishing Institute (MDPI). doi: 10.3390/app15020881.
R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and B. Ommer, “High-Resolution Image Synthesis with Latent Diffusion Models,” Dec. 2021, [Online]. Available: http://arxiv.org/abs/2112.10752
D. Lamichhane, “Advanced Detection of AI-Generated Images Through Vision Transformers,” IEEE Access, 2024, doi: 10.1109/ACCESS.2024.3522759.
G. Monkam, W. Xu, and J. Yan, “A GAN-based Approach to Detect AI-Generated Images,” 2023, doi: 10.1109/SNPD-Winter57765.2023.10223798.
D. S. Chinta, S. Kamineni, R. P. Chatragadda, and S. Kamepalli, “Analyzing Image Classification on AI-Generated Art Vs Human Created Art Using Deep Learning Models,” in 2024 3rd International Conference on Electrical, Electronics, Information and Communication Technologies, ICEEICT 2024, Institute of Electrical and Electronics Engineers Inc., 2024. doi: 10.1109/ICEEICT61591.2024.10718485.
A. Rossler, D. Cozzolino, L. Verdoliva, C. Riess, J. Thies, and M. Niessner, “FaceForensics++: Learning to detect manipulated facial images,” in Proceedings of the IEEE International Conference on Computer Vision, Institute of Electrical and Electronics Engineers Inc., Oct. 2019, pp. 1–11. doi: 10.1109/ICCV.2019.00009.
B. Zi, M. Chang, J. Chen, X. Ma, and Y. G. Jiang, “WildDeepfake: A Challenging Real-World Dataset for Deepfake Detection,” in MM 2020 - Proceedings of the 28th ACM International Conference on Multimedia, Association for Computing Machinery, Inc, Oct. 2020, pp. 2382–2390. doi: 10.1145/3394171.3413769.
T. Karras, S. Laine, M. Aittala, J. Hellsten, J. Lehtinen, and T. Aila, “Analyzing and improving the image quality of stylegan,” in Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, IEEE Computer Society, 2020, pp. 8107–8116. doi: 10.1109/CVPR42600.2020.00813.
M. A. Rahman, B. Paul, N. H. Sarker, Z. I. A. Hakim, and S. A. Fattah, “Artifact: A Large-Scale Dataset With Artificial And Factual Images For Generalizable And Robust Synthetic Image Detection,” in Proceedings - International Conference on Image Processing, ICIP, IEEE Computer Society, 2023, pp. 2200–2204. doi: 10.1109/ICIP49359.2023.10222083.
J. J. Bird and A. Lotfi, “CIFAKE: Image Classification and Explainable Identification of AI-Generated Synthetic Images,” IEEE Access, vol. 12, pp. 15642–15650, 2024, doi: 10.1109/ACCESS.2024.3356122.
M. Z. Hossain, F. Uz Zaman, and M. R. Islam, “Advancing AI-Generated Image Detection: Enhanced Accuracy through CNN and Vision Transformer Models with Explainable AI Insights,” in 2023 26th International Conference on Computer and Information Technology, ICCIT 2023, Institute of Electrical and Electronics Engineers Inc., 2023. doi: 10.1109/ICCIT60459.2023.10440990.
Y. Wang, Y. Hao, and A. X. Cong, “Harnessing Machine Learning for Discerning AI-Generated Synthetic,” 2024. Accessed: Jun. 04, 2025. [Online]. Available: https://arxiv.org/pdf/2406.13688
M. Nayim, V. Mohan, T. N. Pandey, B. B. Dash, B. B. Dash, and S. S. Patra, “Detection of Leading CNN Models for AI Image Accuracy and Efficiency,” in International Conference on Intelligent Algorithms for Computational Intelligence Systems, IACIS 2024, Institute of Electrical and Electronics Engineers Inc., 2024. doi: 10.1109/IACIS61494.2024.10721936.
A. S. Gupta, K. P. Shreneter, and S. Sehgal, “Visual Veracity: Advancing AI-Generated Image Detection with Convolutional Neural Networks,” in 2024 11th International Conference on Reliability, Infocom Technologies and Optimization (Trends and Future Directions), ICRITO 2024, Institute of Electrical and Electronics Engineers Inc., 2024. doi: 10.1109/ICRITO61523.2024.10522113.
P. Mehta, A. Sagar, and S. Kumari, “Enhancing Image Authenticity Detection: Swin Transformers and Color Frame Analysis for CGI vs. Real Images,” Procedia Comput Sci, vol. 258, pp. 2695–2702, 2025, doi: 10.1016/j.procs.2025.04.530.
G. Chen, C. Du, Y. Yu, H. Hu, H. Duan, and H. Zhu, “A Deepfake Image Detection Method Based on a Multi-Graph Attention Network,” Electronics (Switzerland), vol. 14, no. 3, Feb. 2025, doi: 10.3390/electronics14030482.
H. Tekchandani, S. Verma, N. D. Londhe, R. R. Jain, and A. Tiwari, “Severity Assessment of Cervical Lymph Nodes using Modified VGG-Net, and Squeeze and Excitation Concept,” in 2021 IEEE 11th Annual Computing and Communication Workshop and Conference, CCWC 2021, Institute of Electrical and Electronics Engineers Inc., Jan. 2021, pp. 709–714. doi: 10.1109/CCWC51732.2021.9375996.
S. Dasgupta, J. Mason, X. Yuan, O. Odeyomi, and K. Roy, “Enhancing Deepfake Detection using SE Block Attention with CNN,” Jun. 2025, doi: 10.1109/icABCD62167.2024.10645262.
P. Mittal, B. Sharma, D. P. Yadav, and I. Ben Dhaou, “Enhancing Blindness Detection using Deep Learning with MobileNet and SE Blocks,” in 2025 International Conference on Control, Automation and Diagnosis, ICCAD 2025, Institute of Electrical and Electronics Engineers Inc., 2025. doi: 10.1109/ICCAD64771.2025.11099419.
A. R. Gunukula, H. Das Gupta, and V. S. Sheng, “Detecting AI-Generated Images Using a Hybrid ResNet-SE Attention Model,” Applied Sciences (Switzerland), vol. 15, no. 13, Jul. 2025, doi: 10.3390/app15137421.
M. S. S. Shazuli and A. Saravanan, “Arithmetic Optimization with SE-DenseNet based Image Retrieval and Classification for Diabetic Retinopathy,” in Proceedings - International Conference on Augmented Intelligence and Sustainable Systems, ICAISS 2022, Institute of Electrical and Electronics Engineers Inc., 2022, pp. 574–580. doi: 10.1109/ICAISS55157.2022.10010803.
G. Ye et al., “Multitask Classification of Breast Cancer Pathological Images Using SE-DenseNet,” 2019. doi: 10.1109/ICACI.2019.8778592.
Q. Cai, X. Liu, and Z. Guo, Identifying Architectural distortion in Mammogram images via a SE-DenseNet model and twice transfer learning. IEEE, 2018. doi: 10.1109/CISP-BMEI.2018.8633197.
Q. Zhou et al., “Grading of hepatocellular carcinoma using 3D SE-DenseNet in dynamic enhanced MR images,” Comput Biol Med, vol. 107, pp. 47–57, Apr. 2019, doi: 10.1016/j.compbiomed.2019.01.026.
Z. Tang, Y. Gao, L. Karlinsky, P. Sattigeri, R. Feris, and D. Metaxas, “OnlineAugment: Online Data Augmentation with Less Domain Knowledge,” Aug. 2020, [Online]. Available: http://arxiv.org/abs/2007.09271
S.-C. Pei and C.-N. Lin, “Image normalization for pattern recognition,” 1995.
G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger, “Densely connected convolutional networks,” in Proceedings - 30th IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Institute of Electrical and Electronics Engineers Inc., Nov. 2017, pp. 2261–2269. doi: 10.1109/CVPR.2017.243.
S. Zagoruyko and N. Komodakis, “Wide Residual Networks,” 2017. doi: https://doi.org/10.48550/arXiv.1605.07146.
J. Hu, L. Shen, S. Albanie, G. Sun, and E. Wu, “Squeeze-and-Excitation Networks,” IEEE Trans Pattern Anal Mach Intell, vol. 42, no. 8, pp. 2011–2023, Aug. 2019, doi: 10.1109/TPAMI.2019.2913372.
R. Sunkara and T. Luo, “No More Strided Convolutions or Pooling: A New CNN Building Block for Low-Resolution Images and Small Objects,” in Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), Springer Science and Business Media Deutschland GmbH, 2023, pp. 443–459. doi: 10.1007/978-3-031-26409-2_27.
J. Tan, J. Yang, S. Wu, G. Chen, and J. Zhao, “A critical look at the current train/test split in machine learning,” Jun. 2021, [Online]. Available: http://arxiv.org/abs/2106.04525
R. Yamashita, M. Nishio, R. K. G. Do, and K. Togashi, “Convolutional neural networks: an overview and application in radiology,” Aug. 01, 2018, Springer Verlag. doi: 10.1007/s13244-018-0639-9.
A. J. Ilemobayo et al., “Hyperparameter Tuning in Machine Learning: A Comprehensive Review,” Journal of Engineering Research and Reports, vol. 26, no. 6, pp. 388–395, Jun. 2024, doi: 10.9734/jerr/2024/v26i61188.
E. Bartz, T. Bartz-Beielstein, M. Zaefferer, and O. Mersmann, “Hyperparameter Tuning for Machine and Deep Learning with R A Practical Guide,” 2023. doi: https://doi.org/10.1007/978-981-19-5170-1.
M. A. K. Raiaan et al., “A systematic review of hyperparameter optimization techniques in Convolutional Neural Networks,” Jun. 01, 2024, Elsevier Inc. doi: 10.1016/j.dajour.2024.100470.
A. Sharma and D. Kumar, “Hyperparameter Optimization in CNN: A Review,” in Proceedings - 4th IEEE 2023 International Conference on Computing, Communication, and Intelligent Systems, ICCCIS 2023, Institute of Electrical and Electronics Engineers Inc., 2023, pp. 237–242. doi: 10.1109/ICCCIS60361.2023.10425571.
P. Micikevicius et al., “Mixed Precision Training,” Feb. 2018, [Online]. Available: http://arxiv.org/abs/1710.03740
M. Sokolova and G. Lapalme, “A systematic analysis of performance measures for classification tasks,” Inf Process Manag, vol. 45, no. 4, pp. 427–437, Jul. 2009, doi: 10.1016/j.ipm.2009.03.002.
I. Markoulidakis, I. Rallis, I. Georgoulas, G. Kopsiaftis, A. Doulamis, and N. Doulamis, “Multiclass Confusion Matrix Reduction Method and Its Application on Net Promoter Score Classification Problem,” Technologies (Basel), vol. 9, no. 4, Dec. 2021, doi: 10.3390/technologies9040081.
S. Gasmi and T. Abbas, “Leveraging Transfer Learning in PyTorch for Effective Image Classification”, doi: 10.13140/RG.2.2.30294.25920.
B. M. Hussein and S. M. Shareef, “An Empirical Study on the Correlation between Early Stopping Patience and Epochs in Deep Learning,” ITM Web of Conferences, vol. 64, p. 01003, 2024, doi: 10.1051/itmconf/20246401003.
Additional Files
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 Nadiyya Hasaniyyah, Khadijah, Sutikno, Zahra Arwananing Tyas

This work is licensed under a Creative Commons Attribution 4.0 International License.





