Nut defect detection system and method based on X-ray

By obtaining a group of nut detection images and generating an identification feature map, comparing it with the defect feature library, and using an artificial intelligence model to identify nut features, the problem of low nut detection accuracy in existing technologies is solved, and efficient detection of different types of nuts is achieved.

CN120543552BActive Publication Date: 2025-10-03HEFEI RUIYUN SUPER MICRO IDENTIFICATION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511038325.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-10-03
Estimated Expiration
2045-07-28

AI Technical Summary

Technical Problem

Existing nut defect detection methods have reduced recognition accuracy and insufficient adaptability when faced with different types of nuts.

Method used

By obtaining a group of inspection images of the nuts to be inspected, generating an identification feature map, and comparing it with the defect feature map in the defect feature library, the artificial intelligence model is used to identify the nut features, build a targeted defect feature library, and improve the detection accuracy.

Benefits of technology

The accuracy of detecting different types of nuts is improved, ensuring the accuracy of nut detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120543552B_ABST
    Figure CN120543552B_ABST
Patent Text Reader

Abstract

The present application discloses an X-ray-based nut defect detection system and method, which relates to the technical field of X-ray detection. The system and method solve the technical problem of reduced recognition accuracy in existing nut defect detection methods when applied to the detection of different types of nuts. A detection image group of nuts to be detected is obtained; the detection image group is composed of a plurality of X-ray images; an identification feature map is generated based on the detection image group, and a detection result is obtained by comparing the identification feature map with a defect feature map in a defect feature library; the defect feature library is generated from a plurality of defective nut detection images; the accuracy of detecting different types of nuts is improved by specifically constructing a defect library and using the feature data of the nuts to be detected to identify defects in the nuts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of X-ray detection technology, and specifically to an X-ray-based nut defect detection system and method. Background Art

[0002] X-ray flaw detection refers to an inspection method that uses the ability of X-rays to penetrate materials and obtain X-ray images based on the different absorption and scattering effects of the materials on the rays to determine the internal defects of the materials.

[0003] Prior art (invention patent publication number CN 112819745 B) discloses a method and device for detecting central worm-eaten defects in nut kernels. The method comprises: obtaining an image to be inspected, which is a rectangular X-ray image circumscribing the material to be inspected; performing central worm-eaten defects detection on the material based on the image; performing sharpening, etching, and binarization on the image to obtain a first binary image; and determining whether the material to be inspected has a central worm-eaten defect based on the area of ​​the inner contour in the first binary image. This method uses the rectangular X-ray image circumscribing the material to be inspected as the image to be inspected. By sharpening, etching, and binarizing the image to obtain the inner contour in the image, the method then determines whether the material to be inspected has a central worm-eaten defect based on the area of ​​the inner contour, thereby detecting internal worm-eaten defects. This method offers the advantages of high detection efficiency, high accuracy, and automated detection.

[0004] The above-mentioned nut defect detection method compares the inner contour area of ​​the nut in the X-ray image with a set threshold to determine whether the nut is infested by insects. However, the space inside different nuts is different, and different pests infect nuts differently. Using a single area threshold to determine whether the nut is infested by pests will lead to a decrease in the accuracy of insect infestation identification. At the same time, the adaptability to different nuts is also greatly reduced. Therefore, a nut defect detection system and method based on X-rays is needed. Summary of the Invention

[0005] The present application aims to solve at least one of the technical problems existing in the prior art; to this end, the present application proposes an X-ray-based nut defect detection system and method to solve the technical problem that the existing nut defect detection method is suitable for detecting different types of nuts, and the recognition accuracy is reduced.

[0006] To achieve the above objectives, the first aspect of the present application provides a nut defect detection method based on X-rays, comprising:

[0007] Obtaining a detection image group of the nut to be detected; the detection image group consists of a plurality of X-ray images;

[0008] An identification feature map is generated based on the detection image group, and a detection result is obtained by comparing the identification feature map with a defect feature map in a defect feature library; the defect feature library is generated by a number of defective nut detection images.

[0009] The present application obtains a detection image group of nuts to be detected; generates an identification feature map based on the detection image group, and obtains a detection result based on the comparison of the identification feature map with the defect feature map in the defect feature library; wherein, the detection image group is obtained by setting and collecting the feature data of the nuts, and the defect feature library is generated by a number of detection images of nuts with defects; by constructing a defect feature library specifically for the nuts to be detected, and then identifying the feature map of each nut to be detected by training an artificial intelligence model, it is determined whether the nuts to be detected have defects, that is, by constructing a defect library specifically, and using the feature data of the nuts to be detected to identify defects in the nuts, the accuracy of detecting different types of nuts is improved.

[0010] Preferably, obtaining the detection image group of the nuts to be detected includes:

[0011] Acquire characteristic data of nuts to be detected; set a detection power group and set a collection number K based on the characteristic data; where K is a positive integer; the detection power group includes K detection powers;

[0012] Generate X-rays of multiple frequencies according to the detection power group, perform K detections on the nuts to be detected based on the X-rays of the multiple frequencies to obtain K X-ray images; and integrate the K X-ray images into a detection image group.

[0013] Preferably, the setting of the detection power group and the number of acquisitions based on the characteristic data includes:

[0014] Extract the maximum and minimum values ​​of the shell density and shell thickness in the feature data;

[0015] Substitute the minimum value of the shell thickness and the shell density into the set power generation function to obtain the optimal power at the current thickness, and use the power as the power lower limit; substitute the maximum value of the shell thickness and the shell density into the set power generation function to obtain the optimal power at the current thickness, and use the power as the power upper limit;

[0016] Extract the uniformity of shell thickness and the smoothness of shell surface from the feature data; generate a set number of acquisitions for nuts to be detected based on the thickness uniformity and smoothness; and set a detection power group based on the lower power limit, the upper power limit, and the set number of acquisitions.

[0017] This application divides the power between the lower power limit and the upper power limit into several detection powers by setting the number of acquisition times; by performing detection according to each detection power, the optimal imaging image of each part can be obtained, which facilitates enhancing the accuracy of subsequent nut feature recognition.

[0018] Preferably, generating a set number of collection times for nuts to be inspected based on thickness uniformity and smoothness includes:

[0019] The set standard thickness uniformity and standard smoothness, as well as the standard acquisition times and adjustable acquisition times set under the standard thickness uniformity and standard smoothness, and the adjustable acquisition times are obtained; the adjustable acquisition times are adjusted based on the ratio of thickness uniformity to standard thickness uniformity, and the ratio of smoothness to standard smoothness to obtain the variable acquisition times; the sum of the variable acquisition times and the standard acquisition times is recorded as the set acquisition times.

[0020] This application sets the number of times to capture images based on the uniformity of the nut shell thickness and the smoothness of its surface; selecting an appropriate number of image captures can ensure accurate detection of nuts.

[0021] Preferably, the step of setting the detection power group based on the lower power limit, the upper power limit, and the set acquisition times includes:

[0022] Calculate the difference between the upper power limit and the lower power limit, and record the ratio of the difference to K-1 as the power step;

[0023] The lower power limit is used as the first detection power;

[0024] The sum of the first detection power and n times the power step is taken as the n+1th detection power; where n is a positive integer less than K;

[0025] The individual detection powers are combined into a detection power group.

[0026] Preferably, generating a recognition feature map based on the detection image group includes:

[0027] Extract each detection image from the detection image group, split each detection image according to the set splitting method to obtain several regional detection images; integrate the regional detection images belonging to the same part in each detection image into a recognition image group;

[0028] Inputting the region detection images in the recognition image group into a feature recognition model in sequence to obtain a number of corresponding recognition feature maps and recognition scores; the feature recognition model is obtained by training an artificial intelligence model;

[0029] The recognition feature graph with the highest recognition score in each recognition image group is obtained, and each of the recognition feature graphs is combined into a recognition feature graph according to corresponding positions.

[0030] Preferably, the feature recognition model is obtained by training an artificial intelligence model, including:

[0031] Acquire several test images, and their corresponding recognition feature maps and recognition scores; the recognition feature maps are features of the internal spaces of nuts in the test images, including features of the spaces between the kernel and the shell, and features of the spaces within the kernel; the recognition scores are scores obtained by experts based on a comprehensive evaluation of the noise in the test images and the confidence of the final recognition, used to evaluate the recognition results. When the image noise is too large, the recognition feature maps obtained will be significantly different from the actual ones, resulting in a large error in the final test result, and the corresponding recognition score will be set smaller; when the confidence of the recognition feature map is low, it indicates that the accuracy of the recognition feature map is low, resulting in a large error in the final test result, and the corresponding recognition score will be set smaller; integrate the test images, recognition feature maps, and recognition scores into several sets of training data and test data;

[0032] The artificial intelligence model is trained using training data, and the trained artificial intelligence model is tested using test data; ultimately, a feature recognition model is obtained, whose input is a detection image and whose output is its corresponding recognition feature map and recognition score; the artificial intelligence model includes a BP neural network model and an RBF neural network model.

[0033] Preferably, the detection result obtained by comparing the identification feature map with the defect feature map in the defect feature library includes:

[0034] Extracting each defect feature map from the defect feature library; calculating the similarity between the target recognition feature map and each defect feature map; the target recognition feature map is one of the multiple recognition feature maps;

[0035] Obtain the maximum value of the similarities between a target recognition feature image and each defect feature image. When the maximum value is greater than a set similarity threshold, the recognition status of the nut corresponding to the target recognition feature image is marked as a defective nut; otherwise, the recognition status of the nut corresponding to the target recognition feature image is marked as a qualified nut;

[0036] The detection result is integrated based on the nut state, the identification feature map and the defect feature map corresponding to the maximum similarity value.

[0037] Preferably, the defect feature library is generated by a number of inspection images of nuts with defects, including:

[0038] Acquire several inspection images with different defects; input the inspection images of the same defect type into the feature recognition model in sequence to obtain corresponding recognition feature maps and recognition scores; obtain the recognition feature maps with recognition scores greater than the set threshold and mark them as defect feature maps;

[0039] A plurality of defect feature maps corresponding to different defects are obtained in sequence; and a defect feature library is constructed based on each defect feature map.

[0040] This embodiment uses an identification feature map that more clearly shows defect features as a defect feature map corresponding to the defect, thereby increasing the accuracy of subsequent defect identification.

[0041] Another aspect of the present application provides an X-ray-based nut defect detection system, comprising: a data acquisition module, a detection module, a data analysis module, and a database;

[0042] The data acquisition module is used to acquire the detection image group and the characteristic data of the nuts to be detected;

[0043] The detection module sets a detection power group and a set acquisition number based on the characteristic data; performs detection according to the detection power group and the set acquisition number;

[0044] The data analysis module generates a recognition feature map based on the detection image group, and obtains a detection result based on the comparison between the recognition feature map and the defect feature map in the defect feature library;

[0045] The database is used to store all data generated and used by this system.

[0046] Compared with the prior art, the present invention has the following advantages:

[0047] 1. The present application obtains a detection image group of nuts to be detected; generates an identification feature map based on the detection image group, and obtains a detection result based on the comparison of the identification feature map with the defect feature map in the defect feature library; wherein, the detection image group is obtained by setting and collecting the feature data of the nuts, and the defect feature library is generated by a number of detection images of nuts with defects; by constructing a defect feature library specifically for the nuts to be detected, and then identifying the feature map of each nut to be detected by training an artificial intelligence model, it is determined whether the nut to be detected has defects, that is, by constructing a defect library specifically, and using the feature data of the nuts to be detected to identify defects in the nuts, the accuracy of detecting different types of nuts is improved.

[0048] 2. This application sets the number of times to capture images based on the uniformity of the nut shell thickness and the smoothness of its surface; selecting an appropriate number of image captures can ensure accurate detection of nuts. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0050] Figure 1This is a schematic diagram of the steps of the nut defect detection method of this application;

[0051] Figure 2 This is a module connection diagram of the nut defect detection system for this application. DETAILED DESCRIPTION

[0052] The following will clearly and completely describe the technical solutions of this application in conjunction with the embodiments. Obviously, the embodiments described are only a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0053] See also Figure 1 The first aspect of the present application provides a method for detecting nut defects based on X-rays, comprising:

[0054] Obtaining a detection image group of the nut to be detected; the detection image group is a group of X-ray images obtained by detecting the image to be detected;

[0055] An identification feature map is generated based on the detection image group. The identification feature map is an image of the internal gaps of the nut identified in the corresponding detection image. The detection result is obtained by comparing the identification feature map with the defect feature map in the defect feature library. The detection result is the nut state obtained by identifying the X-ray image of the nut to be detected. The defect feature library is generated from several detection images of nuts with defects.

[0056] This embodiment obtains a detection image group of nuts to be detected; generates an identification feature map based on the detection image group, and obtains a detection result based on the comparison of the identification feature map with the defect feature map in the defect feature library; wherein, the detection image group is obtained by setting and collecting the feature data of the nuts, and the defect feature library is generated by a number of detection images of nuts with defects; by constructing a defect feature library specifically for the nuts to be detected, and then identifying the feature map of each nut to be detected by training an artificial intelligence model, it is determined whether the nut to be detected has defects, that is, by constructing a defect library specifically, and using the feature data of the nuts to be detected to identify defects in the nuts, the accuracy of detecting different types of nuts is improved.

[0057] Acquiring a detection image group of a nut to be detected, including: acquiring feature data of the nut to be detected; setting a detection power group and setting a collection frequency based on the feature data;

[0058] Setting the detection power group and the number of acquisitions based on the characteristic data includes: extracting the maximum and minimum values ​​of the shell density and shell thickness in the characteristic data. It can be understood that the maximum and minimum values ​​of the shell density and shell thickness of a certain nut type are set fixed values, rather than measured values ​​for a certain nut; the characteristic data of the nuts to be detected are related parameters of some characteristics of the nuts to be detected, including the maximum and minimum values ​​of the shell density and shell thickness; the shell density and shell thickness can be used to determine the power, wavelength and intensity of the X-ray used when detecting the corresponding nuts to be detected; this embodiment takes power as an example;

[0059] Substitute the minimum value of the shell thickness and the shell density into the set power generation function to obtain the optimal power at the current thickness, and use the power as the power lower limit; substitute the maximum value of the shell thickness and the shell density into the set power generation function to obtain the optimal power at the current thickness, and use the power as the power upper limit; specifically, the power generation function in this embodiment is:

[0060]

[0061] Wherein, GL is the optimal power, that is, the power that can penetrate the shell under the corresponding shell thickness and shell density, and the noise meets the set maximum noise limit; HD is the shell thickness value, CHD is the set reference shell thickness value; MD is the shell density; CMD is the reference shell density; CGL is the reference power corresponding to the reference shell thickness and reference shell density, that is, the power that can penetrate the shell under the reference shell thickness and shell density, and the noise meets the set maximum noise limit; δ1 and δ2 are adjustment coefficients used to adjust the influence of shell thickness and shell density on the selection of X-ray machine power, and the specific values ​​are set according to experience; it can be understood that this embodiment only provides one feasible method; in this embodiment, δ1=0.4, δ2=0.6;

[0062] Extracting the uniformity of shell thickness and the smoothness of shell surface from the feature data; generating a set number of acquisitions for nuts to be detected based on the thickness uniformity and smoothness; setting a detection power group based on a lower power limit, an upper power limit, and the set number of acquisitions; the detection power group includes a plurality of detection powers;

[0063] Generate specific X-rays according to the detection power group to detect the nuts to be detected and obtain X-ray images with a set number of acquisition times; and integrate the various X-ray images into a detection image group.

[0064] Generating a set number of collections of nuts to be inspected based on thickness uniformity and smoothness includes: obtaining set standard thickness uniformity and standard smoothness, as well as their corresponding standard collection times, and adjusting the collection times; adjusting the adjustable collection times based on the ratio of thickness uniformity to standard thickness uniformity, and the ratio of smoothness to standard smoothness to obtain a variable collection times; recording the sum of the variable collection times and the standard collection times as the set collection times; specifically,

[0065]

[0066] Among them, CC is the set acquisition number, that is, the minimum standard acquisition number; BCC is the standard acquisition number, KCC is the adjustable acquisition number; HJ is the thickness uniformity value, BHJ is the set standard thickness uniformity value; GD smoothness value; BGD is the set standard smoothness value; ε1 and ε2 are set proportional coefficients used to adjust the influence of thickness uniformity and smoothness on the set acquisition number. The specific values ​​are set according to professional experience; in this embodiment, ε1=0.5, ε2=0.5;

[0067] The thickness uniformity is used to indicate the distribution of nutshell thickness. The more uniform the thickness distribution, the larger the corresponding thickness uniformity value. Smoothness is used to indicate the smoothness of the nutshell surface. The smoother the nutshell surface, the greater the corresponding smoothness. The thickness uniformity in this embodiment is generated by the variance of the thickness of each set area of ​​the nut. The larger the variance value, the smaller the corresponding thickness uniformity value.

[0068] In this embodiment, the number of times of collecting images is set according to the uniformity of the thickness of the nut shell and the smoothness of its surface; selecting an appropriate number of image collection times can ensure accurate detection of nuts.

[0069] Setting a detection power group based on a lower power limit, an upper power limit, and a set acquisition number includes: calculating a difference between the upper power limit and the lower power limit, and recording a ratio of the difference to the set acquisition number minus one as a power step;

[0070] The lower power limit is used as the first detection power;

[0071] The sum of the first detection power and one-time power step length is taken as the second detection power;

[0072] The sum of the first detection power and twice the power step length is taken as the third detection power;

[0073] Obtain each detection power in sequence until the sum of the first detection power and the set acquisition times minus one power step is taken as the final detection power;

[0074] The individual detection powers are combined into a detection power group.

[0075] Because the power of X-rays is too high, it will cause excessive noise, affecting imaging; the power of the X-ray machine is too low; it is difficult to penetrate the surface of the nuts, affecting subsequent feature recognition; that is, different thicknesses and densities of nut shell parts need to be detected with different X-rays, which will have better detection results; this embodiment divides the power between the lower power limit and the upper power limit into several detection powers by setting the number of acquisitions; according to each detection power, the optimal imaging image of each part can be obtained, which facilitates enhancing the accuracy of subsequent nut feature recognition.

[0076] Generating a recognition feature map based on the detection image group includes: extracting each detection image in the detection image group, splitting each detection image according to a set splitting method to obtain a plurality of regional detection images; the splitting method in this embodiment is a simple grid splitting; integrating the regional detection images belonging to the same part in each detection image into a recognition image group;

[0077] Inputting the region detection images in the recognition image group into a feature recognition model in sequence to obtain a number of corresponding recognition feature maps and recognition scores; the feature recognition model is obtained by training an artificial intelligence model;

[0078] The recognition feature graph with the highest recognition score in each recognition image group is obtained, and each of the recognition feature graphs is combined into a recognition feature graph according to corresponding positions.

[0079] In this embodiment, the recognition feature map is obtained by recombining images with better effects in different regions, so that the recognition feature map can more clearly and accurately represent the characteristics of the nuts.

[0080] The feature recognition model is obtained through artificial intelligence model training, including: obtaining a number of detection images, and their corresponding recognition feature maps and recognition scores; the recognition feature map is the feature of the internal space of the nut in the detection image, including the space between the kernel and the shell and the space feature inside the kernel; the recognition score is a set function set by an expert, combined with the noise of the detection image and the final recognition confidence to obtain a score for evaluating the recognition result. When the image noise is too large, the recognition feature map obtained by recognition will be significantly different from the actual one, which will cause the final detection result error to be large, and the corresponding recognition score setting will be smaller; when the confidence of the recognition feature map is small, it means that the accuracy of the recognition feature map is low, which will cause the final detection result error to be large, and the corresponding recognition score setting will be smaller; it can be understood that during the stage of training or testing the artificial intelligence model, since the confidence of the output result is almost close to 1, the recognition score in the training data or test data is computable; the detection image, recognition feature map and recognition score are integrated into several groups of training data and test data;

[0081] The artificial intelligence model is trained using training data, and the trained artificial intelligence model is tested using test data; specifically, the test image in the test data is input into the trained artificial intelligence model to obtain the corresponding recognition feature map and recognition score, and the similarity between the recognition feature map and the corresponding recognition feature map in the corresponding test data, as well as the difference between the recognition score and the corresponding recognition score in the corresponding test data are obtained; when the similarity is greater than the set similarity threshold and the difference is less than the set difference threshold, it means that the group of test data has passed the test; otherwise, the relevant parameters of the artificial intelligence model are adjusted, and the group of test data is used again for testing until a set proportion of test data passes the test; finally, a feature recognition model is obtained with the test image as input and the corresponding recognition feature map and recognition score as output; wherein the artificial intelligence model includes a BP neural network model and an RBF neural network model.

[0082] Obtaining a detection result based on comparing the recognition feature map with defect feature maps in a defect feature library includes: extracting each defect feature map in the defect feature library; calculating the similarity between the target recognition feature map and each defect feature map; the target recognition feature map is one of multiple recognition feature maps; the similarity between the compared images can be obtained by training an artificial intelligence model, or by comparing histograms and texture features of the feature maps; the greater the similarity, the more similar the textures of the two images are;

[0083] Obtain the maximum value of the similarities between a target recognition feature image and each defect feature image. When the maximum value is greater than a set similarity threshold, the recognition status of the nut corresponding to the target recognition feature image is marked as a defective nut; otherwise, the recognition status of the nut corresponding to the target recognition feature image is marked as a qualified nut;

[0084] The detection result is integrated based on the nut state, the identification feature map and the defect feature map corresponding to the maximum similarity value.

[0085] The defect feature library is generated from several inspection images of defective nuts, including: obtaining several inspection images with different defects; inputting the inspection images of the same defect type into the feature recognition model in sequence to obtain corresponding recognition feature maps and recognition scores; obtaining recognition feature maps with recognition scores greater than a set threshold and marking them as defect feature maps;

[0086] A plurality of defect feature maps corresponding to different defects are obtained in sequence; and a defect feature library is constructed based on each defect feature map.

[0087] This embodiment uses an identification feature map that more clearly shows defect features as a defect feature map corresponding to the defect, thereby increasing the accuracy of subsequent defect identification.

[0088] See also Figure 2 , another aspect of the present application provides an X-ray-based nut defect detection system, comprising: a data acquisition module, a detection module, a data analysis module and a database;

[0089] The data acquisition module is used to acquire the detection image group and the characteristic data of the nuts to be detected;

[0090] The detection module sets a detection power group and a set acquisition number based on the characteristic data; performs detection according to the detection power group and the set acquisition number;

[0091] The data analysis module generates a recognition feature map based on the detection image group, and obtains a detection result based on the comparison between the recognition feature map and the defect feature map in the defect feature library;

[0092] The database is used to store all data generated and used by this system.

[0093] Some of the data in the above formula are calculated by removing the dimensions and taking their numerical values. The formula is a formula that is closest to the actual situation obtained by software simulation of a large amount of collected data; the preset parameters and preset thresholds in the formula are set by technical personnel in this field according to actual conditions or obtained through simulation of a large amount of data.

[0094] How this application works:

[0095] The present application obtains a detection image group of nuts to be detected; generates an identification feature map based on the detection image group, and obtains a detection result based on the comparison of the identification feature map with the defect feature map in the defect feature library; wherein, the detection image group is obtained by setting and collecting the feature data of the nuts, and the defect feature library is generated by a number of detection images of nuts with defects; by constructing a defect feature library specifically for the nuts to be detected, and then identifying the feature map of each nut to be detected by training an artificial intelligence model, it is determined whether the nuts to be detected have defects, that is, by constructing a defect library specifically, and using the feature data of the nuts to be detected to identify defects in the nuts, the accuracy of detecting different types of nuts is improved.

[0096] The above embodiments are only used to illustrate the technical method of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present application.

Claims

1. A nut defect detection method based on X-ray, characterized in that: include: Obtaining a detection image group of a nut to be detected; comprising: obtaining characteristic data of the nut to be detected; setting a detection power group and a number of acquisitions K based on the characteristic data, where K is a positive integer; the detection power group including K detection powers; generating X-rays of multiple frequencies according to the detection power group, performing K detections on the nut to be detected based on the X-rays of the multiple frequencies to obtain K X-ray images; and integrating the K X-ray images into a detection image group; The method of setting a detection power group and a collection number based on characteristic data includes: extracting the maximum and minimum values ​​of the shell density and shell thickness in the characteristic data; substituting the minimum value of the shell thickness and the shell density into a set power generation function to obtain the optimal power at the current thickness, and using the power as the power lower limit; substituting the maximum value of the shell thickness and the shell density into the set power generation function to obtain the optimal power at the current thickness, and using the power as the power upper limit; extracting the uniformity of the shell thickness and the smoothness of the shell surface in the characteristic data; generating a set collection number of nuts to be detected based on the thickness uniformity and the smoothness; and setting the detection power group based on the power lower limit, the power upper limit, and the set collection number. The detection image group consists of a number of X-ray images; Generating a recognition feature map based on the detection image group includes: extracting each detection image in the detection image group, splitting each detection image according to a set splitting method to obtain a plurality of regional detection images; integrating the regional detection images belonging to the same part in each detection image into a recognition image group; Inputting the region detection images in the recognition image group into a feature recognition model in sequence to obtain a number of corresponding recognition feature maps and recognition scores; the feature recognition model is obtained by training an artificial intelligence model; Obtaining the recognition feature graph with the highest recognition score in each recognition image group, and combining each of the recognition feature graphs into a recognition feature graph according to corresponding positions; The detection result is obtained based on the comparison between the recognition feature map and the defect feature map in the defect feature library; the defect feature library is generated by a number of defective nut detection images.

2. The X-ray-based nut defect detection method according to claim 1, characterized in that: Generates a set number of acquisitions of nuts to be inspected based on thickness uniformity and smoothness, including: The set standard thickness uniformity and standard smoothness, as well as the standard acquisition times and adjustable acquisition times set under the standard thickness uniformity and standard smoothness are obtained; the adjustable acquisition times are adjusted based on the ratio of thickness uniformity to standard thickness uniformity, and the ratio of smoothness to standard smoothness to obtain the variable acquisition times; and the sum of the variable acquisition times and the standard acquisition times is recorded as the set acquisition times.

3. The X-ray-based nut defect detection method according to claim 1, characterized in that: The step of setting the detection power group based on the power lower limit, the power upper limit, and the set acquisition times includes: Calculate the difference between the upper power limit and the lower power limit, and record the ratio of the difference to K-1 as the power step; The lower power limit is used as the first detection power; The sum of the first detection power and n times the power step is taken as the n+1th detection power; where n is a positive integer less than K; The individual detection powers are combined into a detection power group.

4. The X-ray-based nut defect detection method according to claim 1, characterized in that: The feature recognition model is obtained through artificial intelligence model training, including: Acquire several test images, and their corresponding recognition feature maps and recognition scores; integrate the test images, recognition feature maps and recognition scores into several sets of training data and test data; The artificial intelligence model is trained using training data, and the trained artificial intelligence model is tested using test data; ultimately, a feature recognition model is obtained, whose input is a detection image and whose output is its corresponding recognition feature map and recognition score; the artificial intelligence model includes a BP neural network model and an RBF neural network model.

5. The X-ray-based nut defect detection method according to claim 1, characterized in that: The detection result is obtained by comparing the recognition feature map with the defect feature map in the defect feature library, including: Extracting each defect feature map from the defect feature library; calculating the similarity between the target recognition feature map and each defect feature map; the target recognition feature map is one of the multiple recognition feature maps; Obtain the maximum value of the similarities between a target recognition feature image and each defect feature image. When the maximum value is greater than a set similarity threshold, the recognition status of the nut corresponding to the target recognition feature image is marked as a defective nut; otherwise, the recognition status of the nut corresponding to the target recognition feature image is marked as a qualified nut; The detection result is integrated based on the nut state, the identification feature map and the defect feature map corresponding to the maximum similarity value.

6. The X-ray-based nut defect detection method according to claim 5, characterized in that: The defect feature library is generated from a number of inspection images of nuts with defects, including: Acquire several inspection images with different defects; input the inspection images of the same defect type into the feature recognition model in sequence to obtain corresponding recognition feature maps and recognition scores; obtain the recognition feature maps with recognition scores greater than the set threshold and mark them as defect feature maps; A plurality of defect feature maps corresponding to different defects are obtained in sequence; and a defect feature library is constructed based on each defect feature map.

7. An X-ray-based nut defect detection system, based on the application of the X-ray-based nut defect detection method according to any one of claims 1 to 6; characterized in that: include: Data acquisition module, detection module, data analysis module and database; The data acquisition module is used to acquire the detection image group and the characteristic data of the nuts to be detected; The detection module sets the detection power group and the number of acquisition times based on the characteristic data; Perform detection according to the detection power group and the set acquisition times; The data analysis module generates a recognition feature map based on the detection image group, and obtains a detection result based on the comparison between the recognition feature map and the defect feature map in the defect feature library; The database is used to store all data generated and used by this system.

Citation Information

Patent Citations

  • Method and apparatus for detecting insect damage in the center of nut kernels

    CN112819745B

  • Deep learning identification method based on X-ray image, system and X-ray machine

    CN110763705A

  • Image processing method and device, mobile terminal and computer readable storage medium

    CN111726533A

  • X-ray image-based method for detecting wizened degree of interior of walnut with shell

    CN118096658A