Dynamic monitoring and precise regulation and control system for nutrition in growing period of urban vegetable garden based on spectral analysis and machine learning

By constructing a spectrum-nutrient content mapping relationship using hyperspectral imaging and deep learning technologies, and combining it with fuzzy control algorithms to calculate the optimal fertilization scheme, the real-time and accuracy problems of crop nutrient monitoring and regulation in urban vegetable gardens have been solved, achieving efficient and intelligent fertilization management.

CN121708459APending Publication Date: 2026-03-20广州市农业农村科学院
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511687335.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-18
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Traditional crop nutrient monitoring methods have long detection cycles, are complex to operate, and are costly, making it difficult to meet the needs of real-time monitoring and dynamic control in urban vegetable gardens. Furthermore, existing spectral analysis models have limited predictive accuracy, and fertilization techniques fail to fully consider individual crop differences and real-time nutrient status, resulting in low fertilization efficiency.

Method used

Leaf spectral feature parameters are acquired using hyperspectral imaging equipment. By combining multi-scale deep convolutional neural networks and transfer learning strategies, a spectrum-nutrient content mapping relationship is constructed. The optimal fertilization scheme is calculated through fuzzy control algorithms to achieve personalized fertilization regulation.

Benefits of technology

It enables dynamic monitoring and precise control of crop nutrient status in urban vegetable gardens, improves the accuracy and adaptability of nutrient diagnosis, enhances fertilization efficiency, reduces the risk of nutrient excess or deficiency, and improves crop growth quality and yield.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121708459A_ABST
    Figure CN121708459A_ABST
Patent Text Reader

Abstract

The invention provides an urban vegetable garden growth period nutrition dynamic monitoring and precise regulation and control system and method based on spectral analysis and machine learning, and relates to the technical field of crop nutrition diagnosis. A spectrum-nutrient content mapping relation is established, and the crop nutrient state is dynamically monitored. A nutrition diagnosis model based on transfer learning dynamically adjusts diagnosis thresholds in different growth stages through a weight adaptive updating mechanism, and the accuracy and adaptability of diagnosis are remarkably improved. Meanwhile, the optimal fertilization proportion is calculated by adopting a fuzzy control algorithm, accurate nutrition supply is realized through the intelligent fertilization system, the problem of overnutrition or insufficient nutrition is effectively avoided, the fertilization efficiency is improved, and resource waste and environmental pollution are reduced. According to the invention, the growth quality and yield of urban vegetable garden crops are significantly improved, and the intelligent and precise development of urban agriculture is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of crop nutrition diagnosis, and more specifically, to a system and method for dynamic monitoring and precise regulation of urban garden growth period nutrition based on spectral analysis and machine learning. BACKGROUND

[0002] In recent years, with the acceleration of urbanization and the continuous increase of population density, urban agriculture has gradually become one of the important directions to solve the food safety and food supply problems of urban residents. Urban gardens, due to their small land occupation, strong environmental adaptability, and flexible planting methods, have become one of the most representative forms in urban agriculture. However, the nutrition management and growth regulation of urban gardens are directly related to the quality and yield of crops, so efficient and precise crop nutrition monitoring and regulation technology has always been a research hotspot and difficulty. Traditional crop nutrition monitoring methods mainly rely on chemical analysis methods, which obtain the nutrient content by collecting crop samples and conducting laboratory tests. However, this method has the problems of long detection period, complex operation, and high cost, which makes it difficult to meet the needs of real-time monitoring and dynamic regulation in modern urban gardens. In recent years, spectral analysis and machine learning technologies have shown great potential in the field of agriculture. Through spectral technology, plant physiological information can be quickly and non-destructively obtained, and combined with machine learning algorithms, complex data can be analyzed and modeled, which can provide a new solution for dynamic monitoring of crop nutrition.

[0003] Although spectral analysis technology has been widely applied in the field of agriculture, its application in urban gardens still faces many challenges. In existing research, the application of spectral data is mostly limited to static analysis at a single time point, which is difficult to effectively capture the rules of nutrient dynamic changes in the growth cycle of crops. In addition, traditional spectral analysis often ignores the influence of leaf tissue structure on spectral response, resulting in limited prediction accuracy of the model. For the research of nutrition diagnosis model, the existing methods are usually based on fixed model parameters or thresholds, lacking the ability to dynamically adjust the nutrient needs of crops at different growth stages, which leads to the limitation of the diagnosis results. At the same time, the current fertilization regulation technology is mostly based on general fertilization parameters, which fails to fully consider the differences between individual crops and real-time nutrition status, resulting in low fertilization efficiency and even causing problems of excess or insufficient nutrition. These technical deficiencies seriously limit the intelligent and precise development of urban garden production management. SUMMARY

[0004] In order to solve the above technical problems, the present application provides a system and method for dynamic monitoring and precise regulation of urban garden growth period nutrition based on spectral analysis and machine learning.

[0005] According to one aspect of the present application, a spectral analysis and machine learning-based urban garden growth period nutrition dynamic monitoring and precision control system is provided, which comprises: A data acquisition module for multi-angle scanning of crop leaves by a hyperspectral imaging device and obtaining chlorophyll fluorescence characteristic parameters through narrowband spectral technology to realize spectral characterization of the nutritional status; A feature extraction module for processing spectral data and structural features based on a multi-scale deep convolutional neural network, capturing dynamic spectral response features under nutritional stress through parallel convolution branches and attention mechanisms; A mapping modeling module for constructing a nonlinear mapping relationship between spectral features and nutrient content, and realizing accurate prediction of multiple nutrient element contents through residual learning and adaptive weight mechanisms; A nutrition diagnosis module for model transfer based on a transfer learning strategy and realizing precise nutrition diagnosis at different growth stages through a dynamic threshold adjustment mechanism; A decision control module for calculating an optimal fertilization scheme based on a fuzzy control algorithm and realizing intelligent decision-making of fertilization ratios by considering element interaction relationships and growth stage characteristics.

[0006] Further, the feature extraction module extracts features based on the multi-scale deep convolutional neural network; Wherein, the multi-scale deep convolutional neural network includes four convolution unit modules, each of which extracts different scale features and combines channel and spatial attention mechanisms, residual connections and skip connections for feature fusion, and finally obtains feature representations through convolution dimension reduction.

[0007] Further, the feature extraction module standardizes spectral feature parameters, extracts time series statistical features using a sliding window method in combination with leaf structure features based on the PROSPECT model, captures multi-scale temporal changes using causal convolution and dilated convolution, and finally connects all features to form a feature tensor.

[0008] Further, the mapping modeling module constructs a nonlinear mapping relationship between spectral features and nutrient content through a multi-layer nonlinear mapping network based on residual learning, balances prediction tasks of different nutrient elements using an attention mechanism, and adopts multiple rules for training. When the determination coefficient output by the multi-layer nonlinear mapping network is greater than a first preset threshold and the root mean square error is less than a second preset threshold, it is considered that an effective spectral-nutrient content mapping relationship has been established.

[0009] Further, the nutrition diagnosis module constructs a three-dimensional nutrition diagnosis threshold matrix for three key growth stages of crops and uses an uncertainty estimation module for diagnosis to output three-level diagnosis results. The nutrition diagnosis module is based on the multi-scale deep convolutional neural network trained in the feature extraction module. The three-dimensional nutrition diagnosis matrix includes four diagnosis threshold points of nitrogen, phosphorus and potassium.

[0010] Further, when the crop enters a new growth stage, the nutrition diagnosis module triggers a threshold dynamic adjustment mechanism, calculates the target threshold based on historical sample data, and uses the exponential moving average method for smooth transition. Wherein, the target threshold is calculated by using kernel density estimation and Gaussian mixture model analysis of nutrient element distribution based on the historical sample data after multiple standard deviation outlier processing and data interpolation.

[0011] Further, based on the fuzzy control algorithm, the optimal fertilization scheme is calculated based on the nutrition diagnosis result, a fuzzy control system is constructed, the state of nitrogen, phosphorus and potassium is divided into five fuzzy subsets, reasoning is carried out through Gaussian membership function and IF-THEN rule, and the fertilization adjustment coefficient is calculated in combination with the element interaction correction mechanism.

[0012] According to another aspect of the present application, a method for urban garden growth period nutrition dynamic monitoring and precise regulation based on spectral analysis and machine learning is provided, which comprises: Collecting hyperspectral image data of the urban garden crop leaves, obtaining spectral characteristic parameters of chlorophyll fluorescence emission peak and absorption peak through narrowband spectral scanning; Based on the spectral characteristic parameters, combined with the spectral scattering characteristics of leaf tissue structure, the dynamic spectral response characteristics of leaf nutrition stress state are extracted by using deep convolutional neural network, and the spectral-nutrient content mapping relationship is established; According to the spectral-nutrient content mapping relationship, a nutrition diagnosis model based on transfer learning is constructed, which realizes the dynamic adjustment of nutrition diagnosis threshold in different growth stages through weight self-adaptive updating mechanism; Based on the diagnosis result of the nutrition diagnosis model, the optimal fertilization ratio parameter is calculated by using fuzzy control algorithm, and precise nutrition supply is carried out through intelligent fertilization system.

[0013] Compared with the prior art, the urban vegetable garden growth period nutrition dynamic monitoring and precision regulation system and method based on spectrum analysis and machine learning provided by the present application realizes dynamic monitoring of the nutrition state of crops in the growth stage by collecting hyperspectral image data of the leaves of urban vegetable garden crops, combining with narrowband spectrum scanning to obtain spectral characteristic parameters of the chlorophyll fluorescence emission peak and absorption peak, and establishing a spectrum-nutrition content mapping relationship. The nutrition diagnosis model based on transfer learning can dynamically adjust the nutrition diagnosis threshold of crops in different growth stages through a weight self-adaptive updating mechanism, significantly improving the accuracy and adaptability of nutrition diagnosis. In addition, the present application uses a fuzzy control algorithm to calculate optimal fertilization ratio parameters and performs precise nutrition supply through an intelligent fertilization system, thereby realizing personalized fertilization regulation, improving fertilization efficiency, and reducing the risk of excess or insufficient nutrition. In this way, the growth quality and yield of urban vegetable garden crops can be significantly improved, which helps to realize efficient and intelligent management of urban agriculture. BRIEF DESCRIPTION OF DRAWINGS

[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, brief introductions will be given below to the drawings needed to be used in the embodiments or prior art descriptions. Obviously, the drawings described below are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings. In the drawings: Figure 1 A system block diagram of the urban vegetable garden growth period nutrition dynamic monitoring and precision regulation system based on spectrum analysis and machine learning according to an embodiment of the present application. DETAILED DESCRIPTION

[0015] Below, example embodiments according to the present application will be described in detail with reference to the drawings. Obviously, the described embodiments are only some of the embodiments of the present application, not all embodiments of the present application, and it should be understood that the present application is not limited to the example embodiments described here.

[0016] Figure 1 A system block diagram of the urban vegetable garden growth period nutrition dynamic monitoring and precision regulation system based on spectrum analysis and machine learning according to an embodiment of the present application. As shown in Figure 1 In the urban vegetable garden growth period nutrition dynamic monitoring and precision regulation system based on spectrum analysis and machine learning, it includes: A data acquisition module for multi-angle scanning of crop leaves by a hyperspectral imaging device and obtaining chlorophyll fluorescence characteristic parameters through narrowband spectrum technology to realize spectral characterization of the nutrition state; The feature extraction module is configured to process the spectral data and the structural features based on a multi-scale deep convolutional neural network, capture dynamic spectral response features under the nutritional stress state through parallel convolution branches and an attention mechanism. The mapping modeling module is configured to construct a nonlinear mapping relationship between the spectral features and the nutritional content, and realize accurate prediction of the multi-nutrient element content through residual learning and an adaptive weight mechanism. The nutritional diagnosis module is configured to perform model migration based on a transfer learning strategy, and realize precise nutritional diagnosis in different growth stages through a dynamic threshold adjustment mechanism. The decision control module is configured to calculate an optimal fertilization scheme based on a fuzzy control algorithm, and realize intelligent decision of the fertilization ratio by considering the element interaction relationship and the growth stage characteristics.

[0017] In the data acquisition module, a hyperspectral imager is used to collect images of the urban garden crop leaves at a fixed height of 0.5 meters, the collected waveband range is 400-2500nm, and the spectral resolution is 1nm. When collecting, the complete leaves on the upper, middle and lower parts of the leaves are selected as the collection objects, 5 sampling points are set for each leaf, and each sampling point is repeatedly collected 3 times to eliminate random errors.

[0018] The narrowband spectral scanning process: the collected hyperspectral images are separated by using a narrowband tunable optical filter, and the spectral data in the chlorophyll fluorescence emission peak value region 680-740nm and the chlorophyll absorption peak value region 430-460nm, 640-670nm are focused on. The Gaussian fitting method is used to extract the peak values of the fluorescence emission curve, and two chlorophyll fluorescence emission peak values F685nm and F740nm are obtained; at the same time, the absorption peak values of the chlorophyll absorption spectrum at 440nm and 660nm are extracted.

[0019] Spectral feature parameter extraction: based on the obtained fluorescence emission peak values and absorption peak values, the fluorescence ratio parameter F685 / F740, the chlorophyll absorption ratio parameter R440 / R660, and the normalized chlorophyll fluorescence index NCFI=(F740-F685) / (F740+F685) are calculated. At the same time, the red edge position REP (Red Edge Position) is extracted as an important spectral feature parameter representing the chlorophyll content. The spectral feature parameters can effectively reflect the chlorophyll content, photosynthetic efficiency and nutritional status of the crop leaves.

[0020] In another aspect, the feature extraction module analyzes the influence mechanism of leaf tissue structure on spectral scattering based on the PROSPECT leaf optical model. By measuring the diffuse reflectance spectrum and the transmission spectrum of the leaf, the leaf tissue structure parameter N value is calculated, which represents the number of air-cell interfaces in the leaf and directly affects the scattering characteristics of light. Combined with the angle between the incident light and the leaf, the surface characteristics of the leaf and other factors, a leaf bidirectional reflectance distribution function (BRDF) model is constructed to correct the spectral data.

[0021] Further, a multi-scale deep convolutional neural network structure is constructed as follows: First, a backbone network is constructed, which adopts four consecutive convolution unit modules, each module including three parallel branches. The first branch uses a 1x1 convolution kernel to capture local spectral features, and when the input spectral dimension is D, 32 1x1 convolution kernels are used for feature extraction; the second branch uses a 3x3 convolution kernel to extract medium-scale features, with a step size of 1 and a padding of 1 to ensure that the output feature map size remains unchanged; the third branch uses a 5x5 convolution kernel to obtain large-scale context information, and also maintains the feature map dimension by appropriate padding. If noise interference is detected in the feature map, a batch normalization layer is added after each branch's convolution layer to correct the data distribution. After the generation of the feature maps of the three branches, a channel attention module is used to calculate the importance weight of each channel, which is based on the channel descriptor obtained by global average pooling and processed by two fully connected layers and a Sigmoid activation function. For the spatial dimension, a spatial attention module is designed to extract spatial saliency features through a dual-branch of max-pooling and average-pooling. After the feature map is weighted by attention, a residual connection structure is used to fuse the features of each scale. A skip connection is set to combine the fine-grained features of the shallow layer with the semantic features of the deep layer. When the feature passes through each convolution unit module, the feature map of the layer is retained and spliced with the up-sampled feature map of the subsequent layer. Finally, a 1x1 convolution kernel is used to reduce the dimension of the fused multi-scale features to obtain the final feature representation. The entire network is trained in an end-to-end manner, and the weighted mean square error loss is selected as the loss function. When there are differences in the prediction difficulty of different nutrient elements, adaptive weights are used to balance the learning process of each task.

[0022] The processing and analysis process based on the extracted spectral feature parameters and leaf tissue structure features are as follows: Firstly, the extracted spectral feature parameters, including fluorescence ratio parameter F685 / F740, chlorophyll absorption ratio parameter R440 / R660, normalized chlorophyll fluorescence index NCFI and red edge position REP, were standardized. When the data distribution deviated, the Z-score standardization method was used to make the characteristic data mean value 0 and variance 1. For leaf tissue structure features, the N value parameter calculated based on the PROSPECT model was combined with leaf surface characteristic parameters and incident light reflection angle to construct a feature vector matrix. When the spectral data fluctuated in time series, the sliding window method was used for feature extraction, the window size was set to 7 days, and the step was 1 day. The statistical features in the window were extracted, including mean, variance, kurtosis and skewness. If abnormal values were detected, a 3 standard deviation threshold was set for filtering, and the adjacent valid values were interpolated. In the time series feature extraction process, the causal convolution layer was designed, and the convolution kernel size was 3. When the input sequence length was L, the sequence length remained unchanged by padding. To capture the changing features of different time scales, the dilated convolution layer was set, and the dilated rate was 1, 2, 4 and 8 respectively, forming a multi-scale receptive field. When the feature sequence was long, a larger dilated rate could capture long-term dependencies. Finally, all the features were concatenated to construct a complete feature tensor, which contained comprehensive information of spectral features, structural features and time series features, providing a data basis for subsequent nutrition diagnosis. If feature redundancy occurred, principal component analysis was used for dimension reduction, and the principal components with cumulative contribution rate of 95% were retained.

[0023] On the other hand, the establishment process of the spectral-nutrient content mapping relationship in the mapping modeling module is as follows: Based on the previously obtained feature tensor, a multi-layer nonlinear mapping network structure is constructed. The first layer uses a fully connected layer with 256 neurons. When the input feature dimension is high, a nonlinear transformation ability is introduced through the ReLU activation function. A residual learning module is designed, which includes two consecutive fully connected layers with 128 neurons in each layer. When the residual branch and the main branch perform element-wise addition operation, the gradient vanishing problem can be effectively alleviated. Considering the differences in the prediction difficulty of different nutrient elements (nitrogen, phosphorus, and potassium), an attention weight layer is designed. The importance weight of each nutrient element prediction task is calculated through the Softmax function. When the prediction error of a certain nutrient element is large, the weight of this task is automatically increased. In the model training stage, a weighted mean square error loss function is used. The weight coefficient is adaptively adjusted according to the content distribution of each nutrient element. If the sample distribution of a certain nutrient element is uneven, the minority class samples are given higher weights. To improve the generalization ability of the model, an L1 regularization term is introduced. When the regularization coefficient is set to 0.001, overfitting can be effectively suppressed. In terms of optimization strategy, the Adam optimizer is used, and the initial learning rate is set to 0.001. When the validation set loss does not decrease for 5 consecutive epochs, the learning rate is decayed to 0.1 of the original. To ensure the stability of the model, the early stopping strategy is used. When the validation set loss does not improve for 10 consecutive epochs, the training is stopped and the optimal model parameters are saved. Finally, the model performance is evaluated by the test set. When the determination coefficient R² of the prediction result is greater than 0.85 and the root mean square error RMSE is less than the preset threshold, it is considered that an effective spectral-nutrient content mapping relationship has been established.

[0024] On the other hand, the nutrition diagnosis module is based on the established spectral-nutrient content mapping relationship model as the source domain model, which contains rich spectral feature extraction ability and nutrition diagnosis experience. The feature extraction layer and mapping layer parameters of the source domain model are extracted. When migrating to a new target crop, these pre-trained parameters are retained as the basis for model initialization. The parameter migration strategy is set. The lower-level feature extraction network is fine-tuned with a smaller learning rate of 0.0001, and the higher-level mapping network is updated with a larger learning rate of 0.001, ensuring that the model can adapt to the new target domain feature distribution.

[0025] Further, based on the crop growth stage is divided into three key periods of vegetative growth period, flowering period and fruiting period. For different growth stages, construct the nutrition diagnosis threshold matrix, including the normal value range and lack of warning value of nitrogen, phosphorus and potassium three nutrients in each growth stage. When detecting the transition of the current growth stage, dynamically adjust the diagnosis threshold through the weight adaptive update mechanism to ensure the smooth transition of the threshold. More specifically, first establish the growth stage recognizer, based on the crop phenotypic characteristics and growth days, the whole growth cycle is divided into three key periods of vegetative growth period, flowering period and fruiting period. For each growth stage, construct a three-dimensional nutrition diagnosis threshold matrix T, the three dimensions of the matrix correspond to nitrogen, phosphorus and potassium three nutrients, each element contains four diagnosis threshold points: severe deficiency threshold T1, slight deficiency threshold T2, normal upper limit T3 and excessive warning value T4. When detecting the crop into a new growth stage, trigger the threshold dynamic adjustment mechanism, calculate the target threshold based on the historical sample data, use the exponential moving average method for smooth transition, the adjustment formula is: T_new = β × T_history + (1-β) × T_current, where β is the smoothing factor, the initial value is set to 0.2. If the current growth stage is in the transition period (such as from vegetative growth period to flowering period), the smoothing factor β is linearly increased to 0.4, to ensure that the threshold can smoothly transition. When continuously monitoring abnormal samples, start the threshold self-correction mechanism, through the statistical distribution characteristics of the last 50 samples, combined with the standard threshold range in the expert knowledge base, fine-tune the current threshold, the adjustment step is set to 5% of the original threshold.

[0026] More specifically, the process of calculating the target threshold based on historical sample data is as follows: First, valid sample data from the most recent 90 days were selected from the historical sample database, and separate sample sets were established for each nutrient element (nitrogen, phosphorus, and potassium). During sample data preprocessing, outliers were removed using a 3-standard-deviation principle. If missing data was found, the median of the five nearest samples was used for imputation. The cleaned sample data were grouped according to growth stage. For each growth stage, the data distribution curve was fitted using kernel density estimation. When the distribution curve exhibited multi-peak characteristics, a Gaussian mixture model was used for peak separation. Based on the separated peak intervals, quantile statistics for each nutrient level were calculated, with the 5th quantile used as the severe deficiency threshold T1, the 25th quantile as the mild deficiency threshold T2, the 75th quantile as the upper limit of the normal range T3, and the 95th quantile as the excess warning value T4. If the number of samples for a certain growth stage was less than 30, a weighted fusion was performed using standard thresholds from an expert knowledge base. The fusion weights were dynamically adjusted according to the number of samples; when the number of samples was n, the weight of historical samples was set to n / 30. Considering the impact of seasonal variations, the calculated thresholds are seasonally corrected. The correction coefficient is determined based on the mean deviation of historical data for the same period, and the current seasonal correction coefficient S is calculated using data from the same period over the past three years. Simultaneously, a crop variety coefficient K is introduced to correct for differences in nutrient requirements among different varieties under standard conditions. The final target threshold is obtained through a comprehensive calculation formula: T_target = T_base × S × K, where T_base is the base threshold. After calculation, the target threshold is compared with the system's preset physiological safety range. If it exceeds the safety range, it is automatically adjusted to the safety range boundary value. All calculated target thresholds and intermediate calculation parameters are recorded in the threshold calculation log to provide a basis for subsequent threshold optimization.

[0027] Furthermore, to improve diagnostic accuracy, an uncertainty estimation module employs a Dropout ensemble strategy, maintaining the Dropout layer active during prediction and obtaining the mean and variance of the prediction results through multiple forward propagations. When the prediction variance exceeds a set threshold, it is marked as a high-uncertainty sample requiring manual review. Simultaneously, a confidence scoring mechanism is designed to calculate the confidence score for the nutritional status diagnosis based on the distance between the predicted value and the diagnostic threshold. If the confidence score is below 0.8, the sample is added to the model update queue. When the number of samples in the queue reaches a preset value, the online model update process is triggered.

[0028] Finally, a three-tiered diagnostic result output mechanism was constructed. The first tier provides quantitative predictions of nutrient element content; the second tier provides qualitative diagnoses of nutritional status, including four levels: severe deficiency, mild deficiency, normal, and excess; the third tier provides diagnostic recommendations based on expert rules, offering targeted regulatory suggestions when nutritional abnormalities are detected, taking into account the current growth stage and environmental conditions. All diagnostic results are presented through a visual interface and updated in real time to the nutritional monitoring database.

[0029] On the other hand, the decision control module uses the diagnostic results of nitrogen, phosphorus, and potassium output by the nutrition diagnostic model as input variables for the fuzzy controller. For each input variable, five fuzzy subsets are designed: severe deficiency (VL, -2), slight deficiency (L, -1), moderate (M, 0), slight excess (H, 1), and severe excess (VH, 2), where the values ​​in parentheses represent the quantified values ​​of that state. When the input variables are fuzzified, a Gaussian membership function is used for mapping, and the function parameter σ is determined based on the distribution characteristics of historical diagnostic data, typically set to 0.4-0.6. A fuzzy rule base is constructed based on expert knowledge, containing 125 (5×5×5) basic rules. The rule expressions use the IF-THEN form, such as "IF nitrogen is VL AND phosphorus is M AND potassium is L THEN nitrogen fertilizer adjusted to VH AND phosphorus fertilizer adjusted to M AND potassium fertilizer adjusted to H". When multiple rules are activated simultaneously, a maximum-minimum synthesis operator is used for rule synthesis. The activation strength of a rule is calculated by the algebraic product of the membership values ​​of the input variable on each fuzzy subset. During inference, an element interaction correction mechanism is introduced. When the adjustment amount of a certain element is large, the adjustment amounts of other elements are corrected through the nutrient balance matrix B. The correction coefficient is determined based on the antagonistic and synergistic relationships between elements. The defuzzification of the inference results uses the centroid method, converting the results obtained from fuzzy inference into a precise fertilizer adjustment coefficient α. A positive α indicates that the fertilizer application needs to be increased, while a negative α indicates that the fertilizer application needs to be reduced. Finally, the actual fertilizer ratio parameter is calculated based on the adjustment coefficient: F_new = F_base × (1 + α), where F_base is the base fertilizer ratio. If the calculated fertilizer ratio exceeds the safe range, it is corrected through a nonlinear constraint function to ensure that the final fertilizer ratio meets the crop's nutritional needs without causing nutrient overload.

[0030] Based on the calculated optimal fertilization ratio, the intelligent fertilization system is controlled for precise replenishment. First, the fertilization ratio is converted into a specific water-soluble fertilizer formula. Once the formula is determined, a variable frequency pump controls the release rate of different fertilizer storage tanks to achieve precise mixing. The fertilization system employs a segmented control strategy, dividing the daily fertilization amount into 3-4 time periods. When soil moisture is detected to be below a threshold, water replenishment is prioritized; nutrient replenishment is then carried out once soil moisture returns to a suitable range. Simultaneously, a fertilization safety control mechanism is implemented; if the amount of fertilizer applied in a single application exceeds a safety threshold, the fertilization task is automatically completed in multiple stages.

[0031] In summary, the spectral analysis and machine learning-based dynamic monitoring and precise regulation system for the nutritional status of urban vegetable gardens during their growth period, based on embodiments of the present invention, has been elucidated. It collects hyperspectral image data of crop leaves in urban vegetable gardens and combines this with narrowband spectral scanning to obtain spectral characteristic parameters of chlorophyll fluorescence emission and absorption peaks, establishing a spectral-nutrient content mapping relationship to achieve dynamic monitoring of the nutritional status of crops at different growth stages. The nutrient diagnosis model based on transfer learning, through a weight adaptive update mechanism, can dynamically adjust the nutrient diagnosis thresholds for different growth stages of crops, significantly improving the accuracy and adaptability of nutrient diagnosis. Furthermore, the present invention employs a fuzzy control algorithm to calculate the optimal fertilization ratio parameters and uses an intelligent fertilization system for precise nutrient supplementation, thereby achieving personalized fertilization regulation, improving fertilization efficiency, and reducing the risk of nutrient over- or under-fertilization. This can significantly improve the growth quality and yield of crops in urban vegetable gardens, contributing to the efficient and intelligent management of urban agriculture.

[0032] Here, those skilled in the art will understand that the specific operations of each step in the above-described method for dynamic monitoring and precise control of nutrient levels in urban vegetable gardens based on spectral analysis and machine learning have been referenced above. Figure 1 The description of the system for dynamic monitoring and precise regulation of nutrient growth in urban vegetable gardens based on spectral analysis and machine learning has been detailed, and therefore, its repeated description will be omitted.

[0033] In summary, the method for dynamic monitoring and precise regulation of nutrient levels in urban vegetable gardens based on spectral analysis and machine learning, as described in this invention, is elucidated. It collects hyperspectral image data of crop leaves in urban vegetable gardens and combines this with narrowband spectral scanning to obtain spectral characteristic parameters of chlorophyll fluorescence emission and absorption peaks, establishing a spectral-nutrient content mapping relationship to achieve dynamic monitoring of the nutrient status of crops at different growth stages. The nutrient diagnosis model based on transfer learning, through a weight adaptive update mechanism, can dynamically adjust the nutrient diagnosis thresholds for different growth stages of crops, significantly improving the accuracy and adaptability of nutrient diagnosis. Furthermore, this invention employs a fuzzy control algorithm to calculate the optimal fertilization ratio parameters and uses an intelligent fertilization system for precise nutrient supplementation, thereby achieving personalized fertilization regulation, improving fertilization efficiency, and reducing the risk of nutrient over- or under-fertilization. This can significantly improve the growth quality and yield of crops in urban vegetable gardens, contributing to the efficient and intelligent management of urban agriculture.

Claims

1. A system for dynamic monitoring and precise regulation of nutrient levels in urban vegetable gardens during their growth period, based on spectral analysis and machine learning, characterized in that: include: The data acquisition module is used by the hyperspectral imaging equipment to scan crop leaves from multiple angles and obtain chlorophyll fluorescence characteristic parameters through narrowband spectral technology to achieve spectral characterization of nutritional status. The feature extraction module is used to process spectral data and structural features based on a multi-scale deep convolutional neural network. It captures dynamic spectral response features under nutrient stress through parallel convolutional branches and attention mechanisms. The mapping modeling module is used to construct a nonlinear mapping relationship between spectral features and nutrient content. Through residual learning and adaptive weighting mechanisms, it can accurately predict the content of multiple nutrients. The nutrition diagnosis module is used for model transfer based on transfer learning strategies and achieves accurate nutrition diagnosis at different growth stages through a dynamic threshold adjustment mechanism. The decision control module is used to calculate the optimal fertilization scheme based on the fuzzy control algorithm. By considering the interaction of elements and the characteristics of the growth stage, it realizes intelligent decision-making on the fertilization ratio.

2. The system for dynamic monitoring and precise regulation of nutrient distribution in urban vegetable gardens based on spectral analysis and machine learning according to claim 1, characterized in that, The feature extraction module extracts features based on the multi-scale deep convolutional neural network; The multi-scale deep convolutional neural network includes four convolutional unit modules. Each convolutional unit module extracts features at different scales and combines them with channel and spatial attention mechanisms, residual connections and skip connections to perform feature fusion. Finally, feature representation is obtained through convolutional dimensionality reduction.

3. The urban vegetable garden nutrient dynamic monitoring and precise regulation system based on spectral analysis and machine learning according to claim 2, characterized in that, The feature extraction module standardizes the spectral feature parameters and combines them with the blade structure features based on the PROSPECT model. It then extracts temporal statistical features using the sliding window method, and uses causal convolution and dilated convolution to capture multi-scale temporal changes. Finally, it connects all features to form a feature tensor.

4. The urban vegetable garden nutrient dynamic monitoring and precise control system based on spectral analysis and machine learning according to claim 3, characterized in that, The mapping modeling module constructs a nonlinear mapping relationship between spectral features and nutrient content through a multi-layer nonlinear mapping network based on residual learning. It uses an attention mechanism to balance the prediction tasks of different nutrient elements and employs multiple rules for training. When the determination coefficient output by the multi-layer nonlinear mapping network is greater than a first preset threshold and the root mean square error is less than a second preset threshold, it can be considered that an effective spectral-nutrient content mapping relationship has been established.

5. The urban vegetable garden nutrient dynamic monitoring and precise control system based on spectral analysis and machine learning according to claim 4, characterized in that, The nutrient diagnosis module constructs a three-dimensional nutrient diagnosis threshold matrix for three key growth stages of crops, and uses an uncertainty estimation module to perform diagnosis, outputting three levels of diagnosis results. The nutrition diagnosis module is based on the multi-scale deep convolutional neural network trained in the feature extraction module; The three-dimensional nutritional diagnostic matrix includes four diagnostic threshold points for nitrogen, phosphorus, and potassium.

6. The urban vegetable garden nutrient dynamic monitoring and precise control system based on spectral analysis and machine learning according to claim 5, characterized in that, When the crop is detected to have entered a new growth stage, the nutrient diagnosis module triggers a threshold dynamic adjustment mechanism, calculates the target threshold based on historical sample data, and uses an exponential moving average method to smooth the transition. The target threshold is calculated by analyzing the distribution of nutrient elements using kernel density estimation and Gaussian mixture model after multiple standard difference constant processing and data interpolation in the historical sample data, and determining four threshold points based on quantiles.

7. The urban vegetable garden nutrient dynamic monitoring and precise control system based on spectral analysis and machine learning according to claim 6, characterized in that, The optimal fertilization scheme is calculated based on the fuzzy control algorithm. A fuzzy control system is constructed based on the nutrient diagnosis results. The states of nitrogen, phosphorus and potassium are divided into five fuzzy subsets. Reasoning is performed through Gaussian membership function and IF-THEN rule. The fertilization adjustment coefficient is calculated by combining the element interaction correction mechanism.

8. A method for dynamic monitoring and precise control of nutrient dynamics during the growing season of urban vegetable gardens based on spectral analysis and machine learning, based on any one of claims 1 to 7, characterized in that, include: Hyperspectral image data of crop leaves in the urban vegetable garden were collected, and spectral characteristic parameters of chlorophyll fluorescence emission peak and absorption peak were obtained by narrowband spectral scanning; Based on the aforementioned spectral feature parameters and combined with the spectral scattering characteristics of leaf tissue structure, a deep convolutional neural network is used to extract the dynamic spectral response features of leaves under nutrient stress and establish a spectral-nutrient content mapping relationship. Based on the spectrum-nutrient content mapping relationship, a nutrient diagnosis model based on transfer learning is constructed. This model achieves dynamic adjustment of the nutrient diagnosis threshold at different growth stages through a weight adaptive update mechanism. Based on the diagnostic results of the nutritional diagnostic model, the optimal fertilization ratio parameters are calculated using a fuzzy control algorithm, and precise nutrient supplementation is carried out through an intelligent fertilization system.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the urban vegetable garden nutrient dynamic monitoring and precise regulation system based on spectral analysis and machine learning as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the urban vegetable garden nutrient dynamic monitoring and precise regulation system based on spectral analysis and machine learning as described in any one of claims 1 to 7.