Intelligent peanut grading equipment and method
Through high-definition cameras and deep learning algorithms, the color and shape characteristics of peanuts are automatically recognized, solving the problems of inefficiency and misjudgment of traditional grading methods, and achieving more accurate peanut grading.
Patent Information
- Application Number
- CN202411182906.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional peanut grading method relies on manual operations, is inefficient and prone to misjudgment. The color and shape of the peanut surface change subtlely, making it difficult to accurately identify with the naked eye.
High-definition cameras are used to collect peanut images, and color and shape features are extracted and fusion through deep learning algorithms to automatically identify the quality level of peanuts.
Improves the efficiency and accuracy of the grading process, reduces manual intervention, and provides more accurate grading results.
Smart Images

Figure CN119169613A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent grading, and more specifically, to an intelligent peanut grading device and method. Background Art
[0002] Peanuts, also known as peanut kernels or peanut seeds, are the seed part of the peanut plant. As a popular dried fruit food, different consumption scenarios have different requirements for the quality of peanuts, such as food processing, direct consumption, etc. Therefore, in order to meet the needs of different consumers, the quality of peanuts needs to be graded.
[0003] However, the traditional peanut grading method may be overly dependent on manual operation, which is not only inefficient, but also prone to misjudgment and inconsistent grading due to human factors. Secondly, the color changes on the surface of peanuts can be very subtle, such as a slight yellow or brown gradient, and the shape of the same peanut can also be obscured, and these changes are difficult to be recognized by the naked eye without auxiliary tools.
[0004] Therefore, an optimized peanut grading equipment is expected. Summary of the invention
[0005] In order to solve the above technical problems, the present application is proposed. The embodiment of the present application provides an intelligent peanut grading device and method, which collects images of peanuts through a high-definition camera, and uses image recognition and analysis processing technology based on deep learning to extract color features and shape features of the peanut images and perform correlation fusion, so as to intelligently obtain the evaluation results of the quality grade of the peanuts. In this way, the high-definition camera can capture the details of the peanuts, and can automatically and accurately identify the color and shape characteristics of the peanuts by using a deep learning algorithm, so as to provide more accurate grading results, thereby reducing the need for manual grading and improving the efficiency of the grading process.
[0006] According to one aspect of the present application, there is provided an intelligent peanut grading device, comprising:
[0007] A peanut fruit image acquisition module is used to acquire images of peanut fruits through a high-definition camera;
[0008] A peanut fruit color and shape feature extraction module is used to extract color features and shape features from the peanut fruit image to obtain a peanut fruit color feature map and a peanut fruit shape feature map;
[0009] A peanut fruit color and shape feature optimization module, used for inputting the peanut fruit color feature map and the peanut fruit shape feature map into the peanut fruit feature optimization module for feature optimization to obtain a peanut fruit color optimized feature map and a peanut fruit shape optimized feature map;
[0010] A peanut fruit quality state feature fusion module, used for fusing the peanut fruit color optimization feature map and the peanut fruit shape optimization feature map to obtain a peanut fruit quality state feature map;
[0011] The evaluation result generating module is used to obtain the evaluation result based on the peanut fruit quality state characteristic diagram, and the evaluation result is used to represent the peanut fruit quality grade.
[0012] According to another aspect of the present application, an intelligent peanut grading method is provided, which comprises:
[0013] The image of peanut fruit is collected by high-definition camera;
[0014] Respectively performing color feature extraction and shape feature extraction on the image of the peanut fruit to obtain a peanut fruit color feature map and a peanut fruit shape feature map;
[0015] Inputting the peanut fruit color feature map and the peanut fruit shape feature map into a peanut fruit feature optimization module for feature optimization to obtain a peanut fruit color optimized feature map and a peanut fruit shape optimized feature map;
[0016] The peanut fruit color optimization feature map and the peanut fruit shape optimization feature map are integrated to obtain a peanut fruit quality state feature map;
[0017] Based on the peanut fruit quality state characteristic diagram, an evaluation result is obtained, and the evaluation result is used to represent the peanut fruit quality grade.
[0018] Compared with the prior art, the present application provides an intelligent peanut grading device and method, which uses a high-definition camera to collect images of peanuts, and uses image recognition and analysis processing technology based on deep learning to extract color features and shape features of the peanut images and perform correlation fusion, so as to intelligently obtain the evaluation results of the quality grade of peanuts. In this way, the high-definition camera can capture the details of the peanuts, and can automatically and accurately identify the color and shape characteristics of the peanuts by using a deep learning algorithm, so as to provide more accurate grading results, thereby reducing the need for manual grading and improving the efficiency of the grading process. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0020] Figure 1 It is a block diagram of an intelligent peanut grading device according to an embodiment of the present application.
[0021] Figure 2 Schematic diagram of the architecture of the intelligent peanut grading device according to an embodiment of the present application.
[0022] Figure 3 It is a block diagram of a peanut color and shape feature extraction module in an intelligent peanut grading device according to an embodiment of the present application.
[0023] Figure 4 The figure is a flow chart of the intelligent peanut grading method according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] The embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, but rather these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0025] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0026] It should be noted that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects, and do not represent a specific order for the objects. It is understandable that the specific order or sequence of "first\second\third" can be interchanged where permitted. It should be understood that the objects distinguished by "first\second\third" can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.
[0027] As shown in this disclosure, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular, but also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list, and the method or device may also include other steps or elements.
[0028] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0029] Peanut, also known as peanut or groundnut (scientific name: Arachis hypogaea), is an herbaceous plant of the genus Arachis, whose seeds grow in pods underground. Peanut is a widely grown oil crop, and its seeds are rich in oil and protein, so it is widely used as a food and oil source around the world. Peanuts are rich in protein, healthy fats (mainly monounsaturated fatty acids and polyunsaturated fatty acids), vitamins, minerals and dietary fiber. As a popular dried fruit food, peanuts have different requirements for the quality of peanuts in different consumption scenarios, such as food processing, direct consumption, etc. Therefore, in order to meet the needs of different consumers, the quality of peanuts needs to be graded.
[0030] However, the traditional peanut grading method may be overly dependent on manual operation, which is not only inefficient, but also prone to misjudgment and inconsistent grading due to human factors. Secondly, the color changes on the surface of peanuts may be very subtle, such as a slight yellow or brown gradient, or the shape of the peanuts is blocked. These small features will cause visual fatigue to workers during long-term visual inspections, making it difficult to maintain a high level of concentration, and these changes are difficult to be recognized by the naked eye without auxiliary tools.
[0031] Therefore, an intelligent peanut grading device is desired, which collects images of peanuts through a high-definition camera, and uses image recognition and analysis processing technology based on deep learning to extract color features and shape features of the peanut images and perform correlation fusion, so as to intelligently obtain the evaluation results of the quality grade of the peanuts. In this way, the high-definition camera can capture the details of the peanuts, and can automatically and accurately identify the color and shape characteristics of the peanuts by using a deep learning algorithm, so as to provide more accurate grading results, thereby reducing the need for manual grading and improving the efficiency of the grading process.
[0032] Figure 1 It is a block diagram of an intelligent peanut grading device according to an embodiment of the present application. Figure 2 FIG. 1 is a schematic diagram of the architecture of the intelligent peanut grading device according to an embodiment of the present application. Figure 1 and Figure 2As shown, the intelligent peanut grading device 100 according to the embodiment of the present application includes: a peanut image acquisition module 110, which is used to acquire images of peanuts through a high-definition camera; a peanut color and shape feature extraction module 120, which is used to extract color features and shape features of the peanut images respectively to obtain a peanut color feature map and a peanut shape feature map; a peanut color and shape feature optimization module 130, which is used to input the peanut color feature map and the peanut shape feature map into the peanut feature optimization module for feature optimization to obtain a peanut color optimization feature map and a peanut shape optimization feature map; a peanut quality state feature fusion module 140, which is used to fuse the peanut color optimization feature map and the peanut shape optimization feature map to obtain a peanut quality state feature map; an evaluation result generation module 150, which is used to obtain an evaluation result based on the peanut quality state feature map, and the evaluation result is used to represent the quality grade of the peanuts.
[0033] In the embodiment of the present application, the peanut fruit image acquisition module 110 is used to acquire images of peanut fruits through a high-definition camera. It should be understood that, considering that the acquisition of peanut fruit images through a high-definition camera refers to the use of a high-resolution camera to capture the appearance characteristics of peanut fruits, thereby obtaining digital images that can be used for analysis and processing. Specifically, these images can contain a variety of information, such as color, shape, size, texture, etc. In detail, the color of the peanut fruit can reflect its maturity and quality. By identifying and analyzing the image of the peanut fruit, peanut fruits at different maturity stages can be identified, thereby performing classification. Similarly, the shape and size of the peanut fruit are important indicators for evaluating its quality. By analyzing the shape of the peanut fruit, the size and shape of the peanut fruit can be measured, and the kernels that meet specific standards can be screened out. Based on this, in the technical solution of the present application, the image of the peanut fruit is acquired through a high-definition camera, so that the acquired image can be used for automated grading equipment, reducing manual intervention, and by accurately identifying unqualified peanut fruits, it is possible to reduce waste caused by incorrect grading and improve resource utilization.
[0034] It is worth mentioning that the HD camera is a camera device that can capture high-resolution images. Specifically, it can provide a higher number of pixels than standard definition cameras, and common resolutions are 720p (1280×720 pixels), 1080p (1920×1080 pixels), 4K (3840×2160 pixels) or even higher. Secondly, it can capture images at more frames per second, with common frame rates of 30fps, 60fps or even higher, which helps capture fast-moving objects. In addition, it can capture a wider range of brightness and color, so that the image can maintain details even in high-contrast environments. Furthermore, it can accurately capture and reproduce colors and reduce color deviation, which is very critical for applications that require color recognition. Therefore, HD cameras are widely used in industrial automation, security monitoring, medical imaging, traffic monitoring, scientific research, aerospace and other fields. With HD cameras, clearer and more detailed visual information can be obtained, thereby improving the accuracy and reliability of various applications. That is, by collecting images of peanuts using high-definition cameras, it is possible to capture subtle features of the peanuts, and the high-resolution images allow even tiny defects or damage to be identified, helping to improve grading accuracy.
[0035] In the embodiment of the present application, the peanut color and shape feature extraction module 120 is used to perform color feature extraction and shape feature extraction on the image of the peanuts to obtain a peanut color feature map and a peanut shape feature map.
[0036] Figure 3 FIG. 1 is a block diagram of a peanut color and shape feature extraction module in an intelligent peanut grading device according to an embodiment of the present application. Specifically, in the embodiment of the present application, Figure 3 As shown, the peanut fruit color and shape feature extraction module 120 includes: a peanut fruit color feature extraction unit 121, which is used to input the image of the peanut fruit into a peanut fruit color feature extraction model to obtain the peanut fruit color feature map; a peanut fruit shape feature extraction unit 122, which is used to input the image of the peanut fruit into a peanut fruit shape feature extractor to obtain the peanut fruit shape feature map.
[0037] In particular, in an achievable embodiment of the present application, color feature information can be extracted from the image of the peanut fruit by the following method. Specifically, firstly, the peanut fruit region is extracted from the image, and image segmentation technology or target detection algorithm can be used, and the peanut fruit region is cropped or extracted to ensure that only the peanut fruit part is included. Then, the extracted peanut fruit image is converted to a suitable color space, such as RGB, HSV, Lab, etc. The HSV color space is usually used for color feature extraction because it separates color information from brightness information. Next, the color feature information of the peanut fruit is extracted by calculating the color histogram of the image of the peanut fruit in the color space. Specifically, the histogram of each channel of the image of the peanut fruit can be calculated separately, or the information of multiple channels can be combined, that is, the color histogram can reflect the distribution of different colors in the image, which is helpful for extracting color features. Afterwards, according to the result of the color histogram, different color feature representation methods can be selected, such as color mean, color variance, shape features of the color histogram, etc.
[0038] Specifically, the peanut fruit color feature extraction unit 121 is used to input the image of the peanut fruit into the peanut fruit color feature extraction model to obtain the peanut fruit color feature map. More specifically, in an embodiment of the present application, the peanut fruit color feature extraction unit is used to: input the image of the peanut fruit into the peanut fruit color feature extraction model based on CNN to obtain the peanut fruit color feature map. Accordingly, it is considered that the color feature information of the peanut fruit can be reflected in the image of the peanut fruit, and these color features have an important influence on the quality grading of the peanut fruit. That is, contaminated peanut fruits may show unusual colors, such as dark brown or black spots, which may be signs of mold growth, and CNN has a powerful ability in image recognition and feature extraction, and can automatically learn the hierarchical features of the image, from edges and textures to more complex shapes and patterns, which is crucial for the recognition of color features. Based on this, in order to more carefully and accurately capture and extract the implicit subtle color feature information in the image of the peanut fruit, in the technical solution of the present application, the image of the peanut fruit is input into a CNN-based peanut fruit color feature extraction model to obtain the peanut fruit color feature map. In this way, the subtle differences in different colors and tones can be better excavated from the image of the peanut fruit, thereby improving the accuracy of peanut fruit color recognition and providing a basis and support for subsequent quality level evaluation.
[0039] Specifically, the peanut fruit shape feature extraction unit 122 is used to input the image of the peanut fruit into the peanut fruit shape feature extractor to obtain the peanut fruit shape feature map. More specifically, in the embodiment of the present application, the peanut fruit shape feature extraction unit is used to: input the image of the peanut fruit into the peanut fruit shape feature extractor based on YOLOv5 to obtain the peanut fruit shape feature map. It should be understood that considering that the image of the peanut fruit also reflects the characteristic information about the shape of the peanut fruit, similarly, these shape information also have an important influence and role in the judgment and identification of the quality of the peanut fruit, and considering that YOLOv5 performs well in object detection tasks and can accurately identify and locate objects in the image, this is crucial for extracting the shape features of the peanut fruit. Therefore, in the technical solution of the present application, the image of the peanut fruit is input into the peanut fruit shape feature extractor based on YOLOv5 to obtain the peanut fruit shape feature map, so that the shape feature information about the peanut fruit can be mined and extracted, which helps to better understand the shape of the peanut fruit.
[0040] It is worth mentioning that the YOLOv5 is a deep learning model based on target detection. It is a fast and efficient target detection algorithm developed by the ultralytics team. The characteristic of this model is that the entire object detection process is completed in one go, instead of requiring multiple scans of the image like traditional target detection methods. Specifically, the characteristics of the YOLOv5 include: YOLOv5 performs well in target detection tasks, with high accuracy and detection speed. In addition, YOLOv5 supports target detection tasks of different scales and can be customized and adjusted according to needs. Therefore, YOLOv5 is widely used in various computer vision tasks, including but not limited to video surveillance, self-driving cars, industrial automation, medical imaging analysis and other fields. Due to its speed and accuracy, YOLOv5 is particularly suitable for application scenarios that require real-time feedback.
[0041] In the embodiment of the present application, the peanut fruit color and shape feature optimization module 130 is used to input the peanut fruit color feature map and the peanut fruit shape feature map into the peanut fruit feature optimization module for feature optimization to obtain the peanut fruit color optimized feature map and the peanut fruit shape optimized feature map. Specifically, in the embodiment of the present application, the peanut fruit color and shape feature optimization module is used to input the peanut fruit color feature map and the peanut fruit shape feature map into the peanut fruit feature optimization module based on bidirectional attention for feature optimization to obtain the peanut fruit color optimized feature map and the peanut fruit shape optimized feature map. It should be understood that considering that the peanut fruit color feature map and the peanut fruit shape feature map both contain the key peanut fruit color and shape feature information, there are also some background features and redundant information accordingly. Based on this, in order to make the model focus more on the key feature information in the peanut fruit color feature map and the peanut fruit shape feature map, and reduce the interference of irrelevant information, in the technical solution of the present application, the peanut fruit color feature map and the peanut fruit shape feature map are respectively input into the peanut fruit feature optimization module based on bidirectional attention for feature optimization to obtain the peanut fruit color optimized feature map and the peanut fruit shape optimized feature map. It is worth mentioning that the bidirectional attention mechanism can identify and strengthen the most important areas in the image for classification and recognition, thereby enhancing the significance of the features. That is, the peanut fruit feature optimization module based on bidirectional attention can consider the feature information in different directions in the peanut fruit color feature map and the peanut fruit shape feature map, which helps to better understand the features of peanut fruit in a complex background. Moreover, through the attention mechanism, the model can automatically select the most useful features and important feature information in the peanut fruit color feature map and the peanut fruit shape feature map, ignore irrelevant or redundant information, and thus obtain the peanut fruit color optimized feature map and the peanut fruit shape optimized feature map containing rich key feature information.
[0042] In the embodiment of the present application, the peanut fruit quality state feature fusion module 140 is used to fuse the peanut fruit color optimization feature map and the peanut fruit shape optimization feature map to obtain the peanut fruit quality state feature map. Accordingly, considering that the peanut fruit color optimization feature map and the peanut fruit shape optimization feature map respectively reflect the abnormal color change feature information of the peanut fruit, such as spots or fading, and the shape feature information of the peanut fruit, such as whether it is full or defective. Therefore, in order to more comprehensively and comprehensively display the overall state of the peanut fruit, in the technical solution of the present application, the peanut fruit color optimization feature map and the peanut fruit shape optimization feature map are fused to obtain the peanut fruit quality state feature map. It should be understood that a more comprehensive peanut fruit quality assessment can be provided by fusing the peanut fruit color optimization feature map and the peanut fruit shape optimization feature map, because the quality is not only affected by color, but also by shape. In particular, color and shape features may complement each other under different conditions, and color information is more prominent in some cases, while shape information is more important in other cases. Secondly, combining the two types of information can improve the accuracy of the grading device, because some defects may not be obvious in a single feature.
[0043] In the embodiment of the present application, the evaluation result generation module 150 is used to obtain an evaluation result based on the peanut quality state characteristic graph, and the evaluation result is used to represent the peanut quality grade. Specifically, in the embodiment of the present application, the evaluation result generation module includes: a peanut quality state feature global feature pooling unit, which is used to perform global pooling based on a feature matrix on the peanut quality state feature graph to obtain a peanut quality state feature vector; a peanut quality state feature reverse learning optimization unit, which is used to perform a viewpoint metric neural network based on reverse learning optimization on the peanut quality state feature vector to obtain an optimized peanut quality state feature vector; a peanut quality evaluation unit, which is used to input the optimized peanut quality state feature vector into a quality evaluator based on a classifier to obtain the evaluation result of the peanut quality grade.
[0044] Specifically, the peanut quality state feature reverse learning optimization unit is used to perform a viewpoint metric neural network based on reverse learning optimization on the peanut quality state feature vector to obtain an optimized peanut quality state feature vector. In particular, in the technical solution of the present application, it is considered that the CNN-based color feature extraction model may not be able to capture all subtle features related to the color of peanuts, especially when the color changes are subtle. The shape feature extractor based on YOLOv5 may not be able to accurately identify the shape features of all peanuts, especially when the shape changes are complex or there are occlusions. The feature optimization module based on bidirectional attention may not be able to optimize all features evenly, and some important features may be over-emphasized or ignored. Fusion of color and shape optimization feature maps into peanut quality state feature maps is a complex process that may introduce additional noise or errors. Global pooling based on feature matrices may lose some local features, especially when some key features of the peanut quality state are concentrated in specific areas of the image. Due to the above reasons, the peanut quality state feature vector has a class harmony offset relative to the predetermined class label of the classifier. Therefore, in order to reduce the class harmony deviation, the peanut quality state feature vector is subjected to the viewpoint metric neural network based on reverse learning optimization to obtain the optimized peanut quality state feature vector.
[0045] More specifically, the peanut quality state feature reverse learning optimization unit is used to: perform probabilistic activation based on the Sigmoid function on the peanut quality state feature vector to obtain a probabilistic peanut quality state feature vector; input the peanut quality state feature vector into the classifier-based quality evaluator to obtain an initial class label probability value; calculate the absolute value of the difference between the feature value of each position in the probabilistic peanut quality state feature vector and the initial class label probability value to obtain a backward machine learning fine-grained error measurement vector; use the backward machine learning fine-grained error measurement vector as a key vector , the peanut quality state feature vector is used as a query vector and a value vector, and the key vector, the query vector and the value vector are input into a converter structure to obtain a backward learning type attention optimized peanut quality state feature vector; the ratio between the sum of the backward machine learning fine-grained error metric vector and the length of the backward machine learning fine-grained error metric vector is calculated, and the value of a natural exponential function with the ratio as a power is calculated as an optimization scaling factor; the product between the optimization scaling factor and the backward learning type attention optimized peanut quality state feature vector is calculated to obtain the optimized peanut quality state feature vector.
[0046] In the embodiment of the present application, specifically, the probabilistic peanut quality state feature vector is processed by the following reverse learning optimization formula to obtain the optimized peanut quality state feature vector; wherein the reverse learning optimization formula is:
[0047]
[0048] Among them, V c represents the probabilistic peanut quality state feature vector, P represents the initial class label probability value, Indicates subtraction by position, V e represents the fine-grained error metric vector for backward machine learning, v i represents the eigenvalue of the ith position of the backward machine learning fine-grained error metric vector, L represents the length of the backward machine learning fine-grained error metric vector, T represents the transpose of the vector, represents vector multiplication, Softmax represents the normalized exponential function, ⊙ represents point multiplication by position, V c ' represents the optimized peanut quality state feature vector.
[0049] Based on this, in the technical solution of the present application, the peanut quality state feature vector is subjected to a viewpoint metric neural network based on reverse learning optimization, which first implements a probabilistic activation based on the Sigmoid function on the peanut quality state feature vector to obtain a probabilistic peanut quality state feature vector, and inputs the peanut quality state feature vector into a quality evaluator based on a classifier to obtain an initial class label probability value. Then, the error between the probabilistic peanut quality state feature vector and the initial class label probability value is calculated through Backward Error Analysis to generate a fine-grained error metric vector, quantifying the viewpoint metric contribution of each feature position to the classification error.
[0050] Then, the backward machine learning fine-grained error metric vector is used as a key vector, the peanut quality state feature vector is used as a query vector and a value vector, and the key vector, the query vector and the value vector are input into a transformer structure to perform error metric-based attention-based backward machine learning on the peanut quality state feature vector through a Transformer-like architecture. In this way, the peanut quality state feature vector is subjected to a backward interpretability analysis so that the obtained backward learning-like attention-optimized peanut quality state feature vector has a backward learning sensitive preference relative to the predetermined class label of the classifier-based quality evaluator. And further, the ratio of the sum of the error metric vector and the vector length is calculated, and the backward learning-like attention-optimized peanut quality state feature vector is subjected to a backward scaling optimization (Backward Optimization) by using the ratio as an exponential calculation of the natural exponential function value. In this way, the sensitivity preference and robustness of the peanut quality state feature vector relative to the predetermined class label of the classifier-based quality evaluator are improved, thereby improving the accuracy of the classification result.
[0051] Specifically, the peanut quality assessment unit is used to input the optimized peanut quality state feature vector into a quality assessor based on a classifier to obtain the assessment result of the peanut quality grade. That is, the optimized peanut quality state feature vector is used for classification processing to intelligently obtain the assessment result of the peanut quality grade. In this way, the high-definition camera can capture the details of the peanuts, and can automatically and accurately identify the characteristics of the peanuts such as color and shape by using a deep learning algorithm, thereby providing a more accurate grading result, which reduces the need for manual grading and improves the efficiency of the grading process.
[0052] In summary, the intelligent peanut grading device 100 based on the embodiment of the present application is explained, which collects images of peanuts through a high-definition camera, and uses image recognition and analysis processing technology based on deep learning to extract color features and shape features of the peanut images and perform correlation fusion, so as to intelligently obtain the evaluation results of the quality grade of peanuts. In this way, the high-definition camera can capture the details of the peanuts, and can automatically and accurately identify the color and shape characteristics of the peanuts by using a deep learning algorithm, so as to provide more accurate grading results, thereby reducing the need for manual grading and improving the efficiency of the grading process.
[0053] Figure 4 FIG. 1 is a flow chart of an intelligent peanut grading method according to an embodiment of the present application. Figure 4As shown, the intelligent peanut grading method according to the embodiment of the present application includes: S110, collecting images of peanuts through a high-definition camera; S120, respectively performing color feature extraction and shape feature extraction on the image of the peanuts to obtain a peanut color feature map and a peanut shape feature map; S130, respectively inputting the peanut color feature map and the peanut shape feature map into a peanut feature optimization module for feature optimization to obtain a peanut color optimization feature map and a peanut shape optimization feature map; S140, fusing the peanut color optimization feature map and the peanut shape optimization feature map to obtain a peanut quality state feature map; S150, obtaining an evaluation result based on the peanut quality state feature map, and the evaluation result is used to represent the quality grade of the peanuts.
[0054] Here, those skilled in the art will appreciate that the specific operations of each step in the above-mentioned intelligent peanut grading method have been described in detail above. Figures 1 to 3 The intelligent peanut grading device has been described in detail in the description of the intelligent peanut grading device, and therefore, its repeated description will be omitted.
[0055] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0056] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.
[0057] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0058] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware, or through the description of the above implementation mode, those skilled in the art can clearly understand that the present invention can be implemented in the form of hardware.
[0059] Implemented by hardware, or firmware, or a combination thereof. When implemented by software, the above functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any medium that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a computer can access. Take this as an example but not limited to: a computer-readable medium can include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer. In addition. Any connection can be appropriately a computer-readable medium. For example, if the software is transmitted from a website, a server or other remote source using a coaxial cable, an optical fiber cable, a twisted pair, a digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, then the coaxial cable, optical fiber cable, twisted pair, DSL, or wireless technologies such as infrared, wireless, and microwaves are included in the fixing of the medium. As used in the present invention, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and blue-ray disc, wherein disk usually reproduces data magnetically, while disc uses laser to reproduce data optically. The above combination should also be included in the scope of protection of computer-readable media.
[0060] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit of the technical solution of the present invention.
Claims
1. An intelligent peanut grading device, characterized in that: include: A peanut image acquisition module is used to acquire images of peanuts through a high-definition camera; A peanut fruit color and shape feature extraction module is used to extract color features and shape features from the peanut fruit image to obtain a peanut fruit color feature map and a peanut fruit shape feature map; A peanut fruit color and shape feature optimization module, used for inputting the peanut fruit color feature map and the peanut fruit shape feature map into the peanut fruit feature optimization module for feature optimization to obtain a peanut fruit color optimized feature map and a peanut fruit shape optimized feature map; A peanut fruit quality state feature fusion module, used for fusing the peanut fruit color optimization feature map and the peanut fruit shape optimization feature map to obtain a peanut fruit quality state feature map; The evaluation result generating module is used to obtain the evaluation result based on the peanut fruit quality state characteristic diagram, and the evaluation result is used to represent the peanut fruit quality grade.
2. The intelligent peanut grading device according to claim 1 is characterized in that: The peanut color and shape feature extraction module comprises: A peanut color feature extraction unit, used for inputting the image of the peanut into a peanut color feature extraction model to obtain the peanut color feature map; The peanut shape feature extraction unit is used to input the image of the peanut into the peanut shape feature extractor to obtain the peanut shape feature map.
3. The intelligent peanut grading device according to claim 2 is characterized in that: The peanut color feature extraction unit is used to: The peanut image is input into a CNN-based peanut color feature extraction model to obtain the peanut color feature map.
4. The intelligent peanut grading device according to claim 3 is characterized in that: The peanut shape feature extraction unit is used to: The peanut image is input into a peanut shape feature extractor based on YOLOv5 to obtain the peanut shape feature map.
5. The intelligent peanut grading device according to claim 4 is characterized in that: The peanut color and shape feature optimization module is used to: The peanut fruit color feature map and the peanut fruit shape feature map are respectively input into a peanut fruit feature optimization module based on bidirectional attention for feature optimization to obtain the peanut fruit color optimized feature map and the peanut fruit shape optimized feature map.
6. The intelligent peanut grading device according to claim 5, characterized in that: The evaluation result generating module comprises: A peanut quality state feature global feature pooling unit, used for performing global pooling on the peanut quality state feature map based on a feature matrix to obtain a peanut quality state feature vector; A peanut quality state feature reverse learning optimization unit, used for performing a viewpoint metric neural network based on reverse learning optimization on the peanut quality state feature vector to obtain an optimized peanut quality state feature vector; The peanut quality evaluation unit is used to input the optimized peanut quality state feature vector into a quality evaluator based on a classifier to obtain the evaluation result of the peanut quality grade.
7. The intelligent peanut grading device according to claim 6, characterized in that: The peanut quality state feature reverse learning optimization unit is used to: Performing probabilistic activation on the peanut quality state feature vector based on a Sigmoid function to obtain a probabilistic peanut quality state feature vector; Inputting the peanut quality state feature vector into the classifier-based quality evaluator to obtain an initial class label probability value; Calculating the absolute value of the difference between the feature value of each position in the probabilistic peanut quality state feature vector and the initial class label probability value to obtain a backward machine learning fine-grained error metric vector; Using the backward machine learning fine-grained error metric vector as a key vector, the peanut fruit quality state feature vector as a query vector and a value vector, the key vector, the query vector and the value vector are input into a converter structure to obtain a backward learning class attention optimized peanut fruit quality state feature vector; Calculating a ratio between a sum of the backward machine learning fine-grained error metric vector and a length of the backward machine learning fine-grained error metric vector, and calculating a natural exponential function value raised to a power of the ratio as an optimization scaling factor; The product of the optimized scaling factor and the backward learning-like attention-optimized peanut quality state feature vector is calculated to obtain the optimized peanut quality state feature vector.
8. An intelligent peanut grading method, characterized in that: include: The image of peanut fruit is collected by high-definition camera; Respectively performing color feature extraction and shape feature extraction on the image of the peanut fruit to obtain a peanut fruit color feature map and a peanut fruit shape feature map; Inputting the peanut fruit color feature map and the peanut fruit shape feature map into a peanut fruit feature optimization module for feature optimization to obtain a peanut fruit color optimized feature map and a peanut fruit shape optimized feature map; The peanut fruit color optimization feature map and the peanut fruit shape optimization feature map are integrated to obtain a peanut fruit quality state feature map; Based on the peanut fruit quality state characteristic diagram, an evaluation result is obtained, and the evaluation result is used to represent the peanut fruit quality grade.
9. The intelligent peanut grading method according to claim 8, characterized in that: The color feature extraction and shape feature extraction are respectively performed on the image of the peanut fruit to obtain a peanut fruit color feature map and a peanut fruit shape feature map, including: Inputting the peanut image into a peanut color feature extraction model to obtain a peanut color feature map; The peanut fruit image is input into a peanut fruit shape feature extractor to obtain the peanut fruit shape feature map.
10. The intelligent peanut grading method according to claim 9, characterized in that: The peanut fruit color feature map and the peanut fruit shape feature map are respectively input into a peanut fruit feature optimization module for feature optimization to obtain a peanut fruit color optimization feature map and a peanut fruit shape optimization feature map, including: The peanut fruit color feature map and the peanut fruit shape feature map are respectively input into a peanut fruit feature optimization module based on bidirectional attention for feature optimization to obtain the peanut fruit color optimized feature map and the peanut fruit shape optimized feature map.
Citation Information
Patent Citations
Lightweight YOLOv5-based in-vivo apple target detection and grading method
CN115862003A
Peanut legume quality detection and classification method based on improved ResNet
CN116912573A
Intelligent battery charging and replacing control system
CN117429299A
Beef carcass quality rating method based on optical test
CN117934463A
Reading information intelligent acquisition and analysis system and method based on big data
CN118093904A
Cited By
Flower quality grading method, equipment and medium
CN120071063A
A method, apparatus, and medium for flower quality grading
CN120071063B
