DOI: 10.3303/CET24113019 Paper Received: 5 April 2024; Revised: 21 September 2024; Accepted: 4 November 2024 Please cite this article as: Garcillanosa M.M., Santiago C.J.C., Seletaria R.B., Perez E.J.N., 2024, Design of Brassica Chinensis L. Nutrient Deficiency Detection and Fertilizing System based on Deep Convolutional Neural Network, Chemical Engineering Transactions, 113, 109-114 DOI:10.3303/CET24113019 CHEMICAL ENGINEERING TRANSACTIONS VOL. 113, 2024 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Jeng Shiun Lim, Bohong Wang, Guo Ren Mong, Petar S. Varbanov Copyright © 2024, AIDIC Servizi S.r.l. ISBN 979-12-81206-14-4; ISSN 2283-9216 Design of Brassica Chinensis L. Nutrient Deficiency Detection and Fertilizing System based on Deep Convolutional Neural Network Mae M. Garcillanosa*, Camille Jasmine C. Santiago, Richel B. Seletaria, Earl Joshua N. Perez Mapúa Malayan Colleges Laguna, Electronics Engineering, Cabuyao, Laguna, Philippines mmgarcillanosa@mcl.edu.ph Plant detection is one of the applications of image processing in agriculture that is being linked with various agricultural tasks nowadays - such as the ability to detect nutritional deficiencies in plants based on the appearance of their leaves. This study is an attempt to contribute on the detection of nutrient deficiency through image processing of Brassica Chinensis L., which usually displays symptoms based on NPK nutrient deficiency and is also locally known as pechay. The study is centered on the hardware development that will be mounted on a robotic prototype and be able to assess a pechay’s health and fertilize it if it lacks nutrients. The detection was based on DenseNet121 model which was trained over numerous healthy and deficient pechay images. If the detection part determines that the pechay was healthy, then the fertilizing system will not release fertilizers. But when it determines the plant to be deficient, the fertilizing system will sprinkle fertilizers on the pechay. The overall system was able to achieve an 85% accuracy in an actual farm set-up. The system was further validated by comparing its results versus the visual inspection results of real-life farmer, and it was found out to be still accurate at 86%. The system further assists the farm owners in reducing the expenses of fertilizer usage and any dangers associated with growing a crop of non-deficient pechay plants. Overall, the process of automated fertilizer system was made possible by using nutrient deficiency detection as the decision-making process. 1. Introduction As the world progresses with time, discoveries and developments in science and technology have fronted the innovation of automation and robotics in line with agriculture. An example for which is the automatic irrigation systems in farms and other plantations, automatic harvesters, and drones. According to Statista Research Department, 2021, the Philippines, which is considered as the primary agricultural country, approximately 25% of its population that are living in rural areas supports themselves through agricultural means. In line with this, one of the most produced vegetable crops in the country is the Brassica Chinensis L., most locally known as Pechay as reported by Philippine Statistics Authority, 2021. From the year 2016 to 2020, the crop production of Pechay had grown to 0.5% average rate within the said period. In addition to the traditional assessment process such as the checking whether the plant crop is suitable for large-scale distribution, the call for having an automatic system that has the capacity to detect the health of the Pechay as well as having the capability to dispense fertilizer as supplement to procure its peak health complete nutrients is relevant. To date, there has no report yet about an attempt to automate the process of tending this local produced of the Philippines. The focal point of this paper is the significance of developing a nutrient deficiency detection and fertilizing system for Brassica Chinensis L. using a convolutional neural network (CNN), as outlined in the study by Barrientos et al., 2022. The study indicates that CNN exhibits high accuracy and a low error rate in characterizing vegetables, and it enhances the efficacy of plant disease detection in agricultural environments. The Brassica Chinensis L. family usually displays symptoms based on NPK nutrient deficiency. Whereas, when a plant exhibits signs of yellowish and pale leaves at the lower part of the leaves, or when the deficiency stage progresses, the plant is said to be nitrogen deficient based on the study of Veazie et al., 2020. The indication of 109 darker color in newly growing leaves and a fading of leaf border in lower leaves implies that it is phosphorus deficient. As the plant grew with a phosphorus deficit, irregular spotting and sizable necrotic patches appeared over time. Lastly, the signs of potassium deficiency in Brassica Chinensis L. family appears to be yellowish in older leaves. Subsequently, irregular chlorotic spotting symptoms also developed in this deficiency, which made the marginal yellowing considerably more obvious. Some serious stages lead to the necrotizing and abscission of leaves when not treated immediately. The information reported in Veazie et al., 2020 about the correlation of visual symptoms of nutrient deficiency to its nutrient disorders, and Ali et al., 2024 about the implementation of swarm-based technologies in the pursuit of efficient production, can help farmers and researchers in the development of technology viable in automation and smart agriculture. In Ristorto et al., 2017, Precision Farming (PF) has been fully recognized for its potential capability to increase field yields, reduce costs, and minimize the environmental impact of agricultural activities. The first stage of the PF management strategy is the collection of field and environmental data useful to obtain information about the crop health status in a field or among different fields and to operate suitably in each of these partitions. In this study, that’s data collection of the different Pechay leaves which manifest health and deficient status by the look and appearance of it. However, the visual tagging of the Pechay leaves were based only on the assessment of the researchers, there was no correlation between fertilizer applications, herbicide persistence, and even differential harvesting. Lastly, decision was made based on the processed image, to drop the fertilizer or not. This work leverages the reported information above to significantly enhance the agricultural practice of pechay here in the Philippines. This innovative approach combines the significance of technologies, artificial intelligence, image processing, and sustainable farming into one solution specifically aimed for the local pechay of the Philippines. 2. Materials and methods Figure 1 shows the flowchart of the system for the raspberry-pi microcontroller and for the arduino pro-micro. The flowchart in Figure 1a is responsible for the image acquisition, while the flowchart in Figure 1b is for the mechanical part of the robot’s movement. In Figure 1c, it shows the system overview of the proposed system. It includes three main parts which are movement, the image processing, and the automatic fertilizing system. Figure 1: (a) Flowchart of the raspberry-pi, (b) flowchart of the arduino pro-micro, (c) conceptual framework of the proposed system (a) (b) (c) 110 2.1 Movement The movement of the robot is done with a wheel and a railings structure as seen Figure 2. The system is elevated above the plants with a railing which allows the robot to move smoothly over the plants. The movement of the system allows the robot to have the capability to travel to the next plant after doing the detection and fertilizing process. The system first starts with its movement mechanism which is the mobile wheeled robot which moves the device to the designated location of the target. Once the hall sensor senses the magnet which indicates the location of Pechay, the image processing will take place. Figure 2: Robot and railings structure 2.2 Image Processing Image processing consists of two parts which are image acquisition and nutrient deficiency detection. First, the image of the leaf will be captured, and the resulting leaf image will serve as the input for the nutrient deficiency detection. If the image detected is non-deficient, then the process will end since it is considered as a non-target. While if the image is detected to be nutrient deficient, this will be utilized as the decision for the automatic fertilizer to determine if it will fertilize or not. Figure 3 are the sample images captured by the robot for a healthy and deficient pechay. Figure 3: Image captured by the robot, (a) healthy, (b) deficient. 2.3 Automatic Fertilizing System Barrientos et al., 2022, reported a novel method in developing a robotic fertilization tasks in crop rows, based on automatic vegetable Detection and Characterization (DaC) through an algorithm based on artificial vision and Convolutional Neural Networks (CNN). It automatically detects the cabbage and red cabbage in different sizes and allows the robotic arm planning and trajectory execution to apply the liquid organic fertilizer. The use of CNN for vegetable detection generated an algorithm that stands out over conventional systems of classical vision because of its robustness against environmental disturbances, especially light changes. On the other hand, the work of Aziz et. al., 2021 proposed a control-based automated fertilizer blending system using a programmable logic controller for fertilizer-sufficient management practices that benefit crop production without causing environmental problems. The automatic fertilizing system provides the robot with the ability to administer fertilizers depending on the condition of the Pechay. If the image processing part determines that the Pechay was healthy, then the fertilizing (a) (b) 111 (b) (a) system will not release fertilizers. But when the Pechay was detected to be deficient, the fertilizing system will sprinkle fertilizers on the Pechay plant. This method does not consider the effect of herbicides soil persistence as compared to the previously reported work in (Garcillanosa et al., 2023). Overall, the system consists of a device that moves over the plants and executes the image processing where it decides whether the automatic fertilizer system will activate or not. After the whole process, it will be repeated several times by moving on to the subsequent Pechay plants until it reaches the end, then it will move back to its original position. 2.4 The Robot There are two main processing units for the robot which are the raspberry-pi microcomputer and the arduino pro-micro microcontroller. Ther raspberry-pi is powered by the 5 V supply, and it is connected to the 720p HD camera and to the arduino pro-micro through USB cable. The arduino pro-micro is in-charge of controlling all of the peripherals which includes the motor driver, dispenser motor, switches, buzzer, and hall sensor. The motor driver controls the four wheels of the robot through the signals that it will receive from the arduino. The main power of the robot comes from the 12 V DC battery which is connected to a 5 V DC to DC converter and 5 V to 3.3 V regulator. This will step down the voltage for the other components which requires lower voltages to run properly. The general route of the proposed mobile robot strolls through a linear direction, forward-backward motion, and vice versa. The mobile robot was placed in line with the path of the seedbed in which the Pechay crops are planted in rows. As the robot strolls through the seedbed, it will stop at the designated markers using ferrite magnets that are specifically distanced along with the distancing of Pechay plants. It will then capture an image of the leaves of the detected Pechay through the nutrient deficiency image processing. In the case that there was a detected nutrient deficiency, the dispensing of the fertilizer will occur. However, if there was no detected deficiency, the robot will then proceed with the next Pechay in line and repeat the process. Lastly, as the mobile wheeled robot arrives at the end of the seedbed, the robot must stroll through reverse motion until it reaches the starting position. With this, the person in charge gets to manually move the railing with the mobile wheeled robot to the next row, and the whole process will be repeated, and the cycle will continue until all the Pechay will be processed. Figure 4 shows the different views of the proposed robot. Figure 4: Different views of the robot (a) left sideview, (b) right sideview, (c) bottom view, (d) top view. 3. Results and discussions DenseNet121 model, a modified version of Deep Convolutional Neural Network (DCNN) was used for training, in which the 920 datasets are divided in a ratio of 40:60, 40 representing the test data and 60 representing the training data. There were 368 training photos and 552 test images utilized in all. After training the model across 100 epochs, the ultimate accuracy obtained is 89.13%. In comparison, the accuracy by using Convolutional Neural Network (CNN) model was only 81.34 % versus an accuracy of 89.13 % for DCNN, it can be inferred that the accuracy in using a DCNN, specifically the DenseNet121 model is more accurate than the accuracy provided by the Convolutional Network. (c) (d) 112 Table 1 tabulates the summary of all the five trials that were performed by detection capacity of the robotic prototype. The robotic prototype was run through two rows, consisting of ten Pechay plant crops in each row, which provides twenty Pechay plants in total. This test examines the accuracy of the image processing technique which is used to identify the leaves condition: deficient and non-deficient. The average accuracy of 85.00 % was achieved which proves to be realistic and significant based on the training data sets of 40:60 only. However, other factors such as the lighting condition, camera quality, and camera positioning can be considered to further improve the accuracy of the image processing aspect of the system. Table 2 tabulates the summarized results for all the tests conducted for the nutrient fertilizer implementation. The same set was used for this testing, that is, two rows consisting of ten Pechay in each row, garnering a total of twenty Pechay. The NPK fertilizer implementation test decides the output of the robot by assessing the distribution of the fertilizer itself to the Pechay in reference to the previously detected health condition of the plant. If indeed the crop is deficient, the fertilizer will be dispensed; otherwise, it will not. It can be observed that the same accuracy was achieved as seen in Table 1. Which means that in every detection of deficient leaves, may it be true or false detection, the fertilizing system will dispense the fertilizer. The release of NPK fertilizer is automatic and depends only on the prediction of deficient Pechay. Table 1: Nutrient deficiency test for 20 Brassica Chinensis L. Trials True Positive True Negative False Positive False Negative Accuracy 1 9 8 2 1 85.00 % 2 8 7 3 2 75.00 % 3 10 8 2 0 90.00 % 4 8 9 1 2 85.00 % 5 9 9 1 1 90.00 % Average 85.00 % Table 2: Summarized results of all tests for nutrient fertilizer implementation test Trials Accuracy 1 85.00 % 2 75.00 % 3 90.00 % 4 85.00 % 5 90.00 % Table 3 tabulates the summarized results for the matrix of the human experts versus the robotic prototype. To further verify the claims of the study, the researchers had to seek professionals who has an extensive knowledge and expertise when it comes to handling the Pechay plant crop. The medium used for this validation is google forms, in which a survey was distributed to a total of nine experts, they were the only willing experts available during that time of testing. These experts are local farmers who specializes in the production of Pechay, they checked the health of the plant through visual inspection only. By visual checking, they decide if they need to put fertilizer or not in a cluster of Pechay. We find this test applicable since we want to compare the performance of our system versus the method of the local farmers. It seeks to match the verdict and results of the researchers versus the robot. Table 3: Summary of confusion matrix for human expert Trials True Positive True Negative False Positive False Negative Accuracy 1 11 7 0 2 90.00 % 2 10 6 1 3 80.00 % 3 9 8 2 2 85.00 % 4 11 6 0 3 85.00 % 5 9 8 2 2 85.00 % 6 9 9 2 0 90.00 % 7 10 5 1 4 75.00 % 8 10 8 1 1 90.00 % 9 11 7 0 2 90.00 % Average 85.56 % 113 4. Conclusions The study aims to design hardware for a robotic prototype capable of detecting the health status of a Pechay plant and providing fertilizer if the plant is nutrient deficient. The robotic prototype utilizes machine learning and the DCNN algorithm for image processing to achieve this. The study's goal is to optimize fertilizer use by applying it only when necessary, thus reducing costs and minimizing the potential risks associated with producing non-deficient Pechay plants. The strong point of accuracy and precision of the robot is consistent. With the conducted comparison based on professional experts, which garnered an accuracy of 85.56 %, it can be argued that the robot's accuracy was credible. Hence, since the nutrient deficiency detection model's accuracy was able to reach the desired accuracy of 88 % it can be said that its implementation was successful and achieved. Overall, the implementation of the chosen image processing technologies performed their specific tasks accurately under the set conditions, to the sorted and grounded data sets. In line with this, the response that the robotic prototype provides in dispensing fertilizer is also accurate, given that the result of the image processing is accurate; hence the all-inclusive findings according to the previously gathered results concluded that both the image processing performed by the machine learning capacity of the raspberry-pi and the resulting response in the dispensing command of the arduino pro-micro is thorough, and is working hand in hand to a certain extent in which the variables such as lighting, weather, alignment and distance of the plants from each other, and age of the plant crop is taken into account. References Ali Z.A., Deng D., Shaikh M.K., Hasan R., Khan M.A., 2024, AI-Based UAV Swarms for Monitoring and Disease Identification of Brassica Plants Using Machine Learning: A Review, Computer Systems Science and Engineering, 48 (1). Aziz D.H.C., Razak N.H., Zulkafli N.I., Saat S., Mohd Tumari M.Z., 2021, Automated Fertilizer Blending System to Reduce Nitrogen Loss and Water Runoffs: A Best Evidence Review, Chemical Engineering Transactions, 89, 367-372. Barrientos A., Cerro J., Ulloa C. C., Krus A., Valero C., 2022, Robotic Fertilization in Strip Cropping using a CNN Vegetables Detection-Characterization Method, Computers and Electronics in Agriculture, 193,106684. Garcillanosa M.M., Bunag N.J.S., Elazegui D.C.L., Natulan J.B.E., 2023, Design of Smart Weed Control System with Consideration of Herbicide Persistence Using Supervised Learning, Chemical Engineering Transactions, 106, 133-138. Perumal V.K., Supriyaa T., Santhosh P.R., Dhanasekaran S., 2024, CNN based plant disease identification using PYNQ FPGA’, Systems and Soft Computing, 6, 200088. Philippine Statistics Authority, 2021, Crops Statistics of the Philippines 2016-2020, accessed 10.06.2024 Ristorto G., Gallo R., Gasparetto A., Scalera L., Vidoni R., Mazzetto F., 2017, A Mobile Laboratory for Orchard Health Status Monitoring in Precision Farming, Chemical Engineering Transactions, 58, 661-666. Statista Research Department, 2021, Agriculture in the Philippines - statistics & facts, accessed 10.06.2024. Veazie P., Cockson P., Henry J., Perkins-Veazie P., Whipker B., 2020, Characterization of Nutrient Disorders and Impacts on Chlorophyll and Anthocyanin Concentration of Brassica rapa var. Chinensis, Agriculture 2020, 10, 461. 114 019.pdf Design of Brassica Chinensis L. Nutrient Deficiency Detection and Fertilizing System based on Deep Convolutional Neural Network