Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 9, No. 1, 2024 70 Intelligent Planting of Subtropical Fruits and Vegetables based on Artificial Intelligence Di Liang 1, *, Zhongming Lin 1, Xiangyun Su 2, Wenjing Li 1, Biaotang Wen 3, Zhendong Chen 4, Yuanyuan Guo 4 and Y.D. Chuah 5 1 Nanning Normal University, Nanning Guangxi, 53000, China 2 School of Languages, Cultures and International Education, Liuzhou Institute of Technology, Liuzhou, Guangxi, 545616, China 3 Jiejiarun Technology Group Co., Ltd, Nanning Guangxi, 53000, China 4 Guangxi Academy of Agricultural Sciences, Nanning Guangxi, 53000, China 5 Department of Mechanical Engineering, Faculty of Engineering & Technology, Tunku Abdul Rahman University of Management and Technology, 53300 Kuala Lumpur, Malaysia * Corresponding author: Di Liang (Email: allenliangdi@163.com) Abstract: This thesis discusses the intelligent planting system of subtropical fruits and vegetables based on artificial intelligence (AI) and visual recognition, especially the application in water and fertilizer management. In view of the problems of inaccurate and inefficient water and fertilizer management faced by fruit and vegetable planting in subtropical areas, this study implements an intelligent water and fertilizer decision support system, which integrates visual recognition, sensor data acquisition, machine learning algorithms and other technologies. Through visual recognition technology, the system can monitor the growth status of crops in real time, accurately identify crop growth parameters and pests and diseases, and provide data support for water and fertilizer decisions. Combined with sensor data such as soil moisture and nutrient content, machine learning algorithms are used to predict and analyze crop water and fertilizer requirements to achieve accurate water and fertilizer management. The experimental results show that the system can significantly improve the accuracy and efficiency of water and fertilizer management and promote high-quality and high-yield subtropical fruits and vegetables. This study provides new ideas and technical support for intelligent and precise agriculture, and has important application value and promotion prospects. Keywords: Artificial Intelligence AI; Visual Recognition; Subtropical Fruits and Vegetables; Intelligent Planting; Water and Fertilizer Management. 1. Introduction With the growth of global population and the acceleration of urbanization, the demand for agricultural products is increasing day by day. Traditional agricultural production methods are facing severe challenges in resource utilization efficiency, environmental friendliness and yield stability. Especially in subtropical areas, due to its unique climatic conditions and soil characteristics, fruit and vegetable cultivation not only requires a lot of water resources and fertilizer input, but also faces problems such as frequent diseases and pests and short growth cycle. Therefore, how to realize the efficient and sustainable cultivation of subtropical fruits and vegetables has become a research hotspot in the current agricultural field. The rapid development of AI provides strong technical support for agricultural intelligence. As an important part of the AI, visual recognition technology has shown great application potential in the agricultural field due to its high efficiency and accuracy. By integrating high-definition cameras, image processing algorithms and machine learning models, visual recognition technology can monitor crop growth status, identify pests and diseases, evaluate crop growth parameters, etc. in real time, and provide rich data support for agricultural production [1]. In terms of water and fertilizer management, traditional methods often rely on empirical judgment and fixed rules, and it is difficult to accurately reflect the actual needs of crops at different growth stages and under different environmental conditions. The intelligent water and fertilizer management system based on AI and visual recognition can establish an accurate water and fertilizer demand forecasting model by analyzing multi-source data such as crop growth data, soil environment information and meteorological conditions, and realize accurate supply and on-demand distribution of water and fertilizer. This can not only improve the utilization efficiency of water and fertilizer resources, reduce waste and pollution, but also promote the healthy growth of crops and improve yield and quality. 2. System Design and Implementation This chapter introduces in detail the design and implementation of subtropical fruit and vegetable intelligent planting system based on AI and visual recognition technology. The main contents include the design of intelligent water and fertilizer decision support system, the application of visual recognition technology in water and fertilizer management, and the integration and test of the whole system [2]. 2.1. Intelligent Water and Fertilizer Decision Support System Intelligent water and fertilizer decision support system is the core module of this research, which aims to realize the precise management of water and fertilizer in fruit and vegetable growth environment by AI algorithm. The system includes four parts: data acquisition, data processing, decision 71 algorithm and user interface. (1) Data acquisition The data acquisition part mainly monitors the key parameters in fruit and vegetable planting environment in real time through sensor network. These sensors are arranged at different depths and locations in the fruit and vegetable planting area to fully cover the planting area. Specifically, sensor types include: Soil Moisture Sensor: Used to monitor the moisture content in the soil and ensure that fruits and vegetables get proper moisture during their growth [3]. Soil Temperature Sensor: Used to measure soil temperature and ensure the maintenance of suitable soil temperature in different seasons and weather conditions. Air Humidity and Temperature Sensors: Used to monitor the humidity and temperature in the air, helping to adjust water and fertilizer regimes to adapt to environmental changes. Light Intensity Sensor: Used to monitor the lighting conditions to ensure that fruits and vegetables get sufficient light. Soil Nutrient Sensor: Used to measure the concentration of key nutrients in the soil, such as nitrogen, phosphorus, potassium, etc., ensuring the balance of nutrient supply [4] These data are transmitted to the data processing center in real time through the wireless transmission module (LoRa) to ensure the timeliness and accuracy of the data. (2) Data processing The data processing part uses big data technology to clean, store and analyze the collected data. Through outlier detection and missing value filling technology, abnormal data and missing data that do not conform to the actual situation are removed or corrected to ensure the accuracy and integrity of data. Cloud database (Azure CosmosDB) is used to store massive amounts of cleaned data to ensure data security and accessibility [5]. Data mining and statistical analysis techniques (such as time series analysis, cluster analysis and correlation analysis) are used to deeply analyze the data, extract useful information and patterns, and provide support for decision-making. (3) Decision algorithm Decision algorithm is the core of intelligent water and fertilizer decision support system. Based on the collected environmental data, machine learning and deep learning algorithms are used for analysis and prediction. Decision tree, which represents the decision process through a tree-like structure, is simple and easy to understand, and is suitable for dealing with classification and regression problems. Random forest, by constructing multiple decision trees and taking their average value, reduces overfitting and improves the generalization ability of the model. Neural network, which uses multi-layer neurons for nonlinear mapping, is suitable for dealing with complex nonlinear relationships, especially for excellent performance on large data sets. Deep learning algorithms (such as convolutional neural network CNN and recurrent neural network RNN), capable of processing complex spatiotemporal data, are suitable for image recognition and time series prediction. Through the learning of historical data, the model can predict the water and fertilizer demand in the future, and generate the optimal water and fertilizer management plan according to the growth stage and specific needs of fruits and vegetables. 2.2. Application of Visual Recognition Technology in Water and Fertilizer Management Visual recognition technology is mainly used in this system to monitor the growth state of fruits and vegetables, identify pests and diseases, and further optimize water and fertilizer management. (1) Image acquisition The image acquisition part is carefully designed, and the regular image capture of the growth process of fruits and vegetables is realized through the high-definition cameras carefully arranged in the fruit and vegetable planting area. The position of the camera is scientifically arranged according to the size and layout of the planting area to ensure all-round coverage and no blind spots, so as to comprehensively record the growth status of fruits and vegetables. According to the different stages of fruit and vegetable growth cycle and the specific monitoring needs, the image acquisition frequency is flexibly set, which not only ensures the timeliness of data, but also completely retains the key information in the fruit and vegetable growth process [6]. These image data are then transmitted to the processing through the network to provide a solid foundation for subsequent analysis and management. (2) Image processing Image processing is a key step to ensure that the collected fruit and vegetable images can be accurately used for subsequent analysis. A variety of image processing algorithms are used to carefully preprocess the original image, and the noise interference in the image is effectively removed by filtering techniques such as Gaussian filtering and median filtering, which significantly improves the image quality. Advanced segmentation algorithms such as threshold segmentation, region growth or edge detection are used to accurately separate the fruit and vegetable subjects from the complex background and extract the region of interest (ROI) that is crucial for analysis. After this series of preprocessing operations are completed, the optimized images are sent to the visual recognition model for more in-depth analysis and recognition. (3) Visual recognition model The visual recognition model is the core component of this study, and its construction is based on convolutional neural network (CNN). The establishment begins with the fine annotation of massive image data, aiming to clearly mark the growth stages of fruits and vegetables, subtle changes in leaf color, and specific symptoms of pests and diseases, so as to provide a solid data foundation for subsequent model training. These labeled data are used to train the CNN model. Through repeated iterations and parameter optimization, the recognition accuracy and robustness of the model are significantly improved. In order to ensure the effectiveness of the model in practical applications, cross-validation and independent test set are also used to comprehensively evaluate the performance of the model to verify its excellent performance in recognition accuracy and generalization ability [7]. The visual recognition model can accurately identify the growth status, leaf color changes and symptoms of diseases and insect pests of fruits and vegetables. Through in-depth analysis of this information, the system can intelligently judge the water and fertilizer demand and diseases and insect pests of fruits and vegetables, providing 72 scientific basis for accurately adjusting water and fertilizer management plans. 2.3. Real-time Monitoring Feedback This system integrates real-time monitoring and real-time feedback mechanism, and uses advanced visual recognition technology to continuously monitor the growth state of fruits and vegetables. By capturing images in real time by the camera, and relying on the trained visual recognition model for in-depth analysis, the system can quickly capture and identify possible problems in the growth process of fruits and vegetables, such as pests and diseases, nutrition deficiency, etc. Once a problem is found, the system automatically triggers the feedback process and seamlessly connects the identification results to the intelligent water and fertilizer decision support system. The system dynamically adjusts the water and fertilizer management plan according to the real- time growth status to ensure the accurate delivery and efficient utilization of resources. The system also sends instant notifications to farmers through mobile applications or web pages, informing them of abnormal conditions in fruit and vegetable growth in detail and targeted operation suggestions. As a result, it significantly improves farmers' response speed and management efficiency, and realizes scientific and intelligent management of fruit and vegetable planting. 2.4. System Integration and Test System integration and test are key steps to ensure that all modules work together and the overall performance of the system is stable. (1) System integration In the process of system integration, we are committed to efficiently integrating the intelligent water and fertilizer decision support system with the visual recognition module. By designing standardized interfaces and protocols, the seamless connection among modules such as data acquisition, processing and decision algorithm is ensured, which not only improves the reliability of data transmission, but also ensures the consistency of data format, laying a solid foundation for the overall operation of the system. The module integration work was carried out, and the accurate fruit and vegetable growth status information extracted by the visual recognition module was seamlessly transmitted to the decision algorithm module through a unified data interface and format, which realized the data sharing and close cooperation between modules, and provided strong support for the generation of intelligent water and fertilizer management plan [8]. After integrating the user interface, the processed data and analysis suggestions are displayed to farmers in real time and intuitively, which greatly facilitates their viewing and operation of the system, and further improves the user experience and practicability of the system. (2) Test method The system test strategy is rigorous and comprehensive, covering three key links: unit test, integrated test and system test. In the unit test stage, we focus on the detailed inspection of the functions and performance of each independent module to ensure that the sensor data collection is accurate. The data processing is efficient and rapid, and the algorithm logic is accurate, which lays a solid foundation for the stable operation of each module of the system. The integration testing stage is dedicated to verifying the interface compatibility and data transmission efficiency between modules. By testing the speed, consistency and interface stability of data transmission between modules, it is ensured that all components of the system can cooperate closely and jointly support the overall operation of the system [9]. In the test stage of the system, we implemented a comprehensive evaluation including functional test, performance test and user experience test, which not only ensured that all functions of the system could operate normally as expected, but also deeply considered the performance ability of the system in high load and complex environment. By letting farmers actually operate and collect their feedback, we continuously optimized the system interface and operation process, and strived to improve user satisfaction and operation convenience, so as to ensure that the whole system can meet the actual application requirements and achieve the goal of high efficiency, stability and ease of use. (3) Test results and analysis Test results show that the system shows excellent real-time response ability, efficient data processing speed, highly accurate decision-making algorithm and high-precision visual recognition ability. Specifically, in the simulated diversified environmental conditions and operating scenarios, the system can quickly respond to farmers' operations and environmental changes, reflecting its powerful real-time performance. For the processing of large amounts of data, the system shows efficient and stable performance, ensuring the rapid and accurate data processing, and providing solid support for timely decision-making. By comparing the actual operation with the water and fertilizer plan generated by the system, the accuracy of the decision-making algorithm is verified, and it is confirmed that the water and fertilizer management plan provided by the system is not only accurate and reliable, but also can effectively respond to different planting needs. The visual recognition model also performs well in identifying the growth status of fruits and vegetables, diseases and pests. Its high-precision recognition ability provides an important guarantee for the intelligent management of the system, and further improves the refinement and intelligence level of agricultural production. 3. Experiment and Result Analysis 3.1. Experimental Design This experiment aims to evaluate the effectiveness of intelligent water and fertilizer management system based on AI and visual recognition technology in subtropical fruit and vegetable cultivation. The experimental subjects were selected as local common citrus fruit trees, such as citrus and grapefruit, which are sensitive to water and nutrient requirements and are suitable as research objects. It was carried out in two orchards with similar conditions, one of which was used as the experimental group, and the intelligent water and fertilizer management system was applied. The other served as a control group, using traditional water and fertilizer management methods. The experimental conditions include the same soil type, climatic conditions, initial fruit tree growth state and cultivation management measures to ensure the accuracy and comparability of the experimental results. The experimental period is one year, covering the whole growth cycle of fruit trees, from spring germination to autumn fruit maturity. The experimental protocol includes regular monitoring of soil moisture, nutrient content, crop growth status (such as leaf color, fruit size) and pests and diseases, and recording 73 relevant data. High-definition cameras and sensor networks are installed in the orchard of the experimental group, image data and environmental parameters are collected in real time, and the water and fertilizer supply plan is automatically adjusted after intelligent system analysis. 3.2. Data Collection and Processing In the data collection stage, we comprehensively used a variety of sensors and manual measurement methods to comprehensively obtain detailed information about soil environment, crop growth status, and pests and diseases. Specifically, soil data was regularly monitored through soil moisture and nutrient sensors to accurately record changes in key nutrient indicators such as moisture content, pH value and nitrogen, phosphorus and potassium in the soil. According to the crop growth data, we recorded the key growth parameters of fruit trees such as tree height, crown width, leaf number and color change, and fruit size in detail by manual measurement [10]. In order to monitor the diseases and pests more intuitively, the high-definition camera of the orchard of the experimental group took images of fruit trees at the preset frequency, and captured the real-time status of leaves, fruits and diseases and pests. In the data preprocessing and feature extraction links, the collected soil data were strictly cleaned to remove outliers and noise interference, and normalized to ensure the consistency and comparability of the data. Data normalization: Normalize the data to the [0, 1] interval, the equation is as follows: For the image data, a series of preprocessing steps such as denoising, enhancement, and segmentation were used to effectively improve the image quality, and key features such as color, texture, shape, pests and diseases of leaves were successfully extracted. Using feature engineering technology, the most representative key features are extracted from soil data and image data, and feature vectors are constructed, which lays a solid foundation for subsequent model training and analysis. 4. Model Training and Evaluation 4.1. Model Training This section introduces the training process of machine learning and deep learning models in detail, including steps such as algorithm selection, data preprocessing, model training and parameter tuning, and model evaluation. A random forest model for water and fertilizer management and a CNN model for image recognition are specifically described. (1) Random forest model training and evaluation Random forest is an ensemble learning method that improves the accuracy and stability of the model by constructing multiple decision trees and taking the average or majority voting results. The algorithm is suitable for regression analysis of environmental data and crop data. The equation is as follows: is the prediction result, N is the number of decision trees, and fi(x) is the prediction value of the i-th decision tree. The data were divided into training set (70%), validation set (15%), and test set (15%). Model construction: Build a random forest model using Random Forest Regressor from the Scikit-learn library, setting the number of decision trees to 100, the maximum depth to 10, and the minimum number of sample splits to 2. Model Training: Train the model using the training set. Here's the code: from sklearn.ensemble import Random Forest Regressof from sklearnmodel _ selection import train _ test spkit # Data partitioning X_train,X_val,y_train,y_val =train_test_split(X,y,test_size=0.3,random_state=42) # modelbuilding Rf=RandomForestRegressor(n_estimators=100,max_dept h=10,min_samples_split=2, random_state=42) # modeltraining rf.fit(X_train, y_train) Parameter tuning: Optimize parameters through grid search and select the optimal parameter combination. About the code: from sklearn.model_selection import GridSearchCV # Define a parameter grid param_grid={ n_estimators': [50, 100, 150], max_depth': [10, 15, 20], min_samples split': [2, 5, 10] } # grid search grid_search = GridSearchCV(estimator=rf, param_grid=param_grid, cv=3, n_jobs=-1, verbose=2) grid_search.fit(X_train, y_train) # Optimal parameters best_params = grid_search.best_params_ The validation set was used to evaluate the model performance, and the mean square error (MSE) and the coefficient of determination (R2) were used to measure the model prediction accuracy. The equation is as follows: The performance of the random forest model is evaluated on the test set, and the prediction error and coefficient of determination (R2R^2R2) are calculated. The evaluation results show that the MSE of the random forest model is 0.015 and the coefficient of determination (R2R^2R2) is 0.92, indicating that the model has high prediction accuracy. 4.2. CNN Model Training and Evaluation CNN is a deep learning model especially suitable for image data processing. Its main structures include convolutional layer, pooling layer and fully connected layer. The convolution operation equation is as follows: 74 Where I is the input image, K is the convolution kernel, and (x, y) is the output position. Data preprocessing to expand the training dataset by rotation, scaling, translation and other methods to increase the robustness of the model. Image processing methods include denoising (Gaussian filtering), image enhancement (adjusting contrast and brightness), and image segmentation (threshold segmentation algorithm). The data were divided into training set (70%), validation set (15%), and test set (15%). The CNN model is constructed using Sequential in the Keras library, containing 3 convolutional layers, 2 pooling layers, and 2 fully connected layers. Each convolutional layer is followed by a ReLU activation function, and the pooling layer adopts maximum pooling. The code: from keras.models import Sequential from keras.layers import Conv2D,MaxPooling2D, Flatten, Dense # modelbuilding Model=sequential([Conv2D(32,)3,3),activation=’rulu’,inp ut_shape=(64,64,3)) MaxPooling2D(pool_size=(2,2)), Conv2D(64,(3,3),activation='relu'), MaxPooling2D(pool_size=(2,2)), Conv2D(128,(3,3), activation='relu'), MaxPooling2D(pool_size=(2,2)), Flatten(), Dense(128, activation='relu'),Dense( 1 , activation=' sigmoid')]) # compilation model model.compile(optimizer='adam',loss='binary_crossentrop y',metrics=('accuracy'l) The CNN model was trained using the training set with an initial learning rate of 0.001, a batch size of 32, and a number of training rounds of 50. Here's the code: # modeltraining history = model.fit(X_train, y_train,epochs=50, batch_size =32,validation_data=(X_val, y_val)) Optimize model parameters by random search, including convolution kernel size, number of layers, learning rate, etc. The validation set is used to evaluate the model performance, and the model recognition accuracy is measured by accuracy. The equation is as follows: Accuracy = Number of Correct Predictions Total Number of Predictions The performance of the convolutional neural network model is evaluated on the test set, and the recognition accuracy and confusion matrix are calculated. The evaluation results showed that the recognition accuracy of CNN model was 0.95, and the confusion matrix showed that the model performed well in the identification of pests and diseases and the monitoring of fruit and vegetable growth status. 5. Results Analysis The experimental results show that the intelligent water and fertilizer management system performs well in subtropical fruit and vegetable cultivation. Compared with the control group, the fruit trees in the orchard of the experimental group grew more robustly, the leaves were bright green, and the incidence of pests and diseases was significantly reduced. The yield and quality of fruits have also been improved, which is characterized by uniform fruit size, high sugar content and better taste. In terms of resource utilization efficiency, the intelligent system can accurately regulate the supply of water and fertilizer according to the actual needs of crops, effectively reducing the waste of water and fertilizer and improving resource utilization efficiency. Through real-time monitoring and feedback mechanism, farmers can find and deal with problems in crop growth in time, improving management efficiency and response speed. In summary, the application effect of AI and visual recognition technology in water and fertilizer management is remarkable, which not only improves the yield and quality of fruits and vegetables, but also promotes resource conservation and sustainable development of the environment. The results of this experiment have important guiding significance and potential application value for subtropical fruit and vegetable planting practice, and provide strong support for the future development of intelligent agriculture. Acknowledgments This work was supported by the Department of Science and Technology of Guangxi Zhuang Autonomous Region, with project number: Guikefa [2024] No. 10. References [1] R.D.Yuan. Application of AI in green agricultural planting [J]. Hebei Agriculture, 2024, (05): 44-46. [2] D.K.Li, Application of AI large model in the field of intelligent agriculture [J]. Hebei Agricultural Machinery, 2024,(09);28- 30.DOI:10.15989/j.cnki.hbnjzzs.2024.09.031. [3] Y.X.Zhang, A brief analysis of the application of AI technology in agricultural irrigation [J]. Southern Agricultural Machinery, 2024, 55 (09): 56-60. [4] F.M.Wang, Wu Lian, Wang Xue, et al. Fruit and vegetable identification and planting guidance system based on AI [J]. Internet of Things technology, 2024, 14 (03): 98-101 +107. DOI: 10.16667/j.issn.2095-1302.2024. 03.023. [5] L.S.Li, Research on the application of Internet of Things and AI technology in agriculture [J]. Modern Agricultural Machinery, 2024, (02): 11-13. [6] Z.Q.Wang, Application of AI large model in the field of intelligent agriculture [J]. Agricultural engineering technology 2024,44(08).17-18.DOI:10.16815/j.cnki.11-5436/s.2024. 08. 0 03. [7] H.Sun, Application of Internet of Things technology based on AI in agriculture [J]. Electronic Technology, 2024, 53 (01): 274-275. [8] F.Hu, Research on the organic promotion of AI and digital transformation of agricultural modernization [N]. Shanxi Science and Technology News, 2024.01.08 (B03). [9] X.Q.Xian, B.L.Liu, Research on the integration and application of 5G and AI technology in intelligent agriculture [J]. Guangxi Communication Technology, 2023, (04): 39-44. [10] B.Han, Z.H. Xu,Research on AI fruit and vegetable precision planting technology [J]. Computer age 2021, (02): 1-3 +7. doi: 10.16644/j.cnki.cn33-1094/tp.2021. 02. 001.