A method and device for in-situ rapid estimation of tea leaf nutrient elements
By using SG-EPO preprocessing and a multi-task learning network, the problem of moisture affecting the spectral data of tea leaves was solved, enabling rapid and accurate estimation of tea nutrients and improving detection efficiency and precision.
Patent Information
- Application Number
- CN202611626789.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-21
- Publication Date
- 2026-11-20
AI Technical Summary
In the current technology, the detection of nutritional elements in tea leaves relies on professional personnel, which is time-consuming and costly. Furthermore, traditional physicochemical detection methods are difficult to implement in real time in tea gardens, and the spectral data of tea leaves in the fresh state are severely affected by moisture.
SG-EPO preprocessing and a multi-task learning network, including a shared feature extraction layer and multiple task heads, were used to process and analyze hyperspectral data of fresh tea leaves. A multi-task learning network was constructed to predict the content and elemental ratios of nitrogen, phosphorus, potassium, and carbon.
It significantly reduced the impact of moisture on spectral prediction, improved prediction accuracy and generalization ability under small sample conditions, and enabled rapid and accurate estimation of tea nutrient elements.
Smart Images

Figure CN123142218A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural remote sensing and spectral analysis technology, and in particular to a method and apparatus for rapid in-situ estimation of nutrient elements in tea. Background Technology
[0002] Based on its economic and nutritional value, tea is a popular and specialized economic crop worldwide. The tender leaves and buds of tea are key factors determining tea quality and are also the primary objects of observation for tea growth and yield. Therefore, timely and rapid monitoring and assessment of the nutritional elements of harvested tea leaves (i.e., one bud and three leaves) is crucial for regulating tea growth and yield.
[0003] However, the testing of nutritional elements in harvested tea leaves currently relies mainly on professional testing personnel, which is time-consuming and costly. Different tea varieties, tree ages, cultivation methods, and growing environments all affect the accumulation of key elements in tea leaves, and traditional physicochemical testing methods are difficult to use for real-time monitoring in tea gardens. Compared to near-infrared spectroscopy, hyperspectral technology not only provides more abundant spectral information but also offers advantages such as rapid and non-destructive testing, fast data acquisition, avoidance of chemical reagents, and simple operation.
[0004] Raw hyperspectral data of tea leaves contains noise and redundant information due to environmental and equipment influences during acquisition. This necessitates processing the raw spectra to enhance spectral reflectance, eliminate excessive interference, and enable the spectra to effectively characterize weak information. Traditional spectral preprocessing algorithms include SG, MSC, and normalization. While these methods effectively reduce the impact of scattering noise and minute noise, the acquired spectra are "in-situ" measurements. Since tea leaves are fresh, the raw spectral data is susceptible to the influence of moisture content in the fresh tea leaves. Summary of the Invention
[0005] In view of this, it is necessary to provide a method and device for rapid in-situ estimation of nutrients in tea leaves, in order to solve the technical problem that the tea spectral data collected in the prior art are "in-situ" measurements, and since the tea leaves are fresh, the original spectral data will be affected by the moisture in the fresh tea leaves.
[0006] To address the above problems, this invention provides a method for rapid in-situ estimation of nutrient elements in tea, comprising: In-situ hyperspectral data of fresh tea leaves were obtained, and SG-EPO preprocessing and characteristic wavelength selection were performed on the in-situ hyperspectral data of fresh tea leaves to obtain characteristic spectra; A multi-task learning network is constructed, comprising a shared feature extraction layer and multiple task heads; wherein the multiple task heads correspond to nitrogen, phosphorus, potassium, and carbon, respectively. The feature spectrum is input into the multi-task learning network, the shared feature extraction layer extracts the shared spectral features from the feature spectrum, and each task head outputs the corresponding predicted values of nitrogen, phosphorus, potassium and carbon content, thereby determining the content and element ratio of nitrogen, phosphorus, potassium and carbon in fresh tea leaves.
[0007] In one possible implementation, the SG-EPO preprocessing of the in-situ hyperspectral data of fresh tea leaves satisfies the following relationship: ; in, The original spectrum, This indicates that the original spectrum is smoothed using SG. This indicates the main interference direction extracted from the moisture-induced differential spectrum. This means projecting the spectrum onto a space orthogonal to the moisture change.
[0008] In one possible implementation, the loss function of the multi-task learning network includes an element prediction error term and an element ratio constraint term, wherein the element ratio constraint term constrains the consistency between the ratios of the predicted values and the true ratios.
[0009] In one possible implementation, the loss function is expressed by the following formula: ; in, This represents the value of the loss function. Indicates element ratio constraint, Indicates the predicted loss for each element. Indicates biological constraints, Indicates regularization, , , and These are the weighting coefficients.
[0010] In one possible implementation, the element ratio includes at least one of N / P, N / K, and C / N, and the ratio constraint adopts the mean square error of the logarithmic ratio.
[0011] In one possible implementation, the shared feature extraction layer includes: Multiple fully connected blocks; Each fully connected block consists of a fully connected layer, a batch normalization layer, an activation layer, and a Dropout layer, in sequence.
[0012] In one possible implementation, the task header consists of two fully connected layers.
[0013] Secondly, the present invention also provides a device for rapid in-situ estimation of nutrient elements in tea, comprising: The preprocessing module is used to acquire in-situ hyperspectral data of fresh tea leaves, perform SG-EPO preprocessing and characteristic wavelength selection on the in-situ hyperspectral data of fresh tea leaves, and obtain characteristic spectra. A construction module is used to construct a multi-task learning network, which includes a shared feature extraction layer and multiple task heads; wherein the multiple task heads correspond to nitrogen, phosphorus, potassium, and carbon, respectively. The prediction module is used to input the feature spectrum into the multi-task learning network. The shared feature extraction layer extracts the shared spectral features from the feature spectrum. Each task head outputs the corresponding predicted values of nitrogen, phosphorus, potassium, and carbon content, thereby determining the content and element ratio of nitrogen, phosphorus, potassium, and carbon in fresh tea leaves.
[0014] Thirdly, the present invention also provides an electronic device, comprising: a processor and a memory; The memory stores a computer-readable program that can be executed by the processor; When the processor executes the computer-readable program, it implements the steps in the in-situ rapid estimation method for tea nutrients as described above.
[0015] Fourthly, the present invention also provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps in the in-situ rapid estimation method for tea nutrients as described above.
[0016] The beneficial effects of this invention are as follows: First, by using SG-EPO preprocessing, the spectrum is projected onto a space orthogonal to moisture changes, significantly reducing the impact of fresh leaf moisture on nutrient element prediction and improving the effective correlation between the spectrum and elements. Then, a multi-task learning network is employed, sharing the underlying feature extraction layer while each task head outputs independently, fully utilizing the commonalities and specificities among elements to improve prediction accuracy and generalization ability under small sample conditions. Attached Figure Description
[0017] Figure 1 A flowchart illustrating an embodiment of the in-situ rapid estimation method for tea nutrients provided by the present invention; Figure 2 A flowchart of the data acquisition and analysis steps; Figure 3 This is a schematic diagram of data acquisition provided by the present invention; Figure 4 Hyperspectral data map provided for this invention; Figure 5 The spectral preprocessing data diagram provided by this invention; Figure 6 The spectral band selection diagram provided by this invention; Figure 7 The diagram shows the prediction modeling results for the N element provided by this invention; Figure 8 The image shows the prediction modeling results of the P element provided by this invention; Figure 9 The image shows the K-element prediction modeling results provided by this invention; Figure 10 The image shows the prediction modeling results for the C element provided by this invention; Figure 11 The feature importance ranking diagram based on Shapley's additive interpretation method provided by this invention; Figure 12 This is a feature influence summary diagram based on the Shapley additive interpretation method provided by the present invention; Figure 13 A graph showing the model evaluation results for nitrogen element provided by this invention; Figure 14 The model evaluation results of phosphorus provided by this invention are shown in the figure. Figure 15 The images show the preprocessed results of the original spectra, where (a) is the original spectrum and (b) is the preprocessed image of SG binding to EPO. Figure 16 This is a schematic diagram of the structure of an embodiment of a multi-task learning network; Figure 17 This is a schematic diagram of an embodiment of the in-situ rapid estimation device for tea nutrients provided by the present invention; Figure 18 This is a schematic diagram of the operating environment of an embodiment of the electronic device provided by the present invention. Detailed Implementation
[0018] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0019] A specific embodiment of the present invention discloses a method for rapid in-situ estimation of nutrient elements in tea. Please refer to [link to relevant documentation]. Figure 1 ,include: S101. Obtain in-situ hyperspectral data of fresh tea leaves, perform SG-EPO preprocessing and characteristic wavelength selection on the in-situ hyperspectral data of fresh tea leaves to obtain characteristic spectra; It should be noted that in-situ hyperspectral data refers to data obtained by directly collecting spectroscopic data from fresh tea leaves using a hyperspectral analyzer under the natural growth conditions of the tea garden, without damaging the tea trees or picking the leaves. "In-situ" emphasizes that the measurement process does not alter the original state of the sample, avoiding moisture loss and physiological changes caused by harvesting, transportation, or other processes.
[0020] It should be noted that in SG-EPO preprocessing, SG refers to Savitzky-Golay smoothing, a smoothing filtering method based on polynomial least squares fitting, used to improve the spectral signal-to-noise ratio; EPO refers to extrinsic parameter orthogonalization, a preprocessing method that eliminates external interference variables through orthogonal projection. SG-EPO combines SG smoothing with EPO, first smoothing and denoising, then projecting to eliminate moisture interference.
[0021] Furthermore, characteristic wavelength selection refers to screening a subset of bands from the full-band spectrum that are most relevant to the target indicator and contain the most information, in order to reduce data dimensionality, eliminate redundancy and collinearity, and improve model robustness. Commonly used methods include Bootstrap Soft Shrinkage (BOSS), Adaptive Weighted Algorithm (CARS), Variable Combinatorial Population Analysis Iterative Preservation of Information Variables (VCPA-IRIV), and Random Frog Jumping (RF).
[0022] In a specific embodiment of this invention, the "Yinghong No. 9," a specialty tea variety from Guangdong Province, is used as the research object. An ASD FieldSpec4 Hi-Res ground-based spectrometer (Analytical Spectral Devices, Boulder, USA) was used to acquire in-situ spectral data of the second and third leaves. The effective wavelength range of the device is 350-2500 nm, with a spectral resolution of 1 nm. Before spectral acquisition, the reflectance spectrum was calibrated using a barium sulfate (BaSO4) white board. Then, a contact fiber optic cable connecting the FieldSpec4's array detector (field of view FOV of 25°) was used to connect to the leaf clip to capture the light reflected from the target. The leaf clip is equipped with a light source, ensuring the stability and accuracy of the measurement by measuring the spectral data in a closed environment.
[0023] For exogenous GABA application, four 60-meter-long tea rows were selected and divided into four experimental groups: CK, T1, T2, and T3. The control group (CK) was sprayed with water; the experimental groups (T1 and T2) were sprayed with GABA at concentrations of 5 mmol / L, 10 mmol / L, and 50 mmol / L, respectively. Foliar spraying was performed every 10 days at a rate of 30 L per 60-meter tea row, between 3 and 4 PM (avoiding rainy days). After three sprayings, 30 days after the first spraying, in-situ spectral data of the second and third leaves were collected using an ASD FieldSpec4 Hi-Res spectrometer. A total of 50 samples were collected for each treatment, with each sample containing 5 tea buds, resulting in 50 spectral data points per sample. The average value was taken as the final spectral value for that sample.
[0024] After collecting spectral data, the tea buds were placed in a 90℃ drying oven until completely dry. The samples were then ground into powder for subsequent determination of N, P, K, and C elemental contents. N content was determined using a nitrogen analyzer (VARIO MAX, Elementary, Germany); samples were digested and extracted using a microwave digester (ETHOS UP, Milestone, Italy), and P and K contents were determined using an inductively coupled plasma atomic emission spectrometer (PE OPTIMA 8000, PerkinElmer, USA); C content was determined using the potassium dichromate external heating method.
[0025] S102. Construct a multi-task learning network, wherein the multi-task learning network includes a shared feature extraction layer and multiple task heads; wherein the multiple task heads correspond to nitrogen, phosphorus, potassium and carbon respectively; S103. The feature spectrum is input into the multi-task learning network. The shared feature extraction layer extracts the shared spectral features from the feature spectrum. Each task head outputs the corresponding predicted values of nitrogen, phosphorus, potassium, and carbon content, thereby determining the content and element ratio of nitrogen, phosphorus, potassium, and carbon in fresh tea leaves.
[0026] The raw hyperspectral data of fresh tea leaves contains noise and redundant information during the acquisition process due to environmental and equipment influences, and the moisture in the fresh leaves can severely interfere with the spectral signal. Therefore, in some preferred embodiments of the present invention, SG-EPO preprocessing is required for the raw spectra.
[0027] like Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 , Figure 8 , Figure 9 , Figure 10 , Figure 11 , Figure 12 , Figure 13 and Figure 14 As shown, the principle of SG-EPO pretreatment is as follows: Figure 2 and Figure 15 As shown, firstly, the original spectrum is smoothed using SG to obtain... SG smoothing works by taking a window near each wavelength point, fitting the data within the window using polynomial least squares, and then taking the center value of the fitted polynomial as the smoothed value for that point. The window size and polynomial order can be selected according to the spectral resolution; for example, the window size can be 7, 9, 11, 15, etc., and the polynomial order can be 2 or 3. In a preferred embodiment, the window size is selected as 11, and the polynomial order is selected as 2.
[0028] Then, the EPO algorithm is used to eliminate moisture interference. The core idea of EPO is to project the spectrum onto a space orthogonal to moisture changes. Specifically, the main interference directions are extracted from the moisture-induced differential spectrum. The moisture-induced differential spectrum can be obtained by measuring the spectral differences under different moisture states, or by extracting moisture-related loading vectors from the spectral matrix through principal component analysis. It is The matrix, where m is the number of spectral wavelength variables, This is a key parameter dimension of EPO. The value of g is typically 1 to 10, and can be selected according to the complexity of moisture disturbance. In a preferred embodiment, Take 3. Finally, the spectrum after SG-EPO preprocessing is: ; in, The original spectrum, This indicates that the original spectrum is smoothed using SG. This indicates the main interference direction extracted from the moisture-induced differential spectrum. This means projecting the spectrum onto a space orthogonal to the moisture change, thereby suppressing the spectral changes caused by the moisture in fresh leaves, while preserving as much information as possible for subsequent quantitative modeling of N, P, K, and C.
[0029] In some embodiments of the present invention, the full-band spectral data comprises 2050 bands, exhibiting high dimensionality and redundancy, resulting in time-consuming model calculations and the presence of interference factors. Therefore, a spectral characteristic wavelength screening algorithm is used to select effective band combinations, enhancing the robustness and accuracy of the prediction model.
[0030] This invention employs four feature wavelength selection algorithms—Boot-Shrink (BOSS), Adaptive Weighted Algorithm (CARS), Variable Combination Population Analysis Iterative Retaining Information Variable (VCPA-IRIV), and Random Frog Jumping (RF)—to screen effective wavelengths in spectral data processed by SG-EPO.
[0031] BOSS employs 1000 bootstrapping and weighted sampling, continuously updates variable weights through model population analysis, and uses the variable combination corresponding to the minimum root mean square error of cross-validation as the optimal wavelength set.
[0032] CARS is set to perform 50 Monte Carlo samplings, with 80% of the calibration samples randomly selected each time. The absolute value of the PLS regression coefficient is used to evaluate the importance of variables, and low-contribution wavelengths are gradually eliminated through exponential decay function and adaptive reweighting sampling.
[0033] VCPA first establishes a model population through 1000 variable combination samplings to initially compress the spectral variables. Then, it uses IRIV to perform binary matrix sampling and iterative evaluation on the candidate wavelengths. Based on the changes in the model prediction error before and after the addition of variables, the variables are divided into strong information, weak information, no information, and interference variables, and the final characteristic wavelengths are obtained through backward elimination.
[0034] The RF setup is set to 10,000 random iterations, with an initial number of variables of 50 and a variable number control parameter of 0.3. The wavelengths are sorted according to their selection probability during the random iteration process, and the optimal number of wavelengths is determined using cross-validation.
[0035] All four algorithms use PLS as the internal evaluation model, with a maximum number of latent variables set to 15, and employ 10-fold cross-validation. The lowest RMSECV is used as the evaluation criterion for the optimal variable combination.
[0036] Furthermore, SVM_RFE is employed to rank the feature importance of sensitive spectral data processed by BOSS, CARS, VCPA-IRIV, and RF, thereby reducing spectral variable redundancy. The SVM_RFE algorithm is an effective combination of SVM and RFE. First, SVM is used to rank the constructed subset of feature variables by importance. RFE iteratively removes low-scoring variables, and the process continues iteratively while simultaneously considering the correlations between all features. Finally, the top 20 spectral bands are selected as the final feature variables for modeling.
[0037] In one specific embodiment, the optimal characteristic wavelength selection combination algorithm is VCPA-IRIV-SVM_RFE for nitrogen, phosphorus, and potassium; and the optimal characteristic wavelength selection combination algorithm is BOSS-SVM_RFE for carbon. This results in a 20-dimensional characteristic spectrum.
[0038] The characteristic wavelengths extracted based on SVM-RFE are shown in Table 1: Table 1: SVM-RFE Feature Extraction Table
[0039] In some embodiments of the present invention, the multi-task learning network constructed by the present invention includes a shared feature extraction layer and four task heads, corresponding to nitrogen, phosphorus, potassium and carbon, respectively.
[0040] The shared feature extraction layer consists of multiple fully connected blocks. For example... Figure 16 As shown, each fully connected block consists of a fully connected layer, a batch normalization layer, an activation layer, and a Dropout layer in sequence.
[0041] In a preferred embodiment, the shared feature extraction layer comprises three fully connected blocks: The first fully connected block: The fully connected layer has an input dimension of 20 and an output dimension of 128; the batch normalization layer normalizes the 128-dimensional output; the activation layer uses the ReLU function; the dropout layer has a dropout rate of 0.2.
[0042] The second fully connected block: The fully connected layer has an input dimension of 128 and an output dimension of 64; the batch normalization layer normalizes the 64-dimensional output; the activation layer uses the ReLU function; the dropout layer has a dropout rate of 0.2.
[0043] The third fully connected block: The fully connected layer has an input dimension of 64 and an output dimension of 32; the batch normalization layer normalizes the 32-dimensional output; the activation layer uses the ReLU function; the dropout layer has a dropout rate of 0.2.
[0044] The output of the shared feature extraction layer is a 32-dimensional shared spectral feature vector.
[0045] like Figure 16 As shown, each task head consists of two fully connected layers. The first fully connected layer maps the 32-dimensional shared features to 16 dimensions, followed by ReLU activation and Dropout (dropout rate of 0.1). The second fully connected layer maps the 16 dimensions to 1 dimension, followed by the Softplus activation function to output the predicted value. The four task heads output the predicted values for the content of nitrogen, phosphorus, potassium, and carbon, respectively.
[0046] In another embodiment, the multi-task learning network can also employ a graph neural network (GNN) structure. N, P, K, and C are used as four nodes, with initial node features obtained from the output of a shared layer; edges represent stoichiometric relationships, such as NP, NK, CN, etc., and edge weights can be learned.
[0047] In another embodiment, the shared feature extraction layer can also employ a one-dimensional convolutional neural network (1D-CNN) or a Transformer encoder. 1D-CNN extracts local band features by sliding convolutional kernels along the spectral dimension; Transformer captures long-range dependencies between bands through a self-attention mechanism. These variations can serve as alternatives to the shared feature extraction layer.
[0048] In another embodiment, a moisture-assisted task head can be added alongside the four element task heads. The moisture-assisted task head predicts leaf moisture content, serving as an auxiliary task to help the shared layer learn moisture-related features, while complementing SG-EPO. Moisture labels can be determined by an oven-drying method or by using a moisture index instead.
[0049] Furthermore, the loss function of the multi-task learning network of this invention consists of four parts: prediction loss for each element, element ratio constraint, biological constraint, and regularization. The total loss function is: ; in, This represents the value of the loss function. Indicates element ratio constraint, Indicates the predicted loss for each element. Indicates biological constraints, Indicates regularization, , , and These are the weighting coefficients.
[0050] Predicted loss for each element Using the Huber loss function, we get: ; in, For the predicted value of the element, This indicates that the multi-task learning network represents the first... In the nth sample Types of elements ( Predicted values including the content of N, P, K, and C; Indicates the first In the nth sample The true value of the element content; n represents the total number of samples participating in the current training, and the weight coefficient. Uncertainty-weighted automatic learning can be adopted: ; in, The uncertainty parameter is the learnable task parameter.
[0051] Element ratio constraint for: ; Using logarithmic ratios can prevent the ratio distribution from becoming skewed, making the constraints more stable.
[0052] Biological constraints To establish a reasonable range for the element ratios of tea trees or an allometric growth relationship, let... Given a pre-defined set of biologically constrained element ratio pairs, let the ratio be... The reasonable range is ,but: ; In one specific embodiment, the reasonable range for N / P in tea plants can be [5, 20], the reasonable range for C / N can be [15, 30], and the reasonable range for N / K can be [0.1, 1.0]. These ranges can be determined based on actual data.
[0053] Regularization for: That is, the sum of squared Frobenius norms of all linear layer weight matrices, used to prevent overfitting.
[0054] In some embodiments of the present invention, the 20-dimensional feature spectrum after feature wavelength selection is input into the multi-task learning network. The SPXY algorithm is used to divide the hyperspectral data and elemental data into training and test sets in an 8:2 ratio. During training, the Adam optimizer is used, with a batch size of 32 and 500 training epochs. 10-fold cross-validation is employed, and the model performance is evaluated using the coefficient of determination R², root mean square error RMSEP, and relative analysis error RPD. During training, a knowledge distillation strategy can be used: first, an independent XGBoost model is used to train each element, and the predicted values are used as soft labels, which are then used as auxiliary supervision signals for the multi-task network to aid in small-sample training.
[0055] Furthermore, the SHAP method is used to calculate the importance values of all features input to the multi-task learning network, evaluating the contribution of each feature to the output and ratio output of each task. Particular attention is paid to which bands contribute significantly to the N / P ratio and whether they align with known protein and chlorophyll absorption bands. SHAP analysis enhances the interpretability of machine learning models and provides a basis for tea tree nutritional diagnosis.
[0056] Based on the above-described method for rapid in-situ estimation of tea nutrients, this invention also provides a device for rapid in-situ estimation of tea nutrients. Please refer to [link to relevant documentation]. Figure 17 ,include: Preprocessing module 510 is used to acquire in-situ hyperspectral data of fresh tea leaves, perform SG-EPO preprocessing and characteristic wavelength selection on the in-situ hyperspectral data of fresh tea leaves, and obtain characteristic spectra. The construction module 520 is used to construct a multi-task learning network, which includes a shared feature extraction layer and multiple task heads; wherein the multiple task heads correspond to nitrogen, phosphorus, potassium and carbon respectively. The prediction module 530 is used to input the feature spectrum into the multi-task learning network, the shared feature extraction layer extracts the shared spectral features from the feature spectrum, and each task head outputs the corresponding predicted values of nitrogen, phosphorus, potassium and carbon content, thereby determining the content and element ratio of nitrogen, phosphorus, potassium and carbon in fresh tea leaves.
[0057] like Figure 18 As shown, based on the above-mentioned method for rapid in-situ estimation of tea nutrients, this invention also provides an electronic device, which can be a mobile terminal, desktop computer, laptop, handheld computer, server, or other computing electronic device. The electronic device includes a processor 610, a memory 620, and a display 630. Figure 18Only some components of the electronic device are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0058] In some embodiments, memory 620 may be an internal storage unit of the electronic device, such as a hard disk or memory. In other embodiments, memory 620 may be an external storage device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc. Furthermore, memory 620 may include both internal and external storage devices. Memory 620 is used to store application software and various types of data installed on the electronic device, such as program code installed on the electronic device. Memory 620 may also be used to temporarily store data that has been output or will be output. In one embodiment, memory 620 stores a multi-element synergistic prediction program 640 for fresh tea leaves based on hyperspectral technology. This multi-element synergistic prediction program 640 for fresh tea leaves based on hyperspectral technology can be executed by processor 610, thereby realizing the in-situ rapid estimation method for tea nutrient elements in various embodiments of this application.
[0059] In some embodiments, processor 610 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 620 or process data, such as executing a method for rapid in-situ estimation of nutrient elements in tea.
[0060] In some embodiments, display 630 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 630 is used to display information from the hyperspectral-based tea leaf multi-element synergistic prediction electronic device and to display a user interface for visualization. Components 610-630 of the electronic device communicate with each other via a system bus.
[0061] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0062] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for in situ rapid estimation of tea leaf nutrient elements, characterized in that, include: In-situ hyperspectral data of fresh tea leaves were obtained, and SG-EPO preprocessing and characteristic wavelength selection were performed on the in-situ hyperspectral data of fresh tea leaves to obtain characteristic spectra; A multi-task learning network is constructed, which includes a shared feature extraction layer and multiple task heads; wherein the multiple task heads correspond to nitrogen, phosphorus, potassium, and carbon, respectively. The feature spectrum is input into the multi-task learning network, the shared feature extraction layer extracts the shared spectral features from the feature spectrum, and each task head outputs the corresponding predicted values of nitrogen, phosphorus, potassium and carbon content, thereby determining the content and element ratio of nitrogen, phosphorus, potassium and carbon in fresh tea leaves.
2. The method for rapid in-situ estimation of tea nutrients according to claim 1, characterized in that, The SG-EPO preprocessing of in-situ hyperspectral data of fresh tea leaves satisfies the following relationship: , in, The original spectrum, This indicates that the original spectrum is smoothed using SG. This indicates the main interference direction extracted from the moisture-induced differential spectrum. This means projecting the spectrum onto a space orthogonal to the moisture change.
3. The method for rapid in-situ estimation of tea nutrients according to claim 1, characterized in that, The loss function of the multi-task learning network includes prediction error terms for each element and ratio constraint terms for each element. The ratio constraint terms constrain the consistency between the ratios of the predicted values and the true ratios.
4. The method for rapid in-situ estimation of tea nutrients according to claim 3, characterized in that, The loss function is expressed by the following formula: , in, This represents the value of the loss function. Indicates element ratio constraint, Indicates the predicted loss for each element. Indicates biological constraints, Indicates regularization, , , and These are the weighting coefficients.
5. The method for rapid in-situ estimation of tea nutrients according to claim 3, characterized in that, The element ratios include at least one of N / P, N / K, and C / N, and the ratio constraint adopts the mean square error of the logarithmic ratio.
6. The method for rapid in-situ estimation of tea nutrients according to claim 1, characterized in that, The shared feature extraction layer includes: Multiple fully connected blocks; Each fully connected block consists of a fully connected layer, a batch normalization layer, an activation layer, and a Dropout layer, in sequence.
7. The method for rapid in-situ estimation of tea nutrients according to claim 1, characterized in that, The task header consists of two fully connected layers.
8. A device for in-situ rapid estimation of nutrient elements in tea, characterized in that, include: The preprocessing module is used to acquire in-situ hyperspectral data of fresh tea leaves, perform SG-EPO preprocessing and characteristic wavelength selection on the in-situ hyperspectral data of fresh tea leaves, and obtain characteristic spectra. A construction module is used to construct a multi-task learning network, which includes a shared feature extraction layer and multiple task heads; wherein the multiple task heads correspond to nitrogen, phosphorus, potassium, and carbon, respectively. The prediction module is used to input the feature spectrum into the multi-task learning network. The shared feature extraction layer extracts the shared spectral features from the feature spectrum. Each task head outputs the corresponding predicted values of nitrogen, phosphorus, potassium, and carbon content, thereby determining the content and element ratio of nitrogen, phosphorus, potassium, and carbon in fresh tea leaves.
9. An electronic device, characterized in that, include: Processor and memory; The memory stores a computer-readable program that can be executed by the processor; When the processor executes the computer-readable program, it implements the steps in the in-situ rapid estimation method for tea nutrient elements as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps in the in-situ rapid estimation method for tea nutrients as described in any one of claims 1-7.
