Tomato ripeness classification with weight-based and texture-adaptive pooling in CNNs
Main Article Content
Abstract
This research introduces a weight-based mixed pooling and adaptive fuzzy pooling mechanism based on feature map texture analysis for attention mechanism Squeeze-and-Excitation Networks (SE) and Convolutional Neural Networks (CNNs) in tomato ripeness classification. Traditional CNNs and SE networks rely on deterministic pooling strategies that can be suboptimal for capturing diverse visual features such as texture and color gradients in fruit. A novel fuzzy pooling system is proposed that dynamically adjusts the fusion ratio of min and max pooling based on real-time texture analysis of feature maps via a Laplacian filter. This mechanism was integrated into Darknet53, ResNet34, and ResNet101 architectures, both directly and within the SE attention block. The method was evaluated on a five-class tomato ripeness dataset using 10-fold cross-validation against traditional and fixed-weight pooling methods. The fuzzy and mixed pooling approach demonstrated superior performance on certain models which include ESEnet: Darknet53 + SE (Fuzzy pool) achieved an average F1 score across folds of 0.8429, outperforming Darknet53 + baseline SE (Average pool) at 0.8350; Extended Net: ResNet34 + Fuzzy pool achieved an average F1 score across folds of 0.8305, outperforming baseline ResNet34 at 0.8130 and ResNet101 + Fuzzy pool achieved an average F1 score across folds of 0.8284, outperforming baseline ResNet101 at 0.8267. This improvement was realized with minimal increase in computational overhead. Specifically, measurements of model parameters (M) and FLOPs (GMACs) showed only a slight increase across all architectures after integrating SEnet into the system, and zero increase after integrating the Laplacian filter and fuzzy logic. The study concludes that logic-based adaptive pooling is a robust strategy that improves feature representation in CNNs, achieving a balance between classification accuracy and computational cost. These findings offer practical value for developing more reliable automated harvesting systems and provide a generalizable enhancement for a wide range of computer vision classification tasks.
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
References
Wiset L, Poomsa-ad N, Onsaard W. Drying characteristics and quality evaluation in microwave-assisted hot air drying of cherry tomato. Eng Appl Sci Res. 2021;48(6):724-31.
Jeeravipoolvarn B, Juangpanich M, Masnate V, Kovithyakorn L. Study on the effects of various irrigation methods on tomato seed production. KKU Eng J. 2013;21(1-2):21-7. (In Thai)
Bapat VA, Trivedi PK, Ghosh A, Sane VA, Ganapathi TR, Nath P. Ripening of fleshy fruit: molecular insight and the role of ethylene. Biotechnol Adv. 2010;28(1):94-107. DOI: https://doi.org/10.1016/j.biotechadv.2009.10.002
Oltman AE, Jervis SM, Drake MA. Consumer attitudes and preferences for fresh market tomatoes. J Food Sci. 2014;79(10):S2091-7. DOI: https://doi.org/10.1111/1750-3841.12638
Miao Z, Yu X, Li N, Zhang Z, He C, Li Z, et al. Efficient tomato harvesting robot based on image processing and deep learning. Precision Agric. 2023;24(1):254-87. DOI: https://doi.org/10.1007/s11119-022-09944-w
Fujinaga T, Yasukawa S, Ishii K. Tomato growth state map for the automation of monitoring and harvesting. J Robot Mechatron. 2020;32(6):1279-91. DOI: https://doi.org/10.20965/jrm.2020.p1279
Chaibung N, Sethanan K. The selecting sugar cane plantation development system for harvesting by considering the accessing to the sugar cane plantation. KKU Eng J. 2012;39(4):375-82. (In Thai)
Srison W, Doungpueng K, Muenkaew P, Chuan-Udom S. Behavior and model of grain separation for a small axial flow maize shelling unit. Eng Appl Sci Res. 2023;50(6):538-47.
Chaowalittawin V, Krungseanmuang W, Sathaporn P, Morita F, Archevapanich T, Purahong B. Banana quality classification using lightweight CNN model with microservice integration system. Eng Appl Sci Res. 2025;52(4):430-8.
Thipsrirach Y, Kosacka-Olejnik M, Poonikom K. Classification of durian maturity using a convolutional neural network. Eng Appl Sci Res. 2023;50(3):233-43.
Wongkvanklom A, Sata V, Sanjayan JG, Chindaprasirt P. Setting time, compressive strength and sulfuric acid resistance of a high calcium fly ash geopolymer containing borax. Eng Appl Sci Res. 2018;45(2):89-94.
Tian Y, Li X, Ma S. Lightweight encoder with attention mechanism for pipe recognition network. J Robot Mechatron. 2024;36(2):343-52. DOI: https://doi.org/10.20965/jrm.2024.p0343
He H, Peng Z, Shang P, Wang W, Pei X. An intent recognition method for aerial swarm based on attention pooling mechanism. J Adv Comput Intell Intell Inform. 2025;29(1):5-11. DOI: https://doi.org/10.20965/jaciii.2025.p0005
Yang T, Chan AB. Visual tracking via dynamic memory networks. IEEE Trans Pattern Anal Mach Intell. 2021;43(1):360-74. DOI: https://doi.org/10.1109/TPAMI.2019.2929034
Mungklachaiya S, Salaiwarakul A. Attention-X: Enhancing the classification of natural attraction scenes with advanced attention mechanisms. Eng Appl Sci Res. 2025;52(3):337-51.
Khan FS, van de Weijer J, Vanrell M. Modulating shape features by color attention for object recognition. Int J Comput Vis. 2012;98:49-64. DOI: https://doi.org/10.1007/s11263-011-0495-2
Fu J, Liu J, Tian H, Li Y, Bao Y, Fang Z, et al. Dual attention network for scene segmentation. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; 2019 Jun 15-20; Long Beach, USA. USA: IEEE; 2019. p. 3141-49. DOI: https://doi.org/10.1109/CVPR.2019.00326
Hu J, Shen L, Sun G. Squeeze-and-excitation networks. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; 2018 Jun 18-23; Salt Lake City, USA. USA: IEEE; 2018. p. 7132-41. DOI: https://doi.org/10.1109/CVPR.2018.00745
Jaderberg M, Simonyan K, Zisserman A, Kavukcuoglu K. Spatial transformer networks [Internet]. arXiv [Preprint]. 2015 [cited 2026 Jan 13]. Available from: https://arxiv.org/abs/1506.02025.
Woo S, Park J, Lee JY, Kweon IS. CBAM: Convolutional block attention module. Proceedings of the European Conference on Computer Vision (ECCV); 2018 Sep 8-14; Munich, Germany. Cham: Springer; 2018. p. 3-19. DOI: https://doi.org/10.1007/978-3-030-01234-2_1
Li X, Wu J, Chang D, Huang W, Ma Z, Cao J. Mixed attention mechanism for small-sample fine-grained image classification. 2019 Asia-Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA ASC); 2019 Nov 18-21; Lanzhou, China. USA: IEEE; 2019. p. 80-5. DOI: https://doi.org/10.1109/APSIPAASC47483.2019.9023058
Peng Y, Chen DZ, Sonka M. Spectral U-Net: Enhancing medical image segmentation via spectral decomposition. 2025 IEEE 22nd International Symposium on Biomedical Imaging (ISBI); 2025 Apr 14-17; Houston, USA. USA: IEEE; 2025. p. 1-5. DOI: https://doi.org/10.1109/ISBI60581.2025.10981199
Jie HJ, Wanda P. RunPool: A dynamic pooling layer for convolution neural network. Int J Comput Intell Syst. 2020;13(1):66-76. DOI: https://doi.org/10.2991/ijcis.d.200120.002
Saeedan F, Weber N, Goesele M, Roth S. Detail-preserving pooling in deep networks. Proceedings of the IEEE conference on computer vision and pattern recognition; 2018 Jun 18-23; Salt Lake City, USA. USA: IEEE; 2018. p. 9108-16. DOI: https://doi.org/10.1109/CVPR.2018.00949
Zafar A, Aamir M, Mohd Nawi N, Arshad A, Riaz S, Alruban A, et al. A comparison of pooling methods for convolutional neural networks. Appl Sci. 2022;12(17):8643. DOI: https://doi.org/10.3390/app12178643
Gong Y, Tang W, Zhou L, Yu L, Qiu G. Quarter Laplacian filter for edge aware image processing. 2021 IEEE International Conference on Image Processing (ICIP); 2021 Sep 19-22; Anchorage, USA. USA: IEEE; 2021. p. 1959-63. DOI: https://doi.org/10.1109/ICIP42928.2021.9506503
Deng J, Dong W, Socher R, Li LJ, Li K, Fei-Fei L. ImageNet: A large-scale hierarchical image database. 2009 IEEE Conference on Computer Vision and Pattern Recognition; 2009 Jun 20-25; Miami, USA. USA: IEEE; 2009. p. 248-55. DOI: https://doi.org/10.1109/CVPR.2009.5206848
Bhairannawar S, Patil A, Janmane A, Huilgol M. Color image enhancement using Laplacian filter and contrast limited adaptive histogram equalization. 2017 Innovations in Power and Advanced Computing Technologies (i-PACT); 2017 Apr 21-22; Vellore, India. USA: IEEE; 2017. p. 1-5. DOI: https://doi.org/10.1109/IPACT.2017.8244991
Prasoetphon T, Selamassakul K, Sittiwanchai T, Jitviriya W. Fuzzy-PID vs. PID controllers: A comparative study on DC motor speed control. 2024 1st International Conference on Robotics, Engineering, Science, and Technology (RESTCON); 2024 Feb 16-18; Pattaya, Thailand. USA: IEEE; 2024. p. 64-8. DOI: https://doi.org/10.1109/RESTCON60981.2024.10463588
Nirthika R, Manivannan S, Ramanan A, Wang R. Pooling in convolutional neural networks for medical image analysis: a survey and an empirical study. Neural Comput Appl. 2022;34(7):5321-47. DOI: https://doi.org/10.1007/s00521-022-06953-8
Redmon J, Farhadi A. YOLOv3: An incremental improvement [Internet]. arXiv [Preprint] 2018 [cited 2026 Jan 13]. Available from: https://arxiv.org/abs/1804.02767.
He K, Zhang X, Ren S, Sun J. Deep residual learning for image recognition. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR); 2016 Jun 27-30; Las Vegas, USA. USA: IEEE; 2016. p. 770-8. DOI: https://doi.org/10.1109/CVPR.2016.90
Thesis tomato. 16th run uploaded images e50 Dataset [Internet]. Roboflow Universe, Roboflow; 2023. [cited 2025 May 12]. Available from: https://universe.roboflow.com/thesis-tomato/16th-run-uploaded-images-e50.
Sittiwanchai T, Khawnuan U, Yodpijit N. Enhancing human activity recognition with lightweight CNN models and integrated blocks. Sci Eng Health Stud. 2024;18:24040001. DOI: https://doi.org/10.69598/sehs.18.24040001
Khawnuan U, Sittiwanchai T, Yodpijit N. Convolutional neural network for wearable fall detection systems. Sci Eng Health Stud. 2023;17:23040002. DOI: https://doi.org/10.69598/sehs.17.23040002
Ishii K, Matsuo T, Takemura Y, Sonoda T, Sanada A, Tominaga M, et al. Report on the 8th tomato-harvesting competition toward smart agriculture. Proceedings of International Conference on Artificial Life and Robotics; 2023 Feb 9-12; Oita, Japan. p. 484-8. DOI: https://doi.org/10.5954/ICAROB.2023.OS20-5
Matsuo T, Takemura Y, Sonoda T, Nishida Y, Yasukawa S, Ishii K. Toward smart tomato greenhouse: the 6th tomato-harvesting-robot competition and regulation changes aiming at practical application. J Robot Netw Artif Life. 2022;9(1):13-9.
Senasutham R, Bureerat S, Laohavanich J, Chiawchanwattana C, Yangyuen S. Multi-objective optimization of a threading machine for tobacco leaves. Eng Appl Sci Res. 2022;49(2):218-27.
