A Method and Apparatus for Predicting Tobacco Yield in Mountainous Areas Based on Spectral Feature Transfer Learning
By using spectral feature transfer learning and regional factor optimization, the problem of sample acquisition in mountain tobacco yield prediction was solved, and higher prediction accuracy was achieved.
Patent Information
- Application Number
- CN202511133944.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-14
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-14
AI Technical Summary
In mountainous terrain, tobacco leaves grow at different rates, making it difficult to obtain representative sampling information, resulting in low accuracy in predicting tobacco yield using existing technologies.
By using spectral feature transfer learning, the model is trained using historical data from plains areas, and mountainous areas are divided into regions. Regional factors are calculated to optimize prediction information and improve prediction accuracy.
This reduced the need for training samples in mountainous areas and improved the accuracy and representativeness of tobacco yield prediction.
Smart Images

Figure CN120726490B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tobacco production technology, specifically to a method and apparatus for predicting the yield of tobacco leaves in mountainous areas based on spectral feature transfer learning. Background Technology
[0002] By collecting spectral data of tobacco canopy using remote sensing or ground-based spectrometers, and combining this data with the correlation between physiological parameters such as chlorophyll content and leaf nitrogen levels and spectral reflectance, a mathematical model of spectral characteristics and yield can be constructed. Through machine learning or statistical methods, accurate prediction of tobacco yield can be achieved. This allows for early understanding of tobacco yield trends, helping tobacco farmers to rationally plan harvesting and storage, providing a scientific basis for tobacco companies to formulate procurement plans, optimizing planting and management strategies, improving resource utilization efficiency, ensuring the stable development of the tobacco industry, and promoting increased income for tobacco farmers.
[0003] When predicting tobacco yield, a large amount of sample data is needed to train the prediction model. For example, patent publication number CN115761507A describes a method and apparatus for predicting tobacco yield based on hyperspectral remote sensing and leaf weight. This method includes the following steps: Step S1: Using the tobacco maturity period as the yield prediction period, acquire hyperspectral remote sensing data, tobacco plant leaf weight, and tobacco yield data from sampling points; Step S2: Construct a tobacco plant leaf weight estimation model using the hyperspectral data and tobacco plant leaf weight data from the sampling points; Step S3: Construct a tobacco yield prediction model using the tobacco plant leaf weight and tobacco yield data from the sampling points; Step S4: Acquire hyperspectral remote sensing data of the tobacco field to be estimated; Step S5: Input the hyperspectral data of the tobacco field to be estimated into the tobacco plant leaf weight estimation model to estimate the leaf weight, and then input the estimated tobacco plant leaf weight into the tobacco yield prediction model to obtain the tobacco yield of the tobacco field to be estimated. This method fully utilizes the relationship between tobacco plant leaf weight and tobacco yield, and combined with the advantages of hyperspectral remote sensing technology, can significantly improve the efficiency and accuracy of tobacco yield estimation.
[0004] When training a model, the difficulty of obtaining samples can also limit its effectiveness. When it is difficult to obtain a large amount of sample data, the need for a large number of samples can be reduced through model transfer. The above methods and methods based on the same principle use spectral data of sampling points to predict yield. In plains, the growth of tobacco leaves is not significantly different, and the sampling points are highly representative. However, in mountainous terrain, the growth of tobacco leaves varies in different locations, making it difficult to obtain representative sampling information and resulting in lower prediction accuracy. Summary of the Invention
[0005] The purpose of this invention is to provide a method and apparatus for predicting the yield of tobacco leaves in mountainous areas based on spectral feature transfer learning, so as to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for predicting the yield of tobacco leaves in mountainous areas based on spectral feature transfer learning, comprising:
[0007] Region division: The target domain is divided into regions according to different location information, and each region is labeled with a region number;
[0008] Data collection: Acquire historical data information from the source region, including spectral and yield information; acquire multiple sample data from different regions, including spectral, topographic, and yield information; acquire multiple prediction information from different regions, including spectral and topographic information;
[0009] Training and Transfer of Source Domain Model: Using spectral information as input and yield information as output, a source domain prediction model is established through historical data of the source domain. Sample data of a selected region is used to freeze the general layer of the source domain prediction model. Topographic information is added as input information to perform secondary training on the source domain prediction model to obtain the preliminary prediction model corresponding to each region. The region with the highest accuracy is selected and marked as the first region. The preliminary prediction model corresponding to the first region is marked as the final prediction model.
[0010] Calculate the region factor: Calculate the region factor of each region relative to the first region using the region factor calculation method, which is used to reflect the difference in input information between each region and the first region;
[0011] Regional factor validation: The regional factor validation method is used to validate the regional factors using sample data information. If the validation fails, a new region is selected as the first region and the regional factors are recalculated until the validation passes.
[0012] Forecast information merging: Based on regional factors, comprehensive information that is highly representative of the forecast information is obtained through comprehensive information acquisition methods;
[0013] Output: Input the comprehensive information into the final prediction model and output the prediction results.
[0014] Preferably, the method for calculating the regional factor includes:
[0015] Based on the final prediction model, regional factors are set for the input information, and the input information is weighted by regional factors to establish a false value prediction model.
[0016] A regional factor calculation database is established using spectral and topographic information of the target area as input information and yield information as output information.
[0017] The false value prediction model is optimized by using a regional factor calculation database to obtain the regional factors of the target region.
[0018] Preferably, the method for calculating the regional factor includes:
[0019] Based on the final prediction model, a vector-formatted regional factor is set for the input information, and the input information is multiplied element-wise with the vector-formatted regional factor to establish a false value prediction model.
[0020] A regional factor calculation database is established using spectral and topographic information of the target area as input information and yield information as output information.
[0021] The false value prediction model is optimized by using a regional factor calculation database to obtain the regional factors of the target region.
[0022] Preferably, the comprehensive information acquisition method includes:
[0023] The spectral and topographic information of the target area are weighted and calculated based on regional factors to obtain the optimized information of the target area.
[0024] Calculate the average value of the optimization information in different regions to obtain comprehensive information that is highly representative of the prediction information.
[0025] Preferably, the comprehensive information acquisition method includes:
[0026] The input information is element-wise multiplied with the region factor in vector format to obtain the optimization information of the target region.
[0027] Calculate the average value of the optimization information in different regions to obtain comprehensive information.
[0028] Preferably, the regional factor verification method includes:
[0029] The sample data is randomly divided into several groups, and the groups are used as the unit of calculation.
[0030] By using a comprehensive information acquisition method, comprehensive information about the samples is obtained, and this comprehensive information is input into the final prediction model to obtain the sample prediction results.
[0031] Calculate the average yield information in the sample data, compare it with the sample prediction results, and if the difference is less than the preset error threshold, it is judged as initially qualified.
[0032] If the initial pass probability of several groups reaches the preset probability threshold, the regional factor is deemed qualified; otherwise, a new region is selected as the first region and the regional factor is recalculated.
[0033] Preferably, the training of the source domain model and transfer specifically includes:
[0034] The source domain prediction model was selected as a multiple linear regression model.
[0035] Based on historical data, the multiple linear regression model was trained using the least squares method to determine the regression coefficients of different elements;
[0036] Various elements of terrain information are added to the multiple linear regression model, and different regression coefficients are assigned to each element.
[0037] The sample data information in each region is randomly divided into a training set and a validation set according to a preset ratio, with each region as the unit.
[0038] Keeping the original regression coefficients unchanged, the multiple linear regression model is trained a second time using the least squares method through the training set of one region to determine the regression coefficients of each element in the terrain information, thereby obtaining a preliminary prediction model for the target region.
[0039] Using the validation set of the target region, the prediction accuracy of the preliminary prediction model for the target region is calculated, and the region with the highest prediction accuracy is selected as the first region. The preliminary prediction model corresponding to the first region is marked as the final prediction model.
[0040] Preferably, the training of the source domain model and transfer specifically includes:
[0041] The source domain prediction model is selected as a CNN model;
[0042] Based on historical data, MSE is used as the loss function, and the CNN model is trained using the gradient descent algorithm.
[0043] Freeze the convolutional layers of the CNN model, replace the last fully connected layer with a new fully connected layer. The input dimension of the new fully connected layer is determined based on the output of the previous layer, and the output dimension is 1. At the same time, add an input channel for terrain information to the input layer.
[0044] The sample data information in each region is randomly divided into a training set and a validation set according to a preset ratio, with each region as the unit.
[0045] Using the training set of one region, MSE is used as the loss function, and the CNN model is trained using the gradient descent algorithm to obtain a preliminary prediction model for the target region.
[0046] Using the validation set of the target region, the prediction accuracy of the preliminary prediction model for the target region is calculated, and the region with the highest prediction accuracy is selected as the first region. The preliminary prediction model corresponding to the first region is marked as the final prediction model.
[0047] Compared with the prior art, the beneficial effects of the present invention are:
[0048] By using transfer learning of spectral features, the source domain prediction model trained on historical source domain data from plains areas is applied to yield prediction in mountainous areas, reducing the need for training samples in mountainous regions. Furthermore, the mountainous regions are divided into regions, and regional factors for different regions are calculated. The prediction information for different regions is optimized through regional factors and comprehensive information acquisition methods to obtain comprehensive information that is highly representative of the prediction information, thereby improving the accuracy of yield prediction.
[0049] Meanwhile, the sample data is randomly divided into several groups, and the groups are used as the calculation unit. The comprehensive information of the samples is obtained through a comprehensive information acquisition method. The comprehensive information of the samples is input into the final prediction model to obtain the sample prediction results. The sample prediction results are used to determine whether the regional factors are qualified. If the sample prediction results differ greatly from the true values, it indicates that the comprehensive information is not representative of the sample data information. The regional factors are then determined to be unqualified. A new region is selected as the first region and the regional factors are recalculated, which can further ensure the accuracy of the prediction results. Attached Figure Description
[0050] Figure 1 This is a flowchart illustrating the method for predicting tobacco yield in mountainous areas according to the present invention.
[0051] Figure 2 This is a flowchart illustrating the regional factor calculation method in this invention;
[0052] Figure 3 This is a flowchart illustrating the regional factor verification method in this invention.
[0053] Figure 4 This is a schematic diagram of the process of training the source domain model and transferring it in this invention. Detailed Implementation
[0054] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] In this application, for ease of understanding, the method steps used do not necessarily need to be executed in the order of steps in this embodiment during actual operation. In other embodiments, these steps may be performed simultaneously or in a different order.
[0056] Example 1:
[0057] When establishing a tobacco yield prediction model for mountainous areas, obtaining sufficient sample size can be challenging. This can be mitigated by transferring prediction models from plains to mountainous regions, reducing the need for a large sample size. Furthermore, in plains, tobacco growth patterns are relatively uniform, making sampling points highly representative. However, in mountainous areas, tobacco growth varies across locations, making random sampling unreliable. Dividing the mountainous region into sub-regions, calculating the differences between each sub-region, and then optimizing the sampling data for different sub-regions based on these differences can improve the representativeness of the sampling data and thus enhance the accuracy of the prediction results.
[0058] like Figures 1-4 As shown, this invention provides a technical solution: a method for predicting the yield of tobacco leaves in mountainous areas based on spectral feature transfer learning, comprising:
[0059] Region division: The target domain is divided into regions according to different location information, and each region is labeled with a region number;
[0060] Data collection: Acquire historical data information from the source region, including spectral and yield information; acquire multiple sample data from different regions, including spectral, topographic, and yield information; acquire multiple prediction information from different regions, including spectral and topographic information;
[0061] Training and Transfer of Source Domain Model: Using spectral information as input and yield information as output, a source domain prediction model is established through historical data of the source domain. Sample data of a selected region is used to freeze the general layer of the source domain prediction model. Topographic information is added as input information to perform secondary training on the source domain prediction model to obtain the preliminary prediction model corresponding to each region. The region with the highest accuracy is selected and marked as the first region. The preliminary prediction model corresponding to the first region is marked as the final prediction model.
[0062] Calculate the region factor: Calculate the region factor of each region relative to the first region using the region factor calculation method, which is used to reflect the difference in input information between each region and the first region;
[0063] Regional factor validation: The regional factor validation method is used to validate the regional factors using sample data information. If the validation fails, a new region is selected as the first region and the regional factors are recalculated until the validation passes.
[0064] Forecast information merging: Based on regional factors, comprehensive information that is highly representative of the forecast information is obtained through comprehensive information acquisition methods;
[0065] Output: Input the comprehensive information into the final prediction model and output the prediction results.
[0066] It should be noted that regional division can be based on location data such as different light intensities, different altitudes, and different temperatures and humidity levels. Locations with similar data should be grouped into one region. The more refined the division, the more accurate the prediction of tobacco yield. The specific division method can be determined based on the terrain for collection, which will not be elaborated here.
[0067] Furthermore, since the source region is a plain and the target region is a mountainous region, when collecting data, spectral information can be detected by a spectrometer (in this embodiment, an ASD FieldSpec spectrometer is used to collect spectral data). For spectral information in production information and historical data, it can be queried through production records and data in the source region, or on-site measurements and records can be made in advance.
[0068] In addition, when conducting spectral detection, at each sampling point, select multiple functional leaves from the middle of the plant that are healthy and free from pests and diseases. For each leaf, measure three different positions on the front of the leaf (leaf tip, leaf middle, and leaf base). Measure each position multiple times and take the average value as the spectral data of that leaf. Moreover, in the sampling of the target domain (mountainous terrain), it is necessary to record the specific area of each sampling.
[0069] like Figure 4 As shown, the training of the source domain model and its transfer specifically includes:
[0070] The source domain prediction model was selected as a multiple linear regression model.
[0071] Based on historical data, the multiple linear regression model was trained using the least squares method to determine the regression coefficients of different elements;
[0072] Various elements of terrain information are added to the multiple linear regression model, and different regression coefficients are assigned to each element.
[0073] The sample data information in each region is randomly divided into a training set and a validation set according to a preset ratio, with each region as the unit.
[0074] Keeping the original regression coefficients unchanged, the multiple linear regression model is trained a second time using the least squares method through the training set of one region to determine the regression coefficients of each element in the terrain information, thereby obtaining a preliminary prediction model for the target region.
[0075] Using the validation set of the target region, the prediction accuracy of the preliminary prediction model for the target region is calculated, and the region with the highest prediction accuracy is selected as the first region. The preliminary prediction model corresponding to the first region is marked as the final prediction model.
[0076] It should be noted that, for ease of understanding, simplified simulation data is used as follows:
[0077] In the historical data (spectral data obtained through the ASD FieldSpec spectrometer, with a wavelength range of 350-2500nm and an accuracy of 1nm; for ease of calculation, this implementation only uses the wavelengths of 470nm, 650nm, and 850nm):
[0078] Sample 1: The reflectance at 470nm is 0.13, the reflectance at 650nm is 0.09, the reflectance at 850nm is 0.33, and the tobacco yield is 188 kg / mu.
[0079] Sample 2: The reflectance at 470nm is 0.13, the reflectance at 650nm is 0.08, the reflectance at 850nm is 0.36, and the tobacco yield is 192 kg / mu;
[0080] Sample 3: The reflectance at 470nm is 0.15, the reflectance at 650nm is 0.07, the reflectance at 850nm is 0.40, and the tobacco yield is 198 kg / mu.
[0081] ...
[0082] In the sample data information (the number of samples is determined based on the area of the region; the larger the sample size, the more samples are taken, and each sample represents the same area):
[0083] Area 1:
[0084] Sample a: The reflectance of the 470nm band is 0.10, the reflectance of the 650nm band is 0.1, the reflectance of the 850nm band is 0.33, the slope type is 1 (sunny slope is numbered 1, shady slope is numbered 2), the altitude is 350m, and the tobacco yield is 187kg / mu.
[0085] Sample b: The reflectance of the 470nm band is 0.12, the reflectance of the 650nm band is 0.08, the reflectance of the 850nm band is 0.36, the slope type is 1 (sunny slope is numbered 1, shady slope is numbered 2), the altitude is 355m, and the tobacco yield is 190kg / mu.
[0086] Sample c: The reflectance of the 470nm band is 0.12, the reflectance of the 650nm band is 0.07, the reflectance of the 850nm band is 0.38, the slope type is 1 (sunny slope is numbered 1, shady slope is numbered 2), the altitude is 355m, and the tobacco yield is 191kg / mu.
[0087] ...;
[0088] Area Two:
[0089] ...;
[0090] Establish a multiple linear regression model:
[0091]
[0092] in This represents the predicted value for tobacco yield in the source domain. , , These represent the reflectance at 470nm, 650nm, and 850nm, respectively. , , These represent the regression coefficients for reflectance at 470nm, 650nm, and 850nm, respectively. This represents the intercept term in a multiple linear regression model.
[0093] The multiple linear regression model is trained using multiple samples from historical data. The training method employs the least squares approach, and the specific process, based on existing technology, will not be elaborated further. It is assumed that the training yields the following results: ≈175.43; ≈113.52; ≈−433.74; ≈104.19.
[0094] Since the reflectivity at 470nm, 650nm, and 850nm are all common properties, the intercept term is removed from the multiple linear regression model during model transfer. All coefficients were frozen, and terrain information (slope and elevation) was added to obtain a new multiple linear regression model:
[0095]
[0096] in This represents the predicted value for tobacco yield within the target domain. , , , , These represent the reflectance at 470nm, 650nm, and 850nm, respectively, as well as the slope and altitude. and These represent the regression coefficients for slope shape and elevation, respectively. This represents the intercept term in a multiple linear regression model.
[0097] Taking area number one as an example:
[0098] The samples in region 1 are divided into training and validation sets in a ratio of 8:2 (in actual use, when the number of samples is large, a variety of allocation methods such as 7:3 or 9:1 can be used, and the specific allocation ratio is not limited).
[0099] The new multiple linear regression model is trained using samples from the training set in region one. The training method employs the least squares approach, and the specific process is based on existing technology and will not be elaborated further. The training yields the following results: ≈224.30; ≈−12.27; ≈0.0047, thus obtaining the preliminary prediction model for region one.
[0100] Then, using samples from the validation set in region one, the prediction accuracy of the preliminary prediction model for region one is verified. In this embodiment, the coefficient of determination (R²) is used. 2 The accuracy of the verification is determined by the calculation process, which is based on existing technology. The result is assumed to be R. 2 ≈0.96.
[0101] Similarly, when calculating region two, a preliminary prediction model for region two can be calculated, and the coefficient of determination (R²) for region two can be calculated. 2 Comparing the determination coefficients of region 1 and region 2, assuming that the determination coefficient of region 1 is larger, the preliminary prediction model of region 1 will be used as the final prediction model, and region 1 will be designated as the first region.
[0102] like Figure 2 As shown, the methods for calculating regional factors include:
[0103] Based on the final prediction model, regional factors are set for the input information, and the input information is weighted by regional factors to establish a false value prediction model.
[0104] A regional factor calculation database is established using spectral and topographic information of the target area as input information and yield information as output information.
[0105] The false value prediction model is optimized by using a regional factor calculation database to obtain the regional factors of the target region.
[0106] It should be noted that, for ease of understanding, the following simulated data is used:
[0107] The final prediction model obtained from the above calculations will be used;
[0108] Set the region factor as The false value prediction model can be obtained as follows:
[0109]
[0110] The meanings of each letter are the same as those mentioned above, and will not be repeated here.
[0111] Using spectral information (reflectance at 470nm, 650nm, and 850nm) and topographic information (slope and elevation) from samples in region 2 as input and yield information as output, the false prediction model is trained using the least squares method. The specific process is based on existing technology and will not be elaborated further. It is assumed that the training yields... =1.15 (sample data for region 2 is not shown; this is a hypothetical value). Therefore, the region factor of region 2 relative to region 1 is 1.15. The larger the region factor, the greater the difference between the samples collected in region 2 and region 1.
[0112] Comprehensive information acquisition methods include:
[0113] The spectral and topographic information of the target area are weighted and calculated based on regional factors to obtain the optimized information of the target area.
[0114] Calculate the average value of the optimization information in different regions to obtain comprehensive information that is highly representative of the prediction information.
[0115] It should be noted that, for ease of understanding, the following simulated data is used:
[0116] Using the regional factors calculated above ,and =1.15;
[0117] In the sample data information:
[0118] Area Two:
[0119] Sample d: 470nm band reflectance is 0.04, 650nm band reflectance is 0.09, 850nm band reflectance is 0.25, slope type is 2 (sunny slope is numbered 1, shady slope is numbered 2), altitude is 354m, tobacco yield is 186kg / mu.
[0120] By weighting all data in region 2 using regional factors, the optimization information can be obtained (represented by a vector): (0.046, 0.104, 0.288, 2.3, 407.1), corresponding to each data item.
[0121] After calculating each sample in each region, the average value of the optimization information is obtained to obtain the comprehensive information. Assuming that there is only one sample in region 2 and only one sample a in region 1 (the region factor of region 1 is 1, and its difference from itself is 0, which means that no optimization is needed), then the comprehensive information is (0.073, 0.102, 0.309, 1.62, 378.55).
[0122] When this comprehensive information is fed into the final prediction model, the predicted tobacco yield is 202 kg / mu (due to the small sample size and large error, the actual yield will be closer to 186.5 kg / mu (the mean of sample d and sample a, where sample a and sample b represent the same area)).
[0123] like Figure 3 As shown, the regional factor validation methods include:
[0124] The sample data is randomly divided into several groups, and the groups are used as the unit of calculation.
[0125] By using a comprehensive information acquisition method, comprehensive information about the samples is obtained, and this comprehensive information is input into the final prediction model to obtain the sample prediction results.
[0126] Calculate the average yield information in the sample data, compare it with the sample prediction results, and if the difference is less than the preset error threshold, it is judged as initially qualified.
[0127] If the initial pass probability of several groups reaches the preset probability threshold, the regional factor is deemed qualified; otherwise, a new region is selected as the first region and the regional factor is recalculated.
[0128] It should be noted that, for ease of understanding, the following simulated data is used:
[0129] Using the sample data and regional factors from Region 1 and Region 2, the overall average tobacco yield of the sample data is 195 kg / mu, the preset error threshold is 8 kg / mu (no specific limit is imposed based on actual needs or past experience), and the preset probability threshold is 92% (no specific limit is imposed based on actual needs or past experience).
[0130] Random assignments are made, assuming that samples a and d are assigned to the same group;
[0131] The comprehensive information for this group was obtained using a comprehensive information acquisition method. The comprehensive information for this group (the comprehensive information for samples a and d was calculated previously and will not be repeated here) is (0.073, 0.102, 0.309, 1.62, 378.55). Substituting the comprehensive information into the final prediction model, the predicted tobacco yield is 202 kg / mu, with an error of 7 kg / mu, which is less than the preset error threshold. Therefore, this group is preliminarily qualified.
[0132] Assuming there are 50 groups in total, 46 of them are initially qualified, with a qualification rate of 92%, which reaches the preset probability threshold. Therefore, the regional factor is qualified, indicating that the regional factor can accurately represent the difference between region 2 and region 1, and can optimize the sample data information of region 2, thereby improving the representativeness of the sample data information of region 2 to the overall sample data information.
[0133] When the regional factors of each region can optimize the sample data information of the corresponding region, the comprehensive information obtained through all prediction information has a strong representativeness of the overall information of the target domain, which can further improve the accuracy of prediction.
[0134] Example 2:
[0135] In Example 1, the calculated regional factor is a single value representing the difference between Region 1 and Region 2. However, the sample data information of Region 1 and Region 2 contains multiple data types, and the contribution of multiple data types to the prediction of tobacco yield is different. Optimization using the same regional factor results in low accuracy. Based on this, this example provides another method for calculating regional factors and a comprehensive information acquisition method, which provides different optimization ratios for different data types to further increase the optimization effect of regional factors and further improve the accuracy of prediction results.
[0136] Methods for calculating regional factors include:
[0137] Based on the final prediction model, a vector-formatted regional factor is set for the input information, and the input information is multiplied element-wise with the vector-formatted regional factor to establish a false value prediction model.
[0138] A regional factor calculation database is established using spectral and topographic information of the target area as input information and yield information as output information.
[0139] The false value prediction model is optimized by using a regional factor calculation database to obtain the regional factors of the target region.
[0140] It should be noted that, for ease of understanding, the following simulated data is used:
[0141] The final prediction model calculated using Example 1 is used;
[0142] Set the region factor as = The false value prediction model can be obtained as follows:
[0143]
[0144] The meanings of each letter are the same as those mentioned above, and will not be repeated here.
[0145] Using spectral information (reflectance at 470nm, 650nm, and 850nm) and topographic information (slope and elevation) from samples in region 2 as input and yield information as output, the false prediction model is trained using the least squares method. The specific process is based on existing technology and will not be elaborated further. It is assumed that the training yields... = (1.15, 1.6, 0.456, 1.446, 1.014724) (sample data for region 2 is not shown; these are hypothetical values). Therefore, the region factor for region 2 relative to region 1 is (1.15, 1.6, 0.456, 1.446, 1.014724). The larger the element in the region factor, the greater its contribution to yield prediction, and the greater the difference between the corresponding elements in the samples collected from region 2 and region 1.
[0146] Comprehensive information acquisition methods include:
[0147] The spectral and topographic information of the target area are weighted and calculated based on regional factors to obtain the optimized information of the target area.
[0148] Calculate the average value of the optimization information in different regions to obtain comprehensive information that is highly representative of the prediction information.
[0149] It should be noted that, for ease of understanding, the following simulated data is used:
[0150] Using the regional factors calculated above ,and = (1.15, 1.6, 0.456, 1.446, 1.014724).
[0151] In the sample data information:
[0152] Area Two:
[0153] Sample d: 470nm band reflectance is 0.04, 650nm band reflectance is 0.09, 850nm band reflectance is 0.25, slope type is 2 (sunny slope is numbered 1, shady slope is numbered 2), altitude is 354m, tobacco yield is 186kg / mu.
[0154] By weighting all data in region 2 using regional factors, the optimization information can be obtained (represented by a vector): (0.046, 0.144, 0.114, 2.892, 359.212), corresponding to each data item.
[0155] After calculating each sample in each region, the average value of the optimization information is obtained to obtain the comprehensive information. Assuming that there is only one sample in region 2 and only one sample a in region 1 (the region factor of region 1 is 1, and its difference from itself is 0, which means that no optimization is needed), then the comprehensive information is (0.073, 0.122, 0.222, 1.946, 354.606).
[0156] By incorporating this comprehensive information into the final prediction model, the predicted tobacco yield is 180.56 kg / mu, which is closer to the actual value than the 202 kg / mu calculated in Example 1, indicating higher prediction accuracy.
[0157] Example 3:
[0158] In Example 1, a multiple linear regression model was used to predict tobacco yield. However, there are many external factors that affect yield and many factors that need to be considered. The multiple linear regression model has certain limitations in predicting yield (some influencing factors are not linearly distributed with the prediction results), and the prediction performance is not ideal. Therefore, based on Example 1, this embodiment provides another prediction model to improve the prediction accuracy.
[0159] Training the source domain model and transferring it includes:
[0160] The source domain prediction model is selected as a CNN model;
[0161] Based on historical data, MSE is used as the loss function, and the CNN model is trained using the gradient descent algorithm.
[0162] Freeze the convolutional layers of the CNN model, replace the last fully connected layer with a new fully connected layer. The input dimension of the new fully connected layer is determined by the output of the previous layer, and the output dimension is 1. Simultaneously, add an input channel for terrain information to the input layer.
[0163] The sample data information in each region is randomly divided into a training set and a validation set according to a preset ratio, with each region as the unit.
[0164] Using the training set of one region, MSE is used as the loss function, and the CNN model is trained using the gradient descent algorithm to obtain a preliminary prediction model for the target region.
[0165] Using the validation set of the target region, the prediction accuracy of the preliminary prediction model for the target region is calculated, and the region with the highest prediction accuracy is selected as the first region. The preliminary prediction model corresponding to the first region is marked as the final prediction model.
[0166] It should be noted that, for ease of understanding, the following simulated data is used:
[0167] When training a CNN model using historical data from the source domain, the specific parameter settings are as follows:
[0168] Network structure:
[0169] Convolutional layer 1: 32 filters, 5×5 kernel size, ReLU activation function. Pooling layer 1: Max pooling, 2×2 kernel size, stride of 2.
[0170] The second convolutional layer has 64 filters, a 3×3 kernel, and uses ReLU as the activation function. The second pooling layer uses max pooling with a 2×2 kernel and a stride of 2.
[0171] Fully connected layer: 128 neurons, with ReLU activation function.
[0172] Output layer: 1 neuron, used to output the predicted yield value.
[0173] Training parameters:
[0174] Optimizer: Adam, initial learning rate set to 0.001, decaying to 0.9 every 50 epochs.
[0175] Loss function: Mean Squared Error (MSE).
[0176] Batch size: 32.
[0177] Number of training epochs: 200.
[0178] Migration phase operations:
[0179] The samples from each region were divided into a training set and a validation set in an 8:2 ratio.
[0180] When transferring a CNN model using one of the training sets:
[0181] Network adjustments: Freeze the first two convolutional layers of the CNN model, replace the last fully connected layer with a new fully connected layer. The input dimension of the new fully connected layer is determined based on the output of the previous layer, and the output dimension is 1. Simultaneously, add an input channel for terrain features to the input layer.
[0182] Training optimization:
[0183] Optimizer: Still using Adam, but with the learning rate adjusted to 0.0001.
[0184] Loss function: In order to balance the weights of different samples, weighted mean squared error (WMSE) is used, and samples with larger output fluctuations are given higher weights.
[0185] Training strategy: Early stopping is adopted. Training is stopped when the loss on the validation set no longer decreases for 10 consecutive epochs to prevent overfitting.
[0186] Through the above training, CNN models (preliminary prediction models) for different regions can also be obtained. (The training and transfer of CNN models are existing technical means. The specific principles and processes will not be elaborated here. The above parameter settings are only one of the parameter adjustment methods. There are no actual restrictions on the parameter adjustment methods. Other parameter adjustment methods can also be used.)
[0187] To verify the accuracy of the preliminary prediction model for each region, this embodiment uses the coefficient of determination (R²). 2 To determine the accuracy of the verification, the calculation process uses existing technology. Assume the calculation result for one region is R. 2 The coefficient of determination is approximately 0.98, and this region has the highest coefficient of determination. Therefore, the preliminary prediction model (CNN model) for this region is used as the final prediction model, and this region is designated as the first region.
[0188] CNN models, through activation functions such as ReLU, enable the model to fit arbitrarily complex nonlinear mappings, making them suitable for modeling complex patterns in data. They are easier and more accurate than multiple linear regression models when dealing with large volumes of data and nonlinear data. In addition, other data models can be used when selecting a model. This embodiment and Embodiment 1 do not restrict the types of models that can be selected.
[0189] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended embodiments and their equivalents.
Claims
1. A method for predicting tobacco yield in mountainous areas based on spectral feature transfer learning, including: Region division: The target domain is divided into regions according to different location information, and each region is labeled with a region number; Data collection: Acquire historical data information from the source region, including spectral and yield information; acquire multiple sample data from different regions, including spectral, topographic, and yield information; acquire multiple prediction information from different regions, including spectral and topographic information; Its features are: Training and Transfer of Source Domain Model: Using spectral information as input and yield information as output, a source domain prediction model is established through historical data of the source domain. Sample data of a selected region is used to freeze the general layer of the source domain prediction model. Topographic information is added as input information to perform secondary training on the source domain prediction model to obtain the preliminary prediction model corresponding to each region. The region with the highest accuracy is selected and marked as the first region. The preliminary prediction model corresponding to the first region is marked as the final prediction model. Calculate the region factor: Calculate the region factor of each region relative to the first region using the region factor calculation method, which is used to reflect the difference in input information between each region and the first region; Regional factor validation: The regional factor validation method is used to validate the regional factors using sample data information. If the validation fails, a new region is selected as the first region and the regional factors are recalculated until the validation passes. Forecast information merging: Based on regional factors, comprehensive information that is highly representative of the forecast information is obtained through comprehensive information acquisition methods; Output: Input the comprehensive information into the final prediction model and output the prediction results.
2. The method for predicting the yield of tobacco leaves in mountainous areas based on spectral feature transfer learning according to claim 1, characterized in that: The method for calculating the regional factor includes: Based on the final prediction model, regional factors are set for the input information, and the input information is weighted by regional factors to establish a false value prediction model. A regional factor calculation database is established using spectral and topographic information of the target area as input information and yield information as output information. The false value prediction model is optimized by using a regional factor calculation database to obtain the regional factors of the target region.
3. The method for predicting the yield of tobacco leaves in mountainous areas based on spectral feature transfer learning according to claim 1, characterized in that: The method for calculating the regional factor includes: Based on the final prediction model, a vector-formatted regional factor is set for the input information, and the input information is multiplied element-wise with the vector-formatted regional factor to establish a false value prediction model. A regional factor calculation database is established using spectral and topographic information of the target area as input information and yield information as output information. The false value prediction model is optimized by using a regional factor calculation database to obtain the regional factors of the target region.
4. The method for predicting the yield of tobacco leaves in mountainous areas based on spectral feature transfer learning according to claim 2, characterized in that: The comprehensive information acquisition method includes: The spectral and topographic information of the target area are weighted and calculated based on regional factors to obtain the optimized information of the target area. Calculate the average value of the optimization information in different regions to obtain comprehensive information that is highly representative of the prediction information.
5. The method for predicting the yield of tobacco leaves in mountainous areas based on spectral feature transfer learning according to claim 3, characterized in that: The comprehensive information acquisition method includes: The input information is element-wise multiplied with the region factor in vector format to obtain the optimization information of the target region. Calculate the average value of the optimization information in different regions to obtain comprehensive information.
6. The method for predicting the yield of tobacco leaves in mountainous areas based on spectral feature transfer learning according to claim 1, characterized in that: The regional factor validation method includes: The sample data is randomly divided into several groups, and the groups are used as the unit of calculation. By using a comprehensive information acquisition method, comprehensive information about the samples is obtained, and this comprehensive information is input into the final prediction model to obtain the sample prediction results. Calculate the average yield information in the sample data, compare it with the sample prediction results, and if the difference is less than the preset error threshold, it is judged as initially qualified. If the initial pass probability of several groups reaches the preset probability threshold, the regional factor is deemed qualified; otherwise, a new region is selected as the first region and the regional factor is recalculated.
7. The method for predicting the yield of tobacco leaves in mountainous areas based on spectral feature transfer learning according to claim 1, characterized in that: The training and transfer of the source domain model specifically includes: The source domain prediction model was selected as a multiple linear regression model. Based on historical data, the multiple linear regression model was trained using the least squares method to determine the regression coefficients of different elements; Various elements of terrain information are added to the multiple linear regression model, and different regression coefficients are assigned to each element. The sample data information in each region is randomly divided into a training set and a validation set according to a preset ratio, with each region as the unit. Keeping the original regression coefficients unchanged, the multiple linear regression model is trained a second time using the least squares method through the training set of one region to determine the regression coefficients of each element in the terrain information, thereby obtaining a preliminary prediction model for the target region. Using the validation set of the target region, the prediction accuracy of the preliminary prediction model for the target region is calculated, and the region with the highest prediction accuracy is selected as the first region. The preliminary prediction model corresponding to the first region is marked as the final prediction model.
8. The method for predicting the yield of tobacco leaves in mountainous areas based on spectral feature transfer learning according to claim 1, characterized in that: The training and transfer of the source domain model specifically includes: The source domain prediction model is selected as a CNN model; Based on historical data, MSE is used as the loss function, and the CNN model is trained using the gradient descent algorithm. Freeze the convolutional layers of the CNN model, replace the last fully connected layer with a new fully connected layer. The input dimension of the new fully connected layer is determined based on the output of the previous layer, and the output dimension is 1. At the same time, add an input channel for terrain information to the input layer. The sample data information in each region is randomly divided into a training set and a validation set according to a preset ratio, with each region as the unit. Using the training set of one region, MSE is used as the loss function, and the CNN model is trained using the gradient descent algorithm to obtain a preliminary prediction model for the target region. Using the validation set of the target region, the prediction accuracy of the preliminary prediction model for the target region is calculated, and the region with the highest prediction accuracy is selected as the first region. The preliminary prediction model corresponding to the first region is marked as the final prediction model.
9. A mountain tobacco yield prediction device based on spectral feature transfer learning, characterized in that: include: Spectral acquisition equipment: used to acquire historical data information of the source region, including spectral information and yield information; Acquire multiple sample data from different regions, including spectral information, topographic information, and yield information; acquire multiple prediction information from different regions, including spectral information and topographic information; Data storage: Used to record data acquired by the spectral acquisition device; Central Processing Area: Used for training source domain models and transfer: Taking spectral information as input and yield information as output, a source domain prediction model is established through historical data information of the source domain. Historical data information of a selected region is used to freeze the general layer of the source domain prediction model. Topographic information is added as input information to perform secondary training on the source domain prediction model, obtain the preliminary prediction model corresponding to each region, and select the region with the highest accuracy and mark it as the first region. The preliminary prediction model corresponding to the first region is marked as the final prediction model. Calculate regional factors: Calculate the regional factor of each region relative to the first region using the regional factor calculation method, to reflect the difference in input information between each region and the first region; Regional factor validation: Validate the regional factors using sample data information using the regional factor validation method. If the validation fails, select a new region as the first region and recalculate the regional factors until the validation passes; Prediction information merging: Obtain comprehensive information that is highly representative of the prediction information using the comprehensive information acquisition method; Output results: Input the comprehensive information into the final prediction model and output the prediction results.
Citation Information
Patent Citations
Tobacco yield estimation method and device based on hyperspectral remote sensing and leaf weight
CN115761507A
Tobacco leaf near infrared spectrum chemical component model optimization method based on transfer learning
CN117809766A
Method for realizing tobacco field yield prediction based on multi-source data analysis
CN119443425A