Peningkatan Akurasi Klasifikasi Kematangan Buah Pisang Menggunakan CNN dengan Attention Mechanism
Abstract
Automated fruit sorting based on deep learning on edge devices faces significant challenges due to limited computational resources. Lightweight architectures such as MobileNetV2 are efficient for inference, yet they often lack sensitivity in capturing fine-grained features like color gradients and subtle features in ripeness classification tasks. This research proposes a selective Squeeze-and- Excitation (SE) module integration strategy on MobileNetV2 to enhance accuracy without significantly increasing the model's parameters. The research methodology involves testing five scenarios: Baseline, All Block, and selective integration in Early (blocks 1-5), Middle (blocks 6-11), and Deep (blocks 12-17) stages to recalibrate features at different hierarchical levels. Experimental results on the Banana Ripeness Classification Dataset demonstrate that the Early scenario yields the most optimal performance, achieving the highest validation accuracy of 96.79% and an F1-score of 0.9679. This scenario proves highly efficient as it maintains the parameter count at 2.88 M, identical to the baseline model. Conversely, integrating across all blocks decreased accuracy to 95.19% while increasing the parameters to 2.91 M. Confusion matrix analysis confirms that the model has a very low misclassification rate for the unripe class. This study concludes that placing SE modules at the early stages of the network is the best strategy to maintain efficiency and classification precision on edge devices.
Keywords: deep learning, edge computing, fruit ripeness classification, mobilenetv2, squeeze-and- excitation.
References
“BANANA Market Review 2023 © iStock Shakeel Sha.”
L. Chuquimarca, B. Vintimilla, and S. Velastin, “Banana Ripeness Level Classification using a Simple CNN Model Trained with Real and Synthetic Datasets,” Apr. 2025, doi: 10.5220/0011654600003417.
M. Rizzo, M. Marcuzzo, A. Zangari, A. Gasparetto, and A. Albarelli, “Fruit ripeness classification: A survey,” Mar. 01, 2023, KeAi Communications Co. doi: 10.1016/j.aiia.2023.02.004.
S. K. Behera, A. K. Rath, and P. K. Sethy, “Maturity status classification of papaya fruits based on machine learning and transfer learning approach,” Information Processing in Agriculture, vol. 8, no. 2, pp. 244–250, Jun. 2021, doi: 10.1016/j.inpa.2020.05.003.
O. Martínez-Mora et al., “Artificial Vision-Based Dual CNN Classification of Banana Ripeness and Quality Attributes Using RGB Images,” Processes, vol. 13, no. 7, Jul. 2025, doi: 10.3390/pr13071982.
M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L.-C. Chen, “MobileNetV2: Inverted Residuals and Linear Bottlenecks,” Mar. 2019, [Online]. Available: http://arxiv.org/abs/1801.04381
J. Hu, L. Shen, S. Albanie, G. Sun, and E. Wu, “Squeeze-and-Excitation Networks,” May 2019,
[Online]. Available: http://arxiv.org/abs/1709.01507
Z. Ullah, M. Hong, T. Mahmood, and J. Kim, “Systematic Integration of Attention Modules into CNNs for Accurate and Generalizable Medical Image Classification,” Mathematics, vol. 13, no. 22, Nov. 2025, doi: 10.3390/math13223728.
P. Wang, T. Niu, and D. He, “Tomato young fruits detection method under near color background based on improved faster r-cnn with attention mechanism,” Agriculture (Switzerland), vol. 11, no. 11, Nov. 2021, doi: 10.3390/agriculture11111059.
Z. Ullah, M. Hong, T. Mahmood, and J. Kim, “Systematic Integration of Attention Modules into CNNs for Accurate and Generalizable Medical Image Diagnosis,” Sep. 2025, [Online]. Available: http://arxiv.org/abs/2509.05343
W. Li, Y. Wang, Y. Yu, and J. Liu, “Application of Attention-Enhanced 1D-CNN Algorithm in Hyperspectral Image and Spectral Fusion Detection of Moisture Content in Orah Mandarin (Citrus reticulata Blanco),” Information (Switzerland), vol. 15, no. 7, Jul. 2024, doi: 10.3390/info15070408.
K. Goyal, P. Kumar, and K. Verma, “Tomato ripeness and shelf-life prediction system using machine learning,” Journal of Food Measurement and Characterization, vol. 18, no. 4, pp. 2715–2730, Apr. 2024, doi: 10.1007/s11694-023-02349-x.
K. Sumathi and V. Vinod, “CLASSIFICATION OF FRUITS RIPENESS USING CNN WITH MULTIVARIATE ANALYSIS BY SGD,” Neural Network World, vol. 32, no. 6, pp. 319–332, 2022, doi: 10.14311/NNW.2022.32.019.
S. Nuanmeesri, “Enhanced hybrid attention deep learning for avocado ripeness classification on resource constrained devices,” Sci Rep, vol. 15, no. 1, p. 3719, Dec. 2025, doi: 10.1038/s41598-025- 87173-7.
Y. Gulzar, “Fruit Image Classification Model Based on MobileNetV2 with Deep Transfer Learning Technique,” Sustainability (Switzerland), vol. 15, no. 3, Feb. 2023, doi: 10.3390/su15031906.
R. Kurniawan, Samsuryadi, F. S. Mohamad, H. O. L. Wijaya, and B. Santoso, “Classification of palm oil fruit ripeness based on AlexNet deep Convolutional Neural Network,” Sinergi (Indonesia), vol. 29, no. 1, pp. 207–220, 2025, doi: 10.22441/sinergi.2025.1.019.
K. K. Yadav and G. Tandan, “FruitNet: Lightweight CNN for High-Throughput Image-Based Fruit
Yield Estimation,” SHS Web of Conferences, p. 2025, 2025, doi: 10.1051/iciaites/2025042701054.
W. Xu, Y. Wan, and D. Zhao, “SFA: Efficient Attention Mechanism for Superior CNN Performance,” Neural Process Lett, vol. 57, no. 2, Apr. 2025, doi: 10.1007/s11063-025-11748-8.
W. Zhang, “A Fruit Ripeness Detection Method using Adapted Deep Learning-based Approach,”
[Online]. Available: www.ijacsa.thesai.org
Z. A. Khan et al., “EA-CNN: Enhanced attention-CNN with explainable AI for fruit and vegetable
classification,” Heliyon, vol. 10, no. 23, Dec. 2024, doi: 10.1016/j.heliyon.2024.e40820.
S.M. Shahriar, “Banana Ripeness Classification Dataset,” Kaggle - https://www.kaggle.com/datasets/shahriar26s/banana-ripeness-classification-dataset.



