Tobacco plant number prediction method based on deep learning
Through deep learning technology and multi-source data processing, combined with spatiotemporal attention mechanism and adaptive weighted regression model, the artificial dependence and nonlinear feature capture problems of traditional methods in the number prediction of cigarette strains is solved, achieving higher prediction accuracy and stability.
Patent Information
- Application Number
- CN202510407156.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-04-02
AI Technical Summary
The prior art has problems such as artificial empirical dependence in the prediction of cigarette strain quantity, difficulty in capturing complex nonlinear features in traditional statistical models, and insufficient multi-source data processing.
Using a deep learning-based method, data is collected through multi-source agricultural sensors, dynamic feature selection network is used to perform multi-source feature fusion, and multi-modal timing prediction model combined with a spatiotemporal attention mechanism to construct an adaptive weighted regression model, and the prediction results are optimized through hierarchical correction model.
It improves the accuracy and stability of the number of tobacco plants, can reflect the growth environment characteristics of the tobacco plants more comprehensively and accurately, and enhances the real-time and adaptability of the prediction.
Smart Images

Figure CN119918023A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural production data prediction, and specifically to a tobacco plant quantity prediction method based on deep learning. Background Art
[0002] In the tobacco planting industry, accurate prediction of tobacco plant numbers is crucial to improving production efficiency and ensuring economic benefits. Traditional tobacco plant number prediction methods mainly rely on manual experience or simple statistical models, which have many limitations.
[0003] From the perspective of manual experience, tobacco farmers mainly rely on their years of accumulated planting experience to estimate the number of tobacco plants. However, this method is greatly affected by subjective factors, the experience levels of different tobacco farmers vary, and it is difficult to adapt to the complex and changing planting environment. For example, soil conditions, climate differences and variety characteristics in different regions will affect the growth of tobacco plants. Manual experience is difficult to comprehensively and accurately consider these factors, resulting in the prediction results often deviating greatly from the actual situation. In some new tobacco areas, tobacco farmers lack sufficient planting experience, making manual predictions less reliable.
[0004] In terms of simple statistical models, although traditional statistical methods such as linear regression can use historical data for prediction to a certain extent, these models usually assume that there is a simple linear relationship between the data and cannot capture the complex nonlinear characteristics of the tobacco plant growth process. Tobacco plant growth is affected by the combined effects of many factors. Environmental factors such as soil moisture, temperature, light, and rainfall are interrelated and influence each other, and are not simple linear relationships. For example, soil moisture promotes tobacco plant growth within a certain range, but too high or too low humidity will inhibit tobacco plant growth. This complex nonlinear relationship is difficult to characterize with traditional statistical models. Moreover, traditional statistical models have strict requirements on data. When there are missing data, noise or outliers, the prediction accuracy of the model will drop significantly.
[0005] With the development of science and technology, intelligent agriculture has become a trend, and sensor technology has been widely used in the agricultural field. Multi-source agricultural sensors can collect a large amount of tobacco field environmental data in real time, including soil moisture, meteorological parameters, tobacco plant growth conditions, etc. However, how to effectively integrate and utilize these multi-source data and mine the information hidden behind the data has become an urgent problem to be solved. At present, most data processing methods simply analyze a single type of data and fail to give full play to the comprehensive advantages of multi-source data.
[0006] Deep learning technology has achieved remarkable results in image recognition, speech processing and other fields, but its application in tobacco plant quantity prediction is still in the exploratory stage. Existing deep learning models have problems such as insufficient feature extraction, low model training efficiency, and low prediction accuracy when processing complex environmental data of tobacco fields. For example, when processing time series data, it is difficult to effectively capture long-term dependencies; when processing spatial data, it is impossible to accurately model the mutual influence of tobacco plant growth between different regions. Therefore, developing a tobacco plant quantity prediction method based on deep learning that can make full use of multi-source data is of great practical significance for promoting the intelligent and precise development of the tobacco planting industry. Summary of the invention
[0007] The purpose of the present invention is to provide a method for predicting the number of cigarettes based on deep learning to solve the problems raised in the above background technology.
[0008] To achieve the above object, the present invention provides the following technical solution: a method for predicting the number of tobacco plants based on deep learning, the method comprising: Collect tobacco field environmental data through multi-source agricultural sensors, the multi-source agricultural sensors include soil moisture sensors, meteorological sensors, lidar point cloud sensors and multi-spectral sensors; perform multi-source feature fusion on the tobacco field environmental data based on a dynamic feature selection network to generate a fused environmental feature vector; input the environmental feature vector into a pre-trained multimodal time series prediction model, the multimodal time series prediction model adopts a spatiotemporal attention mechanism, constructs a spatiotemporal association matrix through time series window division and spatial region division, and models tobacco plant growth trends based on the spatiotemporal association matrix; An adaptive weighted regression model is constructed according to the growth trend parameters output by the multimodal time series prediction model. The adaptive weighted regression model takes the minimum prediction error of the number of tobacco plants and the lowest model complexity as optimization goals, and uses an improved particle swarm optimization algorithm to dynamically adjust the model weights, wherein the improved particle swarm optimization algorithm introduces an inertia weight adaptive attenuation mechanism and a global optimal de-disturbance strategy; the tobacco plant number prediction result is output based on the adaptive weighted regression model.
[0009] Preferably, the method further comprises: A hierarchical correction model is constructed according to the prediction results of the number of tobacco plants, and the hierarchical correction model includes a trend layer, a residual layer and a correction layer, wherein the trend layer performs trend smoothing on the prediction results based on a sliding average algorithm, the residual layer dynamically compensates for the prediction residual based on a gated recurrent unit network, and the correction layer performs boundary correction on the final prediction value based on the constrained least squares method to generate optimized tobacco plant number prediction data.
[0010] Preferably, the dynamic feature selection network performs multi-source feature fusion on tobacco field environmental data including: Acquire raw data from multi-source agricultural sensors, the raw data including soil moisture time series, meteorological parameter matrix, laser radar point cloud density distribution data, and multispectral reflectance curve; segment the raw data based on a sliding time window, and extract statistical features of each segment of data, including mean, variance, extreme value, and trend slope; Constructing a feature importance evaluation function, the function calculates the correlation between each feature and the number of tobacco plants through a weighted combination of mutual information entropy and Pearson correlation coefficient; sorting the features based on the correlation, and using a dynamic threshold cutoff method to screen features with high correlation; A feature fusion network is constructed, which includes parallel one-dimensional convolution branches and fully connected branches, wherein the one-dimensional convolution branches extract temporal features through multi-scale convolution kernels, and the fully connected branches extract spatial features through nonlinear mapping; an adaptive weighting mechanism is used to fuse the branch outputs to generate a fused environmental feature vector.
[0011] Preferably, the training method of the multimodal time series prediction model includes: A spatiotemporal correlation matrix was constructed, the time dimension was divided into multiple overlapping windows, the spatial dimension was divided into gridded regions, and the spatiotemporal correlation weights were calculated based on the covariance between the environmental characteristics within the window and the number of tobacco plants between regions; Design a spatiotemporal attention module, extract temporal dependency and spatial correlation respectively through a multi-head self-attention mechanism, and use residual connections and layer normalization to optimize the attention output; A hybrid prediction network is constructed, which includes a long short-term memory network branch and a Transformer branch, wherein the long short-term memory network branch is used to capture local temporal patterns, and the Transformer branch is used to model global spatiotemporal dependencies; a gated fusion unit is used to dynamically weight and merge branch outputs to generate growth trend parameters.
[0012] Preferably, the improved particle swarm optimization algorithm dynamically adjusts the model weights including: Initialize the particle swarm parameters, each particle represents a set of weight vectors, and calculate the prediction error and complexity penalty of the weight vector through the fitness function; Adopting an inertia weight adaptive attenuation mechanism, the mechanism dynamically adjusts the inertia weight according to the number of iterations and particle diversity, and its attenuation function is a piecewise exponential function; Design a global optimal solution perturbation strategy. When the particle swarm falls into a local optimum, add Gaussian noise perturbation to the global optimal solution and re-evaluate the fitness through neighborhood search. The particle swarm is updated based on the elite retention strategy, the first K particles with the highest fitness are retained to enter the next generation directly, and the remaining particles generate a new population through crossover and mutation operations.
[0013] Preferably, the residual layer of the hierarchical correction model dynamically compensates the prediction residual based on a gated recurrent unit network, including: Construct a residual sequence, take the difference between the predicted result and the actual number of tobacco plants as input, and map the residual sequence to a high-dimensional space through a time embedding layer; Design a gated recurrent unit network, the network includes a reset gate and an update gate, and dynamically adjusts the transmission ratio of historical residual information through a gating mechanism; An attention enhancement mechanism is adopted to introduce temporal attention weights in the hidden state to perform reinforcement learning on the residual features of key time points.
[0014] Preferably, the correction layer performs boundary correction on the final prediction value based on the constrained least squares method, including: Constructing boundary constraints, the constraints including physical upper and lower limits of the number of tobacco plants and the maximum rate of change of predicted values at adjacent time points; Design a constrained optimization objective function, taking the square error between the predicted value and the corrected value as the target term, and adding the boundary constraint as a penalty term to the Lagrange multiplier; The iterative projection method is used to solve the constrained optimization problem by alternately updating the correction value and the multiplier parameter until the convergence condition is met.
[0015] Preferably, the method further comprises a real-time prediction update method: Based on the online learning framework, the newly added tobacco field environmental data is input into the sliding time window, and the highly correlated feature set is updated through the incremental feature selection algorithm; The multimodal time series prediction model is fine-tuned using an elastic weight update strategy, which calculates parameter importance through the Fisher information matrix and limits the update amplitude of important parameters. Build a dynamic priority queue to prioritize training samples based on prediction error and data freshness, and give priority to training high-priority samples.
[0016] Preferably, the data processing method of the multispectral sensor includes: The multi-spectral reflectance curve is subjected to spectral dimension reduction, and nonlinear features are extracted using kernel principal component analysis to generate low-dimensional spectral feature vectors; Construct a spectrum-environment correlation model and establish the mapping relationship between spectral characteristics and soil moisture and meteorological parameters through partial least squares regression; The missing spectral data are interpolated based on the mapping relationship, and the adaptive weighted average method is used to fuse the interpolation results with the actual measured values.
[0017] Compared with the prior art, the present invention has the following beneficial effects: The present invention collects tobacco field environmental data through multi-source agricultural sensors, and uses a dynamic feature selection network to perform multi-source feature fusion. The network can not only obtain raw data such as soil moisture, meteorology, laser radar point cloud density distribution, and multi-spectral reflectivity, but also extract statistical features through sliding time window segmentation processing, and then use the feature importance evaluation function to screen high-correlation features. Finally, through a feature fusion network containing a one-dimensional convolution branch and a fully connected branch, an adaptive weighting mechanism is used to generate an environmental feature vector. This process fully mines the useful information in multi-source data. Compared with the traditional single data processing method, it can more comprehensively and accurately reflect the growth environment characteristics of tobacco plants, provide a solid data foundation for subsequent predictions, and greatly improve the accuracy of predictions.
[0018] The multimodal time series prediction model adopts the spatiotemporal attention mechanism to construct a spatiotemporal correlation matrix through time series window division and spatial region division. This method can effectively capture the spatiotemporal dependencies in the growth process of tobacco plants and accurately model the growth trends of tobacco plants. For example, in the time dimension, it can identify the impact of environmental factors on the number of tobacco plants at different growth stages; in the spatial dimension, the interaction of tobacco plant growth in different regions can be considered. In addition, the model contains long short-term memory network branches and Transformer branches, which are used to capture local time series patterns and model global spatiotemporal dependencies, respectively, and then dynamically weighted and merged outputs through gated fusion units. This multi-branch structure design, combined with the attention mechanism, enables the model to perform better in processing complex tobacco plant growth data, and the prediction accuracy is significantly improved compared to traditional prediction models.
[0019] The adaptive weighted regression model takes the minimum prediction error of tobacco plant number and the lowest model complexity as the optimization goal, and uses the improved particle swarm optimization algorithm to dynamically adjust the model weights. The improved particle swarm optimization algorithm introduces the inertia weight adaptive attenuation mechanism and the global optimal de-disturbance strategy, which can effectively prevent the algorithm from falling into the local optimum, improve the search efficiency, and enable the model to quickly find the optimal weight combination under different tobacco field environments and data conditions. By continuously optimizing the model weights, the adaptive weighted regression model can better fit the relationship between the number of tobacco plants and environmental characteristics, further improving the accuracy and stability of the prediction.
[0020] The hierarchical correction model includes a trend layer, a residual layer, and a correction layer, which optimizes the prediction results from multiple angles. The trend layer smoothes the prediction results based on the sliding average algorithm, removes noise and fluctuations in the prediction data, and makes the prediction trend more in line with the actual situation; the residual layer uses a gated recurrent unit network to dynamically compensate for the prediction residuals, and through the gating mechanism and attention enhancement mechanism, effectively learns and utilizes historical residual information to make fine adjustments to the prediction results; the correction layer corrects the boundaries of the final prediction value based on the constrained least squares method, taking into account the physical upper and lower limits of the number of tobacco plants and the maximum rate of change of the prediction values at adjacent time points, to ensure that the prediction results are within a reasonable range and avoid unreasonable prediction values. This complete set of correction mechanisms can greatly improve the accuracy of the prediction results and provide more reliable decision-making basis for tobacco farmers and tobacco companies.
[0021] The present invention also has a real-time prediction update method, which can process newly added tobacco field environmental data in a timely manner based on an online learning framework. The highly correlated feature set is updated through an incremental feature selection algorithm to ensure that the model always uses the most valuable data for prediction; the multimodal time series prediction model is fine-tuned using an elastic weight update strategy to ensure the stability of the model while enabling it to quickly adapt to data changes; a dynamic priority queue is constructed to prioritize training samples according to prediction error and data freshness, and high-priority samples are trained first to improve model training efficiency and real-time prediction. In addition, the data processing method of the multispectral sensor effectively processes multispectral data and improves data quality through operations such as spectral dimension reduction, construction of a spectral-environmental correlation model, and data interpolation and fusion, thereby further improving the performance of the overall prediction system. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a working principle diagram of the method for predicting the number of tobacco plants of the present invention; Figure 2 Flowchart for training a multimodal time series prediction model; Figure 3 Flowchart of the improved particle swarm optimization algorithm for adjusting model weights; Figure 4 Diagram of steps for dynamic compensation of residual layer of layer correction model; Figure 5 Figure 2. The correction steps of the correction layer based on constrained least squares method. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] See also Figure 1-5 The present invention provides a method for predicting the number of tobacco plants based on deep learning, and its overall implementation scheme is as follows: Tobacco field environmental data collection: Multi-source agricultural sensors are used to obtain tobacco field environmental data. Soil moisture sensors monitor soil moisture in real time to reflect the soil moisture conditions for tobacco plant growth. Meteorological sensors collect meteorological parameters such as temperature, humidity, light, and wind speed, which have a significant impact on tobacco plant growth and development. LiDAR point cloud sensors can obtain tobacco plant spatial distribution information, such as plant spacing and planting density. Multispectral sensors collect spectral reflectance data in different bands to analyze the physiological state and growth status of tobacco plants. Through the collaborative work of these multi-source sensors, tobacco field environmental data can be collected comprehensively and accurately.
[0025] Multi-source feature fusion: Multi-source feature fusion is performed on the collected tobacco field environmental data based on the dynamic feature selection network. First, the original data of each sensor is obtained, including soil moisture time series, meteorological parameter matrix, lidar point cloud density distribution data and multispectral reflectance curve. Then, the original data is segmented using a sliding time window to extract the statistical features of each segment of data, such as mean, variance, extreme value and trend slope, etc. These statistical features can effectively reflect the change law and characteristic information of the data. After that, a feature importance evaluation function is constructed, and the correlation between each feature and the number of tobacco plants is calculated by the weighted combination of mutual information entropy and Pearson correlation coefficient. The features are sorted based on this, and the dynamic threshold truncation method is used to screen out high-correlation features. Finally, a feature fusion network is constructed, which contains parallel one-dimensional convolution branches and fully connected branches. The one-dimensional convolution branch uses multi-scale convolution kernels to extract time series features, and the fully connected branch extracts spatial features through nonlinear mapping. The outputs of the two branches are fused using an adaptive weighting mechanism to generate a fused environmental feature vector.
[0026] Modeling the growth trend of tobacco plants: The fused environmental feature vector is input into the pre-trained multimodal time series prediction model. The model adopts the spatiotemporal attention mechanism. First, the time dimension is divided into multiple overlapping windows, and the spatial dimension is divided into gridded regions. The spatiotemporal correlation weights are calculated based on the covariance of the environmental features in the window and the number of tobacco plants between regions, and then the spatiotemporal correlation matrix is constructed. Through this spatiotemporal correlation matrix, the model can effectively capture the spatiotemporal dependencies in the growth process of tobacco plants. Then, the model designs a spatiotemporal attention module, and uses the multi-head self-attention mechanism to extract temporal dependencies and spatial correlations respectively, and uses residual connections and layer normalization to optimize the attention output to improve the model performance. In addition, the model constructs a hybrid prediction network, which includes a long short-term memory network branch and a Transformer branch. The long short-term memory network branch is good at capturing local temporal patterns, and the Transformer branch is used to model global spatiotemporal dependencies. Finally, the gated fusion unit is used to dynamically weight the outputs of the two branches to generate tobacco plant growth trend parameters.
[0027] Construct an adaptive weighted regression model and predict: An adaptive weighted regression model is constructed based on the growth trend parameters output by the multimodal time series prediction model. The model takes the minimum prediction error of the number of tobacco plants and the lowest model complexity as the optimization goal, and uses the improved particle swarm optimization algorithm to dynamically adjust the model weights. During the adjustment process, the particle swarm parameters are initialized first, each particle represents a set of weight vectors, and the prediction error and complexity penalty of the weight vector are calculated through the fitness function. The inertia weight adaptive attenuation mechanism is adopted to dynamically adjust the inertia weight according to the number of iterations and particle diversity, and its attenuation function is a piecewise exponential function. At the same time, a global optimal solution perturbation strategy is designed. When the particle swarm falls into a local optimum, Gaussian noise perturbation is added to the global optimal solution, and the fitness is re-evaluated through neighborhood search. Finally, the particle swarm is updated based on the elite retention strategy, and the first K particles with the highest fitness are retained to directly enter the next generation, and the remaining particles generate a new population through crossover and mutation operations. After the above optimization process, the prediction results of the number of tobacco plants are output based on the adaptive weighted regression model.
[0028] The implementation of the present invention is further described below in conjunction with Examples 1 to 5.
[0029] Embodiment 1: After obtaining the prediction results of the number of tobacco plants, a hierarchical correction model is constructed. The model is divided into a trend layer, a residual layer, and a correction layer.
[0030] The trend layer smoothes the prediction results based on the sliding average algorithm. The sliding average algorithm calculates the average value of the prediction value within a certain time window, removes short-term fluctuations and noise in the data, and highlights the long-term trend of the change in the number of tobacco plants. Assume that the prediction result sequence is , the sliding window size is , then the smoothed sequence output by the trend layer is middle, (when or In this way, the influence of some random factors on the prediction results can be effectively filtered out, making the trend clearer.
[0031] The residual layer dynamically compensates the prediction residual based on the gated recurrent unit network. First, the residual sequence is constructed, and the difference between the predicted result and the actual number of tobacco plants is used as input. The residual sequence is mapped to a high-dimensional space through the time embedding layer to enhance the expression ability of the residual features. Then the gated recurrent unit network is designed, which contains a reset gate and an update gate. The reset gate determines how much past information is retained for the calculation of the current state, and the update gate controls the mixing ratio of the current input information and the past state information in the new state. The transmission ratio of historical residual information is dynamically adjusted through the gating mechanism, so that the network can adaptively learn and adjust according to the residual features at different times. In addition, the attention enhancement mechanism is adopted to introduce the temporal attention weight in the hidden state to strengthen the learning of the residual features at key time points. For example, in the critical period of tobacco plant growth, such as the rapid growth period and the flowering period, the residual features are more important for the correction of the prediction results. The attention mechanism can highlight the residual information at these key time points, thereby compensating the prediction error more accurately.
[0032] The correction layer makes boundary corrections to the final predicted value based on the constrained least squares method. First, boundary constraints are constructed, including the physical upper and lower limits of the number of tobacco plants, which are determined based on actual factors such as the planting density limit of the tobacco field and the carrying capacity of the land; as well as the maximum rate of change of the predicted value at adjacent time points to ensure that the change of the predicted value conforms to the natural law of tobacco plant growth. Then, a constrained optimization objective function is designed, and the square error between the predicted value and the corrected value is used as the target term, and the boundary constraint is added to the Lagrange multiplier as a penalty term. Finally, the iterative projection method is used to solve the constrained optimization problem, and the correction value and the multiplier parameter are updated alternately until the convergence condition is met. After being processed by the correction layer, the optimized tobacco plant number prediction data is generated, which significantly improves its accuracy and rationality.
[0033] Embodiment 2: This embodiment describes in detail the specific process of multi-source feature fusion of tobacco field environmental data by the dynamic feature selection network, ensuring that high-value features for tobacco plant quantity prediction can be extracted from a large amount of complex original data, and these features can be effectively fused to provide high-quality input for subsequent prediction models.
[0034] The raw data of multi-source agricultural sensors are obtained. The soil moisture time series output by the soil moisture sensor records the changes in moisture content in the soil at different time points. The meteorological parameter matrix collected by the meteorological sensor contains data on multiple meteorological factors such as temperature, humidity, light, wind speed, etc. at different times. The laser radar point cloud density distribution data reflects the distribution density of tobacco plants in space. The multispectral reflectance curve collected by the multispectral sensor contains the physiological information and growth status of the tobacco plants.
[0035] The original data is segmented based on the sliding time window to extract the statistical characteristics of each segment of data. The size of the sliding time window can be reasonably set according to the time resolution of the data and actual needs. For each segment of data, its mean, variance, extreme value and trend slope are calculated. The mean reflects the average level of the data in the time period, the variance reflects the degree of dispersion of the data, the extreme value shows the maximum and minimum values of the data, and the trend slope describes the change trend of the data. For example, for the soil moisture time series , at a length of In the sliding time window of ,variance , the maximum value , minimum The trend slope is obtained by calculating the ratio of the difference between adjacent data points and the time interval.
[0036] A feature importance evaluation function was constructed, and the correlation between each feature and the number of tobacco plants was calculated by weighted combination of mutual information entropy and Pearson correlation coefficient. Mutual information entropy is used to measure the degree of information sharing between two variables, and Pearson correlation coefficient reflects the degree of linear correlation between two variables. Assume that the feature variable is , the number of tobacco plants variable is , mutual information entropy , Pearson correlation coefficient ,in yes and The joint probability distribution of and They are and The marginal probability distribution of is the sample size, and They are and No. Sample values, and They are and By setting appropriate weights and , combine the mutual information entropy and Pearson correlation coefficient to get the feature importance evaluation value Based on the correlation, the features are sorted and the dynamic threshold cutoff method is used to select the features with high correlation. The dynamic threshold can be dynamically adjusted according to the distribution of the feature importance evaluation value and actual experience to ensure that the selected features have high correlation and are not too redundant.
[0037] Construct a feature fusion network, which includes parallel one-dimensional convolution branches and fully connected branches. The one-dimensional convolution branch extracts temporal features through multi-scale convolution kernels. Convolution kernels of different scales can capture feature information at different time scales. For example, small-scale convolution kernels can focus on short-term local changes, while large-scale convolution kernels can grasp long-term trend changes. The fully connected branch extracts spatial features through nonlinear mapping and effectively integrates the spatial relationships in the original data. Finally, an adaptive weighting mechanism is used to fuse the branch outputs. The adaptive weighting mechanism dynamically adjusts the weights according to the importance of the feature information output by the two branches, so that the fused environmental feature vector can better integrate temporal and spatial features, providing more representative input for subsequent prediction models.
[0038] Embodiment 3: This embodiment describes in detail the training process of the multimodal time series prediction model. By reasonably constructing the model structure and training method, the model can accurately learn the temporal and spatial laws of tobacco plant growth and improve the modeling ability of tobacco plant growth trends, thereby laying the foundation for accurately predicting the number of tobacco plants.
[0039] The spatiotemporal correlation matrix is constructed, and the time dimension is divided into multiple overlapping windows. The size and overlap of the windows can be adjusted according to the actual data characteristics and analysis requirements. At the same time, the spatial dimension is divided into gridded areas, and each grid represents a spatial unit. The spatiotemporal correlation weight is calculated based on the covariance of the environmental characteristics within the window and the number of tobacco plants between regions. Assume that the time window is , the spatial region is and , the environmental feature vector is , the number vector of tobacco plants is , then the spatiotemporal association weight ,in represents the covariance, By calculating the association weights between different time windows and spatial regions, a complete spatiotemporal association matrix is constructed, which can effectively reflect the relationship between spatiotemporal factors in the growth process of tobacco plants.
[0040] A spatiotemporal attention module is designed to extract temporal dependency and spatial correlation respectively through a multi-head self-attention mechanism. The multi-head self-attention mechanism can capture the relationship between features from different angles through parallel calculation of multiple different attention heads. In the temporal dimension, the attention mechanism can focus on the dependency of the growth status of tobacco plants between different time points; in the spatial dimension, it can mine the correlation of the number of tobacco plants in different spatial regions. Residual connections and layer normalization are used to optimize the attention output. Residual connections can avoid the problem of gradient disappearance during deep neural network training, allowing the model to better learn long-term dependencies; layer normalization standardizes the input of each layer, accelerates the convergence speed of the model, and improves the training efficiency and stability of the model.
[0041] A hybrid prediction network is constructed, which includes a long short-term memory network branch and a Transformer branch. The long short-term memory network branch is good at capturing local temporal patterns. Its internal memory unit can effectively save past information and dynamically adjust the memory content according to the current input, so as to accurately model the changing trend of tobacco plant growth in a short period of time. The Transformer branch takes advantage of its self-attention mechanism to model global spatiotemporal dependencies and capture the dependencies that span a long time and a large spatial range during tobacco plant growth. The gated fusion unit is used to dynamically weight and merge the branch outputs to generate growth trend parameters. The gated fusion unit dynamically adjusts the weights according to the importance of the feature information output by the two branches, so that the growth trend parameters finally generated can comprehensively consider the local temporal patterns and global spatiotemporal dependencies, and more accurately reflect the growth trend of tobacco plants. During the training process, a large amount of historical tobacco field environmental data and the corresponding tobacco plant quantity data are used to train the model, and the parameters of the model are continuously adjusted through the back propagation algorithm, so that the model can learn the optimal spatiotemporal correlation relationship and growth trend modeling method.
[0042] Embodiment 4: This embodiment describes in detail the process of dynamically adjusting the model weights in the adaptive weighted regression model using the improved particle swarm optimization algorithm. By optimizing the algorithm, the model achieves a better balance between prediction accuracy and model complexity, thereby improving the accuracy of tobacco plant quantity prediction and the generalization ability of the model.
[0043] Initialize the particle swarm parameters. Each particle represents a set of weight vectors, which correspond to the weights in the adaptive weighted regression model. The number of particles, initial positions, and speeds can be set according to the scale of the problem and actual experience. The prediction error and complexity penalty of the weight vector are calculated through the fitness function. Fitness function ,in is the weight vector, is the prediction error of the number of tobacco plants when using this weight vector for prediction, which can be calculated using common error measurement methods such as mean square error. It is a measure of model complexity, for example, it can be measured by the number of parameters in the model or the structural complexity of the model. It is the complexity penalty coefficient, which is used to balance the relationship between prediction error and model complexity and can be optimized through experiments.
[0044] The inertia weight adaptive attenuation mechanism is adopted to dynamically adjust the inertia weight according to the number of iterations and particle diversity, and its attenuation function is a piecewise exponential function. Assume that the number of iterations is , the maximum number of iterations is , the particle diversity index is (e.g., it can be measured by the standard deviation of the particle positions), inertia weight The decay function can be expressed as:
[0045] in and are the maximum and minimum values of the inertia weight, is the attenuation coefficient, is the particle diversity threshold. At the beginning of the algorithm, a larger inertia weight helps particles to explore globally in the search space; as the iteration proceeds, the inertia weight gradually decays according to the particle diversity, allowing particles to focus more on local search and improve search accuracy.
[0046] Design a global optimal solution perturbation strategy. When the particle swarm falls into a local optimum, add Gaussian noise perturbation to the global optimal solution and re-evaluate the fitness through neighborhood search. Whether the particle swarm falls into a local optimum can be determined by observing whether the global optimal solution does not change much in multiple consecutive iterations or whether the fitness value converges to a smaller range. Assume that the global optimal solution is , the added Gaussian noise is ,in is the noise standard deviation, which can be adjusted according to actual conditions. After adding noise, we get a new solution , then Search in the neighborhood of , re-evaluate the fitness, and find a better solution. In this way, it can help the particle swarm jump out of the local optimum and continue to find a better weight vector.
[0047] Based on the elite retention strategy, the particle swarm is updated, and the first K particles with the highest fitness are retained to enter the next generation directly. The remaining particles generate a new population through crossover and mutation operations. The crossover operation simulates the gene exchange process in biological genetics. Two particles are selected from the current population, and some of their genes (i.e., some elements of the weight vector) are exchanged according to a certain crossover probability to generate new particles. The mutation operation randomly changes some genes of the particles with a certain mutation probability, introduces new gene information, and prevents the algorithm from converging prematurely. The elite retention strategy can ensure that the optimal solution in each generation will not be lost. At the same time, the crossover and mutation operations increase the diversity of the population, enabling the algorithm to find the optimal solution in a wider search space and continuously optimize the weights of the adaptive weighted regression model.
[0048] Embodiment 5: This embodiment covers the specific process of real-time prediction and update method and multi-spectral sensor data processing. The real-time prediction and update method enables the model to adjust the prediction in time with the arrival of new data, maintaining the timeliness and accuracy of the prediction; multi-spectral sensor data processing further explores its data value and provides a more reliable basis for tobacco plant quantity prediction.
[0049] Real-time prediction update method: Based on the online learning framework, when there is new tobacco field environmental data, it is input into the sliding time window. The role of the sliding time window is to dynamically screen and process the data and retain the data fragments that are most relevant to the current prediction task. Update the high-correlation feature set through the incremental feature selection algorithm. Based on the existing feature selection results, the incremental feature selection algorithm quickly determines whether the features in the new data are of great value to the prediction. For example, the previously constructed feature importance evaluation function is used to calculate the correlation between the new features and the number of tobacco plants, and the features with a correlation higher than the dynamic threshold are added to the high-correlation feature set. At the same time, those old features that have become no longer important due to the emergence of new data are eliminated to ensure that the feature set always maintains high relevance and effectiveness for predicting the number of tobacco plants.
[0050] The elastic weight update strategy is used to fine-tune the multimodal time series prediction model. This strategy calculates the importance of parameters through the Fisher information matrix and limits the update range of important parameters. The Fisher information matrix reflects the influence of model parameters on data distribution. For those important parameters that have a greater impact on model performance, a smaller update range is given to avoid excessive fluctuations in model parameters due to the introduction of new data, which destroys the learned stable features; for relatively unimportant parameters, a larger update range is allowed so that they can adapt to changes in new data more quickly. In the specific calculation, it is assumed that the model parameters are , Fisher information matrix ,in is the input data, The model is parameterized Generate data The probability distribution of . The importance score of each parameter is calculated according to the Fisher information matrix, and then the update step length of the parameter is determined. ,in is the learning rate, is the loss function, and robust fine-tuning of the model is achieved in this way.
[0051] Build a dynamic priority queue to prioritize training samples based on prediction error and data freshness. Samples with large prediction errors mean that the model performs poorly on these data and needs to be learned and improved first; data freshness takes into account that new data more accurately reflects the current growth status of tobacco plants, and new data has higher freshness. For example, you can define sample priority ,in and is the weight coefficient used to balance the impact of prediction error and data freshness, is the prediction error of the model for this sample, It can be quantified based on the difference between the data collection time and the current time. The smaller the difference, the higher the freshness. Prioritize training of high-priority samples so that the model can correct problems in the current prediction more quickly, while absorbing information from new data in a timely manner and continuously improving prediction performance.
[0052] Data processing method of multispectral sensor: perform spectral dimension reduction on multispectral reflectance curve, use kernel principal component analysis (KPCA) to extract nonlinear features, and generate low-dimensional spectral feature vectors. Multispectral reflectance curve contains data of multiple bands, with high dimensionality and complex nonlinear relationships. KPCA can more effectively extract nonlinear features from data by mapping raw data to high-dimensional feature space and performing principal component analysis in high-dimensional space. The specific steps are as follows: first, define the kernel function ,in The original data Nonlinear mapping function mapped to high-dimensional space. Common kernel functions include Gaussian kernel Etc. Then calculate the kernel matrix , perform eigendecomposition on the kernel matrix ,in is a diagonal matrix of eigenvalues, is the eigenvector matrix. The eigenvector corresponding to the largest eigenvalue is used to calculate the projection coefficient , project the original data in these projection directions to obtain the low-dimensional spectral feature vector , achieving spectral dimension reduction, reducing data redundancy and retaining key information.
[0053] The spectrum-environment correlation model is constructed, and the mapping relationship between spectral features and soil moisture and meteorological parameters is established through partial least squares regression (PLSR). Partial least squares regression can effectively establish a regression model between the dependent variable and multiple independent variables when there is multicollinearity in the independent variables. Suppose the spectral feature matrix is , the environmental parameter matrix composed of soil moisture and meteorological parameters is , PLSR simultaneously decomposes and , extract the pair The component with the greatest explanatory power is used to build a regression model. The specific process is to first calculate and The score vector and , and the load vector and , through iterative calculation, and The covariance between them is maximized. Then the regression coefficient matrix is constructed based on the score vector and the load vector , and we get the regression equation ,in is the residual matrix. Through this model, spectral features can be used to predict soil moisture and meteorological parameters, or spectral data can be analyzed and interpreted based on known environmental parameters.
[0054] The missing spectral data are interpolated based on the mapping relationship, and the adaptive weighted average method is used to fuse the interpolation results and the actual measured values. When there is missing spectral data, the established spectral-environment association model is used to predict the missing value. For example, for a missing spectral band value, the missing value can be predicted by a regression model based on the spectral data of other bands and the corresponding soil moisture and meteorological parameters. Then the adaptive weighted average method is used to fuse the interpolation results and the actual measured values. The adaptive weighted average method dynamically adjusts the weights according to the reliability of the interpolated values and the actual measured values. The reliability can be measured by indicators such as prediction error and coefficient of variation of the data. Assume that the interpolation value is The actual measured value is , the weights are and , the result after fusion ,in and satisfy ,and and Dynamically changes according to the reliability of the data. If the prediction error of the interpolated value is small, it means that the interpolation result is more reliable. On the contrary, if the coefficient of variation of the actual measured value is small, it means that the actual measured value is more stable and reliable. In this way, the missing value problem in multispectral sensor data can be handled more accurately, the data quality can be improved, and more reliable data support can be provided for tobacco plant quantity prediction.
[0055] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0056] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for predicting the number of tobacco plants based on deep learning, characterized in that: include: Collect tobacco field environmental data through multi-source agricultural sensors, the multi-source agricultural sensors include soil moisture sensors, meteorological sensors, lidar point cloud sensors and multi-spectral sensors; perform multi-source feature fusion on the tobacco field environmental data based on a dynamic feature selection network to generate a fused environmental feature vector; input the environmental feature vector into a pre-trained multimodal time series prediction model, the multimodal time series prediction model adopts a spatiotemporal attention mechanism, constructs a spatiotemporal association matrix through time series window division and spatial region division, and models tobacco plant growth trends based on the spatiotemporal association matrix; An adaptive weighted regression model is constructed according to the growth trend parameters output by the multimodal time series prediction model. The adaptive weighted regression model takes the minimum prediction error of the number of tobacco plants and the lowest model complexity as optimization goals, and uses an improved particle swarm optimization algorithm to dynamically adjust the model weights, wherein the improved particle swarm optimization algorithm introduces an inertia weight adaptive attenuation mechanism and a global optimal de-disturbance strategy; the tobacco plant number prediction result is output based on the adaptive weighted regression model.
2. The method according to claim 1, characterized in that Also includes: A hierarchical correction model is constructed according to the prediction results of the number of tobacco plants, and the hierarchical correction model includes a trend layer, a residual layer and a correction layer, wherein the trend layer performs trend smoothing on the prediction results based on a sliding average algorithm, the residual layer dynamically compensates for the prediction residual based on a gated recurrent unit network, and the correction layer performs boundary correction on the final prediction value based on the constrained least squares method to generate optimized tobacco plant number prediction data.
3. The method according to claim 1, characterized in that: The dynamic feature selection network performs multi-source feature fusion on tobacco field environmental data, including: Acquire raw data from multi-source agricultural sensors, the raw data including soil moisture time series, meteorological parameter matrix, laser radar point cloud density distribution data, and multispectral reflectance curve; segment the raw data based on a sliding time window, and extract statistical features of each segment of data, including mean, variance, extreme value, and trend slope; Constructing a feature importance evaluation function, the function calculates the correlation between each feature and the number of tobacco plants through a weighted combination of mutual information entropy and Pearson correlation coefficient; sorting the features based on the correlation, and using a dynamic threshold cutoff method to screen features with high correlation; A feature fusion network is constructed, which includes parallel one-dimensional convolution branches and fully connected branches, wherein the one-dimensional convolution branches extract temporal features through multi-scale convolution kernels, and the fully connected branches extract spatial features through nonlinear mapping; an adaptive weighting mechanism is used to fuse the branch outputs to generate a fused environmental feature vector.
4. The method according to claim 1, characterized in that The training method of the multimodal time series prediction model includes: A spatiotemporal correlation matrix was constructed, the time dimension was divided into multiple overlapping windows, the spatial dimension was divided into gridded regions, and the spatiotemporal correlation weights were calculated based on the covariance between the environmental characteristics within the window and the number of tobacco plants between regions; Design a spatiotemporal attention module, extract temporal dependency and spatial correlation respectively through a multi-head self-attention mechanism, and use residual connections and layer normalization to optimize the attention output; A hybrid prediction network is constructed, which includes a long short-term memory network branch and a Transformer branch, wherein the long short-term memory network branch is used to capture local temporal patterns, and the Transformer branch is used to model global spatiotemporal dependencies; a gated fusion unit is used to dynamically weight and merge branch outputs to generate growth trend parameters.
5. The method according to claim 1, characterized in that The improved particle swarm optimization algorithm dynamically adjusts the model weights including: Initialize the particle swarm parameters, each particle represents a set of weight vectors, and calculate the prediction error and complexity penalty of the weight vector through the fitness function; Adopting an inertia weight adaptive attenuation mechanism, the mechanism dynamically adjusts the inertia weight according to the number of iterations and particle diversity, and its attenuation function is a piecewise exponential function; Design a global optimal solution perturbation strategy. When the particle swarm falls into a local optimum, add Gaussian noise perturbation to the global optimal solution and re-evaluate the fitness through neighborhood search. The particle swarm is updated based on the elite retention strategy, the first K particles with the highest fitness are retained to enter the next generation directly, and the remaining particles generate a new population through crossover and mutation operations.
6. The method according to claim 2, characterized in that The residual layer of the hierarchical correction model dynamically compensates the prediction residual based on the gated recurrent unit network, including: Construct a residual sequence, take the difference between the predicted result and the actual number of tobacco plants as input, and map the residual sequence to a high-dimensional space through a time embedding layer; Design a gated recurrent unit network, the network includes a reset gate and an update gate, and dynamically adjusts the transmission ratio of historical residual information through a gating mechanism; An attention enhancement mechanism is adopted to introduce temporal attention weights in the hidden state to perform reinforcement learning on the residual features of key time points.
7. The method according to claim 2, characterized in that The correction layer performs boundary correction on the final prediction value based on the constrained least squares method, including: Constructing boundary constraints, the constraints including physical upper and lower limits of the number of tobacco plants and the maximum rate of change of predicted values at adjacent time points; Design a constrained optimization objective function, taking the square error between the predicted value and the corrected value as the target term, and adding the boundary constraint as a penalty term to the Lagrange multiplier; The iterative projection method is used to solve the constrained optimization problem by alternately updating the correction value and the multiplier parameter until the convergence condition is met.
8. The method according to claim 1, characterized in that Also includes real-time prediction update methods: Based on the online learning framework, the newly added tobacco field environmental data is input into the sliding time window, and the highly correlated feature set is updated through the incremental feature selection algorithm; The multimodal time series prediction model is fine-tuned using an elastic weight update strategy, which calculates parameter importance through the Fisher information matrix and limits the update amplitude of important parameters. Build a dynamic priority queue to prioritize training samples based on prediction error and data freshness, and give priority to training high-priority samples.
9. The method according to claim 1, characterized in that: The data processing method of the multi-spectral sensor comprises: The multi-spectral reflectance curve is subjected to spectral dimension reduction, and nonlinear features are extracted using kernel principal component analysis to generate low-dimensional spectral feature vectors; Construct a spectrum-environment correlation model and establish the mapping relationship between spectral characteristics and soil moisture and meteorological parameters through partial least squares regression; The missing spectral data are interpolated based on the mapping relationship, and the adaptive weighted average method is used to fuse the interpolation results with the actual measured values.
Citation Information
Patent Citations
Oil and gas field energy yield intelligent prediction method and system based on deep learning
CN118052316A
Subway passenger flow volume prediction method and device based on DCG and double-branch parallel
CN118469079A
Crop growth prediction method and system based on artificial intelligence and crop growth model
CN118709789A
Intelligent agricultural planting decision support implementation method based on big data analysis
CN118863578A
Artificial intelligence-based crop yield prediction method and system
CN119312989A
Cited By
Agricultural environment intelligent regulation and control method and system based on cloud platform
CN120238842A
Method for predicting content of supercooled water in cloud based on deep learning and spatio-temporal data driving
CN120255027A
Rice quality evaluation method and system based on spectral data analysis
CN120408121A
Remote monitoring and management rice seedling raising, irrigation and plant protection system, computer equipment and medium
CN120494761A
Spatial-temporal feature fusion modeling method for multi-source sensing data
CN121031387A