A material defect detection method and device
Patent Information
- Application Number
- CN202211198903.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2042-09-29
AI Technical Summary
为了解决人工进行物料缺陷检测的效率低的问题,目前主要通过深度学习对工业物料进行缺陷检测,但是深度学习需要有足够的学习样本才能保证对物料缺陷学习的准确性,而缺陷检测领域中的样本数量通常较少,因此,无法保证深度学习的准确性,降低了物料缺陷检测的准确性
[0040]经由上述的技术方案可知,本申请公开一种物料缺陷检测方法、装置及电子设备,包括:获取待检测物料的待检测图像;基于目标缺陷检测模型对待检测图像进行处理,获得目标区域特征;基于目标区域特征,确定待检测物料的缺陷检测结果。其中,目标缺陷检测模型为基于初始模型和目标增量图像确定的模型,目标增量图像为基于初始模型进行筛选得到的图像。本申请能够利用增量小样本学习,保证了模型性能,提升了物料缺陷检测的准确性。
Smart Images

Figure CN115439465B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of detection technology, and more specifically to a method and apparatus for detecting material defects. Background Technology
[0002] In the industrial manufacturing sector, defect detection of materials is necessary to ensure the output or manufacture of high-quality materials. To address the low efficiency of manual material defect detection, deep learning is currently the primary method for defect detection in industrial materials. However, deep learning requires a sufficient number of training samples to ensure accuracy in learning about material defects. The number of samples in the defect detection field is typically limited, thus compromising the accuracy of deep learning and reducing the overall accuracy of material defect detection. Summary of the Invention
[0003] In view of the above, this application provides the following technical solution:
[0004] A method for detecting material defects, comprising:
[0005] Acquire the image of the material to be inspected;
[0006] The image to be detected is processed based on the target defect detection model to obtain the target region features. The target defect detection model is a model determined based on an initial model and a target incremental image. The target incremental image is an image obtained by filtering based on the initial model.
[0007] Based on the characteristics of the target area, the defect detection result of the material to be tested is determined.
[0008] Optionally, the method further includes:
[0009] Obtain the initial incremental image;
[0010] The initial incremental image is detected based on the initial model, and the detection results are sorted.
[0011] The initial incremental images are filtered based on the sorting of the detection results to obtain a specified number of target incremental images;
[0012] The initial model is updated based on the labeled incremental image corresponding to the target incremental image to obtain the target defect detection model.
[0013] Optionally, updating the initial model based on the labeled incremental image corresponding to the target incremental image to obtain the target defect detection model includes:
[0014] Obtain the labeled incremental image corresponding to the target incremental image, and the first initial image corresponding to the initial model;
[0015] Based on the image features of the target incremental image and the image features corresponding to the first initial image, the first initial image is filtered to obtain the target initial image;
[0016] The initial model is updated based on the initial target image and the labeled incremental image to obtain the target defect detection model.
[0017] Optionally, the step of filtering the first initial image based on the image features of the target incremental image and the image features corresponding to the first initial image to obtain the target initial image includes:
[0018] The image features corresponding to the first initial image are processed to obtain a first vector set corresponding to the first initial image, so that the first vector set is determined as a memory vector, and a memory space is constructed based on the memory vector;
[0019] The image features of the target incremental image are processed to obtain the incremental vector;
[0020] The incremental vector is compared with the memory vector, and the target memory vector is determined from the memory vector based on the comparison result;
[0021] The image of the target memory vector object is determined as the target initial image.
[0022] Optionally, the method further includes:
[0023] In response to processing based on the initial target image and the incremental labeled image, the vectors corresponding to the initial target image and the incremental labeled image are stored in the memory space so that the model is updated based on the vectors in the memory space.
[0024] Optionally, the step of detecting the initial incremental image based on the initial model and obtaining a ranking of the detection results includes:
[0025] Based on the initial model, the initial incremental image is detected to obtain the target region features corresponding to each initial incremental image and the score corresponding to the target region features;
[0026] Based on the scores, each initial incremental image is sorted, and the sorting results are determined as the sorting of the detection results.
[0027] Optionally, the method further includes:
[0028] Based on the initial model, the target incremental image is detected to obtain the target region corresponding to each target incremental image;
[0029] The target incremental image is annotated based on the target region to obtain an annotated incremental image.
[0030] Optionally, determining the defect detection result of the material to be inspected based on the characteristics of the target area includes:
[0031] The target region features are matched with material defect features to obtain matching results;
[0032] Based on the matching results, the defect detection results of the material to be tested are determined.
[0033] A material defect detection device, comprising:
[0034] The acquisition unit is used to acquire the image of the material to be inspected.
[0035] The processing unit is used to process the image to be detected based on the target defect detection model to obtain target region features, wherein the target defect detection model is a model determined based on an initial model and a target incremental image, and the target incremental image is an image obtained by filtering based on the initial model;
[0036] The determining unit is used to determine the defect detection result of the material to be inspected based on the characteristics of the target area.
[0037] An electronic device, comprising:
[0038] Memory, used to store applications and the data generated by the running of the applications;
[0039] A processor for executing the application program to implement the material defect detection method as described in any one of the above descriptions.
[0040] As described above, this application discloses a method, apparatus, and electronic device for detecting material defects, comprising: acquiring an image of the material to be detected; processing the image based on a target defect detection model to obtain target region features; and determining the defect detection result of the material based on the target region features. The target defect detection model is a model determined based on an initial model and target incremental images, and the target incremental images are images obtained by filtering based on the initial model. This application utilizes incremental few-sample learning, ensuring model performance and improving the accuracy of material defect detection. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0042] Figure 1 A schematic flowchart of a material defect detection method provided in an embodiment of this application;
[0043] Figure 2 A schematic diagram illustrating processing based on memory space provided in an embodiment of this application;
[0044] Figure 3 This is a schematic diagram of the structure of a material defect detection device provided in an embodiment of this application;
[0045] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0046] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0047] This application provides a material defect detection method based on machine learning. It processes existing material defect images to obtain a target defect detection model, which is then used to detect defects in the material's image to determine the detection result. To ensure the accuracy of the defect detection model, iterative updates are needed based on incremental images. This application accurately filters incremental images and uses these filtered images to iteratively update the defect detection model, thereby reducing iteration time, improving model performance, and ensuring the accuracy of material defect detection.
[0048] See Figure 1 This is a flowchart illustrating a material defect detection method provided in an embodiment of this application. The method may include the following steps:
[0049] S101. Obtain the image of the material to be inspected.
[0050] In the manufacturing industry, all materials, dyes, parts, semi-finished products, and scraps generated during production, excluding the final product, are generally referred to as "materials." Image acquisition equipment can be used to acquire images of the materials to be inspected, obtaining an image corresponding to that material. This can be done by acquiring images of each individual material, or by acquiring images of the entire material to filter out defective materials.
[0051] Typically, the image of the material to be inspected can be processed directly to obtain the defect detection result. Alternatively, the image to be inspected can be processed first, and then defect detection can be performed on the processed image. Image processing can include noise removal, image enhancement, image encoding, etc., to improve the image quality of the image to be inspected, making it easier to identify and detect defects more accurately in the future.
[0052] S102. Based on the target defect detection model, process the image to be detected to obtain the features of the target region.
[0053] S103. Based on the characteristics of the target area, determine the defect detection results of the material to be inspected.
[0054] The target defect detection model is determined based on an initial model and target incremental images. The target incremental images are images obtained by filtering based on the initial model. That is, the target defect detection model is a machine learning model that iteratively updates the initial model. The initial model is a machine learning model trained on a first initial image, which is a detection image of material labeled with target region features representing material defects. In this embodiment, after obtaining the initial incremental images, since the number of initial incremental images may be large, directly using the initial incremental images to update the initial model would increase the model's training time. Therefore, in this embodiment, the initial incremental images need to be filtered to select the incremental images most needed for learning, i.e., the target incremental images, so that the initial model can be updated based on the target incremental images. The target incremental images are images where the detection results are relatively inaccurate when using the initial model. Therefore, the target incremental images can be obtained by filtering the initial incremental images based on the initial model.
[0055] In one embodiment of this application, it further includes:
[0056] Obtain initial incremental images; perform detection on the initial incremental images based on the initial model to obtain a ranking of the detection results; filter the initial incremental images based on the ranking of the detection results to obtain a specified number of target incremental images; update the initial model according to the labeled incremental images corresponding to the target incremental images to obtain the target defect detection model.
[0057] The initial incremental image can be a newly generated inspection image of defective material, such as an inspection image corresponding to defective material identified by an experienced operator, or an inspection image that was not identified or whose inspection results were inaccurate when performing defect detection using existing detection methods. An existing initial model can be used to detect the initial incremental images, obtaining a detection result corresponding to each initial incremental image. This detection result includes not only specific target region features but also probability information for identifying those target region features. For example, the detection result might include first target region features and second target region features, with a probability of 80% for detecting the first target region feature and 70% for detecting the second target region feature. Typically, the detection result output by the initial model is the one with the highest probability value; in this example, it is the first target region feature. Correspondingly, the probability value can also be a probability value representing the degree of uncertainty, i.e., the probability of detecting the target region feature with uncertainty. In this case, a high probability value indicates that the target region feature cannot be detected, while a low probability value indicates that the target region feature has been detected. Specifically, in one implementation, the step of detecting the initial incremental images based on the initial model and obtaining a ranking of the detection results includes: detecting the initial incremental images based on the initial model to obtain target region features corresponding to each initial incremental image and a score corresponding to the target region features; ranking each initial incremental image based on the scores, and determining the ranking result as the ranking of the detection results. It should be noted that, in order to improve the accuracy of the iteratively updated initial model—that is, to enable the updated model to more accurately detect image features that the original initial model could not detect—the score corresponding to the target region feature is usually an uncertainty score. Then, each initial incremental image is ranked based on this uncertainty score, and the ranking result is determined as the ranking of the detection results. This allows the incremental image with the highest uncertainty to be selected as the target incremental image. It also reduces the number of images learned during model iteration and update, thus reducing the training time for model updates.
[0058] Furthermore, based on the ranking of the detection results, the initial incremental images are filtered to obtain a specified number of target incremental images. The number of target incremental images can be determined based on the actual model update requirements or the detection accuracy of the initial incremental images by the initial model. The ranking method is determined according to the score type corresponding to the score of the target region in the detection results. The ranking method includes ascending order and descending order. For example, when ranking according to the score of the uncertainty of identifying the feature of the target region in the incremental image, a specified number of incremental images with the highest uncertainty can be selected as target incremental images by descending order.
[0059] After obtaining the target incremental image, it can be annotated to obtain an annotated incremental image. This involves labeling the target region features in the target incremental image. Specifically, professionals can annotate the defect regions (target region features) corresponding to the target incremental image. Furthermore, to reduce the workload of manual annotation by professionals, the target incremental image can be detected first based on an initial model to obtain the target region corresponding to each target incremental image; then, the target incremental image can be annotated based on the target region to obtain the annotated incremental image. The region to be annotated can be determined first using an initial model, and then the target region determined by the initial model can be annotated or corrected manually or through other processing methods, thereby reducing the workload of directly searching for the target region.
[0060] Since this application is in the field of material defect detection, the target region features can be image features that characterize the incremental image of the target region, representing the presence of defects in the corresponding material. For example, if the material is a machine part, the target region features could be image features representing cracks in an image of the machine part, or image features characterizing surface roughness. Then, the initial model is updated using labeled incremental images to obtain the target defect detection model. Specifically, the initial model can be updated using model distillation, that is, the model structure of the initial model is used to learn from the labeled incremental images until the updated initial model can accurately detect the target region features in the incremental image, or the error in detecting the target region features is within a predetermined error range. This yields the target defect detection model.
[0061] For example, an initial model is used to train a target defect detection model. The knowledge about the target task learned by the initial model is then transferred to the target defect detection model, achieving model distillation and resulting in a distilled target defect detection model. The target task is to identify target region features in an image of the material being inspected. The target defect detection model can be obtained by acquiring the detection loss and distillation loss of the initial model. The detection loss is determined by comparing the detected target region features obtained from the initial model's detection of the incremental target image with the actual labeled target region features. The distillation loss is the loss obtained by performing knowledge distillation evaluation using the corresponding initial model. An image sample can be selected and input into both the initial model and the target defect detection model to obtain corresponding detection results. The difference between the two detection results determines the corresponding distillation loss for the target task.
[0062] Furthermore, in order to improve the detection accuracy of the target defect detection model obtained after updating the initial model, in one implementation of this application, updating the initial model based on the labeled incremental image corresponding to the target incremental image to obtain the target defect detection model includes:
[0063] Obtain the labeled incremental image corresponding to the target incremental image, and the first initial image corresponding to the initial model; based on the image features of the target incremental image and the image features corresponding to the first initial image, filter the first initial image to obtain the target initial image; update the initial model according to the target initial image and the labeled incremental image to obtain the target defect detection model.
[0064] The initial model is a machine learning model trained on a first initial image. This means the initial model can acquire image features from the first initial image and the features of the corresponding labeled target regions through deep learning, enabling accurate detection of the corresponding target regions in images similar to the first initial image. To update the initial model more accurately, the update process needs to ensure it not only learns image information from the labeled incremental images but also further learns from the original images. Specifically, based on image features, a target initial image matching the target incremental image is selected from the first initial image, allowing the initial model to deepen its learning of the target initial image. For example, if the target incremental image is for part A, and the initial model's detection of target region features when detecting defects in part A is inaccurate, it's possible that the first initial image containing images for part A is insufficient. Therefore, in addition to adding images for part A, images for part A from the first initial image can also be obtained. This allows for deep learning on these images during the initial model update process. Similarly, model distillation information from the initial model's learning process on the target initial image can be obtained, facilitating the update of the initial model using this model distillation information.
[0065] Specifically, when updating the initial model, a corresponding storage space can be set up to store the first initial image used to train the initial model, so that the stored first initial image can be used to iteratively update the initial model in the future.
[0066] In one implementation, the step of filtering the first initial image based on image features of the target incremental image and image features corresponding to the first initial image to obtain the target initial image includes:
[0067] The image features corresponding to the first initial image are processed to obtain a first vector set corresponding to the first initial image, so that the first vector set is determined as a memory vector, and a memory space is constructed based on the memory vector; the image features of the target incremental image are processed to obtain an incremental vector; the incremental vector is compared with the memory vector, and the target memory vector is determined in the memory vector based on the comparison result; the image of the target memory vector object is determined as the target initial image.
[0068] Furthermore, in response to processing based on the initial target image and the labeled incremental image, the vectors corresponding to the initial target image and the labeled incremental image are stored in the memory space, so that the model is updated based on the vectors in the memory space.
[0069] In this embodiment, improved incremental images are used to determine incremental few samples, enabling incremental few-sample learning. Training is performed only on newly labeled target incremental images. Through knowledge distillation of the initial model and the target defect detection model, memory space, and few-sample learning processing, the iterative update speed during model training is accelerated. Additional memory space is used to retain the defect features of the first initial image (i.e., old data), ensuring that the defect detection performance of the first initial image remains unchanged.
[0070] For example, see Figure 2This diagram illustrates a memory space-based processing method provided in this application embodiment. First, a memory space composed of memory vectors representing a certain amount of data is initialized. Each memory vector consists of a key and a value, obtained through training. The key represents image feature information, such as type or item characteristics, while the value is the image to be detected. For the initial model, the memory vector can be the vector corresponding to the first initial image. After obtaining the target incremental image, to facilitate feature learning and processing, the image features can be converted into vectors for processing. The memory vector can be the vector corresponding to the first initial image and the target incremental image; however, to further improve the acquisition of defect features, the first initial image can be filtered. The target incremental image is mapped to a vector through embedding mapping, resulting in an incremental vector. Then, the incremental vector is compared with the key in the memory vector to obtain the value of the K memory vectors closest to the incremental vector key. In other words, by comparing the image features of the target incremental image with the image features of the first initial image, the K memory vectors closest to the target incremental image are obtained from the first initial image. These K memory vectors and the target incremental image are input into the neural network to obtain the defect detection result. The training of each incremental image is further improved through knowledge distillation and few-shot learning. After training through incremental learning, the defect features of both the old and new defect images are retained in the memory space, thus maintaining the defect performance on the old defect images while training only on the old defect images to detect new defects. Figure 2 In this model, model1 is the initial model and model2 is the student model corresponding to the initial model. Then, knowledge from model1 can be distilled into model2 through knowledge distillation to obtain the target defect detection model.
[0071] After obtaining the target defect detection model, the image to be inspected can be processed based on the model to obtain the target area features. Based on these features, the defect detection result of the material to be inspected can be determined. This can be done by determining the correspondence between the target area features and the corresponding defect detection level; that is, the defect detection result characterizes the degree of defect, such as level one defect, level two defect, etc. Specifically, the defect level can be pre-defined by professionals based on the type and severity of the defect. Therefore, the processing outcome of the material to be inspected can be determined based on the defect detection result, such as whether it can continue to be used in production.
[0072] In one implementation, determining the defect detection result of the material to be tested based on the target area features includes: matching the target area features with material defect features to obtain a matching result; and determining the defect detection result of the material to be tested based on the matching result. The material defect features include defect features determined based on the material type, such as the presence of cracks, surface roughness, etc. Then, the detected target area features are matched with the material defect features, for example, matching the crack features of the detected target area with the crack length feature in the material defect features to obtain a matching result. The matching result can be determined based on a length measurement value; for example, if the crack length is 1 mm, the corresponding output material defect detection result is a level 1 defect; if the length is 3 mm, it is a level 2 defect, and so on.
[0073] In this embodiment, active learning is utilized to proactively recommend the images most in need of annotation in the initial incremental images. Incremental few-shot learning is employed, iteratively training only on the annotated incremental images corresponding to the target incremental images, thereby reducing model training time and achieving better model processing performance. Specifically, the main learning process includes: firstly, obtaining a first initial image; then, partially annotating the first initial image; training an initial model based on the annotated image; then using the initial model to detect all initial incremental images; obtaining an information score for each initial incremental image based on the uncertainty and label score in the detection results; sorting all initial incremental images in descending order based on this information score; and then performing incremental learning processing, selecting a few images from the initial incremental images as target incremental images based on the sorted images, and then annotating them to obtain an annotated incremental image. Finally, incremental few-shot learning is used, training only on the annotated incremental images, i.e., through knowledge distillation of the old and new models and meta-learning, to obtain the target defect detection model.
[0074] Correspondingly, this application also provides a material defect detection device, see [link to relevant documentation]. Figure 3 ,include:
[0075] The acquisition unit 301 is used to acquire the image of the material to be inspected;
[0076] The processing unit 302 is used to process the image to be detected based on the target defect detection model to obtain target region features, wherein the target defect detection model is a model determined based on an initial model and a target incremental image, and the target incremental image is an image obtained by filtering based on the initial model;
[0077] The determining unit 303 is used to determine the defect detection result of the material to be detected based on the characteristics of the target area.
[0078] This application discloses a material defect detection device, comprising: an acquisition unit acquiring an image of the material to be detected; a processing unit processing the image based on a target defect detection model to obtain target region features; and a determination unit determining the defect detection result of the material based on the target region features. The target defect detection model is a model determined based on an initial model and target incremental images, and the target incremental images are images obtained by filtering based on the initial model. This application utilizes incremental few-sample learning, ensuring model performance and improving the accuracy of material defect detection.
[0079] In one embodiment, the apparatus further includes:
[0080] Image acquisition unit, used to acquire initial incremental image;
[0081] A detection unit is used to detect the initial incremental image based on the initial model and obtain a ranking of the detection results;
[0082] A filtering unit is used to filter the initial incremental image based on the sorting of the detection results to obtain a specified number of target incremental images;
[0083] The update unit is used to update the initial model based on the labeled incremental image corresponding to the target incremental image to obtain the target defect detection model.
[0084] Optionally, the update unit includes:
[0085] The first acquisition subunit is used to acquire the labeled incremental image corresponding to the target incremental image, and the first initial image corresponding to the initial model;
[0086] The filtering subunit is used to filter the first initial image based on the image features of the target incremental image and the image features corresponding to the first initial image to obtain the target initial image;
[0087] An update subunit is used to update the initial model based on the initial target image and the labeled incremental image to obtain a target defect detection model.
[0088] Furthermore, the filtering subunit is specifically used for:
[0089] The image features corresponding to the first initial image are processed to obtain a first vector set corresponding to the first initial image, so that the first vector set is determined as a memory vector, and a memory space is constructed based on the memory vector;
[0090] The image features of the target incremental image are processed to obtain the incremental vector;
[0091] The incremental vector is compared with the memory vector, and the target memory vector is determined from the memory vector based on the comparison result;
[0092] The image of the target memory vector object is determined as the target initial image.
[0093] Optionally, the device further includes:
[0094] A storage subunit is configured to, in response to processing based on the initial target image and the incremental labeled image, store the vectors corresponding to the initial target image and the incremental labeled image in the memory space, so that model updates can be performed based on the vectors in the memory space.
[0095] Furthermore, the detection unit includes:
[0096] The detection subunit is used to detect the initial incremental image based on the initial model, and obtain the target region features corresponding to each initial incremental image and the score corresponding to the target region features;
[0097] The sorting subunit is used to sort each initial incremental image based on the score, and to determine the sorting result as the sorting of the detection results.
[0098] Optionally, the device further includes:
[0099] A region detection unit is used to detect the target incremental image based on the initial model to obtain the target region corresponding to each target incremental image;
[0100] The annotation unit is used to annotate the target incremental image based on the target region to obtain an annotated incremental image.
[0101] Furthermore, the determining unit is specifically used for:
[0102] The target region features are matched with material defect features to obtain matching results;
[0103] Based on the matching results, the defect detection results of the material to be tested are determined.
[0104] It should be noted that the specific implementation of each unit and subunit in this embodiment can be referred to the corresponding content above, and will not be described in detail here.
[0105] In another embodiment of this application, a readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the various steps of the material defect detection method as described in any of the preceding claims.
[0106] In another embodiment of this application, an electronic device is also provided, see [link to relevant documentation]. Figure 4 The electronic device may include:
[0107] Memory 401 is used to store the application and the data generated by the application during its operation;
[0108] Processor 402 is configured to execute the application program to implement the material defect detection method as described in any of the above.
[0109] It should be noted that the specific implementation of the processor in this embodiment can be referred to the corresponding content above, and will not be described in detail here.
[0110] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0111] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0112] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0113] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting material defects, comprising: Acquire the image of the material to be inspected; The image to be detected is processed based on a target defect detection model to obtain target region features. The target defect detection model is a model obtained by iteratively updating an initial model using target incremental images. The target incremental images are determined as follows: an initial incremental image is obtained; the initial incremental image is detected based on the initial model to obtain a ranking of the uncertainty of the detection results; the initial incremental images are filtered based on the ranking of the uncertainty of the detection results to obtain a specified number of target incremental images. Based on the characteristics of the target area, the defect detection result of the material to be tested is determined.
2. The method according to claim 1, wherein the target defect detection model is obtained by iteratively updating the initial model using the target incremental image, comprising: The initial model is iteratively updated based on the labeled incremental image corresponding to the target incremental image to obtain the target defect detection model.
3. The method according to claim 2, wherein updating the initial model based on the labeled incremental image corresponding to the target incremental image to obtain the target defect detection model includes: Obtain the labeled incremental image corresponding to the target incremental image, and the first initial image corresponding to the initial model; Based on the image features of the target incremental image and the image features corresponding to the first initial image, the first initial image is filtered to obtain the target initial image; The initial model is iteratively updated based on the initial target image and the labeled incremental image to obtain the target defect detection model.
4. The method according to claim 3, wherein filtering the first initial image based on the image features of the target incremental image and the image features corresponding to the first initial image to obtain the target initial image includes: The image features corresponding to the first initial image are processed to obtain a first vector set corresponding to the first initial image, so that the first vector set is determined as a memory vector, and a memory space is constructed based on the memory vector; The image features of the target incremental image are processed to obtain the incremental vector; The incremental vector is compared with the memory vector, and the target memory vector is determined from the memory vector based on the comparison result; The image corresponding to the target memory vector is determined as the target initial image.
5. The method according to claim 4, further comprising: In response to processing based on the initial target image and the incremental labeled image, the vectors corresponding to the initial target image and the incremental labeled image are stored in the memory space so that the model is updated based on the vectors in the memory space.
6. The method according to claim 1, wherein the step of detecting the initial incremental image based on the initial model to obtain a ranking of the uncertainty of the detection results includes: Based on the initial model, the initial incremental image is detected to obtain the target region features corresponding to each initial incremental image and the score corresponding to the target region features; Based on the scores, each initial incremental image is sorted, and the sorting results are determined as the order of uncertainty of the detection results.
7. The method according to claim 2, further comprising: Based on the initial model, the target incremental image is detected to obtain the target region corresponding to each target incremental image; The target incremental image is annotated based on the target region to obtain an annotated incremental image.
8. The method according to claim 1, wherein determining the defect detection result of the material to be inspected based on the characteristics of the target area includes: The target region features are matched with material defect features to obtain matching results; Based on the matching results, the defect detection results of the material to be tested are determined.
9. A material defect detection device, comprising: The acquisition unit is used to acquire the image of the material to be inspected. The processing unit is configured to process the image to be detected based on a target defect detection model to obtain target region features. The target defect detection model is a model obtained by iteratively updating an initial model using target incremental images. The target incremental images are determined as follows: obtaining an initial incremental image; detecting the initial incremental image based on the initial model to obtain a ranking of the uncertainty of the detection results; and filtering the initial incremental images based on the ranking of the uncertainty of the detection results to obtain a specified number of target incremental images. The determining unit is used to determine the defect detection result of the material to be inspected based on the characteristics of the target area.
10. An electronic device, comprising: Memory, used to store applications and the data generated by the running of the applications; A processor for executing the application to implement the material defect detection method as described in any one of claims 1-8.
Citation Information
Patent Citations
Incremental training method and related product
CN112766501A
Software adaptive testing method based on data integration prediction
CN114238068A
Power grid defect detection method and device based on incremental learning, equipment and medium
CN114359619A