A method and system for rapid multi-parameter determination of vegetable waste
By automatically switching between spectral and image acquisition modes, and combining deep neural networks and hybrid optimization algorithms, the problem of efficient and accurate multi-parameter detection of vegetable waste has been solved, improving detection accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ACADEMY OF AGRICULTURE & FORESTRY SCIENCES
- Filing Date
- 2025-01-24
- Publication Date
- 2026-07-21
AI Technical Summary
Traditional vegetable waste detection technologies are costly and time-consuming, and existing rapid testing equipment has low detection accuracy, making it difficult to meet the needs of large-scale, rapid, multi-parameter simultaneous detection, and lacking comprehensive and systematic analysis.
The system automatically switches between spectral and image acquisition modes to extract spectral and image features, which are then fused into comprehensive features. A deep neural network is constructed to detect multiple parameters of vegetable waste, and a hybrid optimization algorithm is used to optimize the network.
It enables rapid and accurate detection of multiple parameters in vegetable waste, improving detection precision and efficiency, and providing a reliable basis for subsequent processing and resource utilization.
Smart Images

Figure CN120028265B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural science and technology, and more specifically to a method and system for rapid multi-parameter testing of vegetable waste. Background Technology
[0002] Vegetable waste, as an important byproduct of agricultural production, plays an indispensable role in improving agricultural resource utilization efficiency and reducing environmental pollution through its proper treatment and resource utilization. However, in practice, the detection and management of vegetable waste face multiple challenges.
[0003] Traditionally, key parameter testing technologies for vegetable waste rely on laboratory analysis, which is costly and time-consuming. Furthermore, existing rapid testing technologies suffer from low accuracy, susceptibility to interference from complex environments, and difficulty in simultaneous multi-parameter testing, making it challenging to meet the demands of large-scale, rapid testing. In addition, traditional testing methods typically only target a single parameter, lacking comprehensive and systematic multi-parameter analysis, thus hindering a full assessment of the safety and reuse potential of vegetable waste.
[0004] Therefore, how to propose a rapid multi-parameter testing method and system for vegetable waste, and efficiently, accurately and conveniently achieve the simultaneous detection of multiple key parameters of vegetable waste, is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention provides a method and system for rapid multi-parameter testing of vegetable waste, which enables rapid multi-parameter detection of vegetable waste and improves detection accuracy and efficiency.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] On the one hand, this invention proposes a rapid multi-parameter measurement method for vegetable waste, comprising the following steps:
[0008] Automatically switch between spectral acquisition mode and image acquisition mode according to preset conditions to acquire raw spectral data and image data respectively;
[0009] Spectral features are extracted from the original spectral data, and image features are extracted from the image data; the spectral features and the image features are then fused to obtain a comprehensive feature.
[0010] A parameter rapid measurement network is constructed, and the comprehensive features are input into the parameter rapid measurement network to obtain multi-parameter detection results of vegetable waste.
[0011] Preferably, extracting spectral features based on the original spectral data includes:
[0012] The first and second derivative spectra are obtained based on the original spectral data;
[0013] The original spectral data, first derivative spectrum, and second derivative spectrum are normalized;
[0014] Align the spectral data according to the wavenumber, corresponding to the three imaginary parts i, j, and k of the quaternion respectively, and the real part of the quaternion is zero. Embed the normalized spectral data, the normalized first derivative spectrum, and the normalized second derivative spectrum into the quaternion space to represent them as pure quaternion spectral matrix forms, which serve as spectral features.
[0015] Preferably, extracting image features based on the image data includes:
[0016] The image data is preprocessed to obtain image processing data;
[0017] The image processing data is imported into a deep convolutional network to obtain multi-scale features, and the regions in the image processing data whose spectral reflectance differences are greater than a preset threshold are obtained through spectral data.
[0018] The region of interest in the image data is obtained by combining the multi-scale features with the spectral reflectance difference region, the gray-level co-occurrence matrix of the region of interest is obtained, and the texture features are obtained based on the gray-level co-occurrence matrix.
[0019] The image features are generated based on the texture features.
[0020] Preferably, the spectral features and the image features are stitched together to obtain the comprehensive features.
[0021] Preferably, the parameter velocity measurement network is constructed based on a deep neural network, including an input layer, a hidden layer, and an output layer;
[0022] The parameter velocimetry network adds a batch normalization layer after each hidden layer, and uses the dropout method to randomly delete a portion of the neurons in each hidden layer.
[0023] Preferably, the parameter velocity measurement network is optimized using a hybrid optimization algorithm, including:
[0024] Step 1. Initialize the parameters of the genetic algorithm and the Bayesian adaptive direct search algorithm;
[0025] Step 2. Perform a global search based on a genetic algorithm for k generations. In each generation, encode each individual in the population, i.e., a set of network parameter settings of the parameter velocity measurement network, and calculate the fitness. The fitness is the detection error of the multi-parameter detection results of vegetable waste.
[0026] Step 3. If the cutoff condition is met, the optimization ends; otherwise, the BADS local search is performed with the GA optimization result as the starting point.
[0027] Step 4. If the cutoff condition is met, the optimization ends; otherwise, replace the worst individual in the population with the optimization result of the BADS algorithm and go to step 2.
[0028] On the other hand, the present invention also proposes a multi-parameter rapid testing system for vegetable waste, used to implement the above-mentioned multi-parameter rapid testing method for vegetable waste, including:
[0029] The spectrum / image acquisition module is used to automatically switch between spectrum acquisition mode and image acquisition mode according to preset conditions, and acquire raw spectral data and image data respectively.
[0030] The feature extraction module is used to extract spectral features based on the original spectral data, extract image features based on the image data, and fuse the spectral features and the image features to obtain comprehensive features.
[0031] The result output module is used to construct a parameter rapid measurement network, input the comprehensive features into the parameter rapid measurement network, and obtain the multi-parameter detection results of vegetable waste.
[0032] Preferably, the spectral / image acquisition module includes a halogen light source, a lens, a metasurface switcher, a near-infrared enhanced CMOS image sensor, and an acquisition circuit;
[0033] The halogen light source is used to provide illumination for near-infrared spectral data acquisition; the lens includes a light-receiving system and a collimation system. The light-receiving system is used to collect light within the field of view through an anti-reflection coating and then into the lens. The collimation system is used to adjust the light into parallel light. The metasurface switcher is located behind the lens and includes an angle adjustment motor and a metasurface structure plate. The adjustment motor drives the metasurface structure plate to block or move away from the incident light path. When the metasurface structure plate blocks the light path, near-infrared spectra are acquired. When the metasurface structure plate moves away from the light path, RGB images are acquired. A near-infrared enhanced CMOS image sensor and acquisition circuit are used to acquire the incident light.
[0034] Preferably, the spectrum / image acquisition module further includes a background correction device, which includes a spectral baseline correction white board and an RGB correction color card, placed within the field of view to eliminate external natural light and background noise during the acquisition process.
[0035] As can be seen from the above technical solution, compared with the prior art, this invention discloses a method and system for rapid multi-parameter detection of vegetable waste. First, it automatically switches acquisition modes according to preset conditions to acquire raw spectral and image data. Then, it extracts spectral features by differentiating, normalizing, and aligning the spectral data using wavenumbers, and embedding it into quaternion space. Next, it preprocesses the image data, calculates texture features by determining the region of interest through a deep convolutional network and spectral reflectance differences, and then concatenates the spectral and image features into a comprehensive feature set. Finally, it constructs a parameter rapid detection network based on a deep neural network and optimizes it using a hybrid optimization algorithm. The comprehensive feature set is then input to obtain the multi-parameter detection results. This invention can integrate spectral and image information to achieve rapid multi-parameter detection of vegetable waste, improving detection accuracy and efficiency, providing a reliable basis for the subsequent treatment and utilization of vegetable waste, and contributing to related environmental protection and resource utilization work. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0037] Figure 1 A flowchart of the method provided by the present invention;
[0038] Figure 2 The system architecture diagram provided for this invention;
[0039] Figure 3 This is a hardware connection diagram for the spectrum / image acquisition module. Detailed Implementation
[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] This invention discloses a rapid multi-parameter testing method for vegetable waste, with reference to... Figure 1 The method includes the following steps:
[0042] S1. Automatically switch between spectral acquisition mode and image acquisition mode according to preset conditions to acquire raw spectral data and image data respectively.
[0043] A 50W halogen light source is selected to ensure sufficient illumination for near-infrared spectral acquisition. The lens's light-gathering system employs a multi-layer anti-reflection coating, achieving a transmittance of over 95% in the near-infrared band. The collimation system can adjust the light into a highly parallel beam. The metasurface switcher's angle adjustment motor uses a stepper motor with an accuracy of 0.01°, paired with a specially designed metasurface structure sheet, enabling precise switching between spectral and image acquisition modes. The near-infrared enhanced CMOS image sensor has a resolution of 1280×1024, and the acquisition circuit's sampling frequency is 50MHz, allowing for fast and accurate data acquisition. The reflectivity of the spectral baseline correction white board is stable at 98% in the near-infrared region, and the RGB correction color chart uses the X-RiteColorCheckerPassport to ensure accurate color correction.
[0044] In a laboratory setting, vegetable waste samples were evenly spread on a sample stage. The preset conditions of the acquisition system were set to automatically switch between spectral and image acquisition modes at regular intervals. After the system was started, a halogen light source emitted light. In spectral acquisition mode, the metasurface structure sheet blocked the light path, and the light was processed by the lens and then acquired by a near-infrared enhanced CMOS image sensor for near-infrared spectral data (i.e., raw spectral data). When switching to image acquisition mode, the metasurface structure sheet was removed from the light path, and RGB image data (i.e., image data) was acquired. After each acquisition, the system automatically acquired spectral baseline correction white board and RGB correction color card data for subsequent background correction.
[0045] S2. Extract spectral features based on the original spectral data and extract image features based on the image data; fuse the spectral features and image features to obtain comprehensive features.
[0046] S21. Extract spectral features based on the original spectral data, including:
[0047] S211. Calculate the first and second derivative spectra based on the original spectral data.
[0048] The original spectral data were smoothed using the Savitzky-Golay filtering algorithm, and then the first-order derivative spectrum and the second-order derivative spectrum were calculated using the central difference method.
[0049] For raw spectral data First derivative spectrum The calculation formula is:
[0050] ;
[0051] in, Wavelength interval. Second derivative spectrum. The calculation formula is:
[0052] .
[0053] S212. Normalize the original spectral data, the first derivative spectrum, and the second derivative spectrum.
[0054] This embodiment uses the minimum-maximum normalization method to transform the original spectral data. First derivative spectrum and second derivative spectrum Normalize them to the interval [0,1].
[0055] S213. Align the spectral data according to the wavenumber, corresponding to the three imaginary parts i, j, and k of the quaternion respectively, with the real part of the quaternion being zero. Embed the normalized spectral data, the normalized first derivative spectrum, and the normalized second derivative spectrum into the quaternion space to represent them as pure quaternion spectral matrix forms, which serve as spectral features.
[0056] First, convert the wavelength to wavenumber. (unit: ) and wavelength (unit: The relationship is: .
[0057] The target wavenumber range is determined to be 10000-1000. , with 10 Wavenumber alignment was performed to maintain the intervals. Linear interpolation was used to align the spectral data. The aligned normalized original spectral data A, normalized first-derivative spectral data B, and normalized second-derivative spectral data C were then assigned to the imaginary parts i, j, and k of a quaternion, respectively, with the real part of the quaternion being zero, forming a pure quaternion spectral matrix Q. Each quaternion element q is represented as:
[0058] q = 0 + Ai + Bj + Ck.
[0059] According to the basic theory of quaternion algebra, the three types of data need to be combined into the same matrix form. The first and second derivative spectral matrices are both extended into matrices with the same form as the original spectral matrix. Under the premise that the derivative spectral data remain unchanged, the missing columns are filled with a matrix with all elements of 0 to form a matrix with the same form as the original spectral matrix, and then the quaternion spectral matrix is constructed.
[0060] By combining raw spectral data, first-derivative spectral data, and second-derivative spectral data into a quaternion spectral matrix, multiple spectral information can be utilized simultaneously. Raw spectral data reflects the basic absorption and reflectance characteristics of vegetable waste, first-derivative spectral data highlights the rate of change of the spectral curve, and second-derivative spectral data is more sensitive to changes in the curvature of the spectral curve. This multi-parameter fusion approach can more comprehensively characterize the internal composition and structural features of vegetable waste, thereby improving the accuracy of detection.
[0061] S22. Extracting image features based on image data, including:
[0062] S221. Preprocess the image data to obtain image processing data.
[0063] The acquired color image is converted into a grayscale image, and the grayscale image is smoothed using mean filtering.
[0064] S222. Import the image processing data into a deep convolutional network to obtain multi-scale features, and use spectral data to obtain regions in the image processing data where the difference in spectral reflectance is greater than a preset threshold condition.
[0065] Multi-scale features of the image are extracted using a pre-trained VGG16 network. The pre-processed grayscale image is resized to 224×224 pixels and then input into the VGG16 network. The VGG16 network contains multiple convolutional and pooling layers, which extract multi-scale features of the image through different levels of convolution and pooling operations.
[0066] The region in the image whose spectral reflectance difference is greater than a preset threshold (set to 0.1) is obtained by using spectral data.
[0067] S223. Obtain the region of interest in the image data based on multi-scale features and spectral reflectance difference regions, obtain the gray-level co-occurrence matrix of the region of interest, and obtain texture features based on the gray-level co-occurrence matrix;
[0068] By combining multi-scale features extracted from the VGG16 network, thresholding segmentation and morphological operations are used to determine the region of interest (ROI) in the image data. First, thresholding is performed on the spectral reflectance difference image to obtain a binary image. Then, morphological operations such as dilation and erosion are used to remove noise and small interference regions, ultimately determining the ROI.
[0069] For the region of interest, calculate its gray-level co-occurrence matrix (GLCM). This indicates that at a distance of d and a direction of Under the given conditions, the probability of pixel pairs with gray values i and j appearing. In this embodiment, a distance d=1 is selected, and directions of 0°, 45°, 90°, and 135° are used to calculate the gray-level co-occurrence matrix. Texture features such as contrast, correlation, energy, and entropy are calculated based on the gray-level co-occurrence matrix, using the following formulas:
[0070] ;
[0071] In the formula, represents the gray level. , Let i and j be the mean values of their gray levels. , Let i be the standard deviation of gray levels i and j.
[0072] S224. Generate image features based on texture features.
[0073] The calculated texture features (contrast, correlation, energy, and entropy) from different directions are concatenated to form an image feature vector.
[0074] S23. Concatenate the spectral features (converting the pure quaternion spectral matrix into an eigenvector) and the image feature vector to obtain a composite feature vector. During this process, it is essential to ensure that the spectral features and image features are dimensionally matched. This can be achieved through appropriate transformations (such as stretching or compression) to match them in a specific dimension.
[0075] S3. Construct a parameter rapid measurement network, input the comprehensive features into the parameter rapid measurement network, and obtain the multi-parameter detection results of vegetable waste.
[0076] The parameter velocimetry network is constructed based on a deep neural network, including an input layer, hidden layers, and an output layer. The number of neurons in the input layer is determined by the dimension of the comprehensive feature vector to ensure that the comprehensive features can be completely input into the network. There are 3-5 hidden layers, with the number of neurons in each layer adjusted based on experience and experiments, generally ranging from tens to hundreds, such as 128, 64, and 32. These hidden layers are used to progressively abstract and extract the input features, uncovering complex relationships within the data. The number of neurons in the output layer is determined by the number of vegetable waste parameters to be detected; in this embodiment, these parameters include organic matter (organic carbon), moisture, and nitrogen.
[0077] The parametric velocimetry network adds a batch normalization layer after each hidden layer to standardize the inputs to the intermediate layers of the neural network, making the data distribution more stable, accelerating network training, and improving the model's generalization ability. Specifically, for the input data of each hidden layer, the mean and variance within a mini-batch are calculated, then normalized, and finally normalized using two learnable parameters (scaling parameters). and offset parameters The normalized data is then scaled and offset. Assuming the input data is x, the batch normalization formula is:
[0078]
[0079] in It is the mean of the small batch of data. It is the variance of the small batch data. It is a local minimum value (usually taken as...) To prevent the denominator from being zero, and These are parameters learned during the training process.
[0080] Because the network has a large number of neurons, the dropout method is used to randomly remove a portion of neurons in each hidden layer to prevent overfitting.
[0081] This embodiment utilizes a hybrid optimization algorithm to optimize the parameter velocimetry network. The optimization steps are as follows:
[0082] Step 1. Initialize the parameters of the genetic algorithm and the Bayesian adaptive direct search algorithm.
[0083] For the GA algorithm, the population size is set, which determines the number of individuals in each generation; the elite ratio is determined and set to 0.1, meaning the best 10% of individuals in each generation are directly retained to the next generation; the crossover probability is set to 0.8, controlling the probability of crossover between individuals; and the mutation probability is set to 0.05, determining the likelihood of mutation. For the BADS algorithm, the initial grid step size and minimum grid step size are initialized, with the initial grid step size set to 0.1 and the minimum grid step size set to 0.001. These parameters affect the accuracy and range of the local search.
[0084] Step 2. Perform a global search based on the genetic algorithm for k generations. In each generation, encode a set of network parameter settings (such as the number of hidden layer neurons, learning rate, batch normalization layer parameters, dropout probability, etc.) for each individual in the population, i.e., the parameter velocimetry network.
[0085] For each individual in the population, its corresponding network parameters are applied to a parameter rapid testing network. Forward propagation is performed using training data, and the difference between the network output and the true label is calculated as the fitness. In this embodiment, fitness is measured by the mean squared error (MSE) of the multi-parameter detection results for vegetable waste. The smaller the MSE value, the closer the network prediction is to the true value, and the higher the fitness. A new generation of the population is generated through selection, crossover, and mutation operations. Selection is based on the individual's fitness, using methods such as roulette wheel selection or tournament selection to give individuals with high fitness a greater probability of being selected for the next generation. Crossover involves gene exchange between selected individuals with a set crossover probability to generate new individuals. Mutation randomly alters the genes of individuals with a mutation probability, increasing population diversity. After multiple generations of genetic operations, the population gradually approaches the global optimum.
[0086] Step 3. If the cutoff condition is met (the maximum number of iterations is reached or the fitness no longer increases), then the optimization ends; otherwise, the BADS local search is performed with the GA optimization result as the starting point.
[0087] The BADS algorithm alternates between local Bayesian optimization and systematic grid search. During Bayesian optimization, a subset of evaluation points at the current iteration step is fitted using a Gaussian process. Based on a low confidence limit strategy, a new evaluation point is selected by weighing the uncertainty of the search region (high Gaussian process uncertainty) against the probability of the region (low Gaussian process mean). When the search process fails repeatedly, a grid search phase begins, advancing a step size in each direction and evaluating points on the grid until an improvement is found or all directions have been tried. If successful, the step size is doubled; otherwise, it is halved. In this way, the BADS algorithm searches for the optimal solution more precisely in the vicinity of the current point.
[0088] Step 4. If the cutoff condition is met, the optimization ends; otherwise, replace the worst individual in the population with the optimization result of the BADS algorithm and go to step 2 until the cutoff condition is met.
[0089] In this embodiment, the optimized parameter rapid testing network is trained as follows:
[0090] A large amount of vegetable waste sample data was collected, containing known true values for multiple parameters. The sample data was divided into a certain proportion (e.g., 70% training set, 20% validation set, 10% test set). The optimized parameter rapid testing network was trained using the training set data. During training, the network weights and biases were continuously adjusted to minimize the loss function (e.g., mean squared error loss function). A suitable optimizer (Adam optimizer in this embodiment) was used to update the network parameters. The Adam optimizer combines the advantages of momentum optimization and the RMSProp algorithm, and can adaptively adjust the learning rate to accelerate training convergence.
[0091] After training, the comprehensive feature vector is input into the trained parameter rapid testing network for forward propagation calculation. The network output is the predicted value of multiple parameters of vegetable waste, thus obtaining the multi-parameter detection result. By comparing with the true parameter values of the test set samples, appropriate evaluation metrics (such as root mean square error (RMSE) and mean absolute error (MAE)) are used to evaluate the network's detection performance. The smaller the RMSE and MAE values, the more accurate the network's detection results are, and the more effectively it can detect the multi-parameter information of vegetable waste.
[0092] On the other hand, such as Figure 2 As shown, this invention also proposes a multi-parameter rapid testing system for vegetable waste, used to implement the above-mentioned multi-parameter rapid testing method for vegetable waste, including:
[0093] The spectrum / image acquisition module is used to automatically switch between spectrum acquisition mode and image acquisition mode according to preset conditions, and acquire raw spectral data and image data respectively.
[0094] The feature extraction module is used to extract spectral features based on raw spectral data and image features based on image data; and to fuse spectral features and image features to obtain comprehensive features.
[0095] The results output module is used to construct a parameter rapid measurement network. By inputting comprehensive features into the parameter rapid measurement network, the multi-parameter detection results of vegetable waste can be obtained.
[0096] Preferably, the spectral / image acquisition module reference Figure 3 It includes a halogen light source, lens, metasurface switcher, near-infrared enhanced CMOS image sensor, and acquisition circuit;
[0097] A halogen light source is used to provide illumination for near-infrared spectral data acquisition; the lens includes a light-receiving system and a collimation system. The light-receiving system is used to collect light within the field of view through an anti-reflection coating and into the lens, while the collimation system is used to adjust the light into parallel light; a metasurface switcher is located behind the lens and includes an angle adjustment motor and a metasurface structure plate. The adjustment motor drives the metasurface structure plate to block or move away from the incident light path. When the metasurface structure plate blocks the light path, near-infrared spectra are acquired; when the metasurface structure plate moves away from the light path, RGB images are acquired; a near-infrared enhanced CMOS image sensor and acquisition circuit are used to acquire the incident light.
[0098] Preferably, the spectrum / image acquisition module also includes a background correction device, including a spectral baseline correction whiteboard and an RGB correction color chart, which are placed in the field of view to eliminate external natural light and background noise during the acquisition process.
[0099] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0100] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A rapid multi-parameter testing method for vegetable waste, characterized in that, Includes the following steps: Automatically switch between spectral acquisition mode and image acquisition mode according to preset conditions to acquire raw spectral data and image data respectively; This is achieved based on a spectrum / image acquisition module, which includes a halogen light source, a lens, a metasurface switcher, a near-infrared enhanced CMOS image sensor, and an acquisition circuit. The halogen light source provides illumination for near-infrared spectral data acquisition. The lens includes a light-receiving system and a collimation system. The light-receiving system collects light within the field of view through an anti-reflection coating and then into the lens. The collimation system modulates the light into parallel light. The metasurface switcher, located behind the lens, includes an angle adjustment motor and a metasurface structure plate. The adjustment motor drives the metasurface structure plate to block or move away from the incident light path. When the metasurface structure plate blocks the light path, near-infrared spectra are acquired; when the metasurface structure plate moves away from the light path, RGB images are acquired. A near-infrared enhanced CMOS image sensor and acquisition circuit are used to acquire the incident light. Spectral features are extracted from the original spectral data, and image features are extracted from the image data. The spectral features and the image features are fused to obtain the comprehensive features; Extracting spectral features based on the original spectral data includes: The original spectral data, first-derivative spectral data, and second-derivative spectral data are combined in a quaternion spectral matrix; Extracting image features based on the image data includes: The image data is preprocessed to obtain image processing data; The image processing data is imported into a deep convolutional network to obtain multi-scale features, and the regions in the image processing data whose spectral reflectance differences are greater than a preset threshold are obtained through spectral data. The region of interest in the image data is obtained by combining the multi-scale features with the spectral reflectance difference region, the gray-level co-occurrence matrix of the region of interest is obtained, and the texture features are obtained based on the gray-level co-occurrence matrix. The image features are generated based on the texture features; The spectral features and the image features are fused to obtain a comprehensive feature, including: The pure quaternion spectral matrix of spectral features is converted into a feature vector and concatenated with the image feature vector to obtain a comprehensive feature vector. A parameter rapid measurement network is constructed, and the comprehensive features are input into the parameter rapid measurement network to obtain multi-parameter detection results of vegetable waste. The parameter rapid measurement network is optimized using a hybrid optimization algorithm, including: Step 1. Initialize the parameters of the genetic algorithm and the Bayesian adaptive direct search algorithm; Step 2. Perform a global search based on a genetic algorithm for k generations. In each generation, encode each individual in the population, i.e., a set of network parameter settings of the parameter velocity measurement network, and calculate the fitness. The fitness is the detection error of the multi-parameter detection results of vegetable waste. Step 3. If the cutoff condition is met, the optimization ends; otherwise, the BADS local search is performed with the GA optimization result as the starting point. Step 4. If the cutoff condition is met, the optimization ends; otherwise, replace the worst individual in the population with the optimization result of the BADS algorithm and go to step 2.
2. The method for rapid multi-parameter testing of vegetable waste according to claim 1, characterized in that, Extracting spectral features based on the original spectral data includes: The first and second derivative spectra are obtained based on the original spectral data; The original spectral data, first derivative spectrum, and second derivative spectrum are normalized; Align the spectral data according to the wavenumber, corresponding to the three imaginary parts i, j, and k of the quaternion respectively, and the real part of the quaternion is zero. Embed the normalized spectral data, the normalized first derivative spectrum, and the normalized second derivative spectrum into the quaternion space to represent them as pure quaternion spectral matrix forms, which serve as spectral features.
3. The method for rapid multi-parameter testing of vegetable waste according to claim 1, characterized in that, The parameter speed measurement network is constructed based on a deep neural network, including an input layer, a hidden layer, and an output layer; The parameter velocimetry network adds a batch normalization layer after each hidden layer, and uses the dropout method to randomly delete a portion of the neurons in each hidden layer.
4. A multi-parameter rapid testing system for vegetable waste, used to implement the multi-parameter rapid testing method for vegetable waste as described in any one of claims 1-3, characterized in that, include: The spectrum / image acquisition module is used to automatically switch between spectrum acquisition mode and image acquisition mode according to preset conditions, and acquire raw spectral data and image data respectively. The feature extraction module is used to extract spectral features based on the original spectral data and to extract image features based on the image data; The spectral features and the image features are fused to obtain the comprehensive features; The result output module is used to construct a parameter rapid measurement network, input the comprehensive features into the parameter rapid measurement network, and obtain the multi-parameter detection results of vegetable waste.
5. The multi-parameter rapid testing system for vegetable waste according to claim 4, characterized in that, The spectrum / image acquisition module also includes a background correction device, which includes a spectral baseline correction white board and an RGB correction color card, placed within the field of view to deduct external natural light and background noise during the acquisition process.