Soil composition detection system based on machine learning and infrared spectroscopy
By utilizing a soil composition detection system based on machine learning and infrared spectroscopy, a portable infrared spectrometer and deep learning methods are used to achieve rapid and low-cost soil detection and decision support. This solves the problems of long detection cycles, high costs, and weak decision support capabilities in existing technologies, and provides high-precision fertilization and planting recommendations.
Patent Information
- Application Number
- CN202511660113.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-11-13
AI Technical Summary
Existing soil testing and decision-making technologies suffer from problems such as long testing cycles, high costs, weak decision support capabilities, and dependence on weather and seasonal conditions. They are unable to achieve rapid on-site testing and automatic extraction of deep spectral features, and cannot directly output agricultural decision-making solutions.
A soil composition detection system based on machine learning and infrared spectroscopy is adopted. It uses a portable infrared spectrometer for on-site detection, combines deep learning methods to automatically extract spectral features, integrates multi-source data such as climate and crops, and outputs quantitative fertilization plans, crop planting suggestions and soil improvement measures.
It has achieved a significant improvement in soil testing efficiency, a reduction of testing costs by more than 95%, a significant increase in prediction accuracy, strong decision support capabilities, wide adaptability, high system integration, and convenient operation, making it suitable for remote rural areas.
Smart Images

Figure CN121141574B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of precision agriculture and artificial intelligence technology, and particularly relates to a soil component detection system based on machine learning and infrared spectrum, which provides a system for soil management and planting decision intelligent support in agricultural production. BACKGROUND
[0002] Soil fertility directly affects crop yield and quality, and accurate understanding of soil nutrient status is of great significance for scientific fertilization and improvement of agricultural production efficiency. Traditional soil nutrient detection mainly relies on laboratory chemical analysis method, although the determination accuracy is high, the detection period usually needs 3-7 days, and the single sample detection cost is between 80-150 yuan, which is difficult to meet the demand of modern precision agriculture for large-area and rapid detection. More importantly, chemical analysis can only provide numerical results of soil nutrient content, and farmers need to comprehensively judge the fertilization scheme according to crop type, target yield, climate conditions and other factors, which depends on professional knowledge and experience, and ordinary farmers are difficult to accurately grasp.
[0003] Chinese patent CN113196294A discloses a system for mapping soil properties using satellite data by machine learning method, which predicts the distribution of farmland soil properties by combining satellite remote sensing multispectral data with Gaussian process regression model. Although this method can monitor soil conditions at a large scale, it has obvious limitations. First, satellite remote sensing data depends on weather conditions, and effective data cannot be obtained when cloud cover occurs, the time resolution is limited by satellite revisit period, and the spatial resolution of 10 meters cannot meet the detection needs of precision to the plot. Second, the output result of the system is only a spatial distribution map of soil properties, which can be used for dividing management areas, but does not provide direct fertilization decision suggestions, and users still need to manually develop fertilization schemes combined with other information. Third, the Gaussian process regression model used by the system relies on the manually designed spectral index in feature engineering, and the deep information contained in the soil spectrum is not fully mined.
[0004] In summary, the existing soil detection and decision-making technology has problems such as long detection period, high cost, weak decision support ability, and dependence on weather and seasonal conditions, and an intelligent soil analysis system that can realize rapid on-site detection, automatically extract spectral deep features, and directly output agricultural decision schemes is urgently needed. SUMMARY
[0005] The purpose of the present application is to provide a soil component detection system based on machine learning and infrared spectrum, which realizes rapid on-site detection of soil by a portable infrared spectrometer, automatically extracts spectral features by a deep learning method, integrates multi-source data such as climate and crops, and directly outputs comprehensive agricultural decisions including quantitative fertilization scheme, crop planting suggestion and soil improvement measures, overcoming the shortcomings of the prior art.
[0006] The application discloses a soil component detection system based on machine learning and infrared spectrum, and has the characteristics that the system comprises a spectrum acquisition module, which is used for on-site scanning of soil samples by a portable Fourier transform infrared spectrometer to acquire continuous infrared absorption spectrum data in a wavelength range of 4000-400 cm -1 A spectrum preprocessing module in communication connection with the spectrum acquisition module is used for baseline correction, multipoint scattering correction and standard normal variable transformation of original spectrum data to generate preprocessed spectrum data; a data fusion module in communication connection with the spectrum preprocessing module is used for integrating the preprocessed spectrum data and regional climate data, soil type data and crop demand data to construct a fusion feature vector; a deep learning decision module in communication connection with the data fusion module comprises a spectrum feature extraction subnetwork, an attention fusion subnetwork and a multi-task learning subnetwork; wherein the spectrum feature extraction subnetwork adopts a one-dimensional convolutional neural network structure to automatically extract spectrum features from the preprocessed spectrum data; the attention fusion subnetwork performs weighted fusion of the spectrum features, environmental features and crop features through a multi-head attention mechanism to generate a comprehensive feature representation; the multi-task learning subnetwork comprises a fertilization decision branch, a planting suggestion branch and a soil improvement branch, and simultaneously outputs a fertilization scheme, a crop suitability score and a soil improvement measure based on the comprehensive feature representation; an agronomic knowledge base in communication connection with the deep learning decision module stores crop nutrient demand standards, soil nutrient abundance and deficiency indexes and fertilization limit rules, and verifies the output results of the deep learning decision module; and a decision output module in communication connection with the agronomic knowledge base generates a comprehensive decision report comprising a quantitative fertilization formula, a crop suitability ranking and a soil improvement scheme.
[0007] Compared with the prior art, the application has the following remarkable beneficial effects:
[0008] First, the detection efficiency is greatly improved. The application uses a portable Fourier transform infrared spectrometer for on-site detection, and the analysis time of a single sample is less than 10 minutes, which is about 2000 times higher than the efficiency of the traditional chemical analysis method. In practical applications, farmers can directly complete soil detection in the field, avoiding the steps of sample collection, transportation, waiting for analysis results, etc., especially in critical agricultural seasons, soil information can be obtained in time for decision adjustment. In terms of detection cost, the one-time investment of the equipment is about 80,000-150,000 yuan, and the marginal cost of single detection is less than 5 yuan, which is more than 95% lower than the cost of traditional chemical detection.
[0009] Second, the prediction accuracy is significantly improved. By using one-dimensional convolutional neural networks to automatically extract spectral features, combined with multi-modal data fusion and multi-task learning framework, the system achieves high accuracy in soil nutrient prediction. According to the cross-validation results, the determination coefficients of soil nitrogen, phosphorus and potassium content prediction are 0.91, 0.89 and 0.90 respectively, and the root mean square errors are 18.5 kg / ha, 12.3 kg / ha and 20.8 kg / ha respectively, which are significantly better than the traditional partial least squares regression method and the Gaussian process regression model reported in the comparative document.
[0010] Third, the decision support capability is strong. The core innovation of the present application is to improve from soil detection to decision guidance, and the system automatically generates a comprehensive decision scheme including the following contents: quantitative fertilization formula, which clearly gives the specific amount of nitrogen, phosphorus and potassium, recommends the type and ratio of fertilizer, and provides detailed split fertilization plan; crop suitability evaluation, which gives a comprehensive suitability score for the crops of interest, and decomposes it into three dimensions of climate adaptation, soil adaptation and nutrient matching; soil improvement scheme, which gives specific improvement measures and amount for soils with problems such as acidification, salinization and low organic matter. This targeted decision-making suggestion reduces the requirement for user's professional knowledge.
[0011] Fourth, the explainability is strong. The system uses SHAP explainability analysis method to quantify the contribution of each input feature to the final decision, and presents it to the user in the form of text and charts. For example, in a fertilization recommendation, the system explains that the recommended amount of nitrogen fertilizer is mainly based on soil organic matter content, historical yield level, target crop type and other factors and their contribution, so that the user can understand the decision logic and enhance the sense of trust.
[0012] Fifth, the adaptability is extensive. The system uses a large-scale dataset from multiple provinces, multiple soil types and multiple crops nationwide during model training, and improves the model robustness through data augmentation technology, so that the system has good generalization ability. In cross-regional migration verification, only a small amount of local samples are needed for fine-tuning, and the determination coefficient of fertilization recommendation can still reach more than 0.86.
[0013] Sixth, the system has high integration. The system integrates hardware, software, knowledge base and user interface into an integrated solution, and users can complete the whole process from spectral scanning to decision report generation through mobile APP, which is convenient to operate. The system supports offline operation mode, and the deep learning model can be deployed on smart phones or edge computing devices after quantization and knowledge distillation optimization, without the need for networking to complete inference, solving the problem of unstable network signal in remote rural areas. BRIEF DESCRIPTION OF DRAWINGS
[0014] Figure 1 The figure is a schematic diagram of the overall structure of the soil component detection system based on machine learning and infrared spectrum of the present application. DETAILED DESCRIPTION
[0015] The application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0016] As shown in the drawings, Figure 1 The soil composition detection system based on machine learning and infrared spectrum of the application includes a spectrum acquisition module 11, a spectrum preprocessing module 12, a data fusion module 13, a deep learning decision module 14, an agronomic knowledge base 15 and a decision output module 16, which are connected to each other through data interfaces to form a complete soil detection and decision chain.
[0017] The spectrum acquisition module 11 uses a portable Fourier transform infrared spectrometer to scan the soil sample on site and obtain continuous infrared absorption spectrum data in the wavelength range of 4000-400 cm⁻¹. In an embodiment of the application, an ALPHA II portable Fourier transform infrared spectrometer of Bruker Company is used, which weighs about 3.9 kilograms and is suitable for field use.
[0018] Specifically, the preparation process of the soil sample is as follows: surface soil at 5-10 points is collected in an S-shaped route on the land to be detected, with a depth of 0-20 centimeters. After mixing the soil at each point uniformly, about 200 grams is taken as a representative sample. The sample is naturally air-dried in a cool place, and plant roots, stones and other impurities are removed. The soil is ground to powder with a mortar and sieved through a 2 millimeter sieve to obtain the sample to be tested. About 2 grams of the sample to be tested is placed on the ATR accessory of the spectrometer to ensure that the sample is in full contact with the ATR crystal, and the spectrometer is started to scan.
[0019] The working parameters of the spectrometer are set as follows: scanning resolution 4 cm⁻¹, scanning times 32. This parameter setting is based on the trade-off between signal-to-noise ratio and detection time. Higher scanning times can improve the signal-to-noise ratio, but will prolong the detection time. After experimental verification, the signal-to-noise ratio reaches about 300:1 when scanning 32 times, which can meet the subsequent analysis requirements, and the time consumption of a single scan is about 90 seconds. The spectrometer automatically averages the results of 32 scans to obtain a continuous spectrum curve containing 1800 data points, and the wave numbers corresponding to the data points are from 4000 cm⁻¹ to 400 cm⁻¹, with an interval of about 2 cm⁻¹.
[0020] The obtained original spectrum data is expressed in absorbance value, denoted as vector , where is the absorbance value corresponding to the th wave number point, and the superscript represents transposition, The value range of the is 1 to 1800. The continuous infrared absorption spectrum contains the molecular vibration information of the organic matter, mineral matter and other components in the soil. Different chemical bonds have characteristic absorption peaks in a specific wave number range. For example, the absorption peaks in the range of 3600-3200 cm-1 mainly correspond to the stretching vibration of hydroxyl , which is related to the soil water content and clay minerals; the absorption peaks in the range of 2950-2850 cm-1 correspond to the stretching vibration of aliphatic carbon-hydrogen bonds, which is closely related to the soil organic matter content; the absorption peaks in the range of 1650-1550 cm-1 correspond to the vibration of amide bonds, which reflects the content of protein substances in the soil.
[0021] The spectrum pretreatment module 12 is in communication connection with the spectrum acquisition module 11 and receives the original spectrum data , performs baseline correction, multipoint scattering correction and standard normal variable transformation on the original spectrum data, and generates pretreated spectrum data . The spectrum pretreatment process includes the following steps.
[0022] First, baseline correction processing is performed. In the acquisition process of the infrared spectrum, due to instrument drift, sample background absorption and other factors, the spectrum baseline will have a slowly changing trend item. This baseline drift will affect the extraction of the spectrum characteristics. The adaptive iterative weighted least squares method is used for baseline correction in the present application. The core idea of the method is to fit a smooth baseline curve through iteration, so that it is as close as possible to the valley part of the spectrum.
[0023] In an embodiment of the present application, the calculation process of the baseline correction is as follows. Let the original spectrum vector be , the fitted baseline vector be , and the weight vector be . The goal of the algorithm is to minimize the weighted combination of the weighted residual sum of squares and the baseline roughness:
[0024] ,
[0025] wherein is the absorbance value of the original spectrum at the th wave number point, is the value of the fitted baseline at the th wave number point, is the weight of the th data point, is the smoothness parameter, which controls the smoothness of the baseline. The second term is the second-order difference of the baseline, which is used to constrain the curvature of the baseline to prevent the baseline from overfitting the peak part of the spectrum.
[0026] The algorithm updates the weights in an iterative reweighting manner. Initially, all weights are set to 1, i.e. . In each iteration, first solve the above minimization problem to get the baseline , then update the weight according to the residual:
[0027] ,
[0028] wherein, denotes the iteration number, is a standard deviation parameter used to control the speed of weight decay. When the spectral value is lower than the baseline, the weight remains 1, indicating that these points are likely to be on the baseline; when the spectral value is higher than the baseline, the weight decays exponentially, so that the peak points have less influence on the baseline fitting.
[0029] In the specific implementation of the present application, the smoothness parameter is set to , which is an empirical value determined based on a large amount of soil spectrum data. A larger value makes the baseline smoother, avoiding the baseline following the rapid changes of the spectrum. The number of iterations is set to no more than 50, and the convergence threshold is set to , i.e. stopping iteration when the baseline change of the adjacent two iterations is less than the threshold. In practical application, the algorithm usually converges after 10-20 iterations. The standard deviation parameter is set to , which makes the weight of the peak points higher than the baseline by about 0.3 absorbance units decay to 0.01, effectively suppressing the influence of the peak on the baseline fitting.
[0030] The spectrum after baseline correction is calculated as:
[0031] ,
[0032] wherein, is the baseline-corrected spectrum vector.
[0033] Next, multi-point scattering correction processing is performed. Physical factors such as particle size and packing density of soil samples can cause light scattering effects, so that the spectral intensity of different samples will exist differences even if the chemical composition is the same. The purpose of multi-point scattering correction is to eliminate the influence of this scattering effect.
[0034] Specifically, first calculate the average spectrum of all training sample spectra as the reference spectrum. Let the training set contain samples, the baseline-corrected spectrum of the th sample is , then the reference spectrum is:
[0035] ,
[0036] wherein, is the number of training samples, in an embodiment of the present application, .
[0037] For any one sample spectrum , assuming there is a linear relationship between it and the reference spectrum:
[0038] ,
[0039] where, is the intercept parameter, is the slope parameter, is an all-one vector, is the residual vector. Parameters and are estimated by least squares:
[0040] ,
[0041] where, and are the values of the sample spectrum and the reference spectrum at the th wavenumber point, respectively.
[0042] After solving the parameters and , the multi-point scattering corrected spectrum is:
[0043] ,
[0044] where, is the multi-point scattering corrected spectrum. This transformation is equivalent to stretching and shifting the original spectrum so that it is on the same scale as the reference spectrum.
[0045] Finally, the standard normal variable transformation is performed. The purpose of this processing is to standardize the spectral data to a zero-mean unit-variance distribution, eliminate the absolute difference in intensity of different sample spectra, and highlight the spectral shape features. For each spectral sample , calculate its mean and standard deviation:
[0046] ,
[0047] ,
[0048] where, is the mean of the spectrum, is the standard deviation of the spectrum, is the value of the multi-point scattering corrected spectrum at the th wavenumber point.
[0049] The spectrum after the standard normal variable transformation is:
[0050] ,
[0051] wherein, is the value of the pre-processed spectrum at the th wavenumber point. The transformed spectrum has a mean of 0 and a standard deviation of 1.
[0052] In one embodiment of the present application, the soil samples collected from a certain plot are pre-processed by spectrum, and there is a slow rising baseline trend near 3400 cm⁻¹ in the original spectrum caused by instrument drift. After adaptive iterative weighted least squares baseline correction, this trend is effectively removed. Multi-point scatter correction eliminates the overall intensity deviation caused by uneven sample filling density, making the spectrum curve smoother. After standard normal variable transformation, the spectrum data of different samples are normalized to a unified scale, which is convenient for subsequent deep learning model processing.
[0053] The data fusion module 13 is in communication connection with the spectrum preprocessing module 12, and receives the preprocessed spectrum data , while integrating regional climate data, soil type data and crop demand data to construct a fusion feature vector . The data fusion process includes climate data acquisition, climate feature calculation, soil type coding, crop parameter extraction and feature vector construction.
[0054] The climate data acquisition unit automatically acquires the climate parameters of the detection site from the meteorological data service platform through the API interface. In one embodiment of the present application, the daily meteorological observation data provided by the China Meteorological Data Network is used, and the meteorological records of the nearest meteorological station are queried according to the latitude and longitude coordinates of the detection site. The basic meteorological parameters obtained include the daily average temperature , cumulative precipitation , sunshine hours and relative humidity in the last 30 days.
[0055] Preferably, the daily average temperature is in units of degrees Celsius, the cumulative precipitation is in units of millimeters, the sunshine hours are in units of hours, and the relative humidity is expressed as a percentage. For example, in a certain detection, the detection site is a county in Henan Province, and the latitude and longitude coordinates are 34.5° N and 113.8° E. The daily average temperature in the last 30 days is 18-26℃, the cumulative precipitation is 45 millimeters, the average sunshine hours are 6.5 hours / day, and the average relative humidity is 65%.
[0056] The climate feature calculation unit calculates derived climate indicators based on these basic meteorological parameters to more comprehensively represent the climate conditions for crop growth. Specifically, the following four derived indicators are calculated:
[0057] First, the heat index , which represents the effective accumulated temperature during the crop growth period. The calculation formula is:
[0058] ,
[0059] wherein, is the daily average temperature on the th day, is the base temperature, usually 10℃, which represents the minimum temperature threshold for the crop to start growing, The value of ranges from 1 to 30. The function represents the maximum of the two values, and the contribution of the day to the accumulated temperature is 0 when the daily average temperature is lower than the base temperature. The unit of the heat index is ℃·day. In the above example, assuming that all daily average temperatures are higher than 10℃ within 30 days, and the average temperature is 22℃, the heat index is about ℃·day.
[0060] Second, the water deficit index , which represents the difference between the water supply and demand during the crop growth period. The calculation formula is:
[0061] ,
[0062] wherein, is the potential evapotranspiration, which represents the total amount of transpiration and soil evaporation of the crop under sufficient water supply, with the unit of millimeter; is the cumulative precipitation, with the unit of millimeter. The potential evapotranspiration is estimated by the Penman-Monteith formula:
[0063] ,
[0064] wherein, is the slope of the saturated vapor pressure curve, with the unit of kPa / ℃; is the net radiation, with the unit of MJ / (m²·day); is the soil heat flux, which is usually negligible on a daily scale and is taken as 0; is the psychrometer constant, which is about 0.067 kPa / ℃; is the daily average temperature, with the unit of ℃; is the wind speed at the height of 2 meters, with the unit of m / s; is the saturated water vapor pressure, with the unit of kPa; is the actual water vapor pressure, with the unit of kPa. In the implementation of the present application, considering the difficulty in obtaining these parameters, a simplified estimation method is adopted, i.e. wherein , , are the average temperature, the maximum temperature and the minimum temperature, respectively, For the top-of-atmosphere radiation, it can be calculated according to the latitude and date. In the above example, the estimated 30-day cumulative potential evapotranspiration is about 120 mm, and the water deficit index is , indicating that the water supply is insufficient, and there is about 62.5% water deficit.
[0065] Third, temperature suitability , indicating the degree of suitability of the current temperature condition for the target crop. The calculation formula is:
[0066] ,
[0067] wherein, is the 30-day average temperature, in ℃; is the optimum temperature of the target crop, in ℃; is the temperature tolerance range of the crop, in ℃. The optimum temperature and tolerance range of different crops are different, for example, the optimum temperature of corn is 25 ℃, and the tolerance range is 15-35 ℃, taking ℃; the optimum temperature of wheat is 18 ℃, and the tolerance range is 10-26 ℃, taking ℃. The temperature suitability value ranges from 0 to 1, and the larger the value, the more suitable the temperature. In the above example, if the target crop is corn, , indicating that the temperature condition is relatively suitable.
[0068] Fourth, water-heat coupling index , which comprehensively considers the influence of heat and water conditions on crop growth. The calculation formula is:
[0069] ,
[0070] wherein, is the heat index, in ℃·day; is the cumulative precipitation, in mm. The unit of this index is , and the larger the value, the better the water-heat condition. In the above example, .
[0071] After the climate feature calculation, a climate feature vector containing 4 basic parameters and 4 derived indexes is obtained, with a total dimension of 8. However, considering the input requirements of the subsequent model, some statistical features such as the standard deviation of the temperature in the last 30 days, the maximum temperature, and the minimum temperature are further supplemented, and finally the dimension of the climate feature vector is 20, denoted as .
[0072] The soil type coding unit codes the soil texture classification into a one-hot vector. Soil texture is classified into different types according to the proportion of sand, silt and clay. In the present application, the international system of soil texture classification is adopted, and the soil is divided into 9 main categories: sandy soil, loamy sand, sandy loam, loam, silt loam, silty sandy loam, clay loam, clay loam and clay.
[0073] One-hot coding is a method of converting a categorical variable into a numerical vector. Specifically, for 9 soil categories, a 9-dimensional vector is constructed, each dimension corresponding to a category. If the soil belongs to a certain category, the value of the corresponding dimension is 1, and the values of the remaining dimensions are 0. For example, if the soil type is loam, the coding vector is , where the 4th element is 1 indicating loam. The advantage of this coding method is to avoid assigning artificial size relationships between different categories.
[0074] In practical applications, soil type can be determined by observing soil texture on site, referring to historical soil survey data or using a portable soil texture analyzer. In an embodiment of the present application, the soil texture is preliminarily judged by touch method: take a small amount of soil and wet it with water, rub it with your fingers, if it feels rough, not sticky, and cannot form a ball, it is judged as sandy soil; if it feels fine, slightly sticky, and can form a ball, it is judged as loam; if it feels very sticky, has strong plasticity, and can be rolled into a thin strip, it is judged as clay. For borderline cases, the soil texture triangle can be used for accurate classification.
[0075] After coding, a 9-dimensional one-hot vector is obtained, denoted as .
[0076] The crop parameter extraction unit extracts the nutrient requirement parameters of the target crop selected by the user from the agronomic knowledge base 15. Different crops have different nutrient requirements, and these parameters are crucial for subsequent fertilization decisions.
[0077] In the present application, the crop nutrient requirement parameters include 15 dimensions: the absorption ratio of nitrogen, phosphorus and potassium , , , respectively representing the proportion of nitrogen, phosphorus and potassium elements absorbed by the crop in the total nutrient absorption; the length of the growth period , in days; the target yield , in kg / ha; the nutrient requirement coefficients of nitrogen, phosphorus and potassium , , , respectively representing the amount of nitrogen, phosphorus and potassium elements required to produce a unit of crop yield, in kg / (kg yield); the root depth , in centimeters; the photosynthesis type coding , C3 plant takes 0, C4 plant takes 1; drought resistance score , value range 0-1; salt tolerance score , value range 0-1; sensitivity to soil pH , value range 0-1; nitrogen fertilizer sensitivity , phosphorus fertilizer sensitivity , potassium fertilizer sensitivity , respectively represent the response degree of fertilizer to yield increase, value range 0-1.
[0078] For example, for corn, the parameter settings are as follows: 、 、 , indicating that the absorption ratio of nitrogen, phosphorus and potassium is about 3:1:2.7; days; kg / ha; kg of nitrogen / (1000 kg of grain), kg of diaphosphorus pentoxide / (1000 kg of grain), kg of potassium oxide / (1000 kg of grain), these coefficients are based on a large number of field test data statistics; cm; , indicating that corn is a C4 plant; , indicating that it has moderate drought resistance; , indicating that it has weak salt tolerance; , indicating that it is not very sensitive to pH changes; 、 、 , indicating that it has a high response to all three fertilizers.
[0079] For wheat, the parameter settings are as follows: 、 、 ; days (winter wheat); kg / ha; kg of nitrogen / (1000 kg of grain), kg of diaphosphorus pentoxide / (1000 kg of grain), kg of potassium oxide / (1000 kg of grain); cm; , indicating that wheat is a C3 plant; ; ; ; 、 、 .
[0080] After extracting the crop parameters, a 15-dimensional vector is obtained, denoted as .
[0081] The feature vector construction unit splices and standardizes the preprocessed spectral data, climate features, soil type encoding and crop parameters to construct the final fused feature vector.
[0082] First, the continuous features are Z-score standardized. For the climate feature vector and the crop parameter vector , the mean and standard deviation of each dimension on the training set are calculated, and then standardized:
[0083] ,
[0084] ,
[0085] where and are the mean and standard deviation of the th dimension of the climate feature on the training set, and are the mean and standard deviation of the th dimension of the crop parameter on the training set, and are the mean and standard deviation of the th dimension of the crop parameter on the training set,
[0086] For the soil type one-hot vector and the preprocessed spectral data , since the one-hot vector is already in a standardized form, and the spectral data has been standardized after standard normal variable transformation, no additional processing is required.
[0087] Then, splice each part of the feature according to a certain order to form a fused feature vector:
[0088] ,
[0089] where the superscript denotes transposition. The total dimension of the fused feature vector is .
[0090] In a preferred embodiment of the present application, for the convenience of subsequent processing, the fused feature vector is divided into three parts: the spectral feature part , with a dimension of 1800; the environmental feature part , with a dimension of ; and the crop feature part , with a dimension of 15. This grouping helps the subsequent attention fusion subnetwork to process different modal features in a targeted manner.
[0091] The deep learning decision module 14 is in communication connection with the data fusion module 13, receives the fused feature vector, and finally outputs the fertilization scheme, crop suitability score and soil improvement measures through the spectral feature extraction subnetwork, attention fusion subnetwork and multi-task learning subnetwork.
[0092] The spectral feature extraction subnetwork adopts a one-dimensional convolutional neural network structure to automatically extract multi-scale features from the preprocessed spectral data. The design of this subnetwork fully considers the characteristics of infrared spectral data: the spectrum is one-dimensional sequence data, and there is correlation between adjacent wave number points; different scale features correspond to different chemical information, such as the shape of a single peak reflecting a specific functional group, and a wider range of spectral patterns reflecting the overall chemical composition.
[0093] Preferably, the spectral feature extraction subnetwork includes a five-layer convolutional structure, which is specifically designed as follows.
[0094] The first convolutional layer receives a preprocessed spectral vector with a dimension of 1800 . This layer uses 64 one-dimensional convolution kernels with a kernel size of 11 and a step size of 1, and uses same padding, i.e., padding with 5 zero values at both ends of the input, so that the output dimension remains 1800 after convolution. The convolution operation can be represented as:
[0095] ,
[0096] wherein, is the output of the first convolutional layer th convolution kernel at position , the value of ranges from 1 to 64, ranges from 1 to 1800; is the th weight of the th convolution kernel, the value of ranges from 0 to 10, corresponding to the convolution kernel size of 11; is the value of the input spectrum at position , and the padded zero value is used when the position exceeds the boundary; is the bias term of the th convolution kernel. The convolution kernel size of 11 means that each convolution kernel focuses on about 11 consecutive wave number points, corresponding to a spectral range of about 22 cm⁻¹, which is sufficient to capture the main shape characteristics of most absorption peaks.
[0097] After the convolution operation, a batch normalization layer and a ReLU activation function are applied. The batch normalization layer normalizes the output of each convolution kernel, and the formula is:
[0098] ,
[0099] ,
[0100] where, and are the mean and variance of the th convolution kernel output, which are calculated during the training process; is a small constant to prevent division by zero, usually ; and are the learnable scaling and shifting parameters. The ReLU activation function is defined as:
[0101] ,
[0102] where, is the output after activation. The output tensor dimension of the first convolution layer is .
[0103] The second convolution layer receives the output of the first convolution layer, uses 128 one-dimensional convolution kernels, and the convolution kernel size is 9, the step is 2. Because the step is 2, the output dimension is halved to 900. At the same time, a max pooling layer is added after this layer, and the pooling window size is 2, which further reduces the dimension to 450. The max pooling operation is defined as:
[0104] ,
[0105] where, is the output of the th feature map at position after pooling, the value range of is 1 to 450; is the activation value before pooling. The role of the pooling operation is to reduce the feature dimension, and at the same time, to enhance the model's invariance to local translation of the spectrum, that is, even if the spectrum peak position has a small offset, the features after pooling remain basically unchanged. The output tensor dimension of the second convolution layer is .
[0106] The third convolution layer uses 256 convolution kernels, the convolution kernel size is 7, the step is 1, and is followed by a max pooling layer, and the pooling window size is 2, the output dimension is . The fourth convolution layer uses 256 convolution kernels, the convolution kernel size is 5, the step is 1, and the output dimension remains . The fifth convolution layer uses 128 convolution kernels, the convolution kernel size is 3, the step is 1, and the output dimension is .
[0107] Finally, the global average pooling layer performs global average on the output of the fifth convolution layer:
[0108] ,
[0109] wherein, is the global average value of the th feature map, the value range of is 1 to 128; is the activation value of the th feature map of the fifth convolutional layer at position . After global average pooling, a 128-dimensional spectral feature vector is obtained.
[0110] In a specific embodiment of the present application, the spectrum of a certain soil sample is extracted for features, and the 64 convolutional kernels of the first convolutional layer learn different feature patterns in different wave number ranges. For example, some convolutional kernels are sensitive to the hydroxyl stretching vibration peaks in the range of 3600-3200 cm⁻¹, and their weights show large positive values in this range; other convolutional kernels are sensitive to the aliphatic carbon-hydrogen bond vibration in the range of 2950-2850 cm⁻¹. With the increase of the depth of the convolutional layer, the features become more abstract and comprehensive, and the high-level convolutional layer can capture the combined patterns between multiple peaks, which are related to the overall chemical composition of the soil. The 128-dimensional feature vector obtained after global average pooling, each dimension corresponding to an abstract spectral pattern, provides a rich information basis for subsequent decision-making.
[0111] The attention fusion subnetwork generates a comprehensive feature representation by weighting the spectral features , environmental features and crop features through a multi-head attention mechanism. The multi-head attention mechanism is the core component of the Transformer architecture, and its advantage lies in its ability to dynamically adapt the mutual attention weights between different features according to the content of the input data.
[0112] First, the three feature vectors are mapped to a unified 128-dimensional embedding space through fully connected layers. For spectral features, since they are already 128-dimensional, they can be used directly or through a linear transformation:
[0113] ,
[0114] wherein, is the weight matrix of , is a 128-dimensional bias vector, is the mapped spectral embedding vector.
[0115] For environmental features, they are mapped from 29 dimensions to 128 dimensions:
[0116] ,
[0117] in, for The weight matrix, It is a 128-dimensional bias vector.
[0118] For crop features, the mapping is from 15 dimensions to 128 dimensions:
[0119] ,
[0120] in, for The weight matrix, It is a 128-dimensional bias vector.
[0121] Concatenate the three embedding vectors along the second dimension to form an embedding matrix:
[0122] ,
[0123] in, Each column corresponds to an embedding vector of a feature mode.
[0124] Next, a multi-head attention mechanism is used to calculate the correlation weights between features. In an embodiment of the invention, eight attention heads are used, each with a dimension of 16. For the first... Each attention point first generates a query matrix through three linear transformations. Key matrix Sum matrix :
[0125] ,
[0126] ,
[0127] ,
[0128] in, , and All The weight matrix, The value range is from 1 to 8.
[0129] Then, calculate the attention weight matrix:
[0130] ,
[0131] in, The dimension for each head is used for scaling to stabilize the gradient; The function is applied row-by-row, ensuring that the weights in each row sum to 1. Attention weight matrix. The Line number Column elements represent the first The feature mode pair of the _th _th The degree of attention given to each feature modality. Specifically, the softmax function is defined as:
[0132] ,
[0133] in, For the input vector, For vector dimensions.
[0134] Calculate the weighted value based on the attention weights:
[0135] ,
[0136] in, For the first The output of each attention head.
[0137] Concatenate the outputs of the 8 attention heads along the first dimension:
[0138] ,
[0139] The semicolon indicates that lines are concatenated.
[0140] The final output of multi-head attention is obtained through linear transformation:
[0141]
[0142] in, for The weight matrix, It is a 128-dimensional bias vector.
[0143] Finally, residual connectivity and layer normalization are applied:
[0144]
[0145] in, For layer normalization, normalization is performed independently for each column. Specifically, for The List:
[0146]
[0147] in, and The first The mean and variance of the column. , and A learnable 128-dimensional vector. denotes element-wise multiplication.
[0148] Fused feature matrix contains three columns, corresponding to the representations of spectral, environmental, and crop modalities after attention fusion. To obtain a single comprehensive feature vector, the three columns are weighted averaged or concatenated and then passed through a fully connected layer for dimension reduction. In an embodiment of the present application, the weighted averaging method is adopted:
[0149]
[0150] wherein, , and are learnable weights satisfying and are all non-negative. During the training process, these weights are adaptively adjusted to optimize the final decision performance. is a 128-dimensional comprehensive feature representation, denoted as comprehensive feature representation vector.
[0151] In a specific embodiment of the present application, by analyzing the attention weight matrix , it is found that the spectral feature has a relatively high attention weight for both the environmental feature and the crop feature, which is reasonable because the spectral information is a direct reflection of the soil nutrient condition. At the same time, the environmental feature also has a relatively high weight for the crop feature, indicating that the influence of climate conditions on crop demand is captured by the model. For example, in a certain detection, the value of the first row (corresponding to the spectral feature) of the attention weight matrix is , indicating that the spectral feature pays 50% attention to itself, 30% attention to the environment, and 20% attention to the crop.
[0152] The multi-task learning subnetwork includes a shared feature layer and three task-specific branches: a fertilization decision branch, a planting recommendation branch, and a soil improvement branch. The advantage of multi-task learning is that different tasks can share underlying features, promote learning from each other, and improve overall performance and generalization ability.
[0153] The shared feature layer receives the comprehensive feature representation and performs nonlinear transformation through a two-layer fully connected network. The first fully connected layer maps the 128-dimensional input to 256 dimensions:
[0154]
[0155] wherein, is the weight matrix of , is a 256-dimensional bias vector, is an activation function.
[0156] The second fully connected layer is further mapped to 128 dimensions, with Dropout regularization applied:
[0157]
[0158] where, is the weight matrix of, is a 128-dimensional bias vector, represents the Dropout probability, i.e., randomly setting 30% of the neuron outputs to 0 during training to prevent overfitting. is the task-shared feature vector with a dimension of 128.
[0159] The fertilization decision branch is connected with the shared feature layer and contains three parallel fully connected subnetworks, which respectively predict the nitrogen fertilizer amount , the phosphorus fertilizer amount , and the potassium fertilizer amount . Each subnetwork has the same structure, and the nitrogen fertilizer prediction subnetwork is taken as an example:
[0160]
[0161]
[0162]
[0163] where, is the weight matrix of, is the weight matrix of, is the weight vector of, , and are the corresponding bias terms, respectively. The output is a scalar, representing the recommended nitrogen fertilizer amount, with the unit of kg / ha. Similarly, the phosphorus fertilizer and potassium fertilizer prediction subnetworks output and , respectively, both with the unit of kg / ha. The planting suggestion branch receives the shared feature and outputs a suitability score vector for different crops. Assuming the number of candidate crops is , in an embodiment of the present application,
[0164] , including corn, wheat, rice, soybean, cotton, peanut, potato, rape, sunflower, and sweet potato. The network structure of the planting suggestion branch is as follows:
[0165] ,
[0166] ,
[0167] in, for The weight matrix, for The weight matrix, It is a 10-dimensional vector, where each element represents the suitability score of the corresponding crop. The function that makes the sum of all scores equal to 1 can be interpreted as the probability of each crop being selected.
[0168] The soil improvement branch outputs multi-label classification results, identifying the types of soil improvement measures that need to be taken. In this invention, eight soil improvement measures are defined: organic matter replenishment, acidic soil conditioning, alkaline soil conditioning, saline soil improvement, compacted soil loosening, heavy metal passivation, trace element supplementation, and water-retaining agent application. The network structure of the soil improvement branch is as follows:
[0169]
[0170]
[0171] in, for The weight matrix, for The weight matrix, It is an 8-dimensional vector, and each element has a value ranging from 0 to 1, representing the activation probability of the corresponding improvement measure. The function is defined as:
[0172]
[0173] When the value of an element is greater than a threshold (usually 0.5), it is considered that this improvement measure needs to be taken.
[0174] In one specific embodiment of the present invention, after soil testing of a certain plot of land, the fertilization decision branch outputs... kg / ha, kg / ha, kg / ha. In the crop suitability scores output by the planting suggestion branch, maize scored 0.35, wheat 0.28, and soybean 0.20, with the remaining crops scoring lower, indicating that maize is the most suitable crop for this plot. In the soil improvement branch's improvement measure vectors, organic matter replenishment had an activation probability of 0.78, acid soil conditioning had an activation probability of 0.62, and the activation probabilities of the remaining measures were all below 0.5, indicating that this plot needs organic matter replenishment and acidity conditioning.
[0175] The multi-task learning sub-network is trained using a weighted loss function. The total loss function is a weighted sum of the losses from the three tasks:
[0176]
[0177] wherein, , and are the losses for the three tasks of fertilization decision, planting suggestion and soil improvement, respectively, , and are the corresponding weight coefficients.
[0178] The fertilization decision branch uses the mean square error loss function:
[0179]
[0180] wherein, is the predicted nitrogen, phosphorus or potassium fertilizer amount, is the true optimal fertilization amount (determined by field trials or expert experience), takes the values of N, P and K. The unit of the mean square error loss is .
[0181] The planting suggestion branch uses the cross-entropy loss function:
[0182]
[0183] wherein, is the true label of the th crop, and if the crop is the most suitable crop, otherwise , is the predicted suitability score of the th crop, and the value of
[0184] The soil improvement branch uses the binary cross-entropy loss function:
[0185]
[0186] wherein, is the true label of the th improvement measure, and is 1 if the measure needs to be taken, otherwise is 0, is the predicted activation probability of the th improvement measure, and the value of
[0187] The weight coefficients are initially set to , , This reflects that the importance of the fertilization decision task is slightly higher than the other two tasks. However, the fixed weight coefficient may not adapt to the difference in learning speed of different tasks. Therefore, the application adopts a dynamic task weight adjustment algorithm to adaptively update the weight coefficient during training.
[0188] Specifically, after the end of each training cycle, the weight is adjusted according to the performance change rate of each task on the validation set. Let the loss of each task on the validation set in the i th cycle be The loss change rate is:
[0189]
[0190] wherein represents one of the three tasks. If the loss of a certain task decreases slowly (the change rate is close to 0 or positive), it means that the task is difficult to learn and its weight needs to be increased; if the loss decreases quickly (the change rate is a large negative value), it means that the task learns smoothly and its weight can be appropriately reduced. The weight update formula is:
[0191]
[0192] wherein is a regulation coefficient that controls the amplitude of weight adjustment, usually taking 0.5. After updating, the weight is normalized so that :
[0193]
[0194] Through this dynamic adjustment mechanism, the model can automatically balance the learning progress of different tasks during training, avoiding the problem of premature convergence of a certain task and insufficient learning of other tasks.
[0195] The agricultural knowledge base 15 is in communication connection with the deep learning decision module 14, stores crop nutrient demand standards, soil nutrient abundance and deficiency indicators, and fertilization limit rules, and verifies and corrects the output results of the deep learning decision module.
[0196] The crop nutrient requirement data table stores standard values of nitrogen, phosphorus and potassium absorption of different crops under target yield. The data table is based on the "China Main Crop Fertilization Guide" prepared by the National Agricultural Technology Extension Service Center and a large number of field test data. For example, corn needs to absorb about 200-230 kg / ha of nitrogen, about 70-90 kg / ha of di pentoxide and about 220-280 kg / ha of potassium oxide under the condition of target yield of 9000 kg / ha. Wheat needs to absorb about 170-200 kg / ha of nitrogen, about 60-80 kg / ha of di pentoxide and about 120-160 kg / ha of potassium oxide under the condition of target yield of 6000 kg / ha.
[0197] The soil nutrient abundance and deficiency classification table is established according to the standards of the Second National Soil Survey and the "Technical Specifications for Soil Testing and Formula Fertilization". The classification table divides the soil nutrient content into five levels: very low, low, medium, high and very high. Specifically, the classification standards for organic matter content are: very low , low , medium , high , very high . The classification standards for alkali-hydrolyzable nitrogen content are: very low mg / kg, low mg / kg, medium mg / kg, high mg / kg, very high mg / kg. The classification standards for available phosphorus content are: very low mg / kg, low mg / kg, medium mg / kg, high mg / kg, very high mg / kg. The classification standards for available potassium content are: very low mg / kg, low mg / kg, medium mg / kg, high mg / kg, very high mg / kg.
[0198] The fertilization limit rule table is based on the Fertilizer Rational Use Guidelines General (NY / T 496-2010) and environmental protection requirements. The rule table specifies the maximum application limit of different nutrient elements to prevent environmental pollution and crop growth obstacles caused by excessive fertilization. The specific rules include: the single application amount of nitrogen fertilizer is not more than 150 kg / ha, and the total amount during the whole growth period is not more than 300 kg / ha; it is prohibited to apply quick-acting nitrogen fertilizer within 30 days before the harvest of crops to avoid the accumulation of nitrate in agricultural products; the application amount of organic fertilizer is not more than 4500 kg / ha to avoid the accumulation risk of salt and heavy metals; the phosphorus fertilizer is reduced by 50% or not applied on high phosphorus soil, which is defined as soil with effective phosphorus content greater than 40 mg / kg.
[0199] The crop planting condition table stores the accumulated temperature requirements, precipitation needs, pH suitable ranges, and soil texture requirements of different crops. For example, the planting conditions of corn are: ≥10℃ accumulated temperature 2000-3000℃·day, precipitation requirement during growth period 300-500 mm, pH suitable range 6.0-7.5, and suitable soil texture is sandy loam to loam. The planting conditions of wheat are: ≥0℃ accumulated temperature 1500-2200℃·day, precipitation requirement during growth period 400-600 mm, pH suitable range 6.5-7.5, and suitable soil texture is loam to clay loam. The planting conditions of rice are: ≥10℃ accumulated temperature 2500-4500℃·day, water demand field environment, pH suitable range 5.5-7.0, and suitable soil texture is clay loam to clay.
[0200] The rule conflict resolution module is responsible for detecting whether the output of the deep learning decision module violates the agronomic rules and making corrections when conflicts are found. Preferably, the process of rule conflict resolution is as follows: first, check whether the nitrogen, phosphorus, and potassium amounts output by the fertilization decision branch exceed the limits in the fertilization limit rule table. If the recommended amount of a certain nutrient element exceeds the maximum limit, it is forced to be limited to the maximum allowed value, and a warning message is added in the decision report, such as the recommended amount of nitrogen fertilizer has reached the safe limit, please strictly follow the split fertilization plan for application. Second, according to the soil nutrient level classification table, the current soil nutrient level is judged. If the soil content of a certain nutrient element has reached the high or very high level, but the model still recommends a high amount of that nutrient, the recommended amount is reduced by half, and a note is added in the report that the soil X content is high, and appropriate reduction of application is suggested. Third, check whether the crop suitability score output by the planting suggestion branch is consistent with the crop planting condition table. If the suitability score of a certain crop is high, but the current climate conditions (such as accumulated temperature, precipitation) do not meet the planting requirements of the crop, the score of the crop is reduced, and a prompt is added in the report that the climate conditions are not suitable, and careful planting is suggested.
[0201] In a specific embodiment of the present application, the soil test result of a certain plot shows that the available phosphorus content is 45 mg / kg, which belongs to a very high level. The recommended amount of phosphorus fertilizer output by the deep learning decision module is 80 kg / ha. The rule conflict resolution module detects this conflict and corrects the recommended amount of phosphorus fertilizer to 40 kg / ha according to the fertilization limit rule that phosphorus fertilizer should be reduced by 50% or not applied on high-phosphorus soil, and marks in the decision report that the soil available phosphorus content is very high, the phosphorus fertilizer has been reduced by 50% according to the rule, and it is recommended to supplement nitrogen and potassium fertilizer.
[0202] The decision output module 16 is in communication connection with the agronomic knowledge base 15, receives the decision results after rule verification and correction, and generates a comprehensive decision report containing quantitative fertilization formula, crop suitability ranking and soil improvement scheme. The decision output module includes a fertilization scheme generation unit, a crop evaluation unit, a soil improvement unit and an explainability analysis unit.
[0203] The fertilization scheme generation unit calculates the actual fertilization amount and generates a detailed fertilization formula based on the output of the fertilization decision branch and the crop nutrient requirement data.
[0204] First, according to the target yield and the nutrient absorption coefficient of the crop, the nutrient requirement amount of the crop is calculated. Taking nitrogen as an example:
[0205]
[0206] wherein, is the nitrogen requirement amount, with the unit of kg / ha; is the target yield, with the unit of kg / ha; is the nitrogen absorption coefficient of the crop, with the unit of kg nitrogen / (1000 kg grain); is the current soil alkali nitrogen content, with the unit of mg / kg; is the standard soil alkali nitrogen content, usually taken as 120 mg / kg. The term in the bracket represents the reduction coefficient of soil nitrogen supply capacity, when the soil nitrogen content is equal to the standard value, the reduction coefficient is 0, indicating that the soil can fully meet the crop demand; when the soil nitrogen content is lower than the standard value, the reduction coefficient is greater than 0, indicating that it needs to be supplemented by fertilization.
[0207] In a specific embodiment of the present application, the target crop is corn, the target yield is 9000 kg / ha, the nitrogen absorption coefficient kg nitrogen / (1000 kg grain), and the soil alkali nitrogen content is 85 mg / kg. The calculation result is:
[0208]
[0209] However, the actual amount of fertilizer to be applied also needs to take into account the utilization rate of the fertilizer. The utilization rates of different types of fertilizers differ, with the nitrogen utilization rate of urea being about 35%, the nitrogen utilization rate of compound fertilizer being about 30%, and the nitrogen utilization rate of organic fertilizer being about 20%. The actual amount of nitrogen fertilizer to be applied is calculated as follows:
[0210]
[0211] wherein, is the nitrogen utilization rate. If urea is used, then:
[0212]
[0213] Similarly, the actual amounts of phosphorus fertilizer and potassium fertilizer to be applied are calculated. For phosphorus fertilizer:
[0214]
[0215]
[0216] wherein, is the phosphorus absorption coefficient, with a unit of kg of diaphosphorus oxide per (1000 kg of seed grain); is the current soil available phosphorus content, with a unit of mg / kg; is the standard available phosphorus content, which is usually taken as 20 mg / kg; is the phosphorus fertilizer utilization rate, which is about 20% for superphosphoric acid calcium.
[0217] For potassium fertilizer:
[0218]
[0219]
[0220] wherein, is the potassium absorption coefficient, with a unit of kg of potassium oxide per (1000 kg of seed grain); is the current soil available potassium content, with a unit of mg / kg; is the standard available potassium content, which is usually taken as 150 mg / kg; is the potassium fertilizer utilization rate, which is about 50% for potassium chloride.
[0221] After the actual fertilization amount of the three elements of nitrogen, phosphorus and potassium is calculated, a split fertilization scheme is further designed. The split fertilization strategies of different crops are different, mainly based on the nutrient demand law of the growth period of crops. For corn, the split fertilization scheme is: 50% of the nitrogen fertilizer, 50% of the total phosphorus fertilizer and 50% of the potassium fertilizer are applied as base fertilizer; 40% of the nitrogen fertilizer and 50% of the potassium fertilizer are applied as topdressing at the bell-mouth stage; and 10% of the remaining nitrogen fertilizer is applied as topdressing at the grain-filling stage. Specifically, if the total amount of nitrogen fertilizer is 165 kg / ha, the total amount of phosphorus fertilizer is 75 kg / ha, and the total amount of potassium fertilizer is 120 kg / ha, the split fertilization plan is:
[0222] Base fertilizer: nitrogen fertilizer kg / ha, phosphorus fertilizer kg / ha, potassium fertilizer kg / ha;
[0223] Topdressing at the bell-mouth stage (about 40-50 days after sowing): nitrogen fertilizer kg / ha, potassium fertilizer kg / ha;
[0224] Topdressing at the grain-filling stage (about 70-80 days after sowing): nitrogen fertilizer kg / ha.
[0225] In terms of fertilization methods, base fertilizer is recommended to be applied before or at the time of sowing, with a fertilization depth of 15-20 cm and a certain distance from the seeds to avoid burning the seeds; topdressing is recommended to be applied in the form of strip or hole fertilization, with a fertilization depth of 8-10 cm, and the soil should be covered after fertilization and combined with irrigation to improve the utilization rate of fertilizer.
[0226] In terms of fertilizer formula optimization, compound fertilizer with a nutrient ratio close to the demand ratio is preferred. In this embodiment, the demand ratio of nitrogen, phosphorus and potassium is about If there is compound fertilizer with a nutrient ratio of 20-10-15, the ratio of nitrogen, phosphorus and potassium is which is relatively close to the demand ratio, and can be the first choice. When using this compound fertilizer, the amount of compound fertilizer is calculated according to the amount of phosphorus demand: the amount of compound fertilizer is kg / ha. The amount of nitrogen provided by this amount is kg / ha, and the amount of potassium is kg / ha. Compared with the demand amount, the nitrogen is still lacking kg / ha, and the potassium is still lacking kg / ha. Therefore, it is recommended to supplement about 32 kg / ha of urea (containing nitrogen 46%, providing about 15 kg / ha of nitrogen) and about 12 kg / ha of potassium chloride (containing potassium oxide 60%, providing about 7.5 kg / ha of potassium oxide).
[0227] The final fertilizer formulation report includes: fertilizer type (20-10-15 compound fertilizer 750kg / ha, urea 32kg / ha, potassium chloride 12kg / ha); detailed fertilization plan; fertilization method recommendations; expected yield increase (based on historical data, the expected yield increase is about 8%, or about 720kg / ha, yield increase rate of 8%).
[0228] The crop assessment unit generates a recommended crop ranking list based on the output of the planting suggestion branch and the crop planting condition table. For each candidate crop, its comprehensive suitability score, climate suitability, soil suitability, and nutrient matching are evaluated.
[0229] The overall suitability score comes directly from the output of the planting suggestion branch. The value ranges from 0 to 1. For ease of understanding, it is converted into a rating system from 0 to 100 points:
[0230]
[0231] in, For crop indexing.
[0232] Climate suitability assesses the degree to which crops adapt to current climatic conditions. Based on the accumulated temperature requirements, precipitation needs, and suitable temperature range in the crop planting condition table, the climate suitability is calculated.
[0233]
[0234] in, , and These are the indicators for temperature suitability, precipitation matching, and accumulated temperature matching, with values ranging from 0 to 1. , and Let be the weighting coefficient, satisfying In this invention, take , , Climate adaptability is converted into a score from 0 to 100.
[0235] Temperature suitability As defined above, the precipitation matching degree is calculated as follows:
[0236]
[0237] in, This represents the cumulative precipitation. For crops The optimal precipitation level This represents the rainfall tolerance range for crops. The accumulated temperature matching degree is calculated as follows:
[0238]
[0239] where, is the current heat index, and are the minimum and maximum heat requirement of the crop, respectively.
[0240] Soil fitness assesses the fitness of soil texture and pH to the crop. According to the crop planting condition table:
[0241]
[0242] where, is the soil texture fitness, is the pH fitness. The soil texture fitness is determined by whether the current soil type is within the range of the crop suitable texture. If it is within the range, , otherwise (indicating sub-suitability). The pH fitness is calculated as:
[0243] ,
[0244] where, is the current soil pH value, and are the pH suitable range of the crop, and the most suitable pH value. Nutrient fitness assesses the fitness of soil nutrient supply to the crop demand:
[0245]
[0246] , where,
[0247] is the content of nitrogen, phosphorus and potassium elements in the soil, is the demand of the crop for the corresponding element. This index reflects the degree to which the existing soil nutrients can meet the crop demand.
[0248] In one specific embodiment of the present invention, a crop suitability assessment was conducted on a plot of land. The assessment results for the top five candidate crops are as follows: Corn: overall score 85 points, climate suitability 88 points, soil suitability 82 points, nutrient matching 80 points; Wheat: overall score 78 points, climate suitability 82 points, soil suitability 76 points, nutrient matching 75 points; Soybean: overall score 72 points, climate suitability 75 points, soil suitability 70 points, nutrient matching 73 points; Cotton: overall score 68 points, climate suitability 70 points, soil suitability 68 points, nutrient matching 66 points; Potato: overall score 65 points, climate suitability 68 points, soil suitability 63 points, nutrient matching 65 points. Based on these assessment results, it is recommended that users prioritize planting corn.
[0249] Based on the output of the soil improvement branch, the soil improvement unit combines soil testing results and a soil nutrient abundance / deficiency classification table to generate specific soil improvement plans. For improvement measures with an activation probability greater than 0.5, detailed implementation suggestions and dosage calculations are provided.
[0250] If organic matter replenishment measures are activated, calculate the required amount of organic fertilizer based on the current and target soil organic matter content. A 1% increase in soil organic matter requires approximately 15,000 kg of organic fertilizer per hectare. The specific calculation formula is as follows:
[0251] ,
[0252] in, The required amount of organic fertilizer to be applied is expressed in kg / ha. The target organic matter content is typically set at 2.5%. This represents the current organic matter content. Soil bulk density is typically taken as 1.3 g / cm³. To improve the soil depth, 20cm is usually taken.
[0253] In one embodiment of the present invention, the current soil organic matter content is 1.8%, and the target is to increase it to 2.3%, then:
[0254] ,
[0255] It is recommended to apply approximately 2000 kg / ha of commercial organic fertilizer, or to use straw return to the field, with a straw return rate of approximately 3000-4000 kg / ha.
[0256] If acidic soil conditioning measures are activated, calculate the amount of lime required based on the current soil pH and the target pH. The amount of lime to be applied is estimated using the buffer capacity method.
[0257] ,
[0258] wherein, is the amount of lime, in kg / ha; is the pH increase amplitude; is the soil buffer capacity, in cmol / kg, which varies greatly among different soil types, about 5-10 for sandy soil, 10-20 for loamy soil, and 20-30 for clay soil; is the soil bulk density, in g / cm³; is the improved soil layer depth, in m; is the purity of lime, usually 90%.
[0259] In an embodiment of the present application, the current soil pH is 5.5, the target is to increase to 6.5, the soil is loamy soil, the buffer capacity is taken as 15 cmol / kg, the bulk density is 1.3 g / cm³, and the improved depth is 0.2 m, then:
[0260] ,
[0261] It is recommended to apply about 4000-4500 kg / ha of agricultural lime powder, divided into two applications, 2 / 3 of the first application, ploughed into the soil, and the remaining 1 / 3 applied after an interval of 3-6 months.
[0262] Similarly, for other activated improvement measures, corresponding implementation recommendations and dosage calculations are also given.
[0263] The explainability analysis unit calculates the contribution of each input feature to the decision result by the SHAP method, and generates feature importance ranking and decision basis explanation. SHAP is an explainability method based on the Shapley value of game theory, which can fairly quantify the contribution of each feature to the model prediction.
[0264] For any decision output, for example, the recommended amount of nitrogen fertilizer , the SHAP value calculation process is as follows. Let the model be a function , and the input feature vector be , where is the total number of features. For the th feature, its SHAP value is defined as:
[0265] ,
[0266] where, is the set of all features, is the subset of features not containing feature , and is the number of elements in the subset , and indicates the use of only the feature subset the prediction of the model. The formula means that, among all possible feature subsets, the SHAP value of a feature is calculated by adding the change of the model's prediction when the feature is added to the subset, and weighted average according to certain weights. The design of the weights makes the SHAP value satisfy several axioms of fairness and consistency. the change of the prediction of the model before and after the feature is added, and weighted average according to certain weights. The design of the weights makes the SHAP value satisfy several axioms of fairness and consistency.
[0267] In actual calculation, since the number of feature subsets increases exponentially with the number of features, it is impossible to enumerate all subsets. The present application uses the KernelSHAP algorithm for approximate calculation. The algorithm calculates the model's prediction value for each subset by sampling a number of feature subsets, and then estimates the SHAP value of each feature by weighted linear regression. Specifically, for a sampled feature subset , a weighted linear regression problem is constructed as follows:
[0268] ,
[0269] where is the baseline prediction value, usually taking the average prediction value of the training set; is the weight of the th subset, defined as , where is the number of combinations. Solving the regression problem obtains the SHAP value of each feature .
[0270] In one embodiment of the present application, an interpretable analysis is performed on the nitrogen fertilizer recommendation, 1000 feature subsets are sampled, and the SHAP values of each feature are calculated. According to the absolute value of the SHAP value, the top ten features with the largest contribution are: soil organic matter content (SHAP value + 12.5 kg / ha), which means that for every 1% increase in soil organic matter, the average nitrogen fertilizer recommendation increases by 12.5 kg / ha; historical yield level (SHAP value + 8.3 kg / ha), which means that for every 1000 kg / ha increase in historical yield, the average nitrogen fertilizer recommendation increases by 8.3 kg / ha; target crop type-corn (SHAP value + 6.7 kg / ha), which means that choosing corn as the target crop increases the nitrogen fertilizer recommendation; soil alkali nitrogen content (SHAP value - 5.2 kg / ha), which means that the higher the soil nitrogen content, the lower the nitrogen fertilizer recommendation; heat index (SHAP value + 3.8 kg / ha), which means that the higher the accumulated temperature, the more vigorous the crop growth, and the higher the nitrogen demand; precipitation (SHAP value + 2.1 kg / ha), which means that adequate precipitation is beneficial for fertilizer uptake; soil pH (SHAP value - 1.5 kg / ha), which means that when the pH deviates from neutral, the nitrogen utilization rate decreases and the amount of nitrogen fertilizer needs to be reduced; soil texture-sandy loam (SHAP value + 1.2 kg / ha); absorbance of the spectrum at 1650 cm⁻¹ (SHAP value + 0.9 kg / ha), which corresponds to the vibration of amide bonds and reflects the soil protein content; absorbance of the spectrum at 2920 cm⁻¹ (SHAP value + 0.7 kg / ha), which corresponds to the vibration of carbon-hydrogen bonds and reflects the organic matter content.
[0271] Based on these SHAP values, a written explanation is generated: "The main basis for the nitrogen fertilizer recommendation of 185 kg / ha includes: the current soil organic matter content is low (contribution 35%), which requires nitrogen supplementation through fertilization; the target yield is set at 9000 kg / ha (contribution 28%), and corn requires sufficient nitrogen supply for high yield; corn is chosen for planting (contribution 22%), and corn is sensitive to nitrogen fertilizer response; the current soil alkali nitrogen content is 85 mg / kg, which is at a medium-low level (contribution 15%). Such an explanation enables users to understand the logic behind the decision and enhances their trust in the system.
[0272] Finally, the decision output module generates a complete PDF decision report, including soil testing basic information, soil nutrient status evaluation, fertilization recommendation detailed scheme, crop selection recommendation list, soil improvement measures, and decision basis explanation, etc., to provide comprehensive agricultural decision support for users.
[0273] The training method of the deep learning decision module 14 includes steps such as training data set construction, data enhancement, model training, and cross-validation evaluation.
[0274] The construction of the training dataset is the basis of model training. The invention collects historical records containing soil infrared spectrum data, soil physicochemical detection data, climate data, fertilization scheme and actual yield as training samples. Data sources include: 23000 soil profile data provided by China Soil Database, including soil physical and chemical properties and spectral data of part of the samples; data of soil testing and fertilization records of 1500 counties and cities from 2018 to 2023 covered by the National Agricultural Technology Center soil testing and fertilization project; daily weather observation data from the National Meteorological Science Data Center; field test data provided by cooperative farms and agricultural research institutions, totaling 8000 samples. During data integration, for samples lacking spectral data, portable infrared spectrometers are used to supplement collection; for samples lacking yield data, crop growth models are used to estimate yield according to fertilization scheme and climate conditions. The final training set is 30000 labeled samples, and the test set is 5000 samples.
[0275] The data structure of each training sample is as follows: the input includes 1800-dimensional spectral data , 20-dimensional climate features , 9-dimensional soil type encoding , 15-dimensional crop parameters ; the label includes the optimal nitrogen, phosphorus and potassium fertilization amount , , , the most suitable crop category , and the soil improvement measure label . The determination of the optimal fertilization amount uses the following method: if the sample comes from field test data, select the fertilization treatment with the best yield increase effect and the optimal economic benefit as the optimal fertilization amount; if the sample comes from the soil testing and fertilization project, use the expert recommended fertilization scheme; if the sample has no explicit fertilization scheme, calculate the theoretical optimal fertilization amount according to the soil nutrient content, crop demand and fertilization limit rules.
[0276] Data augmentation techniques are used to increase the diversity of training samples and improve the robustness of the model. The following four enhancement methods are applied to spectral data:
[0277] First, wavelength translation. Randomly shift the spectrum by ±2 wave numbers to simulate small differences in instrument wavelength calibration:
[0278] ,
[0279] where is a random integer, uniformly sampled in .
[0280] Second, intensity perturbation. Scale the spectral intensity according to the normal distribution:
[0281] ,
[0282] where, is subject to a normal distribution with mean 1.0 and standard deviation 0.05, i.e. . This augmentation simulates minor changes in sample packing density or instrument response.
[0283] Third, baseline drift simulation. Add a linear or quadratic polynomial baseline offset:
[0284] ,
[0285] where, , and are random coefficients subject to , and distributions, respectively. This augmentation simulates instrument baseline drift.
[0286] Fourth, Gaussian noise injection. Add Gaussian white noise with standard deviation 0.01:
[0287] ,
[0288] where, . This augmentation simulates random noise from the instrument.
[0289] During training, randomly select 1-2 augmentation methods to combine for each sample, so that the model sees more diverse spectral data.
[0290] The model training uses the following configuration: the optimizer is selected as Adam, the initial learning rate is set to 0.001, and the beta parameter is , . The learning rate scheduling uses the cosine annealing strategy, and within 200 training cycles, the learning rate gradually decays from the initial value to 1% of the initial value according to the cosine function:
[0291] ,
[0292] where, is the learning rate of the th cycle, is the initial learning rate, is the minimum learning rate, is the total number of cycles. This learning rate scheduling strategy maintains a high learning rate in the early stage of training to quickly converge, and reduces the learning rate in the later stage to fine-tune.
[0293] The batch size is set to 32 samples. In each training epoch, the training set is randomly shuffled and divided into several batches according to the batch size. The forward propagation, loss function and back propagation are calculated for each batch, and the model parameters are updated. The number of training epochs is set to 200 rounds, but the early stopping mechanism is used: during the training process, the model performance is evaluated on the validation set every 10 epochs. If the validation set loss does not decrease for 20 consecutive rounds, the training is stopped in advance to avoid overfitting.
[0294] In terms of weight initialization, the convolutional layer uses the He initialization method:
[0295] ,
[0296] wherein, is the number of input channels of the layer. The fully connected layer uses the Xavier initialization method:
[0297] ,
[0298] wherein, and are the number of input and output neurons of the layer, represents a uniform distribution. The bias term is initialized to 0.
[0299] In terms of regularization, L2 regularization is used, and a weight square sum term is added to the loss function:
[0300] ,
[0301] wherein, is the regularization coefficient, represents the network layer index, is the weight of the layer. In addition, Dropout is used in the fully connected layer, and the probability is set to 0.3.
[0302] The cross-validation evaluation uses the 5-fold cross-validation method. The 30000 training samples are randomly divided into 5 subsets, each containing 6000 samples. In turn, 4 subsets are used as the training set and 1 subset is used as the validation set, for a total of 5 rounds of training and evaluation. In each fold, the model is trained according to the training configuration described above, and the performance is evaluated on the validation set. The evaluation indicators include:
[0303] For the fertilizer recommendation task, the root mean square error and the determination coefficient are calculated:
[0304] ,
[0305] ,
[0306] wherein, represent the nitrogen, phosphorus or potassium fertilizer use amount, The number of samples in the validation set, And The predicted value and the true value of the first sample, The mean of the true value.
[0307] For the crop suitability prediction task, the Top-3 accuracy is calculated, that is, whether the most suitable crop is in the top three predicted scores:
[0308] ,
[0309] Where, is an indicator function, which is 1 if the condition is true, and 0 otherwise.
[0310] The results of 5-fold cross-validation are averaged to obtain the generalization performance estimate of the model. In the implementation of the present application, the determination coefficients of nitrogen, phosphorus and potassium in fertilizer recommendation are , , , and the root mean square errors are kg / ha, kg / ha, kg / ha. The Top-3 accuracy of crop suitability prediction is 92.5%.
[0311] After training, the model parameters corresponding to the best performance of the validation set are selected as the final model. In order to adapt to the deployment requirements of mobile devices and edge computing, the model is quantized and knowledge distilled. Quantization refers to converting model weights and activation values from 32-bit floating-point numbers to 8-bit integers to reduce model size and computational complexity:
[0312] ,
[0313] Where, is the original floating-point weight, is the quantized integer weight, is the scaling factor, is the zero point. After quantization, the model size is compressed from about 200MB to about 50MB, the inference time on a smartphone CPU is reduced from about 8 seconds to about 1.8 seconds, and the prediction accuracy only decreases slightly, with a determination coefficient decrease of no more than 0.02.
[0314] Knowledge distillation further optimizes the model. Use the original large model as the teacher model, train a student model with fewer parameters, and make the output of the student model as close as possible to the teacher model:
[0315] ,
[0316] Where, Loss for student model and real label, KL divergence for student model and teacher model output:
[0317] ,
[0318] where, and are the predicted probabilities of the teacher and student model for the th class respectively, is a weight coefficient, usually taking 0.3. Through knowledge distillation, the student model inherits the prediction ability of the teacher model while maintaining a small parameter amount, achieving efficient inference on mobile devices.
[0319] To sum up, the soil component detection system based on machine learning and infrared spectrum of the present application realizes rapid on-site detection through a portable infrared spectrometer, automatically extracts spectral features through a deep convolutional neural network, fuses multi-modal data through a multi-head attention mechanism, simultaneously outputs fertilization schemes, crop suitability scores and soil improvement measures through a multi-task learning framework, verifies rules in combination with an agronomic knowledge base, and finally generates a comprehensive decision report containing quantitative fertilization recipes, crop recommendations and improvement schemes. The system has the advantages of high detection efficiency, high prediction accuracy, strong decision support capability, good interpretability and wide adaptability, and provides strong technical support for precision agriculture.
[0320] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A soil composition detection system based on machine learning and infrared spectroscopy, characterized in that, include: The spectral acquisition module is used to perform on-site scanning of soil samples using a portable Fourier transform infrared spectrometer, acquiring spectral data at a depth of 4000-4000 cm. -1 Continuous infrared absorption spectral data within a wavelength range; a spectral preprocessing module, communicatively connected to the spectral acquisition module, used to perform baseline correction, multi-point scattering correction, and standard normal variable transformation on the raw spectral data to generate preprocessed spectral data; The data fusion module is communicatively connected to the spectral preprocessing module and is used to integrate the preprocessed spectral data with regional climate data, soil type data and crop requirement data to construct a fused feature vector. A deep learning decision-making module, communicatively connected to the data fusion module, includes a spectral feature extraction subnetwork, an attention fusion subnetwork, and a multi-task learning subnetwork. The spectral feature extraction subnetwork employs a one-dimensional convolutional neural network structure to automatically extract spectral features from the preprocessed spectral data. The attention fusion subnetwork uses a multi-head attention mechanism to weightedly fuse the spectral features with environmental and crop features to generate a comprehensive feature representation. The multi-task learning subnetwork includes a fertilization decision branch, a planting suggestion branch, and a soil improvement branch, simultaneously outputting fertilization plans, crop suitability scores, and soil improvement measures based on the comprehensive feature representation. An agronomic knowledge base, communicatively connected to the deep learning decision-making module, stores crop nutrient requirement standards, soil nutrient abundance / deficiency indicators, and fertilization limit rules, validating the output results of the deep learning decision-making module. A decision output module, communicatively connected to the agronomic knowledge base, generates a comprehensive decision report containing quantitative fertilization formulas, crop suitability rankings, and soil improvement plans. The workflow of the attention fusion sub-network includes: mapping the spectral features, environmental features, and crop features to a unified embedding space through embedding layers; calculating the correlation weights between features using a multi-head attention mechanism, with each attention head computing the query matrix, key matrix, and value matrix in parallel, and calculating attention weights based on the product of the query matrix and the key matrix to obtain a weighted feature representation; concatenating the outputs of multiple attention heads and obtaining an attention fusion feature vector through a linear transformation; adding the attention fusion feature vector to the input features and normalizing it to generate the comprehensive feature representation. The data fusion module includes: a climate data acquisition unit, which automatically acquires climate parameters of the detection location, including average daily temperature, cumulative precipitation, effective accumulated temperature, and relative humidity; a climate feature calculation unit, connected to the climate data acquisition unit, which calculates derived climate indices based on the climate parameters, including heat index, water deficit index, temperature suitability, and hydrothermal coupling index; a soil type encoding unit, which encodes soil types into unique thermal vectors; a crop parameter extraction unit, which extracts crop nutrient requirement parameters from the agronomic knowledge base according to the target crop; and a feature vector construction unit, connected to the climate feature calculation unit, the soil type encoding unit, and the crop parameter extraction unit, which concatenates the preprocessed spectral data, the derived climate indices, the unique thermal vectors, and the crop nutrient requirement parameters to construct the fused feature vector.
2. The system according to claim 1, characterized in that, The spectral feature extraction subnetwork includes: a first convolutional layer that receives the preprocessed spectral data and performs convolution operations on the preprocessed spectral data using 64 convolutional kernels to extract coarse-grained features; a second convolutional layer connected to the first convolutional layer that performs convolution operations on the output of the first convolutional layer using 128 convolutional kernels to extract medium-scale features; a third convolutional layer connected to the second convolutional layer that performs convolution operations on the output of the second convolutional layer using 256 convolutional kernels to extract fine-scale features; and a global pooling layer connected to the third convolutional layer that performs global average pooling on the output of the third convolutional layer to generate a fixed-dimensional spectral feature vector.
3. The system according to claim 1, characterized in that, The multi-task learning sub-network includes: a shared feature layer, which receives the comprehensive feature representation and performs nonlinear transformation through a fully connected network to generate task-shared features; a fertilization decision branch, connected to the shared feature layer, which includes three parallel fully connected sub-networks that predict nitrogen fertilizer application, phosphorus fertilizer application, and potassium fertilizer application, respectively; a planting suggestion branch, connected to the shared feature layer, which outputs suitability score vectors for different crops; and a soil improvement branch, connected to the shared feature layer, which outputs multi-label classification results to identify the types of soil improvement measures that need to be taken.
4. The system according to claim 3, characterized in that, The multi-task learning sub-network is trained using a weighted loss function. Specifically, the mean squared error loss of the fertilization decision branch, the cross-entropy loss of the planting suggestion branch, and the binary cross-entropy loss of the soil improvement branch are multiplied by their respective weight coefficients and then summed to obtain the total loss value. The weight coefficients are adaptively updated during training using a dynamic task weight adjustment algorithm.
5. The system according to claim 1, characterized in that, The spectral preprocessing module processes the original spectral data as follows: performs baseline correction on the original spectral data using an adaptive iterative weighted least squares method; iteratively reweights and fits the baseline, subtracting it from the original spectral data to eliminate baseline drift; calculates the average spectrum of all sample spectra as a reference spectrum; performs linear regression on each sample spectrum to obtain regression coefficients; uses the regression coefficients to perform multi-point scattering correction on the sample spectra; calculates the mean and standard deviation for each spectral sample; and standardizes the spectral samples to a zero-mean, unit-variance distribution using a standard normal variable transformation.
6. The system according to claim 1, characterized in that, The decision output module includes: a fertilization scheme generation unit, which calculates crop nutrient requirements based on the fertilization scheme, corrects for actual fertilization amount based on fertilizer utilization rate, and generates a fertilization formula including fertilizer type, total fertilization amount, and phased fertilization plan; a crop evaluation unit, which generates a crop recommendation ranking list based on the crop suitability score, with each crop including comprehensive score, climate adaptability, soil adaptability, and nutrient matching degree; a soil improvement unit, which generates improvement schemes based on the soil improvement measures, including organic matter replenishment measures, pH adjustment measures, and heavy metal remediation measures; and an interpretability analysis unit, which calculates the contribution of each input feature to the decision result using the SHAP method, and generates a feature importance ranking and a decision basis explanation.
7. The system according to claim 1, characterized in that, The agronomic knowledge base includes: a crop nutrient requirement data table, storing standard values for nitrogen, phosphorus, and potassium uptake by different crops at target yields; a soil nutrient abundance / deficiency classification table, storing the abundance / deficiency classification standards for organic matter, available nitrogen, available phosphorus, and readily available potassium; a fertilizer application limit rule table, storing the maximum application limits for nitrogen, phosphorus, and potassium fertilizers based on safe fertilization principles; a crop planting condition table, storing the accumulated temperature requirements, precipitation requirements, suitable pH range, and soil texture requirements for different crops; and a rule conflict resolution module, connected to the deep learning decision module, which corrects the output when the output of the deep learning decision module conflicts with the rules in the fertilizer application limit rule table.
8. The system according to claim 1, characterized in that, The training method for the deep learning decision-making module includes: collecting historical data containing soil infrared spectral data, soil physicochemical test data, climate data, fertilization plans, and actual yields as training samples; applying wavelength shifting, intensity perturbation, baseline drift simulation, and Gaussian noise injection to the spectral data in the training samples for data augmentation; using the Adam optimizer to perform end-to-end training of the deep learning decision-making module, and using a cosine annealing learning rate scheduling strategy to adjust the learning rate; evaluating the model's generalization performance through five-fold cross-validation, with evaluation metrics including root mean square error, mean absolute error, coefficient of determination, and fertilization recommendation accuracy.
Citation Information
Patent Citations
Mapping soil properties with satellite data using machine learning approaches
CN113196294A
Soil nutrient spectrum detection and regulation method and system
CN120435970A
Method for the determination of the availability of nitrogen and / or carbon in e.g. soils, earth materials, sediments and composts for the plant growth and for the quentification of the nitrogen fertilization
EP1102065A2