Method for predicting and analyzing anthocyanin content of red onion based on CIELab color quantization

Through the combination of CIELab color quantization and near-infrared spectrometer, third-order correlation modeling is constructed, and the subjectivity problem of the prediction of anthocyanins content on red-skinned onion is solved, achieving more efficient prediction accuracy and reliability.

CN120369645AActive Publication Date: 2025-07-25VEGETABLE RES INST OF GANSU ACAD OF AGRI SCI
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510846529.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-07-25
Estimated Expiration
2045-06-24

AI Technical Summary

Technical Problem

In the prior art, the prediction of anthocyanins content on red-skinned onions has strong subjectivity due to sensory evaluation, and lacks an effective quantitative prediction system, which cannot accurately reflect the anthocyanins content.

Method used

CIELab color quantization combined with near-infrared spectrometer is used to construct third-order correlation modeling by improving continuous projection algorithm and particle swarm optimization algorithm, and fuse color parameters and spectral data to achieve accurate prediction of anthocyanin content.

Benefits of technology

It improves the accuracy and reliability of anthocyanin content prediction, reduces subjective interference, enhances the nonlinear capture ability of the prediction model, and shortens the training time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120369645A_ABST
    Figure CN120369645A_ABST
Patent Text Reader

Abstract

The invention discloses a red onion anthocyanin content prediction and analysis method based on CIELab color quantification. The method comprises the following steps: S1, collecting color quantification indexes by using a spectrophotometer; s2, acquiring original spectral data by using a near-infrared spectrometer, and extracting characteristic wavelengths based on an improved continuous projection algorithm to obtain optimal spectral absorption data; s3, performing tensor fusion operation on the color quantitative index and the optimal spectral absorption data to obtain a one-dimensional fusion feature vector, and constructing a three-order correlation model containing spectral data-color parameter-anthocyanin content based on the one-dimensional fusion feature vector in combination with a particle swarm optimization algorithm; and S4, based on three-order correlation modeling, outputting a red onion anthocyanin content prediction result, color parameters directly reflecting visual representation of anthocyanin and spectral data revealing molecular structure information, and after the color parameters and the spectral data are complementary and fused, the model can capture more comprehensive feature correlation, so that the prediction accuracy is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of anthocyanin content prediction, and particularly to a prediction and analysis method for the anthocyanin content of red - skinned onions based on CIELab color quantification. Background Art

[0002] Anthocyanin, as an essential water - soluble pigment in plants, belongs to flavonoid secondary metabolites and is widely present in various tissues and organs of plants. In red - skinned onions, anthocyanin plays a very important role. It not only gives them a unique and bright color, attracting consumers' attention, but also greatly enhances the nutritional value and health benefits of red - skinned onions due to its excellent antioxidant, anti - inflammatory and other biological activities.

[0003] Currently, in the work of grading the appearance color of onion bulbs, the main method is sensory evaluation based on the "Data Standard for Onion Germplasm Resources". However, this traditional method has many drawbacks that cannot be ignored. The evaluation results are extremely vulnerable to the subjective factors of evaluators. For example, there are differences in the visual sensitivity of different people, and the perception and judgment criteria for colors are not the same; the amount of evaluation experience also affects the accuracy of evaluation. Secondly, in the specific field of predicting the anthocyanin content of red - skinned onions, the in - depth research based on the Lab color quantification system is still in its infancy. At present, there is no mature and effective prediction system, which cannot provide strong technical support for the red - skinned onion industry. Therefore, a prediction and analysis method for the anthocyanin content of red - skinned onions based on CIELab color quantification is proposed here. Summary of the Invention

[0004] In order to overcome the above - mentioned defects of the prior art and to achieve the above - mentioned purpose, the present invention proposes the following technical solutions: A prediction and analysis method for the anthocyanin content of red - skinned onions based on CIELab color quantification, comprising: S1: Using a spectrophotometer to collect color quantification indicators; S2: Using a near - infrared spectrometer to collect original spectral data, and extracting characteristic wavelengths based on an improved successive projections algorithm to obtain the best spectral absorption data; Among them, the improved successive projections algorithm is realized by introducing an adaptive parameter adjustment mechanism into the traditional successive projections algorithm; S3: Performing a tensor fusion operation on the color quantification indicators and the best spectral absorption data to obtain a one - dimensional fusion feature vector, and constructing a three - order correlation model including spectral data - color parameters - anthocyanin content based on the one - dimensional fusion feature vector in combination with the particle swarm optimization algorithm; Among them, the one-dimensional fusion feature vector obtains a third-order correlation modeling framework by adjusting the structure of a basic neural network model, and then updates the model parameters of the third-order correlation modeling framework through the particle swarm optimization algorithm and obtains the optimal parameters to construct a third-order correlation modeling including spectral data - color parameters - anthocyanin content; S4: Based on the third-order correlation modeling, output the prediction result of the anthocyanin content of red onion.

[0005] The process of collecting the color quantization index is as follows: Uniformly select 3 measurement points along the middle transverse diameter of the red onion bulb for one week, and use a CR-9 spectrophotometer to measure each measurement point to obtain the lightness data, the axial coordinate data from green to red, and the axial coordinate data from blue to yellow of each point.

[0006] The process of obtaining the best spectral absorption data based on the improved successive projections algorithm is as follows: Randomly select a band as the initial band, select characteristic wavelengths from the full wavelength range of the initial spectral data, select new wavelengths from the remaining wavelengths in the full wavelength range for each iteration, and minimize the condition number of the new set composed of the current selected wavelength set and the new wavelength; Set an initial adaptation threshold , and iteratively determine the final adaptation threshold through an adaptive parameter adjustment mechanism ; Obtain the linear correlation metric value of the matrix formed by the new wavelength and the current selected wavelength set , when and can minimize the condition number of the new set, select the corresponding wavelength and add it to the characteristic wavelength set, and the initial spectral data corresponding to all wavelengths that meet the conditions is the best spectral absorption data .

[0007] The process of obtaining the condition number is as follows: Obtain the matrix X composed of the initial spectral data corresponding to the wavelengths, and based on the norm of the matrix X and the inverse matrix of the matrix X of the norm

[0008] The implementation process of the adaptive parameter adjustment mechanism is as follows: Define the ratio of the number of selected characteristic wavelengths to the total number of wavelengths , where m is the number of currently selected characteristic wavelengths and n is the total number of wavelengths in the full wavelength range; When , use the mean square error to evaluate the performance of the selected characteristic wavelength set, calculate the performance change rate of two adjacent iterations, and when the performance change rate is less than the preset minimum value, reduce the initial adaptation threshold Obtain a new adaptation threshold , and the calculation formula is: where is the adjustment coefficient.

[0009] The process of obtaining the adjustment coefficient is as follows: Through the idea of reinforcement learning, the process of iteratively determining the final adaptation threshold through the adaptive parameter adjustment mechanism is regarded as the behavior of the agent, the spectral data is regarded as the environment, and the performance index of the selected characteristic wavelength set is used as the reward; Define the initial adjustment coefficient range, randomly initialize the adjustment coefficient within the initial adjustment coefficient range to form an initial adjustment coefficient set, For each adjustment coefficient in the initial adjustment coefficient set, use the corresponding adjustment coefficient to adjust the wavelength selection threshold, and obtain the corresponding reward value based on the successive projections algorithm; Store the state, action, reward, and next state in the experience replay pool, randomly extract a batch of experience data, and use the deep neural network to represent the policy function and minimize the loss function to update the neural network parameters; Iteratively update the neural network parameters to find the adjustment coefficient that maximizes the reward and obtain the optimal adjustment coefficient.

[0010] The process of obtaining the one-dimensional fusion feature vector is as follows: Combine the color quantization index and the best spectral absorption data into a two-dimensional tensor, preset a weight tensor, the dimension of the weight tensor matches that of the two-dimensional tensor, and obtain the one-dimensional fusion feature vector through the tensor contraction operation.

[0011] The process of obtaining the third-order correlation modeling framework is as follows: The preset basic neural network model includes an input layer, a middle layer, and an output layer; Modify the number of neurons in the input layer to the dimension of, add custom convolutional layers and fully connected layers to the middle layer of the pre-trained model. The custom convolutional layers and fully connected layers are 2 to 3 convolutional layers, the convolutional kernel sizes are 3×3 and 5×5 respectively, the stride is 1, and the padding is 1. Replace the output layer with a fully connected layer with a single neuron, and the output of the neuron is the predicted anthocyanin content value.

[0012] The process of obtaining the optimal model parameters by updating the model parameters based on the particle swarm optimization algorithm is as follows: Based on the particle swarm optimization algorithm, regard each particle as a parameter combination, which includes parameters to be optimized, and define a fitness function to obtain the fitness value of each particle; Update the positions and velocities of the particles in the swarm. After each iteration, compare the fitness value of each particle with its own historical best fitness value to find the current global best position. The model parameters corresponding to the global best position are the combination of model parameters with the highest fitness value. Use the regression task loss function to train and evaluate the model. When the obtained loss function is minimized, a fully trained third-order correlation model is obtained.

[0013] The present invention has the following beneficial effects: First, through the tensor fusion of the CIELab color quantization index and the near-infrared spectral data, a third-order correlation model including "spectrum-color-anthocyanin content" is constructed, breaking through the information limitation of single-modal data. The color parameters directly reflect the visual representation of anthocyanins, and the spectral data reveals the molecular structure information. The two complement each other. After fusion, the model can capture more comprehensive feature correlations and significantly improve the prediction accuracy. Second, the improved successive projections algorithm introduces an adaptive parameter adjustment mechanism, and dynamically optimizes the threshold adjustment coefficient γ through reinforcement learning, enabling the algorithm to automatically adjust the strictness of feature wavelength selection according to the sample characteristics. When the proportion of the selected wavelength number reaches 20%, the threshold is dynamically adjusted based on the mean square error change rate, avoiding the subjectivity of manual parameter tuning, effectively reducing the interference of redundant wavelengths, and retaining the most representative spectral features. Finally, the particle swarm optimization algorithm is used for parameter optimization of the third-order correlation model. Regarding the tensor fusion weights and neural network parameters as particles, the optimal parameter combination is obtained through global search. Compared with the traditional gradient descent method, PSO can more efficiently jump out of the local optimal solution, shorten the model training time, and at the same time enhance the ability to capture the non-linear relationship of spectral-color data through the convolutional layer design, realizing accurate regression prediction of anthocyanin content. Description of the Drawings

[0014] Figure 1 It is a method step diagram of the prediction and analysis method for anthocyanin content in red onion based on CIELab color quantization proposed by the present invention. Detailed Embodiments

[0015] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0016] Embodiment 1 As Figure 1 shown, the prediction and analysis method for anthocyanin content in red onion based on CIELab color quantization proposed by the present invention includes: S1: Collect color quantization indexes using a spectrocolorimeter. Randomly select fully mature red - skinned onions as samples and remove their outer dry skins to avoid interference of the outer dry skins on color measurement. Uniformly select 3 measurement points along the middle - diameter circumference of the red - skinned onion bulb. Use a CR - 9 spectrocolorimeter to measure each measurement point to obtain the L (lightness data), a (axial coordinate data from green to red), and b (axial coordinate data from blue to yellow) data for each point. Specifically, the value range of the L value is 0 - 100, and the larger the value, the brighter the color. A negative a value indicates a tendency towards green, and a positive value indicates a tendency towards red. A negative b value represents a tendency towards blue, and a positive value represents a tendency towards yellow. Take the average of the L, a, and b values obtained from the 3 measurement points of each bulb to reduce measurement errors. Measure 10 bulbs for each material, and repeat the measurement 3 times for each bulb. Then, average the average L, a, and b values of the 10 bulbs again to obtain the representative values of L (lightness), a (axial coordinate from green to red), and b (axial coordinate from blue to yellow) for final analysis. Based on the representative values of L (lightness), a (axial coordinate from green to red), and b (axial coordinate from blue to yellow), 、 、 calculate color quantization indexes, which include color value, hue value, and color and luster index. The color value Chroma is used to measure the concentration of pigments. The larger the Chroma value, the higher the pigment concentration. The calculation formula is: ; The hue value Hue reflects basic color types such as red, orange, green, blue, purple, and transitional colors between these colors, helping to judge the color type and hue tendency. The calculation formula is: ; The color and luster index CIRG is used to comprehensively reflect the surface color characteristics of substances. The calculation formula is: ; The color quantization indexes are expressed as ; Specifically, by selecting points at the mid-diameter of the red onion bulb for measurement and taking the average multiple times to obtain the representative values of the CIELab color parameters (L, a, b), the lightness, red-green, and yellow-blue axial coordinate information of the red onion epidermis color can be accurately reflected. By selecting 3 measurement points for each bulb and taking the average, measuring 10 bulbs for each material and averaging 3 measurements for each repetition, this method of taking the average of multiple measurements can effectively reduce measurement errors caused by factors such as uneven samples and measurement instrument errors, improving the accuracy and reliability of the color parameters. Finally, based on the representative values 、 、 Calculate derivative indicators such as Chroma, Hue, and CIRG, which enrich the description of the color characteristics of red onions from different angles and help to deeply analyze the relationship between color and the inherent properties of anthocyanin content.

[0017] S2: Use a near-infrared spectrometer to collect the original spectral data, and perform characteristic wavelength extraction based on the improved successive projections algorithm to obtain the best spectral absorption data; Among them, the improved successive projections algorithm is realized by introducing an adaptive parameter adjustment mechanism into the traditional successive projections algorithm; Based on mature peeled red onions, use a near-infrared spectrometer to scan the average spectrum 10 times in the range of 900 - 1700 nm, with a resolution of 2 nm, and obtain the initial spectral data S after normalization processing; Perform characteristic wavelength extraction based on the initial spectral absorption data through the improved successive projections algorithm; Randomly select a wavelength band as the initial band, and select characteristic wavelengths from the full wavelength range of the initial spectral data S. Each iteration selects a new wavelength from the remaining wavelengths in the full wavelength range such that the condition number of the new set composed of the current selected wavelength set (m is the number of currently selected characteristic wavelengths) and the new wavelength is minimized; The condition number is used to measure the abnormality of the matrix. The process of obtaining the condition number is as follows: Obtain the matrix X composed of the initial spectral data corresponding to the wavelengths. Its condition number cond(X) is defined as the norm of the matrix X and the norm of the inverse matrix of the matrix X The product of is, that is: .

[0018] Continuously select the wavelength that minimizes the condition number of the new set, and introduce an adaptive parameter adjustment mechanism to gradually construct the characteristic wavelength set ; Set an initial adaptation threshold , the final adaptation threshold is iteratively determined through an adaptive parameter adjustment mechanism ; During the iteration process, the initial adaptation threshold is adjusted according to the change in the performance index of the selected characteristic wavelength set ; Define the ratio of the number of selected characteristic wavelengths to the total number of wavelengths , where m is the current number of selected characteristic wavelengths and n is the total number of wavelengths in the full wavelength range; When reaches a specific ratio (i.e., ), the mean square error (MSE) is used to evaluate the performance of the selected characteristic wavelength set. Let the performance of the selected characteristic wavelength set at the i-th iteration be , and calculate the performance change rate between two adjacent iterations , and the calculation formula is: .

[0019] Among them, represents the performance of the selected characteristic wavelength set at the -th iteration on the validation set; Specifically, the mean square error (MSE) is used to evaluate the performance of the selected characteristic wavelength set. First, sample data of the selected characteristic wavelength set is collected, and the spectral intensity data corresponding to the selected characteristic wavelength set is matched with the true anthocyanin content data of the samples. For each sample, calculate the error between its spectral information under the selected characteristic wavelength set and the true anthocyanin content, sum the squares of the errors of all samples, and then divide by the total number of samples. The resulting mean square error represents the performance of the selected characteristic wavelength set. The smaller the MSE value, the closer and more accurate the relationship between the selected characteristic wavelength set and the anthocyanin content; When is less than a preset minimum value ( ), that is, when the performance improvement of the selected characteristic wavelength set starts to slow down, reduce the initial adaptation threshold to obtain a new adaptation threshold , and the calculation formula is: Among them, is the adjustment coefficient; The process of obtaining the adjustment coefficient is as follows: Through an idea of reinforcement learning, the process of iteratively determining the final adaptation threshold through an adaptive parameter adjustment mechanism is regarded as the behavior of the intelligent agent, the spectral data is regarded as the environment, and the performance index of the selected characteristic wavelength set is used as the reward to find the optimal ; Define the initial adjustment coefficient range ( , ), and randomly initialize a series of values within this range to form an initial candidate set (initial adjustment coefficient set) , being the number of candidates; For each in the initial adjustment coefficient set , use the corresponding to adjust the initial adaptation threshold (according to ), and then obtain the corresponding reward value R based on the successive projection algorithm (SPA); Based on the successive projection algorithm (SPA), define the reward function through the performance change rate, expressed as , that is, the smaller the performance change rate, the higher the reward value; Construct an experience replay pool D, and store the experience data (state, action, reward, next state) of each iteration. Among them, the state is the state information of the selected characteristic wavelength set before adjusting the threshold, including the current number m of selected characteristic wavelengths and the performance change rate , the action is the process of using the adjustment coefficient to adjust the initial adaptation threshold, the next state is the state information corresponding to the new selected characteristic wavelength set after adjusting the threshold and re-screening the wavelengths, and the reward is the value of the reward function ; Store these experiences in the experience replay pool D, randomly extract a batch of experience data from the experience replay pool D, and use the deep neural network to represent the policy function of the experience data. Update the network parameters by minimizing the loss function of the deep neural network, continuously iterate and update the network parameters, so that the policy function is gradually optimized (the loss function is gradually minimized), and find the that can maximize the reward, and the adjustment coefficient corresponding to the that maximizes the reward is the optimal adjustment coefficient ; Specifically, update the gap between the output of the current policy function (i.e., the predicted action) and the actual expected action by minimizing the loss function of the deep neural network. Since the policy function determines what action should be taken in the current state, using the deep neural network as the policy function and minimizing the loss function of the deep neural network is to make this gap (the predicted action and the actual expected action) smaller and smaller, making the policy function more accurate and effective; Among them, the state is defined as the current value and the selected wavelength set, and the action is to select a certain The value adjustment threshold, the reward is the calculated reward value, and the next state is the state updated after performing the action (such as the new selected wavelength set); Meanwhile, consider whether the linear correlation between the new wavelength and the existing wavelength set meets the initial adaptation threshold , calculate the new wavelength The linear correlation metric value r of the matrix X formed by the new wavelength and the currently selected wavelength set, and let the new wavelength The corresponding initial spectral data is , the spectral data matrix corresponding to the selected wavelength set is X, and the calculation formula for the linear correlation metric value r is: .

[0020] Among them, N is the number of samples, is the k-th element in the new wavelength , is the mean of all elements in the new wavelength , is the k-th row vector of the matrix , is the mean of each row vector of the matrix ; Specifically, when obtaining spectral data, multiple red onion samples are usually measured, and each sample has a corresponding spectral intensity value at the new wavelength . Arranging the spectral intensity values of all samples at the new wavelength in sample order forms the initial spectral data corresponding to the new wavelength ; Only when and it can minimize the condition number of the new set, the corresponding wavelength is selected and added to the characteristic wavelength set. In this way, during the iteration process, as the threshold is dynamically adjusted, all eligible wavelengths are continuously screened out, and the initial spectral data corresponding to all the finally screened wavelengths forms the best spectral absorption data .

[0021] S3: Perform a tensor fusion operation on the color quantization index and the best spectral absorption data to obtain a one-dimensional fusion feature vector, and construct a third-order correlation model including spectral data - color parameters - anthocyanin content based on the one-dimensional fusion feature vector combined with the particle swarm optimization algorithm; Among them, the one-dimensional fusion feature vector obtains a third-order correlation modeling framework by adjusting the structure of a basic neural network model, and then updates the model parameters of the third-order correlation modeling framework through the particle swarm optimization algorithm and obtains the optimal parameters to construct a third-order correlation model including spectral data - color parameters - anthocyanin content; The process of obtaining the one-dimensional fusion feature vector of the tensor through tensor fusion operation is as follows: Combine the color quantization index and the optimal spectral absorption data into a two-dimensional tensor , expressed as: .

[0022] Specifically, the first row of this two-dimensional tensor contains various color-related normalization parameters, and the second row is the normalized spectral data after feature wavelength extraction. By integrating different types of data into a tensor structure, it prepares for subsequent fusion operations; Initialize a weight tensor W using random numbers. The dimension of the weight tensor W matches that of the tensor , which is a tensor of (2×(3 + M)), where 3 is the basic dimension of the color quantization index , and M is the number of derived color indices. Then, obtain the one-dimensional fusion feature vector F through tensor contraction operation; Specifically, the tensor contraction operation refers to the summation of the product of the corresponding elements of the tensor and the weight tensor W, that is, each element in the tensor is multiplied by the corresponding weight in the weight tensor W, and then all the product results are accumulated. Finally, a one-dimensional fusion feature vector is obtained. This fusion feature vector combines the information of color parameters and spectral absorption features and serves as the input for subsequent modeling; Preset a basic neural network model, take the one-dimensional fusion feature vector as the input, and adjust the neural network model to obtain the third-order correlation model framework. The process is as follows: The preset basic neural network model includes an input layer, a middle layer, and an output layer; Input layer adjustment: Modify the input layer of the basic neural network model so that it can receive the one-dimensional fusion feature vector , and modify the number of neurons in the input layer to the dimension of (2×(3 + M)); Middle layer adjustment: Add custom convolutional layers and fully connected layers to the middle layer of the basic neural network model. The custom convolutional layers and fully connected layers are 2 to 3 convolutional layers, with convolutional kernel sizes of 3×3 and 5×5 respectively, a stride of 1, and a padding of 1; Output layer adjustment: Replace the output layer of the basic neural network model with a fully connected layer with a single neuron. The output of the neuron is the predicted anthocyanin content value, and the activation function is selected as a linear function; Obtain the third-order correlation modeling framework after adjustment; The process of updating model parameters based on the particle swarm optimization algorithm to obtain the optimal model parameters is as follows: Through a particle swarm optimization algorithm, each particle is regarded as a set of parameter combinations related to a one-dimensional fusion feature vector These parameters include the element values of the weight tensor in the tensor fusion process, as well as the parameters of the layers related to processing the one-dimensional fusion feature vector (the connection weights from the input layer to subsequent layers) in the neural network model. Suppose there are parameters to be optimized, and a particle contains a corresponding parameter; Define a fitness function Obtain the fitness value of each particle. For example: , where is the loss when using the corresponding parameters of the particle, is the fitness value, and the higher it is, the better the parameter combination; Specifically, in the particle swarm optimization process, for each particle, substitute its corresponding parameter combination into the model, use the preset training set (or validation set) data, through the mean square error function, input the one-dimensional fusion feature vector of the sample into the model to obtain the predicted value, and then calculate the loss by comparing with the true value , this loss reflects the loss situation of the model when using the parameters corresponding to this particle, and is used to calculate the fitness function value and evaluate the quality of the parameter combination; Each particle has a velocity vector v, and the velocity vector v is used to control the moving direction and step size of the particle; Continuously update the position and velocity of the particle swarm, compare the fitness value of each particle with its own historical best fitness value to find the current global optimal position. The process is as follows: After each iteration, compare the fitness value of each particle with its own historical best fitness value (that is, the parameter combination corresponding to the best fitness obtained by the particle in previous iterations). If the current fitness value is higher, update the particle's own optimal position . At the same time, compare the fitness values of all particles to find the current global optimal position . The model parameters corresponding to the global optimal position are the model parameter combination with the highest fitness value, which are used as the parameters of the third-order correlation model, and the regression task loss function is used to train and evaluate the model. When the obtained loss function is the smallest, a fully trained third-order correlation model is obtained; Specifically, by adjusting the structure of the third-order correlation model, at the input layer, adapt to the dimension of the one-dimensional fusion feature vector F (2×(3 + m)) to ensure effective data input; In the middle layer, add 2 to 3 convolutional layers (with 3×3 and 5×5 convolutional kernels, stride 1, padding 1) to enhance the local feature extraction ability and capture the non-linear associations in the spectral-color data; Output layer: Replace it with a single-neuron fully connected layer (linear activation) to directly output the predicted value of anthocyanin content, which conforms to the model architecture design of the regression task (no activation function or linear activation, suitable for continuous value prediction); Meanwhile, through the application of Particle Swarm Optimization (PSO), regard the model parameters (tensor fusion weights, neural network connection weights) as particles in PSO, evaluate the quality of the parameters through the fitness function f, and update the positions of the particle swarm to search for the global optimal parameter combination. The introduction of PSO solves the optimization problem of the non-linear parameter space and avoids the limitations of traditional manual parameter tuning.

[0023] S4: Based on the third-order correlation modeling, output the predicted result of the anthocyanin content in red skin onions; Perform a tensor fusion operation on the color quantization index and the best spectral absorption data to obtain a one-dimensional fusion feature vector, and input the one-dimensional fusion feature vector into the third-order correlation modeling to output the quantified prediction result of the anthocyanin content in red skin onions ; Example: Select a red skin onion sample. After removing the outer dry skin, the following are measured: Color parameters: L = 35, a = 12, b = 8 (experimental quantified data); Spectral data: After SPA extraction, 3 characteristic wavelengths are retained, and the corresponding normalized spectral intensities are [0.6, 0.4, 0.7]; Step 1: Calculate the color quantization index: ; ; ; Color quantization index vector: H = [14.42, 33.69, 2.96]; Step 2: Construct a two-dimensional tensor and fuse: Assume the number of characteristic wavelengths m = 3, and the spectral data vector is S = [0.6, 0.4, 0.7], then the two-dimensional tensor is ; The weight tensor W is set to: W = [0.3, 0.2, 0.4, 0.8, 0.7, 0.9] after training; Tensor contraction calculation: F = 13.638; Step 3: Model prediction: Input F = 13.638 into the constructed third-order correlation modeling. The output layer weight obtained from the optimal model parameters is 2.5, and the bias is 5. Then the predicted value: ; The predicted anthocyanin content of this red onion sample is 39.1 mg / kg (experimental quantitative data).

[0024] In the application, several formulas involved are calculated by taking their numerical values after dimensionless treatment. The establishment of the formulas is obtained by collecting a large amount of data for software simulation to get a formula closest to the actual situation. Some coefficients or weights in the formulas are set by those skilled in the art according to the actual situation, so no more details will be given here.

[0025] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution.

[0026] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for predicting and analyzing the anthocyanin content of red - skin onions based on CIELab color quantization, characterized in that, Including: S1: Collect color quantization indexes using a spectrophotometer colorimeter; S2: Collect original spectral data using a near-infrared spectrometer, extract characteristic wavelengths based on an improved successive projections algorithm, and obtain optimal spectral absorption data; Among them, the improved successive projections algorithm is achieved by introducing an adaptive parameter adjustment mechanism into the traditional successive projections algorithm; S3: Perform tensor fusion operation on the color quantization indexes and the optimal spectral absorption data to obtain a one-dimensional fusion feature vector, and construct a third-order correlation model including spectral data - color parameters - anthocyanin content based on the one-dimensional fusion feature vector combined with the particle swarm optimization algorithm; Among them, the one-dimensional fusion feature vector obtains a third-order correlation modeling framework by adjusting the structure of a basic neural network model, and then updates the model parameters of the third-order correlation modeling framework through the particle swarm optimization algorithm and obtains the optimal parameters to construct a third-order correlation model including spectral data - color parameters - anthocyanin content; S4: Based on the third-order correlation model, output the prediction result of the anthocyanin content in red onion.

2. The prediction and analysis method for the anthocyanin content of red skin onions based on CIELab color quantization according to claim 1, wherein, The process of collecting the color quantization indexes is as follows: Uniformly select 3 measurement points along the middle transverse diameter of the red onion bulb, and use a CR-9 spectrophotometer colorimeter to measure each measurement point to obtain the lightness data, the axial coordinate data from green to red, and the axial coordinate data from blue to yellow at each point.

3. The prediction and analysis method for the anthocyanin content of red skin onions based on CIELab color quantization according to claim 1, wherein, The process of obtaining the optimal spectral absorption data based on the improved successive projections algorithm is as follows: Randomly select a band as the initial band, select characteristic wavelengths from the full wavelength range of the initial spectral data, and select a new wavelength from the remaining wavelengths in the full wavelength range for each iteration, and minimize the condition number of the new set composed of the current selected wavelength set and the new wavelength; Set an initial adaptation threshold , and iteratively determine the final adaptation threshold through an adaptive parameter adjustment mechanism ; Obtain the linear correlation measure value of the matrix formed by the new wavelength and the currently selected wavelength set , when and can minimize the condition number of the new set, select the corresponding wavelength and add it to the characteristic wavelength set, and the initial spectral data corresponding to all wavelengths that meet the conditions is the best spectral absorption data .

4. The prediction and analysis method for the anthocyanin content of red - skin onions based on CIELab color quantization according to claim 3, wherein, The process of obtaining the condition number is as follows: Obtain the matrix X composed of the initial spectral data corresponding to the wavelengths, and based on the norm of the matrix X and the inverse matrix of the matrix X to obtain the condition number by multiplying the norm of the inverse matrix of the matrix X 5. The prediction and analysis method for the anthocyanin content of red - skin onions based on CIELab color quantization according to claim 3, wherein, The implementation process of the adaptive parameter adjustment mechanism is as follows: Define the ratio of the number of selected characteristic wavelengths to the total number of wavelengths , where m is the number of currently selected characteristic wavelengths and n is the total number of wavelengths in the full wavelength range; When , the mean square error is used to evaluate the performance of the selected characteristic wavelength set, and the performance change rate between two adjacent iterations is calculated. When the performance change rate is less than the preset minimum value, the initial adaptation threshold is decreased to obtain a new adaptation threshold , and the calculation formula is as follows: Among them, is an adjustment coefficient.

6. The method for predicting and analyzing the anthocyanin content of red skin onions based on CIELab color quantization according to claim 5, characterized in that, The process of obtaining the adjustment coefficient is as follows: Through the idea of reinforcement learning, regard the process of iteratively determining the final adaptation threshold through the adaptive parameter adjustment mechanism as the behavior of the intelligent agent, regard the spectral data as the environment, and regard the performance index of the selected characteristic wavelength set as the reward; Define the initial adjustment coefficient range, randomly initialize the adjustment coefficients within the initial adjustment coefficient range to form an initial adjustment coefficient set, For each adjustment coefficient in the initial adjustment coefficient set, use the corresponding adjustment coefficient to adjust the wavelength selection threshold, and obtain the corresponding reward value based on the successive projections algorithm; Store the state, action, reward, and next state in the experience replay pool, randomly extract a batch of experience data, and update the deep neural network parameters by minimizing the loss function using the policy function representing the experience data by the deep neural network; Iteratively update the deep neural network parameters, find the adjustment coefficient that maximizes the reward, and obtain the optimal adjustment coefficient.

7. The method for predicting and analyzing the anthocyanin content of red skin onions based on CIELab color quantization according to claim 1, wherein, The process of obtaining the one-dimensional fusion feature vector is as follows: Combine the color quantization indexes and the optimal spectral absorption data into a two-dimensional tensor, preset a weight tensor, the dimension of the weight tensor matches that of the two-dimensional tensor, and obtain a one-dimensional fusion feature vector through tensor contraction operation.

8. The prediction and analysis method for the anthocyanin content of red skin onions based on CIELab color quantization according to claim 7, wherein The process of obtaining the third-order correlation modeling framework is as follows: The preset basic neural network model includes an input layer, an intermediate layer, and an output layer; Modify the number of neurons in the input layer to dimensions. Add custom convolutional layers and fully connected layers to the middle layer of the pre-trained model. The custom convolutional layers and fully connected layers consist of 2 to 3 convolutional layers with kernel sizes of 3×3 and 5×5 respectively, a stride of 1, and a padding of 1. Replace the output layer with a fully connected layer with a single neuron, and the output of the neuron is the predicted anthocyanin content value.

9. The method for predicting and analyzing the anthocyanin content of red skin onions based on CIELab color quantization according to claim 8, wherein, The process of updating the model parameters based on the particle swarm optimization algorithm to obtain the optimal model parameters is as follows: Based on the particle swarm optimization algorithm, each particle is regarded as a parameter combination, including parameters to be optimized, and a fitness function is defined to obtain the fitness value of each particle; Update the position and velocity of the particle swarm. After each iteration, compare the fitness value of each particle with its own historical optimal fitness value to find the current global optimal position. The model parameters corresponding to the global optimal position are the model parameter combination with the highest fitness value; Use the regression task loss function to train and evaluate the model. When the obtained loss function is the smallest, a fully trained third-order correlation model is obtained.

Citation Information

Patent Citations

  • Meat online non-destructive testing method and apparatus based on fusion of image and spectrum information

    CN101551341A

  • Improved continuous projection algorithm

    CN111859276A

  • Method for enhancing camouflage target

    CN118261808A

  • Near infrared spectrum rapid detection system and real-time analysis method

    CN119510347A

  • Prediction method, medium and system for chlorophyll concentration of fresh tobacco leaves

    CN120031822A