Neural network construction method for peanut seed phenotype parameter prediction

By improving the YOLOv5s neural network, combined with SimAM, BiFPN and SIoU loss functions, the problem of high investment and low accuracy in the prediction of peanut seed phenotype parameters is solved, and high-precision and efficient measurement of peanut seed phenotype parameters is achieved.

CN119323781APending Publication Date: 2025-01-17SHANDONG UNIV OF SCI & TECH +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411733112.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

The prior art has problems such as high investment cost, low data accuracy, and difficulty in distinguishing fruit color from background in the prediction of peanut seed phenotype parameters, resulting in partial missed and missed detection, and the model is not targeted and specific applicable.

Method used

Using the improved YOLOv5s neural network, by adding the similarity attention mechanism SimAM to the backbone network, the weighted bidirectional feature pyramid network BiFPN is used in the neck structure, and the loss function is replaced as the SIoU loss function, and the directional bounding box OBB is used as the target detection Module, perform prediction of peanut seed phenotype parameters.

Benefits of technology

It realizes accurate measurements in all directions without blind spots, integrates more features, reduces redundant calculations, improves regression accuracy and convergence speed, and significantly improves the accuracy of peanut seed phenotype parameters prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323781A_ABST
    Figure CN119323781A_ABST
Patent Text Reader

Abstract

The invention discloses a neural network construction method for peanut seed phenotypic parameter prediction, which belongs to the technical field of neural networks, is used for peanut seed phenotypic parameter prediction, and comprises the following steps: obtaining a peanut photo as a data source, dividing a training set and a test set, inputting the training set into an improved YOLOv5s neural network for training, and after the training meets a precision requirement, obtaining a prediction result; and inputting the test set into the trained improved YOLOv5s neural network to predict phenotypic parameters of the peanut seeds to obtain the perimeter and the area of the peanut seeds. According to the invention, the prediction frame is generated according to the specific shape of the object and the orientation of the peanut, all-directional dead-angle-free accurate measurement is realized, and the model is enabled to better focus on the feature information of the peanut; more features are fused under the condition that the cost is not increased, and redundant calculation is reduced; and the degree of freedom of the regression process is effectively reduced, so that the convergence speed of the network is accelerated, and the regression accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention discloses a neural network construction method for predicting peanut seed phenotypic parameters, and belongs to the technical field of neural networks. Background Art

[0002] In recent years, machine vision detection technology based on deep learning has developed rapidly. When it is used to improve phenotypic genomics technology and then promote the research and development of intelligent breeding and precision cultivation technology, it has the advantages of wide application range, high precision, and the ability to realize automated detection. However, due to the different shapes of peanuts, the difficulty in distinguishing the fruit color from the background and other limitations, there are still problems that need to be solved urgently, such as high investment cost, low data accuracy, and difficulty in implementation.

[0003] Existing methods of obtaining crop phenotypes often consume a lot of manpower, material resources and financial resources; at the same time, those methods also have significant obstacles in authenticity verification and result visualization; the methods of obtaining crop phenotypes still cannot solve the technical problem of difficulty in distinguishing fruit color from background, resulting in missed detection and misdetection of some peanuts; the methods of obtaining crop phenotypes cannot fully integrate and extract the morphological and arrangement characteristics of peanuts themselves, and the constructed models are not targeted and specifically applicable, resulting in low quality and poor accuracy of the information obtained. Summary of the invention

[0004] The purpose of the present invention is to provide a neural network construction method for predicting peanut seed phenotypic parameters, so as to solve the problem of inaccurate prediction of peanut seed phenotypic parameters in the prior art.

[0005] A neural network construction method for predicting peanut seed phenotypic parameters, using a YOLOv5s neural network, including a backbone network Backbone, a neck structure Neck and a head structure Head, using a CIoU loss function, and using a hierarchical bounding box HBB as a target detection module. Neck includes a path aggregation network PANet, and the YOLOv5s neural network is improved. A similarity attention mechanism SimAM is added to Backbone, and a weighted bidirectional feature pyramid network BiFPN is used in Neck to replace the path aggregation network PANet, and a SIoU loss function is used to replace the CIoU loss function, and an directional bounding box OBB is used to replace HBB. Peanut photos are obtained as the data source, divided into training set and test set, and the training set is input into the improved YOLOv5s neural network for training. After the training meets the accuracy requirements, the test set is input into the trained improved YOLOv5s neural network to predict the phenotypic parameters of peanut seeds and obtain the circumference and area of ​​peanut seeds.

[0006] SimAM is set at the input end of Backbone, and the input feature map is divided into three branches, two of which are imported into the self-attention weight calculation module. The result of the self-attention weight calculation module is input The activation function is then multiplied with the third branch, and then the feature map is output.

[0007] SimAM explores the importance of each neuron by analyzing the energy function: ; ; ; ; In the formula, is the energy function on each channel, For input features The variance of each channel in is a hyperparameter, for The target neurons, for The mean value on each channel in is the number of energy functions, For Backbone Input features The value of For the enhanced features, is the activation function.

[0008] BiFPN includes four branches, each of which extracts features of an input image through multiple convolutional layers. The four branches process four feature maps P3, P4, P5 and P6 from different convolutional layers. P3 and P6 pass through two convolutional layers in turn, P4 and P5 pass through three convolutional layers in turn, the first convolutional layer passed by P6 is connected to the second convolutional layer passed by P5, the second convolutional layer passed by P4, and the second convolutional layer passed by P3 in turn, the first convolutional layer passed by P5 is connected to the third convolutional layer passed by P5, the first convolutional layer passed by P4 is connected to the third convolutional layer passed by P4, and the second convolutional layer passed by P3 is connected to the third convolutional layer passed by P4, the third convolutional layer passed by P5, and the second convolutional layer passed by P6 in turn.

[0009] BiFPN's feature fusion methods include: ; ; ; In the formula, It is the first Input features , is the output feature, is the input feature The number of yes The weight of It is a very small number.

[0010] SIoU loss function include: ; ; ; ; ; ; ; ; ; ; ; In the formula, is the distance loss, is the intersection-over-union ratio between the predicted box and the true box area, is the shape loss, is the importance of shape loss, and Represent the length and width of the real box respectively, and Represent the length and width of the prediction box respectively, Indicates taking the maximum value, , , , is an intermediate parameter, ( , ) is the centroid coordinate of the prediction box, ( , ) is the centroid coordinate of the real box, and are the length and width of the minimum enclosing rectangle, Indicates taking the minimum value, is the distance between the two centroids Euclidean distance of coordinates, is the distance between the two centroids Euclidean distance between coordinates.

[0011] After improving the YOLOv5s neural network, Backbone includes two convolutional network layers CBS, a first pulse neural network layer CSP1_1, a convolutional network layer CBS, a second pulse neural network layer CSP1_2, SimAM, a convolutional network layer CBS, a third pulse neural network layer CSP1_3, SimAM, a convolutional network layer CBS, a first pulse neural network layer CSP1_1, SimAM, and a pooling layer SPPF in sequence. The convolutional network layer CBS includes a convolutional layer Conv, a batch normalization layer CN, and a SiLU activation layer. CSP1_1 includes one cross-stage local network CSPNet, CSP1_2 includes two cross-stage local networks CSPNet, and CSP1_3 includes three cross-stage local networks CSPNet. Neck includes three branches, each of which includes BiFPN and a convolutional layer Conv. The first branch includes upsampling, BiFPN and a convolutional layer Conv in sequence. The second branch includes BiFPN and a convolutional layer Conv in sequence. The third branch includes a convolutional network layer CBS, BiFPN and a convolutional layer Conv in sequence. The first SimAM of Backbone is connected to the BiFPN of the first branch. The second SimAM of Backbone is connected to the BiFPN of the second branch. The pooling layer SPPF is connected to the convolutional network layer CBS of the third branch. The convolutional network layer CBS of the third branch is provided with an upward module, including the convolutional network layer CBS of the third branch connected to upsampling, BiFPN, a double pulse neural network layer CSP2, a convolutional network layer CBS and the upsampling of the first branch in sequence. The second SimAM of Backbone is connected to the BiFPN of the upward module. A convolutional network layer CBS is provided in front of the BiFPN of the second branch. The BiFPN of the second branch is connected to the BiFPN of the third branch through a convolutional network layer CBS. The convolutional layers Conv of the three branches of Neck are connected to a feature map in Head respectively, with scales of 80×80×255, 40×40×255, and 20×20×255 respectively.

[0012] After OBB captures the peanut seed, the perimeter of the peanut seed is calculated through the contour point set. The contour is Points , ,……, Composition, the perimeter of a peanut seed with an open outline for: ; In the formula, It is the first The coordinates of a point.

[0013] Peanut seed circumference with closed outline for: .

[0014] Calculating peanut seed area by contour point set : .

[0015] Compared with the prior art, the present invention has the following beneficial effects: a prediction frame is generated according to the specific shape of the object and the orientation of the peanut, so as to achieve accurate measurement in all directions without blind spots, and enable the model to better focus on the characteristic information of the peanut fruit; more features are integrated without increasing the cost, and redundant calculations are reduced; the degrees of freedom of the regression process are effectively reduced, thereby accelerating the convergence speed of the network and improving the regression accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is the original image of the first set of experiments; Figure 2 This is the result of using the YOLOv5s neural network to predict the target of peanut seeds in the first group of experiments; Figure 3 This is a result diagram of target prediction of peanut seeds in the first group of experiments using the present invention; Figure 4 Heatmap of target prediction for peanut seeds in the first set of experiments using the YOLOv5s neural network; Figure 5 A heat map showing target prediction of peanut seeds in the first group of experiments using the present invention; Figure 6 This is the original image of the second set of experiments; Figure 7 This is the result of using the YOLOv5s neural network to predict the target of peanut seeds in the second group of experiments; Figure 8 The result diagram of target prediction for peanut seeds in the second group of experiments using the present invention is shown; Fig. 9 Heatmap of target prediction for peanut seeds in the second set of experiments using the YOLOv5s neural network; Fig.10 A heat map showing target prediction of peanut seeds in the second group of experiments using the present invention; Fig.11 This is the original image of the third set of experiments; Fig.12 This is the result of using the YOLOv5s neural network to predict the target of peanut seeds in the third group of experiments; Fig.13This is a result diagram of target prediction of peanut seeds in the third group of experiments using the present invention; Fig.14 Heat map of target prediction for peanut seeds in the third experiment using the YOLOv5s neural network; Fig.15 A heat map showing target prediction of peanut seeds in the third group of experiments using the present invention; Fig.16 It is a technical flow chart of the present invention; Fig.17 This is the structural diagram of the similarity attention mechanism SimAM; Fig.18 Schematic diagram of SIoU loss function calculation; Fig.19 This is the BiFPN network structure diagram; Fig. 20 This is the network structure diagram after improving the YOLOv5s neural network. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention is described clearly and completely below. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] A neural network construction method for predicting peanut seed phenotypic parameters, using a YOLOv5s neural network, including a backbone network Backbone, a neck structure Neck and a head structure Head, using a CIoU loss function, and using a hierarchical bounding box HBB as a target detection module. Neck includes a path aggregation network PANet, and the YOLOv5s neural network is improved. A similarity attention mechanism SimAM is added to Backbone, and a weighted bidirectional feature pyramid network BiFPN is used in Neck to replace the path aggregation network PANet, and a SIoU loss function is used to replace the CIoU loss function, and an directional bounding box OBB is used to replace HBB. Peanut photos are obtained as the data source, divided into training set and test set, and the training set is input into the improved YOLOv5s neural network for training. After the training meets the accuracy requirements, the test set is input into the trained improved YOLOv5s neural network to predict the phenotypic parameters of peanut seeds and obtain the circumference and area of ​​peanut seeds.

[0019] SimAM is set at the input end of Backbone, and the input feature map is divided into three branches, two of which are imported into the self-attention weight calculation module. The result of the self-attention weight calculation module is input The activation function is then multiplied with the third branch, and then the feature map is output.

[0020] SimAM explores the importance of each neuron by analyzing the energy function: ; ; ; ; In the formula, is the energy function on each channel, For input features The variance of each channel in is a hyperparameter, for The target neurons, for The mean value on each channel in is the number of energy functions, For Backbone Input features The value of For the enhanced features, is the activation function.

[0021] BiFPN includes four branches, each of which extracts features of an input image through multiple convolutional layers. The four branches process four feature maps P3, P4, P5 and P6 from different convolutional layers. P3 and P6 pass through two convolutional layers in turn, P4 and P5 pass through three convolutional layers in turn, the first convolutional layer passed by P6 is connected to the second convolutional layer passed by P5, the second convolutional layer passed by P4, and the second convolutional layer passed by P3 in turn, the first convolutional layer passed by P5 is connected to the third convolutional layer passed by P5, the first convolutional layer passed by P4 is connected to the third convolutional layer passed by P4, and the second convolutional layer passed by P3 is connected to the third convolutional layer passed by P4, the third convolutional layer passed by P5, and the second convolutional layer passed by P6 in turn.

[0022] BiFPN's feature fusion methods include: ; ; ; In the formula, It is the first Input features , is the output feature, is the input feature The number of yes The weight of It is a very small number.

[0023] SIoU loss function include: ; ; ; ; ; ; ; ; ; ; ; In the formula, is the distance loss, is the intersection-over-union ratio between the predicted box and the true box area, is the shape loss, is the importance of shape loss, and Represent the length and width of the real box respectively, and Represent the length and width of the prediction box respectively, Indicates taking the maximum value, , , , is an intermediate parameter, ( , ) is the centroid coordinate of the prediction box, ( , ) is the centroid coordinate of the real box, and are the length and width of the minimum enclosing rectangle, Indicates taking the minimum value, is the distance between the two centroids Euclidean distance of coordinates, is the distance between the two centroids Euclidean distance between coordinates.

[0024] After improving the YOLOv5s neural network, Backbone includes two convolutional network layers CBS, a first pulse neural network layer CSP1_1, a convolutional network layer CBS, a second pulse neural network layer CSP1_2, SimAM, a convolutional network layer CBS, a third pulse neural network layer CSP1_3, SimAM, a convolutional network layer CBS, a first pulse neural network layer CSP1_1, SimAM, and a pooling layer SPPF in sequence. The convolutional network layer CBS includes a convolutional layer Conv, a batch normalization layer CN, and a SiLU activation layer. CSP1_1 includes one cross-stage local network CSPNet, CSP1_2 includes two cross-stage local networks CSPNet, and CSP1_3 includes three cross-stage local networks CSPNet. Neck includes three branches, each of which includes BiFPN and a convolutional layer Conv. The first branch includes upsampling, BiFPN and a convolutional layer Conv in sequence. The second branch includes BiFPN and a convolutional layer Conv in sequence. The third branch includes a convolutional network layer CBS, BiFPN and a convolutional layer Conv in sequence. The first SimAM of Backbone is connected to the BiFPN of the first branch. The second SimAM of Backbone is connected to the BiFPN of the second branch. The pooling layer SPPF is connected to the convolutional network layer CBS of the third branch. The convolutional network layer CBS of the third branch is provided with an upward module, including the convolutional network layer CBS of the third branch connected to upsampling, BiFPN, a double pulse neural network layer CSP2, a convolutional network layer CBS and the upsampling of the first branch in sequence. The second SimAM of Backbone is connected to the BiFPN of the upward module. A convolutional network layer CBS is provided in front of the BiFPN of the second branch. The BiFPN of the second branch is connected to the BiFPN of the third branch through a convolutional network layer CBS. The convolutional layers Conv of the three branches of Neck are connected to a feature map in Head respectively, with scales of 80×80×255, 40×40×255, and 20×20×255 respectively.

[0025] After OBB captures the peanut seed, the perimeter of the peanut seed is calculated through the contour point set. The contour is Points , ,……, Composition, the perimeter of a peanut seed with an open outline for: ; In the formula, It is the first The coordinates of a point.

[0026] Peanut seed circumference with closed outline for: .

[0027] Calculating peanut seed area by contour point set : .

[0028] The present invention comprehensively considers phenotypic omics knowledge, uses deep learning technology, relies on the YOLOv5s model, introduces OBB technology, and builds a model suitable for small target peanut phenotype (length and width) measurement based on the non-parameter SimAM attention mechanism, BiFPN-based Neck network optimization, and SIoU loss function improvement. At the same time, in order to make the model more convenient to use, a peanut phenotype measurement platform is also built for intelligent data collection and calculation. In order to study the method of image analysis and information measurement of peanut seed phenotypic parameters, the present invention uses peanut photos as the data source, wherein there are nearly 1,100 photos of peanuts of different varieties and nearly 33,000 peanut instances. The data set contains peanuts of various varieties, which can ensure that the trained model has robustness and transferability. The pixel size is unified to 6000×4000, and the peanut background is unified to black. 646 representative peanut images are extracted from the data set, and the training set and the test set are divided according to the ratio of 4:1 to keep the data sets independent of each other. The data set is annotated using annotation software based on the five-parameter annotation method, and all target category labels are uniformly set to peanuts.

[0029] The target detection module of the YOLOv5s algorithm uses the HBB algorithm, which represents the bounding box of the object by constructing a hierarchical structure. Usually, it starts with a large bounding box and gradually subdivides it into smaller sub-bounding boxes until each sub-bounding box can tightly surround its corresponding object. However, this algorithm can only accurately measure the horizontal or vertical target boundaries. If the target position has various rotation angles, the length and width of the measured boundary cannot correspond to the actual length and width of the target. The OBB algorithm is a method of using an axis-aligned rectangle or cuboid to enclose an object, which can be rotated according to the shape and direction of the object to more tightly enclose the object. OBB is used as the detection framework to more accurately capture the geometric center point of the peanut fruit and adapt to the position change of the target; the YOLOv5s network structure mainly includes three parts: the backbone network (Backbone), the neck structure (Neck) and the head structure (Head). Among them, the Backbone is responsible for extracting the basic features in the input image; the Neck is responsible for further processing the features extracted by the Backbone and integrating them into a multi-scale feature map; the Head is responsible for the final detection and classification tasks. The YOLOv5s target detection model has a fast detection speed while maintaining high accuracy. YOLOv5s improves the overall performance of the model through the collaborative work of multiple convolutional units. The Neck part adopts the path aggregation network PANet and the feature pyramid network FPN structure. FPN extracts feature maps from different layers of Backbone, and then integrates these feature maps layer by layer to propagate high-level semantic features in a top-down manner. It introduces a feature aggregation module to further integrate information from different scales and convey the strong positioning features of shallow feature maps in a bottom-up manner. When making predictions, the prediction box generated by YOLOv5s is filtered based on the CIoU loss function, and the prediction box with the highest confidence score is output.

[0030] In actual measurement scenarios, due to differences in peanut varieties, the color of some peanuts may be difficult to distinguish from the background color, resulting in model omission or misselection. In order to reduce the interference of the background on phenotypic information, the SimAM attention mechanism is introduced. SimAM is a parameter-free 3D attention module that uses the analysis of energy functions to explore the importance of each neuron based on neuroscience theory, and then calculates the attention weight. The SimAM attention mechanism measures the similarity between the input data and the reference vector by calculating the similarity between the two; based on the similarity results, it normalizes and weights them, thereby assigning corresponding weights to each input data to achieve attention and control of different features. In the task of measuring the width of peanut growth, SimAM can more comprehensively evaluate the feature weights, reduce the interference caused by the difference between the kernel color and the background color, evaluate each neuron through the energy function, and distinguish them according to the energy level of the adjacent neurons: the lower the energy of the neuron, the greater the difference between it and its adjacent neurons, and thus it appears more important.

[0031] YOLOv5s uses a path aggregation network PANet, which adds a bottom-up path that can pass the bottom-level position information to the feature map, so that the feature map contains both the top-level semantic information and the bottom-level position information. However, PANet is mainly based on the results of adjacent features in the feature fusion process, and it is difficult to achieve cross-scale connection and feature weighting. Its feature fusion capability cannot meet the needs of peanut length and width measurement. In order to overcome the shortcomings of PANet, the feature fusion network in the original YOLOv5s is replaced with a bidirectional feature pyramid network BiFPN. BiFPN takes into account the distortion of the edge of peanuts, so that the network pays more attention to the channel features related to the edge distortion of peanuts during the fusion process, enhances feature fusion, and improves the detection speed. In addition, the BiFPN network adds additional weights to each input and stacks the network structure multiple times to achieve the fusion of more high-level features. This can improve the accuracy of peanut length and width measurement.

[0032] Traditional CIoU does not consider the mismatch between the angle of the predicted box and the actual box, which leads to slow model convergence and unsatisfactory results. SIoU redefines the penalty term and considers the vector angle, which improves the speed of model training and the accuracy of inference. The present invention uses the SIoU loss function to achieve more accurate peanut length and width measurement.

[0033] To verify that the improved experiment conducted by the present invention has a certain improvement effect on the detection effect, the traditional YOLOv5s network is used as a comparison model, and SimAM, BiFPN and SIoU are used as verification modules for ablation experiments. The experimental results show that adding SimAM attention mechanism, BiFPN module and SIoU module to the model can improve the detection effect of the model. In general, the training accuracy of the present invention is the highest, and the average accuracy is improved by 4.2 percentage points compared with the traditional YOLOv5s model. The model of the present invention is more accurate in detecting and locating peanuts, which accelerates the collection process of peanut phenotypic data.

[0034] The peanut data set is input into the present invention for training, and the data set is input into the improved YOLOv5s peanut phenotype measurement model. The training parameters during model training are set to an initial learning rate of 0.0033. In the first five generations of training (5 epochs), the learning rate increases from 0.0033 to 0.01, and then decreases to 0.001 after cosine decay. The target box loss weight is 0.05, the classification loss weight is 0.3, the confidence loss weight is 0.6, the training batch size is 2, the number of iterations is 300, and the adaptive scaling image size is set to 640×640. A total of 290 rounds of training were performed. In order to better reflect the advantages of the present invention, the performance of the present invention and the YOLOv5s model without adding modules was compared and analyzed. The present invention shows rapid performance improvement in the early stage of training. As the number of iterations increases, the model shows good recognition and classification capabilities, and stabilizes at around 95% after about 150 iterations, indicating that the overall performance of the model is excellent and has high robustness. The loss value gradually decreases during the training process, especially in the first few rounds of iterations, and then decreases from the initial 0.25 to a stable level of 0.05, indicating that the model is close to its optimal state.

[0035] By counting the peanut images of different colors and calculating their missed detection rates, the missed detection rates of red peanuts, black peanuts and white peanuts were 0.28%, 3.12% and 0.21% respectively before the improvement. After the improvement, the missed detection rates of red peanuts, black peanuts and white peanuts were 0.06%, 0.15% and 0.02% respectively. After the improvement, the missed detection rates of red peanuts, black peanuts and white peanuts were reduced by 0.14%, 2.97% and 0.19% respectively. In summary, the improved R-YOLOv5s-SBS algorithm can achieve high-precision and accurate phenotypic measurement for peanuts of different colors in the image.

[0036] The present invention conducted three groups of experiments. The original images of the first group of experiments are as follows: Figure 1 The original images of the second set of experiments are shown in Figure 6 As shown, the original images of the third group of experiments are as follows Fig.11The results of using the YOLOv5s neural network to predict the target of the peanut seeds in the first group of experiments are shown in the figure below. Figure 2 As shown in the figure, the results of using the YOLOv5s neural network to predict the target of the peanut seeds in the second group of experiments are shown in Figure 7 As shown in the figure, the results of using the YOLOv5s neural network to predict the target of peanut seeds in the third group of experiments are shown in Fig.12 As shown; the result of using the present invention to perform target prediction on the peanut seeds of the first group of experiments is shown in FIG. Figure 3 As shown in FIG. 1 , the result of using the present invention to perform target prediction on the peanut seeds of the second group of experiments is shown in FIG. Figure 8 As shown in FIG. 1 , the result of using the present invention to perform target prediction on peanut seeds of the third group of experiments is shown in FIG. Fig.13 As shown, it can be seen that the labeling of peanut seeds by OBB is significantly higher than that by HBB.

[0037] Use the visualization tool Grad-CAM to obtain the heat map of the last layer of the model. GradCAM is a tool for visually analyzing the performance of image classification networks. Its core principle is to generate an attention heat map related to a specific output result by backpropagating it to a specified convolutional layer. By calculating the weighted sum of the gradient and feature map at a specific location, GradCAM can highlight the key areas of the model in the image. This method helps to explain the decision-making process of the model, verify whether the network's attention area is reasonable, and then evaluate the detection accuracy and effectiveness of the model. The darker the red in the heat map, the greater the feature weight. The heat map of the target prediction of peanut seeds in the first group of experiments using the YOLOv5s neural network is as follows Figure 4 As shown in Figure 2, the heat map of the target prediction of peanut seeds in the second group of experiments using the YOLOv5s neural network is shown in Figure 2. Fig. 9 As shown in Figure 2, the heat map of the target prediction of peanut seeds in the third group of experiments using the YOLOv5s neural network is shown in Figure 2. Fig.14 As shown; the heat map of the target prediction of the peanut seeds in the first group of experiments using the present invention is as follows Figure 5 As shown, the heat map of target prediction of peanut seeds in the second group of experiments using the present invention is as follows Fig.10 As shown, the heat map of target prediction of peanut seeds in the third group of experiments using the present invention is as follows Fig.15 As shown in the figure, from the comparison before and after the improvement, it can be seen that the improved heat map responds more locally to each target object, and the activation area is more concentrated in the core area of ​​the target. At the same time, it can be seen that the global activation is more consistent. The red high activation area in the heat map is clearer after the improvement, covering the core position of each target object. This shows that the model has a better understanding of the overall shape and structure of the target.

[0038] 136 photos were randomly selected from the data set, containing about 4080 peanut fruit instances. The actual length data of peanut fruit were collected by semi-automatic batch processing of the software, and the accuracy was evaluated by scatter plot. The results showed that the determination coefficient was as high as 98.056%, which further proved the practicality of the present invention in peanut phenotyping. The data of the YOLOv5s model was processed in the same way, showing a determination coefficient of 91.198%.

[0039] Compared with traditional manual measurement and visual recognition methods, this project uses advanced YOLOv5s target detection technology to conduct in-depth analysis of peanut images through a computer vision system, and quantitatively and automatically extract, identify and analyze peanut phenotypic characteristics such as size, shape, color, etc. In addition, deploying the model edge to the web page can achieve efficient and convenient interactive data processing. The fully automated recognition, processing, and analysis process can effectively reduce accidental errors caused by manual labor, and enhance the reliability of phenotypic data and the repeatability of scientific research.

[0040] Compared with the existing peanut phenotypic measurement methods, the results obtained by the present invention are more accurate, take less time, and require less investment. At the same time, with the help of the online platform built by the present invention, the user threshold is further lowered. The present invention can provide high-quality peanut growth and width data, and can better utilize phenomics to promote intelligent breeding and precision cultivation technology, thereby promoting the screening of high-quality peanut varieties, promoting the progress and development of the seed industry with intelligent technology, and accelerating the process of agricultural modernization and intelligence. From the perspective of economic benefits, the present invention solves the bottleneck of phenotypic data acquisition, helps screen high-quality varieties of peanuts, increases peanut crop yields, and promotes economic development; from the perspective of social benefits, the seed industry is the "chip" of agriculture, and seed industry research is inseparable from food security. The present invention provides support for peanut seed genotype research.

[0041] The technical roadmap of the present invention is as follows: Fig.16 As shown, it includes collecting peanuts and making peanut sample data sets, selecting deep learning models, establishing an improved YOLOv5s peanut phenotype measurement model, inputting the peanut data set into the improved YOLOv5s peanut phenotype measurement model for training, using the trained model to measure the phenotype of peanut fruit and evaluate its accuracy, and building a peanut phenotype information intelligent extraction platform based on the Vue front-end framework and the Flask back-end framework. The structure diagram of the similarity attention mechanism SimAM is as follows Fig.17 As shown in the figure, SimAM is set at the input end of Backbone, and the input feature map is divided into three branches, two of which are imported into the self-attention weight calculation module. The result of the self-attention weight calculation module is input The activation function is then multiplied with the third branch, and then the feature map is output.

[0042] The SIoU loss function calculation is shown as follows Fig.18 As shown, A in the figure represents the center point of the prediction box, and Represents the center point of the real box. The relative position of these two center points is an important factor in SIoU. Represents the distance from the center A of the predicted box to the center of the real box The smaller the distance, the closer the predicted box is to the true box, and the smaller the error. and The two angles are used to measure the direction difference between the predicted box and the true box. is the angle between the line from the center of the predicted box to the center of the true box and the wide side of the predicted box, and It is the angle between this line and the wide side of the real frame. and is the width and height of the smallest rectangular box that encloses the predicted box and the true box. This rectangular box can help define the scale and distance metric between bounding boxes, especially in the comparison of boxes at different scales.

[0043] The BiFPN network structure is shown in the figure Fig.19 As shown, BiFPN includes four branches, each branch extracts features of the input image through multiple convolutional layers, and the four branches process four feature maps P3, P4, P5 and P6 from different convolutional layers. P3 and P6 pass through two convolutional layers in turn, P4 and P5 pass through three convolutional layers in turn, the first convolutional layer passed by P6 is connected to the second convolutional layer passed by P5, the second convolutional layer passed by P4, and the second convolutional layer passed by P3 in turn, the first convolutional layer passed by P5 is connected to the third convolutional layer passed by P5, the first convolutional layer passed by P4 is connected to the third convolutional layer passed by P4, and the second convolutional layer passed by P3 is connected to the third convolutional layer passed by P4, the third convolutional layer passed by P5, and the second convolutional layer passed by P6 in turn.

[0044] The network structure diagram after improving the YOLOv5s neural network is as follows Fig. 20As shown, after the YOLOv5s neural network is improved, Backbone includes two convolutional network layers CBS, the first pulse neural network layer CSP1_1, the convolutional network layer CBS, the second pulse neural network layer CSP1_2, SimAM, the convolutional network layer CBS, the third pulse neural network layer CSP1_3, SimAM, the convolutional network layer CBS, the first pulse neural network layer CSP1_1, SimAM, and the pooling layer SPPF in sequence. The convolutional network layer CBS includes a convolutional layer Conv, a batch normalization layer CN, and a SiLU activation layer. CSP1_1 includes one cross-stage local network CSPNet, CSP1_2 includes two cross-stage local networks CSPNet, and CSP1_3 includes three cross-stage local networks CSPNet. Neck includes three branches, each of which includes BiFPN and a convolutional layer Conv. The first branch includes upsampling UP sample, BiFPN and convolutional layer Conv in sequence. The second branch includes BiFPN and convolutional layer Conv in sequence. The third branch includes convolutional network layer CBS, BiFPN and convolutional layer Conv in sequence. The first SimAM of Backbone is connected to the BiFPN of the first branch, the second SimAM of Backbone is connected to the BiFPN of the second branch, the pooling layer SPPF is connected to the convolutional network layer CBS of the third branch, and the convolutional network layer CBS of the third branch is provided with an upward module, including the convolutional network layer CBS of the third branch connected to upsampling, BiFPN, double pulse neural network layer CSP2, convolutional network layer CBS and upsampling of the first branch in sequence, the second SimAM of Backbone is connected to the BiFPN of the upward module, a convolutional network layer CBS is provided in front of the BiFPN of the second branch, and the BiFPN of the second branch is connected to the BiFPN of the third branch through a convolutional network layer CBS. The convolutional layers Conv of the three branches of Neck are connected to a feature map in Head respectively, with scales of 80×80×255, 40×40×255, and 20×20×255 respectively.

[0045] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features may be replaced by equivalents, and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A neural network construction method for predicting peanut seed phenotypic parameters, using a YOLOv5s neural network, including a backbone network Backbone, a neck structure Neck and a head structure Head, using a CIoU loss function, and using a hierarchical bounding box HBB as a target detection module, Neck including a path aggregation network PANet, characterized in that: Improve the YOLOv5s neural network, add the similarity attention mechanism SimAM in Backbone, use the weighted bidirectional feature pyramid network BiFPN to replace the path aggregation network PANet in Neck, use the SIoU loss function to replace the CIoU loss function, and use the directional bounding box OBB to replace HBB; Peanut photos are obtained as the data source, divided into training set and test set, and the training set is input into the improved YOLOv5s neural network for training. After the training meets the accuracy requirements, the test set is input into the trained improved YOLOv5s neural network to predict the phenotypic parameters of peanut seeds and obtain the circumference and area of ​​peanut seeds.

2. A neural network construction method for predicting peanut seed phenotypic parameters according to claim 1, characterized in that: SimAM is set at the input end of Backbone, and the input feature map is divided into three branches, two of which are imported into the self-attention weight calculation module. The result of the self-attention weight calculation module is input The activation function is then multiplied with the third branch, and then the feature map is output.

3. A neural network construction method for predicting peanut seed phenotypic parameters according to claim 2, characterized in that: SimAM explores the importance of each neuron by analyzing the energy function: ; ; ; ; In the formula, is the energy function on each channel, For input features The variance of each channel in is a hyperparameter, for The target neurons, for The mean value on each channel in is the number of energy functions, For Backbone Input features The value of For the enhanced features, is the activation function.

4. A neural network construction method for predicting peanut seed phenotypic parameters according to claim 3, characterized in that: BiFPN includes four branches, each of which extracts features of an input image through multiple convolutional layers. The four branches process four feature maps P3, P4, P5 and P6 from different convolutional layers. P3 and P6 pass through two convolutional layers in turn, P4 and P5 pass through three convolutional layers in turn, the first convolutional layer passed by P6 is connected to the second convolutional layer passed by P5, the second convolutional layer passed by P4, and the second convolutional layer passed by P3 in turn, the first convolutional layer passed by P5 is connected to the third convolutional layer passed by P5, the first convolutional layer passed by P4 is connected to the third convolutional layer passed by P4, and the second convolutional layer passed by P3 is connected to the third convolutional layer passed by P4, the third convolutional layer passed by P5, and the second convolutional layer passed by P6 in turn.

5. A neural network construction method for predicting peanut seed phenotypic parameters according to claim 4, characterized in that: BiFPN's feature fusion methods include: ; ; ; In the formula, It is the first Input features , is the output feature, is the input feature The number of yes The weight of It is a very small number.

6. A neural network construction method for predicting peanut seed phenotypic parameters according to claim 5, characterized in that: SIoU loss function include: ; ; ; ; ; ; ; ; ; ; ; In the formula, is the distance loss, is the intersection-over-union ratio between the predicted box and the true box area, is the shape loss, is the importance of shape loss, and Represent the length and width of the real box respectively, and Represent the length and width of the prediction box respectively, Indicates taking the maximum value, , , , is an intermediate parameter, ( , ) is the centroid coordinate of the prediction box, ( , ) is the centroid coordinate of the real box, and are the length and width of the minimum enclosing rectangle, Indicates taking the minimum value, is the distance between the two centroids Euclidean distance of coordinates, is the distance between the two centroids Euclidean distance between coordinates.

7. A neural network construction method for predicting peanut seed phenotypic parameters according to claim 6, characterized in that: After improving the YOLOv5s neural network, Backbone includes two convolutional network layers CBS, a first pulse neural network layer CSP1_1, a convolutional network layer CBS, a second pulse neural network layer CSP1_2, SimAM, a convolutional network layer CBS, a third pulse neural network layer CSP1_3, SimAM, a convolutional network layer CBS, a first pulse neural network layer CSP1_1, SimAM, and a pooling layer SPPF in sequence. The convolutional network layer CBS includes a convolutional layer Conv, a batch normalization layer CN, and a SiLU activation layer. CSP1_1 includes one cross-stage local network CSPNet, CSP1_2 includes two cross-stage local networks CSPNet, and CSP1_3 includes three cross-stage local networks CSPNet. Neck includes three branches, each of which includes BiFPN and a convolutional layer Conv. The first branch includes upsampling, BiFPN and a convolutional layer Conv in sequence. The second branch includes BiFPN and a convolutional layer Conv in sequence. The third branch includes a convolutional network layer CBS, BiFPN and a convolutional layer Conv in sequence. The first SimAM of Backbone is connected to the BiFPN of the first branch. The second SimAM of Backbone is connected to the BiFPN of the second branch. The pooling layer SPPF is connected to the convolutional network layer CBS of the third branch. The convolutional network layer CBS of the third branch is provided with an upward module, including the convolutional network layer CBS of the third branch connected to upsampling, BiFPN, a double pulse neural network layer CSP2, a convolutional network layer CBS and the upsampling of the first branch in sequence. The second SimAM of Backbone is connected to the BiFPN of the upward module. A convolutional network layer CBS is provided in front of the BiFPN of the second branch. The BiFPN of the second branch is connected to the BiFPN of the third branch through a convolutional network layer CBS. The convolutional layers Conv of the three branches of Neck are connected to a feature map in Head respectively, with scales of 80×80×255, 40×40×255, and 20×20×255 respectively.

8. A neural network construction method for predicting peanut seed phenotypic parameters according to claim 7, characterized in that: After OBB captures the peanut seed, the perimeter of the peanut seed is calculated through the contour point set. The contour is Points , ,……, Composition, the perimeter of a peanut seed with an open outline for: ; In the formula, It is the first The coordinates of a point.

9. A neural network construction method for predicting peanut seed phenotypic parameters according to claim 8, characterized in that: Peanut seed circumference with closed outline for: 。 10. A neural network construction method for predicting peanut seed phenotypic parameters according to claim 9, characterized in that: Calculating peanut seed area by contour point set : 。

Citation Information

Patent Citations

  • Network abnormal behavior identification method, device and system based on lightweight double-frame rate

    CN114663816A

  • Target detection method based on improved YOLOv5s network model

    CN117372684A

  • Method and system for detecting small target in aerial image of unmanned aerial vehicle, and electronic equipment

    CN118015490A

  • Network module and distribution method and apparatus, electronic device, and storage medium

    US20200294249A1

  • Juvenile fish limb identification method based on multi-scale cascaded perceptual convolutional neural network

    US20230343128A1