Anthocyanin content detection method, system, equipment and medium
The spectral information of colored potatoes is obtained through microscopic hyperspectral imaging technology, and specific structures and mechanisms are added to the convolutional neural network model to construct an anthocyanin prediction model, solving the problem of inaccurate detection of anthocyanin content in the existing technology , achieving higher detection accuracy.
Patent Information
- Application Number
- CN202411645895.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the detection of the anthocyanin content in colored potatoes relies on chemical methods, and there are manual operation errors, resulting in inaccurate detection results.
Microscopic hyperspectral imaging technology is used to obtain the spectral information of colored potatoes, and residual blocks are added to the convolutional neural network model and attention mechanism based on multi-headed attention and normalization, using the autoregular non-monotonic neural activation function Mish, Construct an anthocyanin prediction model.
Through this method, the accuracy of anthocyanin content detection can be improved, errors can be reduced, and more accurate detection results can be provided.
Smart Images

Figure CN119394931A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of agricultural product detection, and in particular to a method, system, equipment and medium for detecting anthocyanin content. Background Art
[0002] Colored potatoes can be used as both food and vegetables. They contain not only various amino acids and trace elements needed by the human body, but also anthocyanins. Anthocyanins have many functions such as anti-oxidation, anti-inflammatory, improving vision, and preventing cancer. Therefore, colored potatoes are deeply loved by consumers and have a good market prospect.
[0003] In the prior art, the detection of anthocyanin content in colored potatoes relies on chemical methods, and the components inside colored potatoes are studied in the laboratory using chemical reagents.
[0004] However, the disadvantage of the above method is that there are errors in the manual operation involved in the chemical method, and the errors will affect the accuracy of the detection, resulting in inaccurate anthocyanin content detection results. Summary of the invention
[0005] The embodiments of the present invention provide a method, system, device and medium for detecting anthocyanin content, which can solve the problem of inaccurate component content detection results in the prior art.
[0006] The embodiment of the present invention provides a method for detecting anthocyanin content, comprising the following steps: obtaining spectral information of colored potatoes under microscopic hyperspectral imaging; adding a residual block and an attention mechanism MANBa based on multi-head attention and normalization after the convolution layer of a convolutional neural network model CNN, and using a self-regularized non-monotonic neural activation function Mish to replace the activation function in the convolutional neural network model CNN to obtain an adjustment model; using spectral information to train the adjustment model to obtain an anthocyanin prediction model capable of predicting anthocyanin content; inputting the spectral information of the colored potato to be tested into the anthocyanin prediction model, extracting information features through the convolution layer, and obtaining anthocyanin content-related features from the information features through the residual block and MANBa, and obtaining the anthocyanin content of the colored potato through the output layer.
[0007] Furthermore, the construction of the residual block specifically includes the following steps: setting two convolution layers with a convolution kernel size of 3×3; adding a circle of pixels to each edge of each input feature map, and not using a bias term in the convolution layer.
[0008] Furthermore, the construction of the attention mechanism MANBa based on multi-head attention and normalization includes the following specific steps: setting 2 batches to process data, each batch has 4 queries and 6 key-value pairs; setting linear transformation to map the query and key-value pairs to a 100-dimensional space through linear changes; dividing the 100 dimensions into 5 heads, each head operating a 20-dimensional subspace; obtaining the attention weight of each head, and obtaining the output of each head according to the attention weight and splicing them; using the normalization method to normalize the global upper and lower parts to obtain the attention output.
[0009] Furthermore, an early stopping strategy with a patience value of patience=20 is set when the spectral information is used to train the adjustment model.
[0010] The embodiment of the present invention provides a detection system for anthocyanin content, comprising: an information acquisition module, used to acquire spectral information of colored potatoes under microscopic hyperspectral imaging; a model optimization module, used to add a residual block and an attention mechanism MANBa based on multi-head attention and normalization after the convolution layer of a convolutional neural network model CNN, and use a self-regularized non-monotonic neural activation function Mish to replace the activation function in the convolutional neural network model CNN to obtain an adjustment model; use spectral information to train the adjustment model to obtain an anthocyanin prediction model capable of predicting anthocyanin content; an anthocyanin prediction module, used to input the spectral information of the colored potato to be tested into the anthocyanin prediction model, extract information features through the convolution layer, obtain anthocyanin content-related features from the information features through the residual block and MANBa, and obtain the anthocyanin content of the colored potato through the output layer.
[0011] An embodiment of the present invention provides a computer device, comprising: a memory and a processor; the memory stores a computer program, and the processor implements the above-mentioned method for detecting anthocyanin content when executing the computer program.
[0012] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for detecting anthocyanin content is implemented.
[0013] The embodiments of the present invention provide a method, system, device and medium for detecting anthocyanin content. Compared with the prior art, the beneficial effects thereof are as follows:
[0014] In the anthocyanin prediction model, the added residual block and the attention mechanism MANBa based on multi-head attention and normalization can capture the anthocyanin content-related features from the image features; this attention mechanism can focus on the most important part of the anthocyanin content-related features, ignore irrelevant information, and improve the accuracy in recognition and detection tasks; ultimately, it can improve the accuracy throughout the experiment and reduce the error in the data acquisition process. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A diagram of the training process of the optimized model provided in an embodiment of the present invention;
[0016] Figure 2 The 3D result diagram of the optimized model provided by the embodiment of the present invention;
[0017] Figure 3 A diagram of the training and testing process of the first model for comparison with the embodiment of the present invention;
[0018] Figure 4 A diagram of the training and testing process of a second model for comparison with an embodiment of the present invention;
[0019] Figure 5 A technical flow chart of a method for detecting anthocyanin content provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.
[0021] See also Figure 5 The present invention provides a method for detecting anthocyanin content, comprising the following steps:
[0022] Step 1: Obtain a spectral image of colored potatoes under microscopic hyperspectral imaging and extract spectral information from the image.
[0023] The potato varieties used in the study were Red Beauty and Black King Kong. Before sampling, the potatoes with smooth and flawless surfaces were cleaned and left to stand at laboratory temperature for 8 hours. The cross section of potato tubers contains different tissue parts. During the experiment, it was found that the anthocyanin color of the outer skin and inner skin is darker than that of the periderm and pith, and the color depth represents the level of anthocyanin content. The study mainly focused on the outer skin and inner skin of potatoes, and slices were made of the outer skin and inner skin.
[0024] There are three main ways to make microscopic sections: paraffin sectioning, frozen sectioning, and freehand sectioning. If paraffin sectioning is used, dehydration is required, and anthocyanin is a water-soluble substance, which is very easy to carry away during the dehydration process, which will cause the anthocyanin information collected to be inaccurate; frozen sectioning requires the use of a fixative to fix the sample during the sample preparation process, and the fixative will penetrate through the cell wall into the cell fluid, so that the substance in the sample to be cut will change, so the spectral information collected is not the original spectral information; freehand sectioning is simple and easy to operate. The operator only needs to hold the sample in one hand and slice with the other hand to complete the cutting of fresh experimental samples. Slices avoid the disadvantages of paraffin sections and frozen sections. Therefore, this study chose manual sectioning. The specific operation process is as follows: use a single blade to cut uniformly sized 8mm×6mm×15mm rectangular blocks from the outer and inner skin of the potato, respectively, and then use a blade to cut into uniform thin slices, and then use tweezers to simply rinse under distilled water to rinse off the starch granules on the surface and the anthocyanins of damaged cells to avoid affecting the subsequent spectral information. After rinsing, use absorbent paper to absorb the surface moisture, place it on a slide, and use a coverslip for simple sealing to delay dehydration and oxidation of the slices.
[0025] Microscopic hyperspectral imaging system:
[0026] This study built a microscopic hyperspectral acquisition system, which is mainly composed of an optical microscopic system, a spectral scanning imager and a data acquisition system. The optical microscopic system mainly includes a microscope and an electric stage. The objective lenses have 5x, 10x, 20x, 50x and 100x magnifications, and the eyepiece magnification is 10x; the electric stage can be adjusted manually or automatically, and can accurately locate the target.
[0027] The spectral scanning imager is mainly composed of an acousto-optic tunable filter AOTF (Acousto-Optic Tunable Filter, hereinafter referred to as AOTF) and its driver and a charge-coupled device imaging device CCD (Charge-Coupled Device, hereinafter referred to as CCD). The spectral range of the spectral scanner is 365-1025nm, with a total of 616 spectra, a spectral resolution of 2.8nm, and the camera resolution of the imaging device is 1.4 million pixels, with a slit size of 30μm.
[0028] The entire imaging process is as follows: Place the prepared potato slices on the stage and turn on the light source. Due to the different molecular structures and chemical substances in the tissues, the light source passing through the potato slices will produce certain absorption, reflection or refraction. Finally, the light that passes through the tissue can enter the microscope. The built-in AOTF driver in the spectral scanning imager outputs signals of different frequencies and drives the acousto-optic tunable filter AOTF to split them into several narrow light signals. After that, the built-in CCD in the spectral scanning imager converts these signals into electrical signals, which are transformed into hyperspectral microscopic images and displayed in the data acquisition system.
[0029] Microscopic hyperspectral data acquisition and correction:
[0030] Sample collection process:
[0031] (1) Before collecting microscopic hyperspectral images, turn on the instrument and preheat it for 30 minutes to ensure that the light source intensity is stable. This study used a transmitted light source.
[0032] (2) Fix the prepared potato slice sample on the microscope stage.
[0033] (3) Open the image acquisition software Hyperspec (hereinafter referred to as Hyperspec), initialize the stage and achieve preliminary focus, look through the eyepiece to adjust the focus to make the image clear, avoid oversaturation of the image, and adjust the light source until the sample to be tested reaches a reasonable light exposure value.
[0034] (4) Set the acquisition parameters in the Hyperspec software. The specific parameters are shown in Table 1. Potato microscopic hyperspectral image acquisition parameters.
[0035] (5) Click the start button in the software and the instrument will start scanning until the scanning is completed and the image acquisition is completed. Repeat the above process to complete the acquisition of all samples.
[0036] Due to the instability of the light source of the hyperspectral imaging system itself and the influence of external noise and the transmission process operation, the collected hyperspectral images have certain noise in certain bands. Therefore, before collecting the microscopic hyperspectral image, the lens cover and the standard white board are used to obtain the full white and full black images respectively. Then, the original image is corrected for black and white in the acquisition software of the imaging system. The calculation process is as follows:
[0037]
[0038] Among them, C is the calibrated image, R is the original image, B is the black reference image (reflectivity is about 0%) obtained by completely covering the camera lens with a lens cap, and W is the white calibration image (reflectivity is about 100%).
[0039] Table 1. Potato microscopic hyperspectral image acquisition parameters.
[0040]
[0041]
[0042] Step 2: Spectral data acquisition. The calibrated potato microscopic hyperspectral image was opened with ENVI5.3 software, and a ROI area of 100*100 was selected on the complete cell structure with color using the square tool. The average spectral transmittance in the ROI area was extracted as the spectral data of the sample. Through this method, the sample spectral information was extracted one by one in the order of marking, and then the spectral data matrix of the outer skin and the inner skin was established as 576*616.
[0043] Step 3: Add residual blocks and MANBa (Multi-HeadAttention and Normalization-based Attention mechanism, hereinafter referred to as MANBa) after the convolutional layer of the convolutional neural network model CNN (Convolutional Neural Network, hereinafter referred to as CNN), and use the self-regularized non-monotonic neural activation function Mish to replace the activation function in the convolutional neural network model CNN to obtain an adjusted model; use spectral information to train the adjusted model to obtain an anthocyanin prediction model that can predict the anthocyanin content. Specifically, in view of the redundancy and general data volume of conventional mesoscopic hyperspectral data, residual blocks, attention mechanisms and MANBa (Multi-HeadAttention and Normalization-based Attention mechanism, hereinafter referred to as MANBa) are added to optimize the convolutional neural network model CNN, and the activation function in the optimized convolutional neural network model CNN is replaced with the self-regularized non-monotonic neural activation function Mish to obtain an adjusted model.
[0044] Previous studies have found that compared with the outer part of potato, the model established for the endodermis can better predict the anthocyanin content. Therefore, in order to further improve the detection accuracy, a new structure was created based on the convolutional neural network endodermis model CNN.
[0045] The new network structure combines residual blocks, attention mechanism Transformer (hereinafter referred to as Transformer) and MANBa module based on multi-head attention and normalized attention mechanism, and uses the self-regularized non-monotonic neural activation function Mish to optimize the model structure and various parameters. The details are as follows:
[0046] The amount of data in this study is small but the model is large, which is prone to overfitting, so a variety of methods are used to avoid overfitting. Parameter optimization and structural optimization are mainly used for adjustment.
[0047] 1. Parameter optimization:
[0048] The amount of data in this study is small but the model is large. In this case, it is easy to overfit, so multiple methods are used to avoid overfitting.
[0049] 1. Optimization of learning rate:
[0050] Use an initial learning rate lr = 0.001 and a learning rate scheduler to avoid overfitting and training falling into local optimality by reducing the learning rate when the validation set loss does not decrease.
[0051] 2. Optimization of Weight Decay:
[0052] Use weight_decay=5e -4 Regularization is performed to prevent overfitting.
[0053] 3. Early Stopping:
[0054] An early stopping strategy with a patience value of 20 is set to stop training when the validation set loss no longer decreases for 20 consecutive epochs to avoid overfitting and unnecessary calculations.
[0055] 4. Batch Normalization and Dropout:
[0056] Using Batch Normalization and Dropout layers increases the generalization ability of the model and prevents overfitting.
[0057] 2. Structural optimization:
[0058] After training, the original convolutional neural network (CNN) structure was found to have the following problems:
[0059] 1. There are problems with the activation function:
[0060] The traditional activation function ReLU (Rectified Linear Unit) will cause neurons to "die" in the negative range (the self-regularized non-monotonic neural activation function Mish is smooth and continuous, does not have this problem, and is better at preserving information flow).
[0061] 2. Long distance dependency problem:
[0062] Traditional CNNs have difficulty capturing long-distance dependent features due to their local receptive fields (the attention mechanism Transformer and the attention mechanism MANBa module based on multi-head attention and normalization solve this problem through the self-attention mechanism).
[0063] 3. Gradient disappearance and training difficulties:
[0064] Traditional deep CNNs are prone to the problem of gradient vanishing (the residual block effectively alleviates this problem through skip connections, improving training efficiency and performance).
[0065] 4. Limited feature extraction capabilities:
[0066] Traditional CNN only extracts features through convolutional layers, and multiple memories of invalid information result in low training efficiency and long training time (the MANBa module further enhances the feature extraction capability, allowing the model to focus more on important features).
[0067] Therefore, corresponding optimization is carried out. The corresponding optimization methods are in brackets. The structural advantages after optimization are prominent:
[0068] Better feature representation capability: Combining the advantages of convolution, residual, Transformer and MANBa, the model can extract multi-level and multi-scale feature representations.
[0069] Stronger global dependency modeling capabilities: The Transformer and MANBa modules enable the model to better capture global dependencies and adapt to more complex tasks.
[0070] Higher training efficiency and stability: The residual block solves the gradient vanishing problem in deep networks and improves the stability and efficiency of training.
[0071] Better activation function: The use of the self-regularized non-monotonic neural activation function Mish brings better gradient fluidity and information retention capabilities, improving the overall performance of the model.
[0072] Step 4: Input the spectral information of the colored potato to be tested into the anthocyanin prediction model, extract features through the convolution layer, and obtain features related to anthocyanin content from image features through the residual block and the attention mechanism MANBa based on multi-head attention and normalization, and obtain the anthocyanin content of the colored potato through the output layer. Specifically, the characteristic spectral variables of anthocyanins in the spectral image information are screened by the feature selection method, and the model is trained and adjusted using the characteristic spectral variables of anthocyanins to obtain an anthocyanin prediction model that can predict the anthocyanin content. Input the spectral information of the potato to be tested into the anthocyanin prediction model to obtain the anthocyanin content of the potato.
[0073] In order to verify the model effect of the present invention, two models were designed for comparative evaluation with the model of the present invention:
[0074] Model 1 adopts CNN model, uses ReLu activation function and sets learning rate to 0.001, the number of training rounds to 100, and the training and testing process is as follows: Figure 3 shown.
[0075] Model 2 adds a long short-term memory (LSTM) module and a self-attention mechanism (Self-Attention) module to the CNN model, and sets the learning rate to 0.001. The number of training rounds is 100, and the training and testing process is as follows: Figure 4 shown.
[0076] Model 3 is a model constructed by the present invention. With the CNN model as the basic framework, the activation function is replaced by Mish from ReLu. Among them, the Mish function combines the advantages of Swish and ReLu functions, and in some cases shows better performance than other activation functions, and helps to stabilize the gradient and accelerate convergence in terms of smoothness and continuity. A residual block is added with an Adam optimizer and a learning rate decay. It is a scheduler that dynamically adjusts the learning rate, which can speed up convergence. It improves the efficiency and effect of model training by monitoring the performance indicators of the model (such as verification loss) and adjusting the learning rate according to its changes. By reducing the learning rate when the verification loss no longer improves, the model can find a better solution earlier before reaching overfitting, thereby reducing the risk of overfitting. Mamba, an attention mechanism based on multi-head attention and normalization, is introduced for optimization.
[0077]
[0078] The smaller the root mean square error, the smaller the model error and the better the model; the larger the residual prediction deviation, the better the model robustness and the more sustainable the large sample experiment. After comparison, through their respective training and prediction processes, it can be seen that during the operation of Model 1 and Model 2, the model jitter is serious, which will lead to unstable and inaccurate data prediction, such as Figure 3 and Figure 4 As shown, model 3 shows that the lines are stable during the training and prediction process, which means that the model operation process is stable and more robust. It can perform large sample predictions for a long time. The residual prediction deviation value is 20.074, and the operation time is short, and the detection is more efficient, which provides support for future industrial development. Figure 1 and Figure 2 shown.
[0079] Purpose of the invention:
[0080] 1) Research on intelligent evaluation of potato anthocyanin content based on microscopic hyperspectral. Potato slices were made by hand, and microscopic hyperspectral image information was collected from different parts of the potato internal tissue structure. The convolutional neural network of the deep learning algorithm was initially optimized, using the rectified linear unit ReLU function and normalization processing, as well as adding long short-term memory (LSTM) modules and self-attention mechanisms (Self-Attention) modules to meet the input spectral data characteristics, and a preliminarily optimized anthocyanin convolutional neural network prediction model was constructed as a comparison group for comparative analysis.
[0081] 2) Propose a variety of optimization algorithms to improve the prediction accuracy of deep learning models for anthocyanin content. Through repeated memory training of data in current convolutional neural network model research, insufficient feature understanding, that is, a group of neurons focus on one feature, lack of memory function, leading to model redundancy, inefficiency and insufficient accuracy, it is proposed to use methods such as incomplete blocks and attention mechanisms to optimize the convolutional neural network CNN prediction model for anthocyanin based on the original algorithm research, which proposes a new direction for model optimization and innovation and improves the model's prediction accuracy for anthocyanin.
[0082] The embodiment of the present invention provides a detection system for anthocyanin content, comprising:
[0083] The information acquisition module is used to obtain the spectral information of colored potatoes under microscopic hyperspectral imaging.
[0084] The model optimization module is used to add a residual block and an attention mechanism MANBa based on multi-head attention and normalization after the convolution layer of the convolutional neural network model CNN, and use the self-regularized non-monotonic neural activation function Mish to replace the activation function in the convolutional neural network model CNN to obtain an adjusted model; the spectral information is used to train the adjustment model to obtain an anthocyanin prediction model that can predict the anthocyanin content.
[0085] The anthocyanin prediction module is used to input the spectral information of the colored potato to be tested into the anthocyanin prediction model, extract the information features through the convolution layer, obtain the anthocyanin content-related features from the information features through the residual block and MANBa, and obtain the anthocyanin content of the colored potato through the output layer.
[0086] An embodiment of the present invention provides a computer device, comprising: a memory and a processor; the memory stores a computer program, and the processor implements the steps of a method for detecting anthocyanin content when executing the computer program.
[0087] An embodiment of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of a method for detecting anthocyanin content are implemented.
[0088] A specific embodiment is as follows:
[0089] (1) The present invention studies a rapid detection method based on the anthocyanin content in potatoes. The study uses microscopic hyperspectral imaging technology to obtain the spectrum and image information of the inner and outer skin of two colored potatoes, Red Beauty and Black King Kong, under microscopic hyperspectral.
[0090] (2) A convolutional neural network model was built to predict the anthocyanin content under the microscopic structure of potatoes.
[0091] Microscopic hyperspectral technology was used to slice the outer and inner parts of the potato to extract the spectral information of the potato microscopic level. A convolutional neural network (CNN) model was used to establish a regression prediction model for the anthocyanin content of potatoes. The results showed that the CNN model had the best prediction performance in the inner part, and the model evaluation results were as follows:
[0092] Rc=0.892, RMSEC=0.028%, Rp=0.885, RMSEP=0.237%, RPD=4.519.
[0093] In order to further improve the prediction accuracy of the CNN model, it is proposed to improve and optimize the model in a variety of ways. With the help of the microscopic spectral image information of the potato endothelium, it is proposed to introduce long short-term memory LSTM and self-attention mechanism Self-Attention on the basis of the original model to further accurately extract feature information. The final model evaluation results are:
[0094] Rc=0.895, RMSEC=0.023%, Rp=0.891, RMSEP=0.158%, RPD=5.350.
[0095] It can be seen that this model has been improved to a certain extent compared with the original CNN model, but its operation process is still not stable enough, which not only makes the model unable to perform large-scale data detection, but also makes the detection accuracy unstable.
[0096] Therefore, further optimization was made: residual blocks, multi-head attention and normalization based attention modules, and self-regularized non-monotonic neural activation function Mish were introduced. The evaluation results of the model were: Rc=0.911, RMSEC=0.012%, Rp=0.893, RMSEP=0.012%, and RPD=20.074.
[0097] It can be seen that the model not only improves data accuracy, but also Figure 4 It can be seen that the model is also more stable in detection.
[0098] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for detecting anthocyanin content, characterized in that: The following steps are involved: Obtain spectral information of colored potatoes under microscopic hyperspectral imaging; A residual block and a multi-head attention and normalized attention mechanism MANBa are added after the convolutional layer of the convolutional neural network model CNN, and the activation function in the convolutional neural network model CNN is replaced with a self-regularized non-monotonic neural activation function Mish to obtain an adjustment model; the adjustment model is trained with spectral information to obtain an anthocyanin prediction model that can predict anthocyanin content; The spectral information of the colored potato to be tested is input into the anthocyanin prediction model, the information features are extracted through the convolutional layer, and the anthocyanin content-related features are obtained from the information features through the residual block and MANBa, and the anthocyanin content of the colored potato is obtained through the output layer.
2. The method for detecting anthocyanin content according to claim 1, characterized in that: The construction of the residual block specifically includes the following steps: Set the convolution kernel size to 3×3 for two convolution layers; A circle of pixels is added to each edge of each feature map of the input, and no bias is used in the convolutional layer.
3. The method for detecting anthocyanin content according to claim 1, characterized in that: The construction of the MANBa mechanism based on multi-head attention and normalization includes the following specific steps: Set up 2 batches to process data, each batch contains 4 queries and 6 key-value pairs; Set a linear transformation to map the query and key-value pairs to a 100-dimensional space through linear changes; Divide 100 latitudes into 5 heads, each head operates on a subspace of 20 latitudes; Get the attention weight of each head, and get the output of each head according to the attention weight and concatenate them; The normalization method is used to normalize the global up and down to obtain the attention output.
4. The method for detecting anthocyanin content according to claim 1, characterized in that: The early stopping strategy with a patience value of patience=20 is set when the spectral information is used to train the adjustment model.
5. A detection system for anthocyanin content, characterized in that: include: An information acquisition module, used to acquire spectral information of colored potatoes under microscopic hyperspectral imaging; A model optimization module is used to add a residual block and a multi-head attention and normalized attention mechanism MANBa after the convolution layer of the convolutional neural network model CNN, and use a self-regularized non-monotonic neural activation function Mish to replace the activation function in the convolutional neural network model CNN to obtain an adjustment model; the adjustment model is trained using spectral information to obtain an anthocyanin prediction model that can predict anthocyanin content; The anthocyanin prediction module is used to input the spectral information of the colored potato to be tested into the anthocyanin prediction model, extract the information features through the convolution layer, obtain the anthocyanin content-related features from the information features through the residual block and MANBa, and obtain the anthocyanin content of the colored potato through the output layer.
6. A computer device comprising: Memory and processor; The memory stores a computer program, wherein the processor implements a method for detecting anthocyanin content according to any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, a method for detecting anthocyanin content according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
CT image cerebral hemorrhage automatic detection system based on improved Unet
CN113256609A
Lip language recognition method and device based on multiple attention mechanisms and storage medium
CN116580278A
Semi-supervised hyperspectral image classification method fusing multi-hop graph convolution and attention
CN116824282A
PM2.5 prediction method and device based on deep neural network
CN116933090A
Method, system and equipment for determining anthocyanin content of purple-leaf lettuce and storage medium
CN117198420A
Cited By
Image processing system for identifying anthocyanin content of colored potatoes
CN120472185A
An image processing system for identifying the anthocyanin content of colored potatoes
CN120472185B