Flue-cured tobacco yield and quality prediction method based on RGB image

By acquiring the RGB images of the tobacco strain and building a flue-cured tobacco production quality prediction model based on the RGB image, the problem of timely feedback and low accuracy in the existing technology is solved, and high-precision production quality prediction and management guidance are achieved.

CN120374510APending Publication Date: 2025-07-25LUZHOU CO LTD SICHUAN TOBACCO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510321457.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The existing technology cannot promptly provide feedback on the quality of flue-cured tobacco production. The traditional method has low accuracy and is affected by outliers. The deep learning model relies on a large amount of data and environmental factors, and lacks effective methods for predicting the quality of flue-cured tobacco production in the field.

Method used

By acquiring the RGB images of the tobacco strain, using Matlab for background segmentation and feature extraction, combining the preferred features of the random forest algorithm, a flue-cured tobacco production quality prediction model based on RGB images was constructed, and traditional machine learning and deep learning algorithms were used to predict, and a flue-cured tobacco production quality prediction APP was constructed.

Benefits of technology

It realizes timely prediction of flue-cured tobacco production quality, improves prediction accuracy and generalization capabilities of the model, provides a theoretical basis for high-quality production and precise management of tobacco agriculture, and meets the needs of the cigarette industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120374510A_ABST
    Figure CN120374510A_ABST
Patent Text Reader

Abstract

The invention discloses a flue-cured tobacco yield and quality prediction method based on an RGB image, and relates to the technical field of tobacco yield and quality detection.The flue-cured tobacco yield and quality prediction method comprises the steps that flue-cured tobacco groups with different yield and quality are obtained by regulating and controlling the flue-cured tobacco topping time, the upper inapplicable leaf removal time and the number of removed leaves, RGB images of tobacco plants are collected when the tobacco plants are transplanted for 90 days, 50 image colors, shapes and texture features are extracted through Matlab2021a, and the color, shape and texture features of the images are obtained; characteristic optimization is performed through a random forest algorithm, and a yield and quality prediction model is constructed by using five traditional machine learning algorithms including a feedforward neural network, a support vector machine, a random forest, a radial basis function neural network and an extreme learning machine and two deep learning algorithms including a one-dimensional convolutional neural network and a long-short term memory neural network to be applied to tobacco yield and quality prediction. The method aims to provide a theoretical basis for production of high-quality suitable products and precise management of tobacco agriculture, and is of great significance to customized production of raw materials and meeting of the requirements of the cigarette industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tobacco leaf yield and quality detection, and particularly relates to a method for predicting the yield and quality of flue-cured tobacco based on RGB images. Background Art

[0002] The yield and quality of crops are the ultimate quantitative characteristics in the agricultural production process. Traditional determination of yield and quality often requires statistics after crop harvesting, which cannot timely feedback production and conduct planning guidance, while yield and quality prediction can provide reference for crop management estimation.

[0003] Current prediction methods include: field destructive sampling surveys, crop growth models, and remote sensing technologies. In previous studies, correlation analysis was carried out by combining images with color and structure information and crop yield and quality to fit a linear regression equation to establish a yield prediction model, which provided a reference for yield prediction. However, the linear regression model has poor effects in dealing with non-linear problems, and outliers will seriously affect the prediction accuracy. Traditional machine learning algorithms such as support vector machines and random forests can well fit non-linear trends, and combine remote sensing spectra and structure information to construct prediction models, which have higher accuracy compared with the linear regression model and are currently applied in the yield and quality prediction of crops such as corn, wheat, and alfalfa. The greatest advantage of deep learning is that it can automatically extract and identify features, and can use images as input to construct models, which are currently applied in aspects such as plant disease detection and yield and quality prediction. However, deep learning models rely on a large amount of data for training, and the accuracy is also affected by problems such as image acquisition equipment, resolution of the acquired images, and illumination brightness. In addition, due to different application scenarios and objects of different machine learning algorithms, their prediction accuracies also vary. Therefore, the prediction of crop yield needs to use multiple machine learning algorithms and deep learning algorithms to model and compare separately. Yield and quality prediction can provide reference for flue-cured tobacco production management and final yield estimation, and currently there is little research on predicting the yield and quality of field flue-cured tobacco through RGB images. Summary of the Invention

[0004] The purpose of the present invention is to overcome the above deficiencies existing in the prior art, and provide a method for predicting the yield and quality of flue-cured tobacco based on RGB images, which provides a theoretical basis for producing high-quality and suitable yield and precise management of tobacco agriculture, and has important significance for customized raw material production and meeting the needs of the cigarette industry.

[0005] In order to achieve the above invention purpose, the present invention provides the following technical solutions:

[0006] A method for predicting the yield and quality of flue-cured tobacco based on RGB images, comprising:

[0007] S1. Obtain image data of tobacco plants;

[0008] S2. Extract features from the processed image data and perform feature optimization;

[0009] S3. Build a prediction model for the yield and quality of flue-cured tobacco and evaluate it;

[0010] S4. Build a prediction APP for the yield and quality of flue-cured tobacco.

[0011] Furthermore, step S1 includes the following steps:

[0012] S11. Uproot the representative tobacco plants in each plot 90 days after transplanting, put them into flowerpots, fix them and move them indoors;

[0013] S12. Use two pure black background cloths of 2m×3m as the background. Place the tobacco plants in the flowerpots and fix them. A turntable is placed below to facilitate changing the shooting angle;

[0014] S13. Pull the turntable clockwise, collect images of each tobacco plant at 25 angles, and collect a total of 80 field photos of the tobacco plants in each treatment at the same time for generalization testing.

[0015] Furthermore, step S2 includes the following steps:

[0016] S21. Use Matlab for background segmentation, denoising, extract the target area in the image, and separate it from the background;

[0017] S22. Use Matlab to extract RGB image features. The RGB image features include 20 color features, 5 texture features and 25 shape features, and feature optimization is carried out through the random forest algorithm.

[0018] Furthermore, building the prediction model for the yield and quality of flue-cured tobacco in step S3 includes the following steps:

[0019] Use five traditional machine learning algorithms including feedforward neural network, support vector machine, random forest, radial basis neural network and extreme learning machine, and two deep learning algorithms including one-dimensional convolutional neural network and long short-term memory neural network to build a yield and quality prediction model.

[0020] Furthermore, the model is evaluated using the coefficient of determination (R 2 ), root mean square error (RMSE) and mean absolute error (MAE), where:

[0021]

[0022] Furthermore, building the prediction APP for the yield and quality of flue-cured tobacco in step S4 includes the following steps:

[0023] Based on the two models with the highest prediction accuracy, combined with background segmentation and feature extraction, a prediction APP for the yield and quality of flue-cured tobacco is built using the Matlab APP design tool.

[0024] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0025] By regulating the topping time of flue-cured tobacco, the removal time and number of upper inapplicable leaves, different groups of flue-cured tobacco with different yields and qualities are obtained. RGB images of tobacco plants are collected 90 days after transplanting, and 50 image color, shape, and texture features are extracted using Matlab 2021a. Feature optimization is carried out through the random forest algorithm, and five traditional machine learning algorithms, namely the backpropagation neural network (BPNN), support vector machine (SVM), random forest (RF), radial basis function neural network (BRF), and extreme learning machine (ELM), and two deep learning algorithms, namely the one-dimensional convolutional neural network (1D-CNN) and long short-term memory neural network (LSTM), are used to construct yield and quality prediction models for application in predicting the yield and quality of tobacco leaves, aiming to provide a theoretical basis for the production of high-quality and suitable-yield tobacco and the precise management of tobacco agriculture, which is of great significance for customized raw material production and meeting the needs of the cigarette industry. Description of the Drawings

[0026] Figure 1 Shows the location of the test plot and the distribution of treatments;

[0027] Figure 2 Schematic diagram of the image acquisition method;

[0028] Figure 3 Image processing;

[0029] Figure 4 Traditional machine learning neural network diagram;

[0030] Figure 5 1D-CNN neural network structure diagram;

[0031] Figure 6 Ranking of the importance of features in the yield (A) and quality (B) prediction models;

[0032] Figure 7 Feature optimization process of the yield (A) and quality (B) prediction models;

[0033] Figure 8 Generalization ability of the yield (A) and quality (B) prediction models with optimized features;

[0034] Figure 9 RF yield prediction model (left) and SVM quality prediction model (right);

[0035] Figure 10 Function page of the flue-cured tobacco yield and quality prediction APP;

[0036] Figure 11 Function display of the flue-cured tobacco yield and quality prediction APP. Detailed Embodiments

[0037] The present invention will be further described in detail below in combination with test examples and specific embodiments. However, it should not be understood that the scope of the above-mentioned subject matter of the present invention is limited to the following embodiments. All technologies implemented based on the content of the present invention belong to the scope of the present invention.

[0038] In this embodiment, a method for predicting the yield and quality of flue-cured tobacco based on RGB images is provided, including:

[0039] S1. Obtain the image data of tobacco plants;

[0040] S2. Extract features from the processed image data and perform feature optimization;

[0041] S3. Construct a prediction model for the yield and quality of flue-cured tobacco and evaluate it;

[0042] S4. Construct a prediction APP for the yield and quality of flue-cured tobacco.

[0043] For further optimization of the above embodiment, step S1 includes the following steps:

[0044] S11. Pull up the tobacco plants that are 90 days after transplanting and representative in each plot, put them into flower pots, fix them, and move them indoors;

[0045] S12. Use two pure black background cloths of 2m×3m as the background. Place the tobacco plants in flower pots and fix them. A turntable is placed below to facilitate changing the shooting angle;

[0046] S13. Pull the turntable clockwise, collect images of each tobacco plant at 25 angles, and collect a total of 80 field photos of the tobacco plants in each treatment at the same time for generalization testing.

[0047] For further optimization of the above embodiment, step S2 includes the following steps:

[0048] S21. Use Matlab to perform background segmentation and denoising, extract the target area in the image, and separate it from the background;

[0049] S22. Use Matlab to extract RGB image features. RGB image features include 20 color features, 5 texture features, and 25 shape features, and perform feature optimization through the random forest algorithm.

[0050] For further optimization of the above embodiment, the steps for constructing a prediction model for the yield and quality of flue-cured tobacco in step S3 include:

[0051] Use five traditional machine learning algorithms, namely feedforward neural network, support vector machine, random forest, radial basis neural network, and extreme learning machine, and two deep learning algorithms, namely one-dimensional convolutional neural network and long short-term memory neural network, to construct a yield and quality prediction model.

[0052] For further optimization of the above embodiments, the model uses the coefficient of determination (R 2 ), root mean square error (RMSE), and mean absolute error (MAE) for evaluation, where:

[0053]

[0054] For further optimization of the above embodiments, constructing the flue-cured tobacco yield and quality prediction APP in step S4 includes the following steps:

[0055] Based on the two models with the highest prediction accuracy, combined with background segmentation and feature extraction, the flue-cured tobacco yield and quality prediction APP was constructed using the Matlab APP design tool.

[0056] The specific implementation process is as follows:

[0057] 1 Materials and Methods

[0058] 1.1 General situation of the test plot

[0059] As Figure 1 shown, it was carried out in Dazhai Township, Gulin County, Luzhou City, Sichuan Province from April to September for 3 years. The test plot is located at 105.43° east longitude and 28.87° north latitude, with an altitude of 1021 m, belonging to the subtropical plateau climate zone; the annual average temperature is 15.9 °C, and the highest temperature is 40 °C; the annual average frost-free period is more than 260 days, which is suitable for the growth of crops. The soil of the test plot is sandy loam, with soil pH 5.23, total nitrogen 2.85 g / kg, total phosphorus 1.28 g / kg, total potassium 12.44 g / kg, alkaline hydrolyzable nitrogen 126.64 mg / kg, available phosphorus 23.7 mg / kg, available potassium 65.32 mg / kg, and organic matter 45.07 g / kg.

[0060] 1.2 Test materials

[0061] (1) Flue-cured tobacco varieties for testing: Zhongchuan 208

[0062] (2) Fertilizers for testing: tobacco special compound fertilizer (10-20-20), tobacco special seedling-promoting fertilizer (12-0-41), potassium sulfate (0-0-50), superphosphate (0-12-0), potassium dihydrogen phosphate foliar fertilizer (0-52-34).

[0063] 1.3 Test design

[0064] The test design is shown in Table 1, and the orthogonal design L9(3 4) Three experimental factors were set. Factor A was the topping time, which were topping at 7 days after budding (A1), topping at 10 days after budding (A2), and topping at 13 days after budding (A3). Factor B was the removal time of upper inapplicable tobacco leaves, which were removed at topping (B1), removed 7 days after topping (B2), and removed 14 days after topping (B3). Factor C was the number of upper inapplicable tobacco leaves removed, which were removing 0 leaves (C1), removing 2 leaves (C2), and removing 4 leaves (C3). A randomized block design was adopted with 3 replications, a total of 27 plots, as Figure 1 shown. 100 tobacco plants were planted in each plot with a plant spacing of 50 cm × 120 cm. When the upper inapplicable tobacco leaves were not removed after topping for each treatment, the number of remaining leaves was not less than 18. The fertilization ratios of N, P2O5, and K2O for each treatment were all 1:2:2, and the nitrogen application rate was 112.5 kg·hm -2 , and the ratio of basal fertilizer to topdressing was 7:3. 1% KH2PO4 was sprayed on the leaf surface in the middle and late stages. Other production measures, such as transplanting, late field management, and harvesting and baking methods, were kept consistent.

[0065] Table 1 Experimental Orthogonal Table

[0066] Table 1 Experimental Orthogonal Table

[0067]

[0068]

[0069] 1.4 Determination methods of related indicators

[0070] 1.4.1 Analysis of basic physical and chemical properties of soil

[0071] After selecting the tobacco-growing plots and dividing each treatment plot, soil samples of each plot were collected by the five-point cross-sampling method before transplanting. The collected soil samples were air-dried naturally for later use and determined after grinding through a sieve with a pore size of 0.15 mm. Alkaline hydrolyzable nitrogen was determined by the alkaline diffusion method, available phosphorus was determined by the NaHCO3 extraction method, available potassium was determined by the flame photometry method, pH was determined by a pH meter, and the specific determination methods of total nitrogen, total phosphorus, total potassium, and organic matter were also carried out with reference to "Soil Agricultural Chemistry Analysis" written by Bao Shidan.

[0072] 1.4.3 Collection and determination of flue-cured tobacco leaf samples

[0073] After the baking was completed, 1 kg of samples of grades B2F (upper orange two) and C3F (middle orange three) were selected from each plot for the evaluation of the appearance quality of tobacco leaves, the determination of conventional chemical components, the determination of physical properties, and the evaluation of sensory smoking quality.

[0074] Table 2 Quantitative criteria for appearance quality evaluation

[0075] Table 2 Quantitative standards of appearance quality evaluation

[0076]

[0077] Appearance quality evaluation: The identification and comprehensive evaluation of the appearance quality of tobacco leaves shall be carried out in accordance with GB / T 18771.4-2015 "Tobacco terminology - Part 4: Quality and testing". As shown in Table 2, the evaluation shall be carried out from six indicators: color (0.3), maturity (0.25), structure (0.1), identity (0.1), oil content (0.2), and chroma (0.05), and the comprehensive score shall be obtained according to the weight of each indicator.

[0078] Table 3 Methods for assigning physical characteristic indicators of tobacco leaves

[0079] Table 3 Methods for assigning physical characteristic indicators of tobacco leaves

[0080]

[0081] Physical property determination: Select 15 - 20 pieces of C3F and B2F cured tobacco leaves from each plot, and determine the single leaf weight of the tobacco leaves after measuring their equilibrium moisture content; the leaf mass weight shall be measured by the punch method; remove the main vein and part of the branch veins of the tobacco leaves and measure the leaf weight and the stem weight respectively to calculate the stem content; the tensile strength shall be measured by a tensile strength tester (model IMT-Tensile02). In accordance with GB / T 18771.4-2015 "Tobacco terminology - Part 4: Quality and testing", as shown in Table 3, the evaluation shall be carried out from four indicators: leaf surface density (0.3), tensile strength (0.25), equilibrium moisture content (0.2), and stem content (0.25), and the comprehensive score shall be obtained according to the weight of each indicator.

[0082] Table 4 Chemical composition index assignment method of tobacco leaves

[0083] Table 4 Chemical composition index assignment method of tobacco leaves

[0084]

[0085]

[0086]

[0087] Determination of chemical components: Take the B2F and C3F tobacco leaves of each treatment, dry, crush, and pass through a sieve with a pore size of 0.15 mm, and then conduct conventional chemical component analysis. The detection indicators include total nitrogen, phosphorus, potassium, nicotine, total sugar, reducing sugar, starch, and chlorine. The determination method refers to "Tobacco Chemistry" written by Wang Ruixin. The evaluation indicators for the coordination of chemical components in cured tobacco leaves include nicotine (0.17), total nitrogen (0.09), reducing sugar (0.14), potassium (0.08), starch (0.07), sugar - alkali ratio (0.25), nitrogen - alkali ratio (0.11), and potassium - chlorine ratio (0.09). The method system refers to GB / T18771.4 - 2015 "Tobacco Terms Part 4: Quality and Testing" (Table 4).

[0088] Table 5 Reference Table for Scores and Qualitative Description of Various Individual Indicators of Sensory Quality of Single Feed Tobacco

[0089] Table 5 Reference Table for Scores and Qualitative Description of Various Individual Indicators of Sensory Quality of Single Feed Tobacco

[0090]

[0091]

[0092]

[0093] Evaluation of sensory quality: Select the B2F and C3F tobacco leaves of each treatment, cut them into shreds, balance the moisture in a constant - temperature box at 22 °C and relative humidity of 60% for 48 h, then roll them into single - feed cigarettes for smoking evaluation, and conduct quantitative scoring with reference to the GB5606 - 2005 standard (Table 5). Calculate the sensory quality score by weighted calculation according to the quality of aroma (0.25), amount of aroma (0.25), off - flavors (0.1), aftertaste (0.1), irritation (0.1), softness (0.5), fineness (0.5), roundness (0.5), dryness (0.5), etc.

[0094] Comprehensive quality of tobacco leaves = Score of appearance quality evaluation × 15%+Score of physical property evaluation × 10%+Score of chemical component evaluation × 25%+Score of sensory quality evaluation × 50%.

[0095] Quality of tobacco leaves = Comprehensive quality of B2F × 40%+Comprehensive quality of C3F × 60%.

[0096] 1.5 Acquisition of RGB Images of Tobacco Plants

[0097] At 90 days after transplanting, representative tobacco plants in each plot were uprooted with roots and placed in flower pots, fixed and moved indoors. Using a Canon Rebel T6 (Canon Inc.), imaging was performed at a resolution of 6000×4000 pixels. The image acquisition method is as Figure 2 shown. Using two pure black background cloths of 2m×3m in size as the background, the tobacco plants were placed in flower pots and fixed. A turntable was placed below to facilitate changing the shooting angle. When shooting, the center point of the camera lens was 1.05m from the ground and 1.4m from the tobacco plant stem. The turntable was pulled clockwise to collect images of each tobacco plant at 25 angles. At the same time, a total of 80 field photos of the tobacco plants in each treatment were collected for generalization testing, and the shooting height and distance were kept as consistent as possible.

[0098] 1.6 RGB Image Processing and Feature Extraction for Flue-cured Tobacco Yield and Quality Prediction

[0099] 1.6.1 Image Processing

[0100] Using Matlab for background segmentation, denoising, and extracting the target area in the image to separate it from the background, facilitating subsequent image feature extraction. As Figure 3 shown;

[0101] 1.6.2 Feature Extraction

[0102] Using Matlab to extract RGB image features, and the extraction content is as follows:

[0103] (1) Color Features

[0104] Extract 9 single-channel color features in the RGB, HSV, and Lab color spaces, as well as 11 color-related features derived (Table 6), for a total of 20 color features.

[0105] Table 6 Color derived features

[0106] Table 6 Color derived features

[0107]

[0108]

[0109] (2) Texture Features

[0110] The texture features include 5 features: Energy, Contrast, Correlation, Homogeneity, and Variance.

[0111] Table 7 Texture features

[0112] Table 7 Texture features

[0113]

[0114] (3) Shape features

[0115] A total of 25 shape features were extracted, as shown in Table 8.

[0116] Table 8 Shape features

[0117] Table 8 Shape features

[0118]

[0119]

[0120]

[0121] Continued table 8 Shape features

[0122] Continued table 8 Shape features

[0123]

[0124]

[0125] 1.7 Construction and evaluation of the prediction model for the yield and quality of flue-cured tobacco

[0126] The model construction was implemented using Matlab 2021a (Matrix laboratory, USA). The software environment was Windows 11, and the hardware environment was a single AMD Ryzen 7-5800H CPU and a GeForce RTX3060 discrete graphics card.

[0127] 1.7.1 Traditional machine learning models

[0128] The traditional machine learning models used included the backpropagation neural network (BPNN), support vector machine (SVM), radial basis function neural network (RBF), extreme learning machine (ELM), and random forest (RF). The neural network is as shown in Figure 4 The input of the model was a 1×50 one-dimensional vector composed of 1200 50 features. Among them, 1200 was 90% of the shuffled data, and the other 10% was used for testing. The yield and quality scores of flue-cured tobacco were used as the output to establish a traditional machine learning model. Some parameters of the model are shown in Table 9.

[0129] Table 9 Model parameters

[0130] Table 9 Model parameters

[0131]

[0132] 1.7.2 Deep learning models

[0133] (1) Convolutional neural network

[0134] A convolutional neural network usually consists of an input layer, convolutional layers, pooling layers, and fully connected layers. The structure of a one-dimensional convolutional neural network (1D-CNN) is similar to that of a two-dimensional convolutional neural network. The main difference is that in 1D-CNN, the size of the convolutional kernel in 2D-CNN is modified to one-dimensional, reducing the complexity of the network. The 1D-CNN used in this paper has its parameters adjusted with reference to the typical Alex net neural network, and the network architecture is as shown in Figure 5 . The input of 1D-CNN is a one-dimensional vector of 1×50 composed of 1200 50 features. Among them, 1200 is 90% of the shuffled data, and the other 10% is used for testing. The neural network contains 6 convolutional layers and 1 fully connected layer. The 6 convolutional layers are one-dimensional convolutional layers with convolutional kernel sizes of 2×1, 4×1, 8×1, 4×1, 2×1, and 4×1 in sequence, with a stride of 1. The first and second layers sense image features at a larger scale when the number of channels is 2 and 4 respectively. The third and fourth layers sense image features at a medium scale when the number of channels is expanded to 8 and 16 respectively. The fifth and sixth layers sense image features at a small scale when the number of channels is expanded to 32 and 64 respectively. The Re LU is used as the activation function for all layers of the entire network. The fully connected layer calculates the weight matrix and bias vector corresponding to each output neuron for yield response. Sgdm is used to replace adam and rmsprop to optimize the weight coefficients. The training dropout rate is 0.1, the initial learning rate is 0.001, the mini-batch size is 10, the maximum number of training epochs is 35, the maximum number of iterations is 10500, and the number of iterations per round is 300.

[0135] (2) Long short-term memory neural network

[0136] The long short-term memory neural network (LSTM) model architecture for flue-cured tobacco yield and quality prediction contains 1 LSTM layer and 1 fully connected layer. The input of the LSTM is a one-dimensional vector of 1×50 composed of 1200 50 features. Among them, 1200 is 90% of the shuffled data, and the other 10% is used for testing. The number of hidden units in the LSTM layer is 10. Adam is used to optimize the weight coefficients. The initial learning rate is 0.01, the learning rate decay factor is 0.1, and the learning rate is 0.01×0.1 after 1000 times of training. The mini-batch size is 7, the maximum number of training epochs is 1000, the maximum number of iterations is 23000, and the number of iterations per round is 23.

[0137] 1.7.3 Model Evaluation

[0138] The model is evaluated using the coefficient of determination (R 2 ), root mean square error (RMSE), and mean absolute error (MAE), where:

[0139]

[0140]

[0141] 1.8 Data Analysis

[0142] Data analysis is performed using SPSS 26 and Excel 2021.

[0143] 2 Results and Analysis

[0144] Using the extracted RGB image color, shape, and texture features, five traditional machine learning algorithms and two deep learning algorithms are used to construct flue-cured tobacco quality and yield prediction models.

[0145] 2.1 Training Results of Flue-cured Tobacco Yield and Quality Prediction Models

[0146] Models are constructed using the 50 extracted image features (Table 10). The SVM model has the highest accuracy in the test sets of both the yield and quality prediction models. The results of the test set of the yield prediction model show that R 2 is 0.989, RMSE is 1.350, and MAE is 0.765. The results of the test set of the quality prediction model show that R 2 is 0.989, RMSE is 0.180, and MAE is 0.115. Generalization tests are performed on the trained models, and the results are shown in Table 11. The RF model has the highest accuracy in the yield prediction model, with R 2 being 0.813, RMSE being 6.013, and MAE being 3.623. The SVM model has the highest accuracy in the quality prediction model, with R 2 being 0.708, RMSE being 0.894, and MAE being 0.403. The accuracy of the two deep learning algorithms in the test sets is good, but the generalization test results are poor.

[0147] Table 10 Prediction model test set results

[0148] Table 10 Prediction model test set results

[0149]

[0150]

[0151] Table 11 Prediction model generalization test results

[0152] Table 11 Prediction model generalization test results

[0153]

[0154] 2.2 Feature optimization of the flue-cured tobacco yield and quality prediction model

[0155] To further improve the accuracy and generalization ability of the model, the random forest algorithm was used to rank the importance of 50 features and extract important features. Both models were tested 100 times repeatedly, the ranking of features was recorded each time, and the frequency of each feature's repeated test in the ranking was counted. The feature ranking results of the yield prediction model are as shown in Figure 6 A, and the feature ranking results of the quality prediction model are as shown in Figure 6 B.

[0156] According to the feature ranking results, the features were added to the model training one by one, and the results are as shown in Figure 7 . It can be seen that for both prediction models, as the number of feature variables added to the training increases, R 2 gradually increases, and RMSE and MAE gradually decrease. The yield prediction model ( Figure 7 A) and the quality prediction model ( Figure 7 B) reach the highest point of R 2 and the lowest points of RMSE and MAE when using 39 and 41 variables respectively. When more variables are added, the prediction accuracy of most models does not improve or even decreases. Combining Figure 4 , it can be known that a total of 39 features from the shape feature "centroid Y" to the texture feature "correlation" are the optimal features of the yield prediction model. A total of 41 features from the shape feature "bounding box Y" to the shape feature "equivalent diameter" are the optimal features of the quality prediction model.

[0157] 2.3 Training results of the flue-cured tobacco yield and quality prediction model after feature optimization

[0158] Using the optimized 39 and 41 features, yield and quality prediction models were constructed respectively (Table 13). The results of the test sets of the yield and quality prediction models show that the SVM model has the highest accuracy. The results of the test set of the yield prediction model are R 2 is 0.987, RMSE is 1.404, and MAE is 0.770. The results of the test set of the quality prediction model are R 2 is 0.986, RMSE is 0.208, and MAE is 0.132. The trained models were subjected to generalization tests, and the results are shown in Table 14. The RF model has the highest accuracy for the yield prediction model, and R 2is 0.820, RMSE is 5.902, and MAE is 3.551; the quality prediction model has the highest accuracy with the SVM model, and R 2 is 0.739, RMSE is 0.884, and MAE is 0.372. The accuracy of the model trained with the selected features does not change much in the test set, but the accuracy of most models improves in the generalization test, indicating that the generalization ability of the model can be improved by random forest feature selection. Combining Figure 8 it can be seen that in multiple repeated tests, the SVM and RF models have strong stability, and their accuracy is better than that of other models. The 1D-CNN and LSTM models perform mediocrely, and their stability and accuracy in the generalization test are worse than those of the SVM and RF.

[0159] Table 13 Prediction model test set results

[0160] Table 13 Prediction model test set results

[0161]

[0162]

[0163] Table 14 Prediction model generalization test results

[0164] Table 14 Prediction model generalization test results

[0165]

[0166] Select the models with the highest accuracy in the generalization test from the above results, which are the RF yield prediction model after feature selection ( Figure 9 left) and the SVM quality prediction model after feature selection ( Figure 9 right). The predicted values and the true values of the two prediction models have a high degree of agreement, which can provide a reference for the prediction of flue-cured tobacco yield and quality.

[0167] 2.5 Construction of the flue-cured tobacco yield and quality prediction APP

[0168] Based on the two models with the highest prediction accuracy, combined with background segmentation and feature extraction, a flue-cured tobacco yield and quality prediction APP was constructed using the Matlab APP design tool. The operation steps are as follows: click the "Enter" button to enter the APP, and click "Exit" to exit the APP. Enter the APP function page, as Figure 10 shown, first click to import an image, a folder will pop up, select the image through the folder, and support formats such as jpg, png, and jpeg.

[0169] The APP function is shown as follows Figure 11 After the image is imported, click the background segmentation button. The APP uses an image segmenter to remove the noisy background and simultaneously extracts features from the image after background segmentation. Click the yield prediction button, and the model calculates and outputs the yield prediction result. The numerical unit of the output result is kg / mu. Click the quality prediction button, and the model calculates and outputs the quality prediction result. The predicted output result is the comprehensive quality score. According to the prediction result, a quality score > 70 indicates excellent quality, 65 - 70 indicates medium quality, and < 65 indicates poor quality. Users can perform growth regulation of agronomic measures based on the quality score and the growth situation of the tobacco plants photographed. For example, if there are more leaves to be retained but the quality score is low, inapplicable leaves can be removed. If there are fewer leaves to be retained and the quality score is low, side shoots can be retained, foliar fertilizer can be sprayed, etc.

[0170] 3 Discussion

[0171] Yield and quality prediction is of great significance for the evaluation of the growth status of flue-cured tobacco in the field and yield estimation. Traditional determination of flue-cured tobacco yield and quality often needs to be carried out after harvesting, which cannot provide timely feedback on production. Yield and quality prediction can provide value for field management of flue-cured tobacco and final yield estimation. In previous studies, through correlation analysis of remote sensing images combined with color, structure information and crop yield, a linear regression equation was fitted to establish an effective yield prediction model. However, the linear regression model has poor processing effect on non-linear problems, and outliers will seriously affect the prediction accuracy. Using machine learning algorithms can well fit non-linear trends. Constructing a crop yield prediction model by combining remote sensing spectra and structure information has higher accuracy compared with the linear regression model. For example, using machine learning algorithms such as BPNN, RBF, ELM, RF, CNN and LSTM has good performance in aspects such as flue-cured tobacco leaf grading, crop disease and variety identification, chlorophyll, biomass, yield, and soil moisture, nutrient and water content prediction. For different application scenarios and objects, the performance of machine learning algorithms is different, and the prediction accuracy also varies. Therefore, this study selected five traditional machine learning algorithms (BPNN, SVM, RF, RBF, ELM) and two deep learning algorithms (1D-CNN, LSTM) to construct a flue-cured tobacco yield and quality prediction model. During the model construction process, the random forest algorithm was used for feature selection, which improved the accuracy and generalization ability of the model, consistent with the research results of Ilniyaz et al. After model comparison, it was found that the measured values and predicted values of the RF yield prediction model and the SVM quality prediction model after feature selection were in good agreement, and could predict relatively accurately, indicating that it is feasible to construct a flue-cured tobacco yield and quality prediction model by combining RGB image features and machine learning methods. However, the prediction accuracy of the deep learning network used in this study is generally average, which may be because the greatest advantage of deep learning compared with traditional machine learning lies in automatic feature extraction and recognition, and the limited image features limit the performance of the deep learning network. Previous studies also showed that under limited data training, deep learning algorithms are not necessarily better than traditional machine learning algorithms, but deep learning has a higher upper limit than traditional machine learning and a wider application range. For example, 2D-CNN can quickly and accurately extract and recognize the features of two-dimensional images, and 3D-CNN can perform multi-layer non-linear transformation modeling on three-dimensional high-complexity data. In addition, the images used in this study were pre-processed, and the influence of the noisy background was reduced through background segmentation and wavelet denoising. When the model is applied to actual production, images are collected using different devices, and there are differences in the distance and resolution of the collected images. In addition, under natural environmental conditions, there are problems such as weeds, leaf occlusion, cluttered background and uneven illumination brightness, resulting in uneven image quality, which will affect the accuracy of the model and have a certain impact on the prediction results. Therefore, future research can be targeted at model optimization and algorithm development.

[0172] Using trained models to form a small program to benefit farmers and provide guidance for agricultural production is an effective way to transform results. In this study, based on the two models with the highest prediction accuracy, combined with background segmentation and feature extraction, the Matlab APP design tool was used to build a flue-cured tobacco yield and quality prediction APP. Currently, the prediction of flue-cured tobacco yield and quality can be achieved, but the function and universality are relatively single, and there is still a certain distance to be applied to actual production. Therefore, in future research, it is necessary to improve the generalization ability and universality of the model, and add functions such as field pest and disease identification and prevention measures, cultivation measures reminders combined with meteorological data and extreme weather warnings, tobacco baking guidance and tobacco grading, etc., to further improve the usability and professionalism of the APP.

[0173] 4 Conclusion

[0174] The yield prediction model constructed using the color, shape and texture features of the tobacco plant RGB image has the best performance in RF. 2 The generalization test R 2 is 0.820; SVM performs best in quality prediction model, and the test set R 2 The generalization test R 2 The actual value and the predicted value are in good agreement, and the prediction can be made accurately. Based on the prediction model and Matlab APP design tool, a flue-cured tobacco yield and quality prediction APP was developed to predict the yield and quality of flue-cured tobacco.

[0175] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for predicting the yield and quality of flue-cured tobacco based on RGB images, characterized in that, Including: S1. Obtain the image data of tobacco plants; S2. Extract features from the processed image data and perform feature optimization; S3. Construct a prediction model for the yield and quality of flue-cured tobacco and evaluate it; S4. Construct a prediction APP for the yield and quality of flue-cured tobacco.

2. The method for predicting the yield and quality of flue-cured tobacco based on RGB images according to claim 1, wherein, Step S1 includes the following steps: S11. Uproot the representative tobacco plants in each plot 90 days after transplanting, put them into flower pots, fix them and move them indoors; S12. Use two pure black background cloths of 2m×3m as the background. Place the tobacco plants in flower pots and fix them. A turntable is placed below to facilitate changing the shooting angle; S13. Pull the turntable clockwise, collect images of each tobacco plant at 25 angles, and collect a total of 80 field photos of tobacco plants in each treatment at the same time for generalization testing.

3. The method for predicting the yield and quality of flue-cured tobacco based on RGB images according to claim 2, wherein, In step S2, the following steps are included: S21. Use Matlab for background segmentation and denoising, extract the target area in the image, and separate it from the background; S22. Use Matlab to extract RGB image features. The RGB image features include 20 color features, 5 texture features and 25 shape features, and feature optimization is performed through the random forest algorithm.

4. A method for predicting the yield and quality of flue-cured tobacco based on RGB images according to claim 3, characterized in that, In step S3, constructing a prediction model for the yield and quality of flue-cured tobacco includes the following steps: Use five traditional machine learning algorithms, namely feedforward neural network, support vector machine, random forest, radial basis neural network and extreme learning machine, and two deep learning algorithms, namely one-dimensional convolutional neural network and long short-term memory neural network, to construct a yield and quality prediction model.

5. The method for predicting the yield and quality of flue-cured tobacco based on RGB images according to claim 4, wherein, The model is evaluated using the coefficient of determination (R 2 ), the root mean square error (RMSE), and the mean absolute error (MAE), where:

6. The method for predicting the yield and quality of flue-cured tobacco based on RGB images according to claim 5, characterized in that, In step S4, constructing a prediction APP for the yield and quality of flue-cured tobacco includes the following steps: Based on the two models with the highest prediction accuracy, combined with background segmentation and feature extraction, a prediction APP for the yield and quality of flue-cured tobacco is constructed using the Matlab APP design tool.