Intelligent peanut quality inspection method
By constructing an improved Yolov7s architecture peanut seed identification network model, the problems of low efficiency and low accuracy in peanut seed identification were solved, realizing automated identification and measurement of peanut seeds, and improving identification accuracy and system stability.
Patent Information
- Application Number
- CN202211443743.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-18
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-11-18
AI Technical Summary
Existing peanut seed testing methods suffer from low measurement efficiency, low accuracy, and low speed, and are difficult to apply to peanut seeds, lacking automation and universality.
A smart peanut seed identification method is constructed, which adopts an improved Yolov7s architecture seed identification network model, combines depthwise separable convolution and inverse residual structure, uses an improved CBAM submodule and genetic algorithm to optimize hyperparameters, and realizes automated identification and measurement of peanut seeds through image processing.
It improves the efficiency and accuracy of peanut seed testing, realizes automated identification and measurement of peanut seeds, reduces the input of manpower and material resources, and improves identification accuracy and system stability.
Smart Images

Figure CN115761582B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of peanut examination, and particularly relates to an intelligent peanut examination method. BACKGROUND
[0002] Peanut is an important oil crop in China, and ensuring the quality and yield of peanuts is of great significance to the grain and oil safety of China. In order to accurately identify and evaluate the symptoms such as high yield, stability, adaptability and stress resistance of peanut varieties selected and introduced in recent years, it is necessary to analyze and judge the seed damage rate, hundred-grain weight, seed length-width ratio and other seed trait information to realize the seed examination. Peanut seed examination is mainly applied in the breeding process to quickly and accurately extract the information needed to judge the advantages and disadvantages of breeding materials, improve the breeding efficiency, provide a basis for the screening of breeding materials, and is an important link of peanut breeding.
[0003] At present, there are still many impurities, small grains, broken grains, bad grains and wormy grains in the harvested peanut seeds, and the quality of peanut seeds directly affects the yield and quality of peanut planting. The traditional peanut seed examination method mainly relies on manual operation, but manual seed examination has the problems of complicated operation, long time consumption, many subjective factors, low precision, poor repeatability and the like, and these reasons also make the seed examination only be sampling detection, and cannot complete the direct measurement of a large number of peanut seeds.
[0004] In the prior art, there are many seed examination methods, such as the invention patent with publication number
CN105009731A
CN109934297A
[0005] For example, compared with corn seeds, peanut seeds are ellipsoidal, while corn seeds are flat, even if image processing methods are used, corn seeds only need to be detected on the upper and lower two surfaces, while peanut seeds must be detected and analyzed in all directions to conduct peanut seed inspection; compared with peanut seeds, rice seeds have a huge size difference, and the inspection direction of rice seeds is mainly to identify the grain category including closed solid, closed partial solid, open solid, open partial solid, closed empty, closed partial empty, open empty and open partial empty, while the inspection direction of peanut seeds is mainly to identify the good and bad of peanut seeds; therefore, the existing inspection methods are difficult to apply to peanut seeds, and there is no specific method for peanut seed inspection in the prior art, and the technical achievements are less, so there is an urgent need for a peanut seed inspection method which is accurate and fast, high in automation, easy for general agricultural technology personnel to operate and apply. SUMMARY
[0006] The present application is to solve the problems of low measurement efficiency, low precision and low speed in the current peanut seed inspection process, and proposes an intelligent peanut seed inspection method to effectively improve the inspection efficiency and work reliability, and is suitable for the inspection of various peanut seeds.
[0007] The present application is implemented by adopting the following technical solutions: an intelligent peanut seed inspection method, comprising the following steps:
[0008] Step A: constructing an inspection network model and training;
[0009] Step A1: constructing a training data set and preprocessing: taking a large number of peanut seed photos and labeling them one by one, collecting a large number of peanut seed photos of various types to make a data set; preprocessing the training data set made to obtain a preprocessed data set;
[0010] Step A2: constructing an inspection network model:
[0011] The inspection network model comprises an input layer, a backbone network, a neck layer and a detection head, the neck layer links the backbone network and the detection head, the neck layer comprises an SPPF and an SElayer, a bottleneck layer is further added in front of the detection head, and the output results of the detection head include four types of good peanut seeds, damaged peanut seeds, white sand peanut seeds and sweet red peanut seeds;
[0012] The backbone network adopts a Yolov7s architecture, comprising a bottleneck layer, a depth separable convolution, an inverse residual structure and an improved CBAM sub-module, the improved CBAM sub-module comprises a channel attention sub-module and a spatial attention sub-module, the channel attention sub-module uses a three-dimensional arrangement to reserve information in three dimensions, and a two-layer MLP is used to amplify the cross-dimensional channel spatial dependency; the spatial attention sub-module uses two convolution layers to fuse spatial information;
[0013] Step A3: training the test network model based on the pre-processed data set, and quantizing and deploying the trained test network model;
[0014] Step B: testing the peanut seeds based on the trained network model, outputting the identification of the peanut seed category, calculating the damage rate, and determining the hundred-seed weight and length-width ratio of the peanuts.
[0015] Further, in step A2, the improved CBAM sub-module adopts a sequential channel-spatial attention mechanism design, and the given input feature mapping F1 is C×H×W , the intermediate state and the output are defined as:
[0016]
[0017]
[0018] wherein F1 is the input feature, F2 is the intermediate state, and F3 is the output state, and Mc and Ms are the channel attention map and the spatial attention map, respectively.
[0019] Further, in step A3, when training, the grid search method is used to optimize the hyperparameters of the model, a hyperparameter evolution list is listed, the hyperparameters trained by the genetic algorithm are used to determine a basic hyperparameter, then mutation is performed, and the weight of each hyperparameter is determined according to the result obtained each time, and after obtaining each hyperparameter and the weight of each hyperparameter, there are two genetic evolution methods:
[0020] (1) randomly selecting a previous hyperparameter as a basic hyperparameter according to the weight of each hyperparameter;
[0021] (2) obtaining a basic hyperparameter by fusing all previous hyperparameters according to the weight of each hyperparameter;
[0022] Meanwhile, the hyperparameters after each genetic evolution are recorded, and at each evolution, the hyperparameters are sorted from large to small according to the previous results, and the weight of the hyperparameters obtained at each previous evolution is calculated according to the fitness function; then the evolution method is determined for evolution; finally, all the evolved hyperparameters are saved, and the optimal one is selected according to the neural network evaluation index.
[0023] Further, in step A2, the input layer processing process is as follows:
[0024] (1) when clustering the initial anchor frame, k cluster centers are selected from all the boundary frames, the boundary frame is taken as a cluster, the cluster is divided into two, and then the cluster with the maximum SSE value is selected for division, and then this step is repeatedly performed until the required number of clusters is reached;
[0025] (2) The distance between samples uses 1-iou as the distance between samples.
[0026] (3) When screening the candidate frame, the confidence of the candidate frame with an overlap greater than a threshold t with the highest score frame is reduced.
[0027] Further, the step B of performing the test includes the following steps:
[0028] Step B1: collect the original image of the peanut seeds, and cut the image frame from the video;
[0029] Step B2: input the peanut aspect ratio detection algorithm based on Opencv, test and compare under different thresholds, and select the optimal fitting threshold as the recommended threshold under fixed illumination intensity;
[0030] Step B3: use Opencv to input the collected image frame into the constructed test network model for prediction and recognition, and obtain four types of results; further, according to the anchor frame number of the recognized peanut seeds, the seed skin damage and the seed skin color, the quantity, the damage rate of the peanut seeds and the category of the peanut seeds are calculated and output;
[0031] Step B4: weigh the peanut seeds, divide the weight by the anchor frame number of the peanut seeds, and multiply by 100 to obtain the hundred fruit weight of the peanut seeds; use Opencv to perform gray processing, binarization and color block erosion and expansion on the picture position predicted by the test network model, and based on the use of minimum rectangular fitting, the aspect ratio of the peanut seeds is calculated.
[0032] Compared with the prior art, the advantages and positive effects of the present application are that:
[0033] The scheme constructs a test network model, solves the problem that the convergence condition is seriously dependent on the initialization of the cluster center when clustering the initial anchor frame, avoids the problem of tending to local optimal solution when clustering the initial anchor frame, tends to global optimal solution, uses 1-iou instead of Euclidean distance, can obtain anchor frame with better precision and higher accuracy, no longer deletes all incomplete matching anchor frames, but reduces the confidence, avoids the overlap condition, solves the problem that when a real object appears in the overlap area, the detection fails and reduces the average detection rate, solves the problem that the threshold is too small and easy to delete by mistake, and the threshold is too large and easy to detect by mistake;
[0034] The redesigned CBAM sub-module can put full global dimension interaction features while reducing information diffusion; by removing the Darknet-based feature extraction network in the original network, adding depth separable convolution and inverse residual structure to reduce the parameter amount, avoiding the problem of increasing the parameter amount caused by the redesigned CBAM sub-module, improving the running speed and accuracy of the neural network, and improving the response time and stability of the system; the hyperparameters are iterated in the training process by the genetic algorithm to obtain the most suitable hyperparameters for the data set, thereby improving the running speed and detection accuracy of the neural network. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 A flowchart of the intelligent peanut variety testing method according to the embodiment of the present application is shown in the figure.
[0036] Figure 2 A network model structure and network layer diagram of the variety testing network according to the embodiment of the present application is shown in the figure.
[0037] Figure 3 A CBAM sub-module structure diagram in the intelligent peanut variety testing method according to the embodiment of the present application is shown in the figure.
[0038] Figure 4 A channel attention sub-module structure diagram in the intelligent peanut variety testing method according to the embodiment of the present application is shown in the figure.
[0039] Figure 5 A spatial attention sub-module structure diagram in the intelligent peanut variety testing method according to the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0040] In order to more clearly understand the above purpose, features and advantages of the present application, the present application will be further described below in combination with the drawings and embodiments. In the following description, a large number of specific details are set forth in order to facilitate a full understanding of the present application, however, the present application can also be implemented in other ways different from those described herein, therefore, the present application is not limited to the specific embodiments disclosed below.
[0041] The embodiment discloses an intelligent peanut variety testing method, which realizes reliable variety testing of peanuts based on deep learning intelligent detection technology and aspect ratio fitting image processing algorithm, as shown in the figure, including the following steps: Figure 1
[0042] Step A: constructing a variety testing network model and training;
[0043] Step A1: constructing a training data set and preprocessing: taking a large number of peanut seed photos and labeling them one by one, collecting a large number of peanut seed photos of various types to make a data set; preprocessing the training data set made to obtain a preprocessed data set;
[0044] Step A2: constructing a seed testing network model;
[0045] Step A3: training the seed testing network model based on the preprocessed data set;
[0046] Step A4: quantization deployment of the model;
[0047] Step B: based on the trained network model, the peanut seeds are tested, the damage rate is calculated, the seed categories are identified, and the hundred fruit weight and length-width ratio of the peanuts are determined.
[0048] In order to further understand the scheme of the present application, the present application will be described in detail as follows:
[0049] The construction of the seed testing network model in step A is the key and difficulty of the present scheme. In the input layer, the initial anchor frame is improved by clustering, 1-iou is used as the distance between samples, and the confidence is reduced to avoid overlap; the CBAM sub-module is redesigned in the backbone network to replace the original Darknet algorithm of YOLOV7 network model, and the depth separable convolution and linear bottleneck reverse residual structure are used.
[0050] Step A1: constructing a training data set and preprocessing;
[0051] First, a large number of peanut seed photos are taken and labeled one by one, a large number of peanut seed photos are collected to make a data set, and in this embodiment, the COCO data set is used to label each peanut seed with a polygon, and in this embodiment, 2215 peanut seed photos are collected to make a data set. The training data set is expanded by using random rotation, counterclockwise cropping, and horizontal offset data enhancement method, the size of each image in the collected training data set is uniformly scaled to (128, 128) format size, and each pixel value of the image is multiplied by 1 / 255, so that each value is between 0 and 1, and the preprocessed training data set is obtained;
[0052] Step A2: constructing a seed testing network model
[0053] When constructing the model, the lightweight model Yolov7s is selected, the network structure is as shown in Figure 2 The model mainly includes four parts: input layer, backbone network, neck layer and detection head. The backbone network of the model adopts Yolov7s and is improved based on the self-made data set. The network model includes bottleneck layer, depth separable convolution, reverse residual structure and improved CBAM sub-module. The neck layer is a network layer linking the backbone network and the detection head, which includes SPPF and SElayer, and the detection head is added with a bottleneck layer. The detection head outputs four categories, which are good peanut seeds, damaged peanut seeds, white sand peanut seeds and sweet red peanut seeds.
[0054] In the input layer:
[0055] (1) For self-made data set, since the target recognition framework often needs to scale the original picture size, and the size of the target object in the data set may also be different from the initial data set, the neural network needs to automatically learn the size of the anchor box during training. Therefore, when clustering the initial anchor box, when selecting k cluster centers in all boundary boxes, k data objects are no longer randomly selected as cluster centers, and k initial cluster centers are selected following the principle that the distance between the initial cluster centers is as far as possible.
[0056] After selecting k cluster centers, the boundary box where the cluster center is located is divided into two clusters, and the next cluster is selected for division. The cluster with the maximum SSE (sum of squared errors) value is selected for division, and then this step is repeatedly performed until the required number of clusters is reached.
[0057] The sum of squared errors formula is as follows:
[0058]
[0059] where w i represents the weight value, represents the average value of all points in the cluster.
[0060] When selecting the cluster with the maximum SSE value for division, the sum of squared errors of clustering can measure the clustering performance. The smaller the SSE, the closer the data points are to their centroids, and the better the clustering effect. The larger the SSE, the farther the data points are from their centroids, and the worse the clustering effect. Division is performed.
[0061] The convergence condition is seriously dependent on the initialization of the cluster center, which avoids the problem of tending to local optimal solution when clustering the initial anchor box, and tends to global optimal solution, which improves the detection accuracy and effect.
[0062] (2) The distance between samples uses 1-iou as the distance between samples. IOU can well represent the closeness of two pairs of width and height. IOU takes a value between [0, 1], and the larger the IOU, the closer the two pairs of width and height, and vice versa, the smaller the difference between the two pairs of width and height.
[0063] The Avg IOU is calculated, that is, the average of the maximum IOU of all target bounding boxes (bboxes) and cluster center anchor boxes (anchors), and the larger the Avg IOU, the better the obtained anchors. Compared with using cluster SSE and cluster IOU, the Avg IOU corresponding to cluster IOU is larger, and 1-IOU(bboxes, anchors) is used to represent the distance, that is, the larger the IOU of bboxes and the corresponding cluster center (anchors), the closer the distance, and the smaller the 1-IOU, as shown in Table 1:
[0064] Table 1 Avg IOU comparison table
[0065]
[0066] (3) When screening the candidate frame, the confidence of the frame with an overlap greater than threshold t with the highest score frame is reduced;
[0067] Suppose the set of all input prediction frames is S, and the algorithm returns the result set D initialized as an empty set, and each time the highest score frame M in S is selected, and then the frames in S are deleted more carefully, and the highest score frame is not directly deleted. For the frame with an overlap greater than threshold t with the highest score frame, the confidence of the frame is reduced, which can to some extent avoid the overlap situation. The problem of detection failure caused by the appearance of a real object in the overlapping area is solved, and the average detection situation is reduced. The problem of easy false deletion when the threshold t is too small and easy false detection when the threshold t is too large is solved.
[0068] In the backbone network:
[0069] After the data set obtains input information through the input layer, it enters the backbone network, extracts the feature information of the image in the data set, and generates a feature map. The backbone network is described in detail as follows:
[0070] The neural network can also put all global interaction features in the case of reducing information dispersion, and the CBAM sub-module is redesigned and improved; the original Darknet algorithm of YOLOV7 network is replaced by using a deep separable convolution and a linear bottleneck inverted residual structure, a lightweight attention model (SE) based on a squeeze and excitation structure is adopted, and a new activation function h-swish(x) is fused.
[0071]
[0072] Wherein, x represents a specified tensor input, and ReLU is a nonlinear activation function.
[0073] The function has no upper bound, no saturation phenomenon, lower bound, strong regularization effect, and non-monotonicity, everywhere continuous and derivable.
[0074] (1) The improved CBAM submodule adopts a sequential channel-space attention mechanism for redesign, and the given input feature map F1 is redefined as: C×H×W , the intermediate state and the output are defined as:
[0075]
[0076]
[0077] Wherein, F1 is the input feature, F2 is the intermediate state, F3 is the output state, Mc and Ms are the channel attention map and the spatial attention map respectively.
[0078] The whole process is as shown in Figure 3 .
[0079] The improved CBAM submodule is divided into a channel attention submodule and a spatial attention submodule; the channel attention submodule (Channel Attention) uses a three-dimensional arrangement to retain information in three dimensions, and uses a two-layer MLP (Multilayer Perceptron) to amplify cross-dimensional channel space dependency, and the module structure is as shown in Figure 4 . The spatial attention submodule (Spatial Attention) uses two convolutional layers for spatial information fusion. The same reduction ratio r is used in the channel attention submodule as in the BAM, and the pooling operation is deleted to further retain the feature map, so sometimes the number of parameters is significantly increased, and the spatial attention submodule structure is as shown in Figure 5 . The improved CBAM submodule is added to the first and third layers of the backbone network, and the tenth layer of the detection head.
[0080] (2) Remove the original network based on Darket feature extraction network, add depth separable convolution and inverse residual structure, add it to the backbone network 2, 4 layers, detection head 11 layers. At the same time, remove the original network based on Darket feature extraction network, add depth separable convolution and inverse residual structure. Depth separable convolution can reduce about 20% of the parameter amount in the network. The inverse residual structure can upgrade the network, expand the number of channels in the data before entering the depth convolution, enrich the number of features, and improve the accuracy. After the depth convolution, the number of channels is compressed, the useful features are automatically selected, and the number of parameters is reduced. Add it to the backbone network 2, 4 layers, detection head 11 layers, reduce the increase of parameter amount caused by the deletion of the pooling. Improve the operation speed and accuracy of the neural network, and improve the response time and stability of the system.
[0081] The neck layer is a network layer that mixes and combines image features, connecting the backbone network and the detection head, and transmitting the feature map processed in the backbone network to the detection head. The detection head is used to predict the image features transmitted, and in this embodiment, the detection head predicts four categories, namely good peanut seeds, damaged peanut seeds, white sand peanut seeds and sweet red peanut seeds.
[0082] Step A3: input into the network model for training
[0083] During the training process, the similarity between the coco dataset scene and the self-made dataset scene is automatically found, so that the neural network automatically fits the characteristic curve of the new dataset.
[0084] During the training process, a base hyperparameter (base hyp) is determined by listing the hyperparameter evolution list and training the hyperparameter (hyp) through a genetic algorithm, and then mutating, and then determining the weight of each hyperparameter according to the result obtained each time. After obtaining each hyperparameter and the weight of each hyperparameter, there are two genetic evolution methods:
[0085] (1) Randomly select a previous hyperparameter as a base hyperparameter according to the weight of each hyperparameter.
[0086] (2) A base hyperparameter is obtained by fusing all previous hyperparameters according to the weight of each hyperparameter.
[0087] At the same time, record the hyperparameters after each genetic evolution. At each evolution, the hyperparameters are sorted from large to small according to the previous results, and then the weight of each hyperparameter obtained by evolution is calculated according to the fitness function; then decide which evolution method to evolve. Finally, save all evolved hyperparameters, and select the best generation according to the neural network evaluation index.
[0088] In this embodiment, the grid search method is used to optimize the hyperparameters. After 50 iterations in the yolov7 algorithm, the optimal hyperparameter value is obtained, which maximizes the system efficiency. Table 2 shows the details:
[0089] Table 2 Hyperparameter and matching value table
[0090]
[0091]
[0092] Step B: test the peanut seeds based on the trained network model;
[0093] Step B1: image acquisition: acquire the original image of the peanut seeds: by controlling the light intensity of the testing device, the image frame is cut from the video captured by the camera.
[0094] Step B2: input the peanut growth width ratio detection algorithm based on Opencv, test and compare under different threshold values, and select the optimal fitting threshold as the recommended threshold of the test system under fixed light intensity.
[0095] Step B3: input the collected image frames to the constructed test network model using Opencv for prediction and recognition, and obtain four types of results; further, according to the anchor frame number of the recognized peanut seeds, the seed skin damage and the seed skin color, the quantity, damage rate and category of the peanut seeds are calculated and output;
[0096] Step B4: use the weighing module to weigh the peanut seeds, divide the weight by the anchor frame number of the peanut seeds, and multiply by 100 to obtain the hundred fruit weight of the peanut seeds; use Opencv to perform gray processing, binarization, color block erosion and expansion, and minimum rectangle fitting on the picture position predicted by the test network model, and finally calculate the accurate length-width ratio.
[0097] In order to further verify the effectiveness of the method, the embodiment tests a bag of unknown peanut seeds: during the test, a total of 2215 data sets are collected, including 869 damaged peanut seeds and 1346 excellent peanut seeds. According to the data set ratio of 4:1, a total of 553 test sets are selected for model prediction, and the test result shows that the model prediction accuracy is as high as 98.3%. 500 peanut seeds are randomly taken from the bag, and 5 tests are performed to calculate the accuracy and recall rate, and the test results are shown in Table 3:
[0098] Table 3 Test Results
[0099]
[0100] According to the above steps, the intelligent peanut test method can obtain the quantity, damage rate, hundred fruit weight and category of the peanut seeds, and realize the peanut test. Moreover, the recognition accuracy can be guaranteed, the manpower and material resources can be effectively saved, the reliability is high, and the automation degree is high.
[0101] The above is only a preferred embodiment of the present application, and is not intended to limit the present application in other forms. Any skilled person in the art can modify or change the above disclosed technical content to equivalent embodiments applied to other fields, but any simple modification, equivalent change and modification made according to the technical essence of the present application to the above embodiments still belongs to the protection scope of the present application.
Claims
1. A smart peanut seed testing method, characterized in that, Includes the following steps: Step A: Construct and train the test network model; Step A1: Construct and preprocess the training dataset: Take a large number of photos of peanut seeds and label them one by one to collect a large number of photos of various peanut seeds to create a dataset; preprocess the training dataset to obtain the preprocessed dataset; Step A2: Construct the examination network model: The peanut seed testing network model includes an input layer, a backbone network, a neck layer, and a detection head. The neck layer connects the backbone network and the detection head, and includes SPPF and SElayer. A bottleneck layer is also added before the detection head. The detection head outputs four categories: good peanut seeds, damaged peanut seeds, white sand peanut seeds, and sweet red peanut seeds. The input layer processing procedure is as follows: (1) When the initial anchor box of clustering is selected, k cluster centers are selected in all the bounding boxes. The bounding box is taken as a cluster and then the cluster is divided into two. Then the cluster with the largest SSE value is selected for division. This step is repeated until the required number of clusters is reached. (2) The distance between samples is 1-iou; (3) When filtering candidate boxes, the confidence level of candidate boxes whose overlap with the highest-scoring box is greater than the threshold t is reduced; The backbone network adopts the Yolov7s architecture, including a bottleneck layer, depthwise separable convolution, inverse residual structure and improved CBAM submodule. The improved CBAM submodule includes a channel attention submodule and a spatial attention submodule. The channel attention submodule uses a three-dimensional arrangement to retain information in three dimensions and uses a two-layer MLP to amplify cross-dimensional channel spatial dependencies. The spatial attention submodule uses two convolutional layers to fuse spatial information; Step A3: Train the examination network model based on the preprocessed dataset, and then deploy the trained examination network model in a quantitative manner. Step B: Based on the trained network model, examine the peanut seeds, output the identification of peanut seed categories, calculate the damage rate, and determine the weight per 100 peanuts and the aspect ratio.
2. The intelligent peanut seed testing method according to claim 1, characterized in that: In step A2, the improved CBAM submodule adopts a sequential channel-space attention mechanism design, given the input feature mapping. The intermediate states and outputs are defined as follows: ; ; Where F1 is the input feature, F2 is the intermediate state, F3 is the output state, and Mc and Ms are the channel attention map and spatial attention map, respectively.
3. The intelligent peanut seed testing method according to claim 1, characterized in that: In step A3, during training, the hyperparameters of the model are optimized using a grid search method, and a hyperparameter evolution list is created. A base hyperparameter is determined using the hyperparameters trained by the genetic algorithm, and then mutation is performed. The weight of each hyperparameter is determined based on the results of each evolution. After obtaining each hyperparameter and its weight, there are two genetic evolution methods: (1) Randomly select a previous hyperparameter as the base hyperparameter based on the weight of each hyperparameter; (2) A basic hyperparameter is obtained by fusing all the previous hyperparameters according to the weight of each hyperparameter; Simultaneously, the hyperparameters after each genetic evolution are recorded. During each evolution, the hyperparameters are sorted from largest to smallest according to the previous results, and the weights of the hyperparameters obtained from each previous evolution are calculated according to the fitness function. Then, the evolution method is selected for evolution. Finally, all evolved hyperparameters are saved, and the optimal one is selected according to the neural network evaluation index.
4. The intelligent peanut seed testing method according to claim 1, characterized in that: Step B, when conducting the examination, specifically includes the following steps: Step B1: Acquire raw images of peanut seeds by extracting image frames from the captured video; Step B2: Input the flower length-to-width ratio detection algorithm based on OpenCV, test and compare it under different thresholds, and select the optimal fitting threshold as the recommended threshold under a fixed light intensity; Step B3: Use OpenCV to input the acquired image frames into the constructed seed identification network model for prediction and recognition, and obtain four types of results; then, based on the number of anchor frames of the identified peanut seeds, seed skin damage, and seed skin color, calculate the number of peanut seeds, damage rate, and output the category of peanut seeds. Step B4: Weigh the peanut seeds, divide the weight by the number of anchor frames of the peanut seeds, multiply by 100 to get the weight of 100 peanut seeds; use OpenCV to perform grayscale processing, binarization, and color block erosion and dilation on the image positions predicted by the seed network model, and calculate the aspect ratio of the peanut seeds based on the minimum rectangle fitting.
Citation Information
Patent Citations
Corn test method and system thereof
CN105009731A
Rice test method based on deep learning convolutional neural network
CN109934297A
Unmanned aerial vehicle real-time vehicle detection method based on convolutional neural network
CN112069868A
Excellent peanut seed screening system and screening method thereof
CN113128578A
Device and method for detecting appearance quality of seeds
CN113820322A