Defect category detection method and system, electronic equipment and storage medium

Through multi-angle and multi-device image acquisition and deep learning model analysis, the accuracy and efficiency of detection of defect categories of R-angle devices in the prior art are solved, and efficient and accurate defect detection is achieved.

CN119887656APending Publication Date: 2025-04-25SHENZHEN GREENING ARTIFICIAL INTELLIGENCE & ROBOTICS RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411915274.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art is difficult to accurately and efficiently detect defect-category detection of devices with R angles, especially when distinguishing between cracked defects and scratch defects, with low detection accuracy.

Method used

By determining the object detection angle of the target detection device and collecting images of multiple angles and multiple devices based on preset multiple image acquisition devices and light sources, an initial detection image group is obtained. Then, the image is detected by using a deep learning model, and the detection results from multiple angles are analyzed comprehensively to determine the target defect category.

Benefits of technology

It realizes efficient and accurate detection of defect category types with R angle devices, avoids the influence of subjective factors, and can more accurately distinguish categories with similar defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119887656A_ABST
    Figure CN119887656A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a defect category detection method and system, electronic equipment and a storage medium, and belongs to the technical field of optical detection. The method comprises the following steps: determining a target detection angle formed by a first detection surface and a second detection surface which are adjacent in a target detection device; based on a first image acquisition device, a second image acquisition device and a third image acquisition device, performing image acquisition on the target detection angle to obtain a first detection image, a second detection image and a third detection image, performing defect category detection on the target detection angle based on the first detection image, the second detection image and the third detection image to obtain a first defect category, a second defect category and a third defect category; and determining a target defect category of the target detection angle based on the first defect category, the second defect category and the third defect category. According to the embodiment of the invention, defect category detection can be accurately and efficiently carried out on the device with the R angle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of optical detection technology, and in particular to a defect category detection method and system, electronic equipment, and storage medium. Background Art

[0002] In the design and manufacturing process, devices with R corners refer to parts or products whose edges or corners are designed to be arc-shaped, such as aluminum boxes (a common packaging material), mechanical parts, etc. Due to the special arc design of the R corner, it is easy to produce subtle crack defects that are not easy to detect under the action of tensile tension, and the hidden crack defects are not allowed to exist in the manufacturing of input devices. Therefore, accurate detection of defect categories in devices with R corners can improve product quality and safety.

[0003] At present, the related technology usually uses manual visual inspection to detect defect categories, but this method is easily affected by subjective factors and has low detection efficiency. In addition, the related technology also proposes a method of using a 2D camera with a single light source to directly photograph devices with R corners to detect defect categories, but this method is difficult to distinguish between hidden crack defects and similar scratch defects, resulting in reduced accuracy in defect category detection. Therefore, how to provide a defect category detection method that can accurately and efficiently detect defect categories for devices with R corners has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to provide a defect category detection method and system, electronic device, and storage medium, which can accurately and efficiently perform defect category detection on devices with R corners.

[0005] To achieve the above objective, a first aspect of an embodiment of the present application provides a defect category detection method, the method comprising:

[0006] Determining a target detection angle of the target detection device, wherein the target detection angle is formed by a first detection surface and a second detection surface adjacent to each other in the target detection device, and an area of ​​the first detection surface is less than or equal to an area of ​​the second detection surface;

[0007] Based on a preset first image acquisition device, a second image acquisition device, and a third image acquisition device, image acquisition is performed on the target detection angle to obtain an initial detection image group, wherein the initial detection image group includes a first detection image acquired by the first image acquisition device, a second detection image acquired by the second image acquisition device, and a third detection image acquired by the third image acquisition device, wherein the first image acquisition device is arranged opposite to the first detection surface, the third image acquisition device is arranged opposite to the second detection surface, and the second image acquisition device is arranged opposite to the target detection angle;

[0008] Perform defect category detection on the target detection angle based on the first detection image to obtain a first defect category;

[0009] Perform defect category detection on the target detection angle based on the second detection image to obtain a second defect category;

[0010] Perform defect category detection on the target detection angle based on the third detection image to obtain a third defect category;

[0011] A target defect category of the target detection angle is determined based on the first defect category, the second defect category, and the third defect category.

[0012] In some embodiments, the target defect category includes a preset disallowed category and a preset allowed category, and determining the target defect category of the target detection angle based on the first defect category, the second defect category, and the third defect category includes:

[0013] If the third defect category is a preset disallowed category, and at least one of the first defect category and the second defect category is the preset disallowed category, determining that the target defect category is the preset disallowed category;

[0014] If the third defect category is the preset disallowed category, and the first defect category and the second defect category are the preset allowed categories, determining that the target defect category is the preset allowed category;

[0015] If the third defect category is a preset allowable category, the target defect category is determined to be the preset allowable category.

[0016] In some embodiments, after determining that the target defect category is the preset allowable category, the method further includes:

[0017] Obtaining a confidence score for the third inspection image based on the third defect category;

[0018] If the confidence score is greater than a preset confidence threshold, the target defect category is determined to be the preset allowed category.

[0019] In some embodiments, the step of performing image acquisition on the target detection angle based on a preset first image acquisition device, a second image acquisition device, and a third image acquisition device to obtain an initial detection image group includes:

[0020] Determining a preset light source having the same number as the detection surfaces included in the target detection device;

[0021] Based on the preset first image acquisition device, the second image acquisition device, the third image acquisition device and the preset light source, image acquisition is performed on the target detection angle to obtain the initial detection image group.

[0022] In some embodiments, the preset light source includes a first light source, a second light source, a third light source, and a fourth light source, and the image acquisition of the target detection angle based on the first image acquisition device, the second image acquisition device, the third image acquisition device, and the preset light source to obtain the initial detection image group includes:

[0023] Capturing an image of the target detection angle based on the first image acquisition device, the first light source, and the third light source to obtain the first detection image;

[0024] Based on the second image acquisition device, the first light source, the second light source, the third light source and the fourth light source, an image of the target detection angle is acquired to obtain the second detection image;

[0025] The target detection angle is imaged based on the third image acquisition device, the second light source, and the fourth light source to obtain the third detection image.

[0026] In some embodiments, the performing defect category detection on the target detection angle based on the first detection image to obtain a first defect category includes:

[0027] Based on the preset first image acquisition device, perform image acquisition on the target detection angle to obtain a detection image training set, wherein the detection image training set includes all detection images acquired by the first image acquisition device;

[0028] The detection image training set is trained based on a preset deep learning model to obtain a defect category detection model;

[0029] The defect category detection is performed on the target detection angle based on the first detection image and the defect category detection model to obtain the first defect category.

[0030] To achieve the above objective, a second aspect of an embodiment of the present application provides a defect category detection system, the system comprising:

[0031] A detection platform, used to place target detection devices;

[0032] An image acquisition unit, comprising a first image acquisition device, a second image acquisition device and a third image acquisition device, wherein the image acquisition unit is used to acquire images of the target detection angle of the target detection device to obtain an initial detection image group;

[0033] The defect category detection unit is communicatively connected with the image acquisition unit, and is used to obtain the initial detection image group and execute the method described in the first aspect.

[0034] In some embodiments, the defect category detection system further includes:

[0035] A light source module includes preset light sources having the same number as the detection surfaces included in the target detection device, and the preset light sources are used to combine with the first image acquisition device, the second image acquisition device and the third image acquisition device to perform image acquisition on the target detection angle to obtain the initial detection image group.

[0036] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0037] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0038] The present application proposes a defect category detection method and system, electronic device, and storage medium. The method determines the target detection angle of the target detection device, which is composed of the adjacent first detection surface and the second detection surface in the target detection device; further, based on the preset first image acquisition device, the second image acquisition device, and the third image acquisition device, the target detection angle is imaged to obtain the first detection image acquired by the first image acquisition device, the second detection image acquired by the second image acquisition device, and the third detection image acquired by the third image acquisition device; further, based on the first detection image, the target detection angle is defect-classified to obtain the first defect category; based on the second detection image, the target detection angle is defect-classified to obtain the second defect category; based on the third detection image, the target detection angle is defect-classified to obtain the third defect category; finally, the target defect category of the target detection angle is determined based on the first defect category, the second defect category, and the third defect category. Compared with the related art, the present application performs defect category detection on the target detection angle through multi-angle and multi-device image acquisition, thereby realizing efficient and accurate detection of the defect category of the target detection angle in the target detection device. This method can not only avoid the influence of subjective factors and improve detection efficiency, but also more accurately distinguish categories with similar defects because it is a defect category obtained after comprehensive defect category detection from multiple angles. In this way, the present application can effectively improve the accuracy and efficiency of defect category detection of devices with R corners. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 is a flow chart of a defect category detection method provided in an embodiment of the present application;

[0040] Figure 2A It is a structural schematic diagram of the R corner of an aluminum box provided in an embodiment of the present application;

[0041] Figure 2B It is a structural schematic diagram of the first detection surface of the aluminum box provided in an embodiment of the present application;

[0042] Figure 2C It is a structural schematic diagram of the second detection surface of the aluminum box provided in an embodiment of the present application;

[0043] Figure 3 yes Figure 1 A flowchart of step S102 in FIG.

[0044] Figure 4 yes Figure 3 A flowchart of step S302 in FIG.

[0045] Figure 5 is a schematic diagram of a system architecture of a defect category detection system provided in an embodiment of the present application;

[0046] Figure 6 yes Figure 1 A flowchart of step S103 in FIG.

[0047] Figure 7 yes Figure 1 A flowchart of step S106 in FIG.

[0048] Figure 8 yes Figure 7 A flowchart of step S703 in FIG.

[0049] Fig. 9 It is a specific flow chart of the defect category detection method provided in the embodiment of the present application;

[0050] Fig.10 It is a hardware structure diagram of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0052] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0054] First, some nouns involved in this application are analyzed:

[0055] LED light: a semiconductor light-emitting device that can efficiently convert electrical energy into light energy and is widely used in lighting, display, signal indication and other fields.

[0056] Laser: A device that can produce high-brightness, monochromatic, coherent light beams, used in many fields such as medical surgery, fiber optic communications, industrial cutting, and scientific research measurement.

[0057] Image processing technology: refers to the process of processing and analyzing images using computer technology, including image acquisition, processing, analysis and understanding to extract useful information or for controlling equipment.

[0058] Deep learning algorithms: are machine learning algorithms that mimic the structure and function of the human brain's neural network. These algorithms are able to learn multi-level representations and abstractions of data by building multi-layered neural networks (also known as deep neural networks). Each layer of the neural network transforms and combines the input data to extract higher-level features. Deep learning algorithms are able to automatically learn complex patterns from large amounts of data without human intervention for feature engineering. These algorithms are widely used in image recognition, speech recognition, natural language processing and other fields.

[0059] Deep learning model: refers to a specific computational model that implements a deep learning algorithm. A deep learning model consists of multiple layers (or "neurons") that are stacked in a specific structure (such as convolutional layers, pooling layers, fully connected layers, etc.) to process input data and produce output. Training a deep learning model involves adjusting the weights and biases in the network to minimize the difference between the predicted output and the actual output. Once trained, the model can be used for prediction and classification tasks on new data.

[0060] Imaging conditions: refers to the process of image acquisition, in which different lighting environments are formed by adjusting the combination of light sources and lighting methods, so as to better highlight and identify defects in the target detection angle. For example, transition field, dark field and bright field, each has different background and defect contrast effects, which helps to comprehensively analyze and detect target defects.

[0061] R angle: refers to the arc-shaped part of the edge or corner of a part or product. This design helps to reduce stress concentration and improve the durability and aesthetics of the part.

[0062] During the design and manufacturing process, due to the special arc design of the R angle, it is easy to produce subtle crack defects under the action of tensile tension, and the hidden crack defect is a defect that is not allowed in device manufacturing. Therefore, accurate detection of defect types in devices with R angles can improve product quality and safety.

[0063] At present, the related technologies usually use manual visual inspection to detect defect categories, but this method is easily affected by subjective factors and has low detection efficiency. In addition, the related technologies also propose a method of using a 2D camera with a single light source to directly photograph devices with R angles to detect defect categories, but this method is difficult to distinguish between hidden crack defects and similar scratch defects, resulting in reduced detection accuracy of defect categories.

[0064] Based on this, the embodiments of the present application provide a defect category detection method and system, an electronic device, and a storage medium, which can accurately and efficiently perform defect category detection on devices with R corners.

[0065] The defect category detection method and system, electronic device, and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the defect category detection method in the embodiments of the present application is described.

[0066] The defect category detection method provided in the embodiment of the present application relates to the field of optical detection technology. The defect category detection method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or can be configured as a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (Content De liveryNetwork, CDN) and big data and artificial intelligence platforms and other basic cloud computing services; the software can be an application that implements the defect category detection method, etc., but is not limited to the above forms.

[0067] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0068] Figure 1 is an optional flow chart of the defect category detection method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.

[0069] Step S101, determining a target detection angle of a target detection device, where the target detection angle is formed by a first detection surface and a second detection surface adjacent to each other in the target detection device;

[0070] Step S102, based on the preset first image acquisition device, second image acquisition device and third image acquisition device, image acquisition is performed on the target detection angle to obtain a first detection image, a second detection image and a third detection image;

[0071] Step S103, performing defect category detection on the target detection angle based on the first detection image to obtain a first defect category;

[0072] Step S104, performing defect category detection on the target detection angle based on the second detection image to obtain a second defect category;

[0073] Step S105, performing defect category detection on the target detection angle based on the third detection image to obtain a third defect category;

[0074] Step S106 , determining a target defect category of a target detection angle based on the first defect category, the second defect category, and the third defect category.

[0075] Steps S101 to S106 shown in the embodiment of the present application are to determine the target detection angle of the target detection device and its adjacent first detection surface and second detection surface; then, based on the preset first image acquisition device, second image acquisition device and third image acquisition device, the target detection angle is imaged to obtain the first detection image, the second detection image and the third detection image; next, based on the first detection image, the second detection image and the third detection image, the target detection angle is respectively subjected to defect category detection to obtain the first defect category, the second defect category and the third defect category; finally, based on the first defect category, the second defect category and the third defect category, the target defect category of the target detection angle is determined. The present application detects the target detection angle by adopting a multi-angle and multi-device image acquisition method to determine the defect category. Compared with the related art, the present application effectively eliminates the adverse effects of manual visual inspection and significantly improves the detection efficiency. At the same time, by comprehensively detecting multiple angles and comprehensively analyzing to determine the defect category, it is possible to more accurately detect and distinguish defect types with similar characteristics. Therefore, the present application can effectively improve the accuracy and efficiency of defect category detection of devices with R angles.

[0076] In step S101 of some embodiments, the target detection device is a product that needs to be inspected for defect categories, such as an aluminum box or a mechanical part. The target detection angle is composed of the adjacent first detection surface and the second detection surface in the target detection device, which specifically refers to the portion of the edge or corner of the target detection device that is designed to be an arc shape, such as the R angle in an aluminum box or a mechanical part.

[0077] It should be noted that the area of ​​the first detection surface is smaller than or equal to the area of ​​the second detection surface, that is, the first detection surface is the surface with a smaller target detection angle, and the second detection surface is the other adjacent surface, which is usually larger.

[0078] It should be noted that the target detection angle of the target detection device can be determined by manual detection, image processing technology or deep learning algorithm, and the specific method is not limited. For example, a deep learning algorithm can be used to automatically identify the R angle in the image through a trained deep learning model to determine the position of the target detection angle. At this time, each R angle in the target detection device can be used as a target detection angle for defect category detection.

[0079] In some embodiments of the present application, the target detection device may be an aluminum box, and in the subsequent embodiments of the present application, the defect category detection method of the present application will be described in detail by taking the aluminum box as an example. Specifically, the target detection angle of the present application may be an R angle of the aluminum box, and three detection areas may be determined based on an R angle of the aluminum box, namely, a first detection surface, an R angle, and a second detection surface. Figure 2A , Figure 2A: is a structural schematic diagram of the R corner of an aluminum box provided in an embodiment of the present application. Figure 2A See the blue area in the middle. Figure 2B , Figure 2B is a schematic diagram of the structure of the first detection surface of the aluminum box provided in the embodiment of the present application. Figure 2B See the blue area on the left. Figure 2C , Figure 2C is a structural schematic diagram of the second detection surface of the aluminum box provided in the embodiment of the present application. Figure 2C As shown in the blue area on the right, the area of ​​the first detection surface of the current aluminum box is smaller than that of the second detection surface.

[0080] See also Figure 3 In some embodiments, step S102 may include but is not limited to steps S301 to S302:

[0081] Step S301, determining preset light sources having the same number as the detection surfaces included in the target detection device;

[0082] Step S302, based on the preset first image acquisition device, the second image acquisition device, the third image acquisition device and the preset light source, image acquisition is performed on the target detection angle to obtain an initial detection image group.

[0083] In step S301 of some embodiments, the preset light source is a light source device used when performing image acquisition. For example, the preset light source can be an LED lamp, a laser or other suitable lighting equipment, etc., without limitation.

[0084] It should be noted that the number of preset light sources can be set according to the number of detection surfaces of the target detection device. For example, if the target detection device is an aluminum box with four detection surfaces, the number of preset light sources can be set to four. If the target detection device is a triangular metal part with three detection surfaces, the number of preset light sources is three.

[0085] It should be noted that the preset light source of the present application is related to the target detection device currently being detected. In the defect category detection system constructed in the present application, the set light sources may include multiple ones, and the corresponding light source can be started as the preset light source as needed.

[0086] In step S302 of some embodiments, the image acquisition device refers to a camera device used to capture images of target detection devices. For example, the image acquisition device may be a high-resolution camera or an industrial camera, and the specific type is not limited. The initial detection image group is a group of detection images acquired by a plurality of such image acquisition devices in cooperation with a preset light source, and the initial detection image group includes a first detection image acquired by a first image acquisition device, a second detection image acquired by a second image acquisition device, and a third detection image acquired by a third image acquisition device. The first image acquisition device is arranged relative to the first detection surface, the third image acquisition device is arranged relative to the second detection surface, and the second image acquisition device is arranged relative to the target detection angle. This group of detection images contains image information of the target detection device at different viewing angles, which is used for subsequent defect category detection and analysis.

[0087] It should be noted that each detection image is acquired by a combination of a single image acquisition device and a preset light source, and represents a specific viewing angle or detection surface of the target detection device.

[0088] See also Figure 4 In some embodiments, the preset light source includes a first light source, a second light source, a third light source, and a fourth light source, and step S302 may include but is not limited to steps S401 to S403:

[0089] Step S401, performing image acquisition on a target detection angle based on a first image acquisition device, a first light source, and a third light source to obtain a first detection image;

[0090] Step S402, performing image acquisition on the target detection angle based on the second image acquisition device, the first light source, the second light source, the third light source and the fourth light source to obtain a second detection image;

[0091] Step S403: Capture an image of the target detection angle based on a third image acquisition device, the second light source, and the fourth light source to obtain a third detection image.

[0092] In steps S401 to S403 of some embodiments, the light source refers to a device used to illuminate the target detection angle when performing image acquisition. The function of the light source is to provide uniform and sufficient light to ensure that the image acquisition device can clearly capture the image of the target detection angle. The light source can be various types of lighting devices, such as LED lights, lasers, or other suitable lighting devices, without limitation.

[0093] It should be noted that when the target detection device is an aluminum box, the first light source, the second light source, the third light source and the fourth light source are respectively arranged opposite to the four detection surfaces of the aluminum box. When detecting one of the R corners of the aluminum box, the first light source, the second light source, the third light source and the fourth light source can be combined to form a dark field imaging condition. Under this condition, the background will appear dark, and the defect will appear bright against the dark background, making it easier to detect and identify. The second light source and the fourth light source can also be combined to form a bright field imaging condition. Under this condition, the background will appear bright, and the defect will appear dark against the bright background, and the defect can be clearly distinguished from the background. The first light source and the third light source can be combined to form a transition field imaging condition. Under this condition, the background brightness is between the bright field and the dark field, darker than the bright field, and the brightness of the defect is also weaker than that in the dark field, thereby highlighting the defect outline and characteristics and assisting in accurate detection.

[0094] It should be noted that when the target detection device is a triangular part and detection is performed on one of its R angles, any three light sources can be selected from the preset light sources. Through specific combinations and settings, three imaging conditions of dark field, bright field and transition field can be formed respectively to meet different detection needs and defect presentation requirements for the R angle.

[0095] It should be noted that when the target detection device is an aluminum box, its defect categories include scratches and hidden cracks. In the case of a combined light source and a multi-image acquisition device, hidden cracks and scratches can be distinguished in imaging. Hidden cracks usually appear curved, with burrs on the edges and obvious bright spots; while scratches appear in a smooth curve, with smooth edges and no obvious bright spots. Through these lighting and imaging conditions, different defects can be more clearly identified and classified, providing a reliable basis for subsequent defect category detection and analysis.

[0096] The present application also provides a defect category detection system, which can implement any defect category detection method of the present application. The system includes:

[0097] A detection platform, used to place target detection devices;

[0098] An image acquisition unit, comprising a first image acquisition device, a second image acquisition device and a third image acquisition device, the image acquisition unit being used to acquire images of a target detection angle of the target detection device to obtain an initial detection image group;

[0099] The defect category detection unit is communicatively connected to the image acquisition unit, and is used to obtain an initial detection image group and execute any defect category detection method of the embodiments of the present application.

[0100] In some embodiments, the defect category detection system further includes:

[0101] The light source module includes preset light sources having the same number as the detection surfaces included in the target detection device, and the preset light sources are used to combine with the first image acquisition device, the second image acquisition device and the third image acquisition device to acquire images of the target detection angle to obtain an initial detection image group.

[0102] It should be noted that the specific implementation of the defect category detection system is basically the same as the specific implementation example of the defect category detection method of the present application, and will not be repeated here.

[0103] See also Figure 5 , Figure 5 It is a system architecture diagram of the defect category detection system provided in an embodiment of the present application. The diagram includes a front view, a left view and a top view to show the system architecture. Among them, the role of the front view and the left view is to help better understand the positional relationship of the components in the system, and the top view includes the main components in the system and their relative positional relationship. In some embodiments, when the target detection device is an aluminum box, and the target detection angle is the R angle of the aluminum box, the light source module in a defect category detection system provided in the present application may include four high-brightness strip light sources, and the image acquisition unit may include three 1200W pixel cameras and three automatic zoom lenses.

[0104] Among them, the present application can take a camera and a lens as a group, which are recorded as camera 1 (corresponding to the first image acquisition device), camera 2 (corresponding to the second image acquisition device), and camera 3 (corresponding to the third image acquisition device). The four highlighted strip light sources are recorded as light source 1 (corresponding to the first light source), light source 2 (corresponding to the second light source), light source 3 (corresponding to the third light source), and light source 4 (corresponding to the fourth light source). In this way, by shooting an aluminum box R corner with three groups of cameras, the initial detection image group of the aluminum box R corner can be obtained. In addition, since the aluminum box R corner contains four R corners, the corresponding image acquisition can be performed by adjusting the configuration required for other R corners.

[0105] Further, the specific image acquisition process is as follows: first, the aluminum box is placed on the detection platform. Then, the first detection surface of the aluminum box is photographed by the combination of the camera 1 of the image acquisition unit and the light source 2 and the light source 4 of the light source module, and the first detection image is collected. Since the camera 1 will only photograph the defects of the first detection surface, and the reflected light of the second detection surface can illuminate the first detection surface, the defect will form a brightness change light spot at the junction of the first detection surface and the R angle. Next, the R angle of the aluminum box is photographed by the combination of the camera 2 of the image acquisition unit and the light sources 1, 2, 3 and 4 of the light source module, and the second detection image is collected. Since the light source converges into a gradual area at the R angle, the presence of defects will interfere with the light distribution in this area, thereby causing the original uniform light spot to change sharply. Finally, the second detection surface of the aluminum box is photographed by the combination of the camera 3 of the image acquisition unit and the light source 2 and the light source 4 of the light source module, and the third detection image is collected. When the light source is reflected back and forth on the second detection surface to realize the bright detection, if there is a defect, it will cause the uniform grayscale plane to change sharply, and the camera 3 only photographs the defects of the second detection surface. The three image acquisition steps are performed synchronously, and the first detection image, the second detection image, and the third detection image finally acquired together constitute an initial detection image group of the R corner of the aluminum box.

[0106] See also Figure 6 In some embodiments, step S103 may include but is not limited to steps S601 to S603:

[0107] Step S601, based on a preset first image acquisition device, performing image acquisition on a target detection angle to obtain a detection image training set, where the detection image training set includes all detection images acquired by the first image acquisition device;

[0108] Step S602, training the inspection image training set based on a preset deep learning model to obtain a defect category detection model;

[0109] Step S603 , performing defect category detection on the target detection angle based on the first detection image and the defect category detection model to obtain a first defect category.

[0110] In step S601 of some embodiments, the inspection image training set is a set of images taken by a first image acquisition device, and these images are used to train a deep learning model to identify and classify different defects.

[0111] In step S602 of some embodiments, the preset deep learning model is a deep learning algorithm that has been set for detecting defect categories, such as a convolutional neural network or a YOLO algorithm, etc., without limitation. Training is to optimize the preset deep learning model using a detection image training set so that it can accurately identify and classify defects. The defect category detection model is a deep learning model obtained after training, which can analyze images and identify the types of defects therein.

[0112] In step S603 of some embodiments, the defect category is a specific defect type found during the target detection angle detection process, such as hidden cracks, scratches, dents, etc. These defect categories help determine the quality of the product and decide whether it needs to be repaired or scrapped. Defect category detection is the process of identifying and classifying product defects. Common methods include manual detection, image processing technology, and deep learning algorithms. For example, convolutional neural networks are used for image recognition and defect classification. For example, edge detection algorithms and morphological processing methods in image processing technology are used to identify and classify defects. The specific method is not limited.

[0113] It should be noted that, based on the first detection image and the defect category detection model, defect category detection is performed on the target detection corner to obtain the first defect category, and the detection image of the target detection corner is analyzed using the trained defect category detection model. The defect category detection model will automatically identify the defect type in the detection image and classify the defects according to preset classification standards, such as distinguishing different types of defects such as hidden cracks, scratches and dents; finally, the defect category detection model will output the defect category of the target detection angle.

[0114] In steps S104 to S105 of some embodiments, the specific implementation is basically the same as the specific implementation of step S103 described above, and will not be repeated here.

[0115] See also Figure 7 In some embodiments, the target defect category includes a preset disallowed category and a preset allowed category, and step S106 may include but is not limited to steps S701 to S703:

[0116] Step S701, if the third defect category is a preset disallowed category, and at least one of the first defect category and the second defect category is a preset disallowed category, determining that the target defect category is a preset disallowed category;

[0117] Step S702, if the third defect category is a preset disallowed category, and the first defect category and the second defect category are preset allowed categories, determining the target defect category is a preset allowed category;

[0118] Step S703: if the third defect category is a preset allowable category, determine that the target defect category is a preset allowable category.

[0119] In steps S701 to S703 of some embodiments, the preset disallowed categories are that certain defect categories found in the defect category detection are unacceptable, and these defects will seriously affect the quality of the product and need to be repaired or scrapped. For example, hidden cracks or deep scratches are found. The preset allowed categories are that certain defect types found in the defect category detection are acceptable and will not affect the normal use and quality of the product. For example, shallow scratches or tiny dents are found.

[0120] See also Figure 8 In some embodiments, step S703 may include but is not limited to steps S801 to S802:

[0121] Step S801, obtaining a confidence score of a third inspection image based on a third defect category;

[0122] Step S802: If the confidence score is greater than a preset confidence threshold, the target defect category is determined to be a preset allowed category.

[0123] In step S801 of some embodiments, the confidence score refers to the confidence level of the deep learning model in the detected defect category, which is usually represented by a value between 0 and 1. A high confidence score means that the deep learning model has a high reliability in the detection result.

[0124] It should be noted that the confidence score can be calculated by analyzing the third detection image through a preset deep learning model.

[0125] In step S802 of some embodiments, the preset confidence threshold is a standard value used to determine whether the confidence score is high enough. For example, the preset confidence threshold can be set to 0.8, indicating that when the confidence score is higher than 0.8, the judgment of the model is considered reliable.

[0126] It should be noted that the confidence score is compared with the preset confidence threshold. If the confidence score is greater than the preset confidence threshold, the detection result is considered reliable, and the target defect category is determined as the preset allowed category. If the confidence score is lower than or equal to the preset confidence threshold, it means that the model has insufficient confidence in the detection result, and the third defect category is determined as the preset unallowed category. This means that the defect may seriously affect the product quality, and it is necessary to further combine the first defect category and the second defect category to determine the defect category of the target detection angle.

[0127] See also Fig. 9 , Fig. 9It is a specific flow chart of the defect category detection method provided in an embodiment of the present application, which specifically includes: first determining the target detection angle of the target detection device, and the adjacent first detection surface and second detection surface; further, using three preset image acquisition devices and a preset light source to respectively acquire detection images of the target detection angle, the first detection surface and the second detection surface; further, performing defect category detection on the acquired detection images of the target detection angle, the first detection surface and the second detection surface, respectively, to obtain the corresponding defect categories of the target detection angle, the first detection surface and the second detection surface; finally, determining whether the defect category of the second detection surface belongs to the preset disallowed category, if so, then determining whether the defect category of the first detection surface or the target detection angle is the preset disallowed category, if it is the preset disallowed category, then determining the target defect category as the preset disallowed category, if not the preset disallowed category, then determining the target defect category as the preset allowed category; if the defect category of the second detection surface is not the preset disallowed category, then directly determining the target defect category as the preset allowed category.

[0128] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above defect category detection method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.

[0129] See also Fig.10 , Fig.10 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0130] The processor 1001 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0131] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the defect category detection method of the embodiment of this application;

[0132] Input / output interface 1003, used to implement information input and output;

[0133] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WI FI, Bluetooth, etc.);

[0134] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );

[0135] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .

[0136] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned defect category detection method is implemented.

[0137] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0138] The defect category detection method and system, electronic device, and storage medium provided in the embodiment of the present application, by determining the target detection angle formed by the adjacent first detection surface and the second detection surface of the target detection device, using the preset first image acquisition device, the second image acquisition device, and the third image acquisition device and the preset light source with the same number as the detection surface to acquire images, and obtain the corresponding first detection image, the second detection image, and the third detection image, thereby replacing the single perspective with a three-perspective perspective, and detecting this type of defect from multiple dimensions and multiple directions, to overcome the limitations of single-perspective imaging and avoid the risk of missed detection in single-perspective detection. Then, the detection image training set is trained based on the preset deep learning model, and the target detection angle is analyzed using the trained defect category detection model and the three collected detection images to identify and classify different types of defects. In addition, the detection accuracy and comprehensiveness are improved with the help of the powerful data analysis capabilities of the deep learning model to ensure that more types of defects can be detected. Finally, the defect category in each detection image and the confidence score of the third detection image are comprehensively judged to determine whether the target defect category is a preset allowed category or a preset unallowed category. By integrating the defect analysis results of multi-view images, comprehensive coverage of defects in target detection devices is ensured, effectively solving the problem of missed detection and improving the accuracy and efficiency of defect category detection of devices with R corners.

[0139] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0140] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0141] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0142] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0143] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable 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. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0144] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0145] In the several embodiments provided in the present application, it should be understood that the disclosed 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 above 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. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0146] The units described above 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 solution of this embodiment.

[0147] In addition, each functional unit in each embodiment of the present application 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-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0148] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store programs.

[0149] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A defect category detection method, characterized in that: The method comprises: Determining a target detection angle of the target detection device, wherein the target detection angle is formed by a first detection surface and a second detection surface adjacent to each other in the target detection device, and an area of ​​the first detection surface is less than or equal to an area of ​​the second detection surface; Based on a preset first image acquisition device, a second image acquisition device, and a third image acquisition device, image acquisition is performed on the target detection angle to obtain an initial detection image group, wherein the initial detection image group includes a first detection image acquired by the first image acquisition device, a second detection image acquired by the second image acquisition device, and a third detection image acquired by the third image acquisition device, wherein the first image acquisition device is arranged opposite to the first detection surface, the third image acquisition device is arranged opposite to the second detection surface, and the second image acquisition device is arranged opposite to the target detection angle; Perform defect category detection on the target detection angle based on the first detection image to obtain a first defect category; Perform defect category detection on the target detection angle based on the second detection image to obtain a second defect category; Perform defect category detection on the target detection angle based on the third detection image to obtain a third defect category; A target defect category of the target detection angle is determined based on the first defect category, the second defect category, and the third defect category.

2. The method according to claim 1, characterized in that: The target defect category includes a preset disallowed category and a preset allowed category, and determining the target defect category of the target detection angle based on the first defect category, the second defect category, and the third defect category includes: If the third defect category is a preset disallowed category, and at least one of the first defect category and the second defect category is the preset disallowed category, determining that the target defect category is the preset disallowed category; If the third defect category is the preset disallowed category, and the first defect category and the second defect category are the preset allowed categories, determining that the target defect category is the preset allowed category; If the third defect category is a preset allowable category, the target defect category is determined to be the preset allowable category.

3. The method according to claim 2, characterized in that After determining that the target defect category is the preset allowable category, the method further includes: Obtaining a confidence score for the third inspection image based on the third defect category; If the confidence score is greater than a preset confidence threshold, the target defect category is determined to be the preset allowed category.

4. The method according to claim 1, characterized in that The method of performing image acquisition on the target detection angle based on the preset first image acquisition device, the second image acquisition device and the third image acquisition device to obtain an initial detection image group includes: Determining a preset light source having the same number as the detection surfaces included in the target detection device; Based on the preset first image acquisition device, the second image acquisition device, the third image acquisition device and the preset light source, image acquisition is performed on the target detection angle to obtain the initial detection image group.

5. The method according to claim 4, characterized in that The preset light source includes a first light source, a second light source, a third light source and a fourth light source, and the image acquisition is performed on the target detection angle based on the preset first image acquisition device, the second image acquisition device, the third image acquisition device and the preset light source to obtain the initial detection image group, including: Capturing an image of the target detection angle based on the first image acquisition device, the first light source, and the third light source to obtain the first detection image; Based on the second image acquisition device, the first light source, the second light source, the third light source and the fourth light source, an image of the target detection angle is acquired to obtain the second detection image; The target detection angle is imaged based on the third image acquisition device, the second light source, and the fourth light source to obtain the third detection image.

6. The method according to claim 1, characterized in that The performing defect category detection on the target detection angle based on the first detection image to obtain a first defect category includes: Based on the preset first image acquisition device, perform image acquisition on the target detection angle to obtain a detection image training set, wherein the detection image training set includes all detection images acquired by the first image acquisition device; The detection image training set is trained based on a preset deep learning model to obtain a defect category detection model; The defect category detection is performed on the target detection angle based on the first detection image and the defect category detection model to obtain the first defect category.

7. A defect category detection system, characterized in that: The system comprises: A detection platform, used to place target detection devices; An image acquisition unit, comprising a first image acquisition device, a second image acquisition device and a third image acquisition device, wherein the image acquisition unit is used to acquire images of the target detection angle of the target detection device to obtain an initial detection image group; A defect category detection unit is communicatively connected to the image acquisition unit, and is used to obtain the initial detection image group and execute the defect category detection method according to any one of claims 1 to 6.

8. The defect type detection system according to claim 7, characterized in that: The defect category detection system further includes: A light source module includes preset light sources having the same number as the detection surfaces included in the target detection device, and the preset light sources are used to combine with the first image acquisition device, the second image acquisition device and the third image acquisition device to perform image acquisition on the target detection angle to obtain the initial detection image group.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.