Abstract
We developed an automated system for detecting Fusarium infection in pineapple leaves and fruits using a two-input onvolutional neural network. Implemented on a Raspberry Pi 5 with a high-quality camera, the system analyzes image pairs, fruit, and leaves of healthy and infected samples. To build the dataset, pineapple images were inoculated with Fusarium, photographed daily for 15 days, then augmented through geometric and color transformations, producing 1500 image pairs. Model transparency was enhanced by using local interpretable model-agnostic explanations (LIME). Evaluated with a confusion matrix, the model achieved an 89.61% accuracy using 77 infected and 77 non-infected image pairs for testing.
1. Introduction
Pineapple or Ananas comosus is cultivated in tropical places, making the Philippines one of the primary producers, and Fusarium disease, brought by a fungus, is one of its phytosanitary threats, which affects the basal portion of the pineapple leaves [1,2]. This does not usually show external symptoms, but subtle ones, such as fruitlet failing to color and the base of the leaves, turning brownish in color, with advanced symptoms having necrotic, deep brown, or black leaves [3,4]. Local interpretable model-agnostic explanations (LIME), as an explainable algorithm used in medical applications such as studies about brain tumor diagnosis, helped identify different regions in a magnetic resonance imaging scan, which greatly influenced the model’s prediction in brain tumor analysis [5].
A study about pineapple leaf disease detection, such as mealybug wilt, leaf spot, and other diseases, was conducted in Ref. [6]. In this study, a data set of healthy pineapple leaves and a set of unhealthy leaves were used to detect the diseases mentioned. The developed system showed an 86.67% accuracy. However, it did not detect Fusarium. Furthermore, the model’s complexity limits user understanding of its decision-making, so LIME is applied to address this, such as to improve object recognition in crime scenes [7].
Most research on pineapple identifies the disease in the leaf or the fruit. Fusarium disease affects both, and automated detection on both is unavailable. Current identification methods are manual, time-consuming, and prone to human error. Also, identifying the features that contribute to misclassification is unknown.
This study aims to develop a Fusarium infection identification system on pineapple leaves and fruit. We used a camera for image input, a Raspberry Pi 5 to do the processes, and an LCD screen for display, and created a CNN model that classifies pineapple leaves and fruit using LIME. The performance was evaluated using a confusion matrix.
The developed system in this study addresses the challenge of detecting Fusarium disease in pineapples, a condition that reduces yield and quality and leads to significant economic losses. CNNs enable efficient and accurate automated detection compared with traditional manual methods. The integration of interpretability techniques enhances transparency, allowing users to better understand model decisions. This approach supports farmers, improves productivity, and promotes sustainable pineapple cultivation, while also offering potential applications for other crops affected by Fusarium.
2. Materials and Methods
2.1. Conceptual Framework
The conceptual framework follows the input–process–output framework to classify Fusarium-infected pineapple and explain misclassification. The images were captured using a Raspberry Pi HQ Camera (Raspberry Pi Holdings Plc, Cambridge, United Kingdom), sourced from Circuitrocks, Parañaque City, Philippines. Once the image was captured, it was fed to the program. CNN was used to classify and extract the picture that was provided. Next, it outputted whether the picture of the leaf provided had Fusarium. Then, the misclassified leaves and fruit images were saved for LIME interpretation at testing.
2.2. Hardware Development
Figure 1 encapsulates the flow and interconnection of the proposed hardware system, consisting of a power source, Raspberry Pi 5 Model B, Raspberry Pi HQ Camera, and Raspberry Pi 7 Touchscreen display. The Raspberry Pi 5 offers versatility in applications, such as machine learning, and supports various programming languages, such as Python version 3.12.3 which is used in the development of this study. In addition, Raspberry Pi 5 controls the other peripheral hardware. Raspberry Pi 5 is loaded with the trained machine learning program. Connected to the microcontroller is a Raspberry Pi 2 HQ Camera for the users to capture images. Another is the Raspberry Pi 7-inch Touchscreen display, which is dedicated to displaying the user interface.
Figure 1.
Block diagram of the system.
Figure 2a shows the experimental setup for how the proposed system would classify the pineapple identification system. The device has a camera that needs to be pointed at the target object to capture the desired image. On the opposite side of the device, facing the user, is the LCD screen that displays the user interface. Figure 2b shows a predicted output of the pineapple leaves and fruit. The fruit is first captured, then the leaves. Then, the classify button is used to classify and kickstart the processing and prediction by feeding the captured image to the model, which in this case is Fusarium-infected pineapple.
Figure 2.
(a) Experimental setup; (b) Graphical user interface.
2.3. Data Gathering
To ensure that Fusarium-related characteristics are represented, isolated Fusarium cultures were inoculated into healthy pineapples to induce infection. Staggered inoculation was employed for 15 days to expand the dataset by capturing progressive stages of infection. Figure 3a shows the isolated Fusarium culture, while Figure 3b,c depicts pineapples used for training and testing, with the former infected and the latter healthy. A total of 100 image pairs of leaves and fruit were collected: 63 pairs captured using the experimental setup and 37 pairs obtained from the internet, which contributed an additional 200 images. These images were used for data augmentation, resulting in 1000 image pairs of infected pineapples. In total, 1500 image pairs were used for testing. For testing purposes, only images captured by the prototype were utilized, comprising 77 pairs of infected and 77 pairs of healthy samples.
Figure 3.
(a) Isolated Fusarium; (b) Fusarium-infected; (c) Not infected.
2.4. Software Development
We utilized a two-input CNN model architecture as shown in Figure 4. Each branch processes the inputs, namely leaves and fruits, separately, in which both undergo extraction and pattern learning. The outputs of these branches are the fruit vector and the leaves vector, which are then concatenated to form a new vector. This vector is passed through fully connected layers so the model can learn combined patterns and decide whether the sample is Fusarium-infected.
Figure 4.
Proposed model architecture.
2.5. LIME
CNN-based prediction models often function as “black boxes,” making it difficult to interpret their decision-making processes. To address this limitation, the study integrated local interpretable model-agnostic explanations (LIME). LIME perturbs input images, generates local surrogate models, and highlights influential regions using superpixels and color coding (green for positive influence, red for negative) [8,9]. Figure 5 illustrates the application of LIME, where an input image is divided into superpixels that can be selectively shown or hidden. The algorithm perturbs the image by randomly altering these superpixels and records the predictive model’s output for each perturbed version. By generating multiple samples, LIME fits a human-interpretable model, such as ridge regression, to approximate the predictive model’s decision-making process and explain its inference [10].
Figure 5.
LIME algorithm diagram in images (Figure colors are irrelevant) [10].
3. Results and Discussion
Table 1 shows the confusion matrix after testing 77 image pairs for healthy pineapple and 77 image pairs for infected pineapple. After recording the results, the following values are derived: True Positive (TP), True Negative (TN), False Positive (FP), and False Negative (FN), which are 49, 77, 0, and 28, respectively. Using the formula shown in (1) and substituting the appropriate values, the system’s overall accuracy is 89.61%.
Table 1.
Confusion matrix.
Table 2 shows the results after running the LIME algorithm on the model, explaining why the model made such decisions. The green area positively contributes to misclassification, while the red area shows negativity.
Table 2.
LIME application results for model explanation.
4. Conclusions and Recommendations
We developed a system for Fusarium infection in pineapple leaves and fruit. The system provides a solution for disease detection by utilizing a CNN model. The system, built with a Raspberry Pi 5 and a camera, achieved an overall accuracy of 89.61%. Through the integration of LIME, the black box nature of deep learning algorithms is addressed by explaining the decision-making process behind the predictions. LIME highlighted the superpixels that show positivity and negativity towards the misclassification. The background plays a role in the model’s decision, so it is recommended to preprocess the captured images by removing the background before feeding them to the model for classification.
Author Contributions
Conceptualization, K.A.B. and R.R.G.; methodology, K.A.B.; software, K.A.B.; validation, K.A.B. and R.R.G.; formal analysis, R.R.G.; investigation, R.R.G.; resources, R.R.G.; data curation, R.R.G.; writing—original draft preparation, R.R.G.; writing—review and editing, R.P.; visualization, K.A.B.; supervision, R.P.; project administration, R.P.; funding acquisition, K.A.B. and R.R.G. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Dataset available upon request from the authors.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Hamzah, A.F.A.; Hamzah, M.H.; Man, H.C.; Jamali, N.S.; Siajam, S.I.; Ismail, M.H. Recent updates on the conversion of pineapple waste (Ananas comosus) to value-added products, future perspectives and challenges. Agronomy 2021, 11, 2221. [Google Scholar] [CrossRef] [Scilit]
- Aquije, G.M.D.F.V.; Korres, A.M.N.; Buss, D.S.; Ventura, J.A.; Fernandes, P.M.B.; Fernandes, A.A.R. Effects of leaf scales of different pineapple cultivars on the epiphytic stage of Fusarium guttiforme. Crop Prot. 2011, 30, 375–378. [Google Scholar] [CrossRef] [Scilit]
- Diseases of Pineapple (Ananas comosus): Pathogen, Symptoms, Infection, Spread & Management. Available online: https://kau.in/sites/default/files/documents/diseases_of_pineapple.pdf (accessed on 23 October 2024).
- Dionio, B.; Bacoba, C.J.; Puig, C.; Ramos, F.R. Fusarium heart rot: First report on pineapple in South Cotabato and Davao City, Philippines. Southeast. Philipp. J. Res. Dev. 2020, 25, 183–196. [Google Scholar] [CrossRef] [Scilit]
- Tiwari, R.; Agrawal, R. Unmasking VGG16: LIME visualizations for brain tumor diagnosis. In Proceedings of the 2024 IEEE International Conference on Computer Vision and Machine Intelligence (CVMI), Prayagraj, India, 19–20 October 2024. [Google Scholar]
- Magmoyao, M.E.L.; Sison, H.A.S.; Pellegrino, R.V. Classification of pineapple leaf diseases using CNN. In Proceedings of the IEEE 5th Eurasia Conference on IoT, Communication and Engineering (ECICE), Yunlin, Taiwan, 27–29 October 2023. [Google Scholar]
- Farhood, H.; Saberi, M.; Najafi, M. Improving object recognition in crime scenes via local interpretable model-agnostic explanations. In Proceedings of the IEEE International Enterprise Distributed Object Computing Workshop (EDOCW), Gold Coast, Australia, 25–29 October 2021. [Google Scholar]
- Abraham, L.A.; Palanisamy, G.; Veerapu, G. Transparent brain tumor detection using DenseNet169 and LIME. Sci. Rep. 2025, 15, 28185. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Lin, L.P.; Seow, Z.H. Classifying brain tumours: A deep learning approach with explainable AI. In Proceedings of the 14th International Conference on Biomedical Engineering and Technology, Seoul, Republic of Korea, 14–17 June 2024. [Google Scholar]
- Hamilton, N.; Webb, A.; Wilder, M.; Hendrickson, B.; Blanck, M.; Nelson, E.; Roemer, W.; Havens, T.C. Enhancing visualization and explainability of computer vision models with local interpretable model-agnostic explanations (LIME). In Proceedings of the IEEE Symposium Series on Computational Intelligence (SSCI), Singapore, 4–7 December 2022. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.







