Article defect detection method and related device

By using a variety of defect detection logic to process object images, the problem of low object defect detection accuracy in the existing technology is solved, and accurate detection of deformation, breaks, rust and non-standard defects is achieved, improving detection efficiency and safety. sex.

CN115131307BActive Publication Date: 2024-08-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210726109.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-23
Publication Date
2024-08-30
Estimated Expiration
2042-06-23

AI Technical Summary

Technical Problem

Existing article defect detection methods have the problem of poor defect detection accuracy, especially due to the low accuracy caused by all-manual detection and single neural network detection methods, and the inability to effectively consider the detection characteristics of different defect types.

Method used

Use at least two different defect detection logics to process the object image to detect different defect types respectively. Through deformation defect detection logic, break defect detection logic, rust defect detection logic and non-standard defect detection logic, the final defect can be obtained through integrated analysis Test results.

Benefits of technology

It significantly improves the accuracy of item defect detection, can accurately detect deformation, breaks, rust and non-standard defects, improves detection efficiency and safety, and meets the requirements of ISO standard container inspection specifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115131307B
    Figure CN115131307B
Patent Text Reader

Abstract

The present application discloses a method for detecting item defects and related devices, which relates to the field of artificial intelligence technology. The present application can be applied to fields such as blockchain, cloud technology, and map vehicle networking. The method comprises: obtaining an item image of an item to be detected; performing defect detection processing on the item image using at least two defect detection logics to obtain at least two item defect information, wherein the at least two defect detection logics are logics corresponding to different defect detection algorithms, and the different defect detection algorithms are used to detect different defect types, and each item defect information corresponds to one defect type; according to the at least two item defect information, a defect detection result of the item to be detected is obtained. The present application can effectively improve the accuracy of item defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and specifically to an object defect detection method and related devices. Background Art

[0002] Item defect detection is the work of detecting defects in items. For example, there is usually a work of defect detection on items such as containers.

[0003] At present, when detecting defects in items, some solutions use fully manual defect inspection, which is easily affected by the experience of the inspectors and the inspection environment, and has the problem of poor defect detection accuracy. In some solutions, all defect types are considered uniformly, and a single neural network is used to perform a single inspection on the defective area of ​​the item or whether there are defects, which also has the problem of poor defect detection accuracy.

[0004] Therefore, there is currently a problem of poor defect detection accuracy in object defect detection work. Summary of the invention

[0005] The embodiments of the present application provide an object defect detection method and related devices, which can effectively improve the accuracy of object defect detection.

[0006] To solve the above technical problems, the present application provides the following technical solutions:

[0007] According to one embodiment of the present application, a method for detecting defects in an object includes: obtaining an object image of an object to be detected; performing defect detection processing on the object image using at least two defect detection logics to obtain at least two types of object defect information, wherein the at least two defect detection logics are logics corresponding to different defect detection algorithms, the different defect detection algorithms are used to detect different defect types, and each type of the object defect information corresponds to one defect type; and obtaining a defect detection result of the object to be detected based on the at least two types of object defect information.

[0008] According to one embodiment of the present application, an object defect detection device includes: an acquisition module, used to acquire an object image of an object to be detected; a detection module, used to perform defect detection processing on the object image using at least two defect detection logics to obtain at least two types of object defect information, wherein the at least two defect detection logics are logics corresponding to different defect detection algorithms, and the different defect detection algorithms are used to detect different defect types, and each type of the object defect information corresponds to one defect type; an analysis module, used to obtain a defect detection result of the object to be detected based on the at least two types of object defect information.

[0009] In some embodiments of the present application, the defect type includes a deformation defect type and other item defect types; the at least two types of item defect information include deformation defect information and other defect information; the detection module includes: a deformation detection unit, which is used to perform defect detection processing on the item image using a deformation defect detection logic to obtain deformation defect information corresponding to the deformation defect type; other detection units, which are used to perform defect detection processing on the item image using other item defect detection logics to obtain other defect information corresponding to other item defect types.

[0010] In some embodiments of the present application, the deformation defect information includes a deformation defect area; the deformation detection unit is used to: extract a total feature map based on the object image, and extract a board background feature map and a candidate deformation feature map based on the total feature map; perform pooling processing on the board background feature map to obtain global features of different dimensions about the board and background; perform weight fusion transformation processing on the global features to obtain an attention weight vector; perform dot multiplication of the attention weight vector and the deformation feature map to obtain a target deformation feature map; and segment the deformation defect area in the object image based on the target deformation feature map.

[0011] In some embodiments of the present application, the deformation defect information also includes deformation defect degree information; the deformation detection unit is used to: perform image classification processing on the deformation defect area to obtain the deformation defect degree information corresponding to the deformation defect area.

[0012] In some embodiments of the present application, the other item defect types include a crack defect type, and the other defect information includes crack defect information; the other detection units include a crack detection unit, which is used to: use a crack defect detection logic to perform defect detection processing on the item image to obtain crack defect information corresponding to the crack defect type.

[0013] In some embodiments of the present application, the gap defect information includes a gap defect area; the gap detection unit is used to: segment the object image into at least one area image; perform linear representation processing on each of the area images to obtain at least one area feature map; perform multi-head self-attention operation processing on the at least one area feature map to obtain an attention feature map corresponding to each of the area images; downsample the attention feature map corresponding to at least one of the area images to generate a gap feature map; and determine the gap defect area in the object image based on the gap feature map.

[0014] In some embodiments of the present application, the other item defect types include rust defect types, and the other defect information includes rust defect information; the other detection units include a rust detection unit, which is used to: use rust defect detection logic to perform defect detection processing on the item image to obtain rust defect information corresponding to the rust defect type.

[0015] In some embodiments of the present application, the rust defect information includes a rust defect area; the rust detection unit is used to: perform image segmentation processing on the object image to obtain a pixel-level segmentation result of the rust area; and solve the connected domain of the pixel-level segmentation result to obtain the rust defect area in the object image.

[0016] In some embodiments of the present application, the rust detection unit is used to: solve the connected domain for the pixel-level segmentation result to obtain the connected domain in the object image; filter the connected domains whose area is smaller than a predetermined size and merge the connected domains whose spatial position is smaller than a predetermined distance to obtain the rust defect area in the object image.

[0017] In some embodiments of the present application, the other item defect types include non-standard defect types, and the other defect information includes non-standard defect information; the other detection units include non-standard detection units, which are used to: use non-standard defect detection logic to perform defect detection processing on the item image to obtain non-standard defect information corresponding to the non-standard defect type.

[0018] In some embodiments of the present application, the non-standard defect information includes a non-standard defect area; the non-standard detection unit is used to: perform feature extraction on the object image to obtain an object image feature map; perform target detection based on the object image feature map to obtain an alternative mark area in the object image; perform target detection on the alternative mark area in the object image to output a target mark area in the object image; perform classification processing on the target mark area in the object image based on metric learning to obtain a non-standard defect area in the target mark area.

[0019] In some embodiments of the present application, the analysis module includes: an integrated analysis unit, used to perform integrated analysis based on at least two types of item defect information to determine the item defect information to be filtered; an information determination unit, used to filter the item defect information to be filtered from the at least two types of item defect information to obtain filtered item defect information; and a result generation unit, used to generate a defect detection result of the item to be detected based on the filtered deformation defect information.

[0020] In some embodiments of the present application, the at least two types of item defect information include deformation defect information and breach defect information, the deformation defect information includes a deformation defect area, and the breach defect information includes a breach defect area; the integration analysis unit is used to: calculate the intersection-and-union ratio of the breach defect area and the deformation defect area to obtain a first intersection-and-union ratio; and determine the deformation defect information corresponding to the deformation defect area corresponding to the first intersection-and-union ratio greater than a first threshold as the item defect information to be filtered.

[0021] In some embodiments of the present application, the at least two types of item defect information include non-standard defect information and breach defect information, the non-standard defect information includes a non-standard defect area, and the breach defect information includes a breach defect area; the integrated analysis unit is used to: calculate the intersection and union ratio of the breach defect area and the non-standard defect area to obtain a second intersection and union ratio; and determine the non-standard defect information corresponding to the non-standard defect area corresponding to the second intersection and union ratio greater than a second threshold as the item defect information to be filtered.

[0022] In some embodiments of the present application, the integrated analysis unit is used to: obtain the confidence of the item defect information corresponding to the same image area; and determine the item defect information to be filtered according to the confidence.

[0023] In some embodiments of the present application, the analysis module includes: a component identification unit, used to perform component identification processing on the object image to obtain a component identification result of the component included in the object to be inspected; and a result generation unit, used to obtain a defect detection result of the object to be inspected based on the at least two types of object defect information and the component identification result.

[0024] In some embodiments of the present application, the component recognition result includes a component area and a component type; the component recognition unit is used to: segment the object image to obtain at least one pre-segmented pixel area, each pre-segmented pixel area corresponds to a component type; based on the pre-segmented pixel area corresponding to each of the component types, calculate the average pixel features corresponding to each of the component types; calculate the contribution score of the average pixel features corresponding to each of the component types to the current pixel point in the object image; for each current pixel point, perform weighted averaging of the contribution score and the average pixel features corresponding to each of the component types to obtain context feature information of each current pixel point; classify the pixels according to the context feature information of each current pixel point to obtain at least one component area, each component area corresponds to a component type.

[0025] In some embodiments of the present application, the result generating unit is used to: filter the false detection information in the at least two types of item defect information according to the component identification result to obtain the target item defect information; and generate the defect detection result of the item to be inspected based on the target item defect information.

[0026] According to another embodiment of the present application, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of a computer, the computer executes the method described in the embodiment of the present application.

[0027] According to another embodiment of the present application, an electronic device includes: a memory storing a computer program; and a processor reading the computer program stored in the memory to execute the method described in the embodiment of the present application.

[0028] According to another embodiment of the present application, a computer program product or a computer program includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations described in the embodiments of the present application.

[0029] In an embodiment of the present application, an object image of an object to be inspected is obtained; defect detection processing is performed on the object image using at least two defect detection logics to obtain at least two types of object defect information, wherein the at least two defect detection logics are logics corresponding to different defect detection algorithms, and the different defect detection algorithms are used to detect different defect types, and each type of object defect information corresponds to one defect type; based on the at least two types of object defect information, a defect detection result of the object to be inspected is obtained.

[0030] In this way, at least two defect detection logics corresponding to different defect detection algorithms are used to perform defect detection processing on the object image according to the corresponding defect types, which can effectively consider the detection characteristics of different defect types, and use appropriate defect detection logic to detect at least two object defect information of different defect types. Finally, the defect detection result is obtained based on at least two object defect information of different defect types, thereby realizing overall defect detection of the object. Compared with manual detection or a single detection method of a single neural network, the accuracy of the defect detection result is effectively improved, thereby effectively improving the accuracy of object defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0032] Figure 1 A schematic diagram of a system to which an embodiment of the present application can be applied is shown.

[0033] Figure 2 A flow chart of a method for detecting object defects according to an embodiment of the present application is shown.

[0034] Figure 3 A flow chart of performing defect detection on an object image according to an embodiment of the present application is shown.

[0035] Figure 4 A flow chart for obtaining defect detection results according to an embodiment of the present application is shown.

[0036] Figure 5 A flow chart for obtaining defect detection results according to another embodiment of the present application is shown.

[0037] Figure 6 A system architecture diagram for performing defect detection on containers in a scenario is shown.

[0038] Figure 7 A flow chart showing a scenario in which the aforementioned embodiment of the present application is used to perform defect detection on a container.

[0039] Figure 8 Show Figure 7 Schematic diagram of camera deployment in the scenario.

[0040] Fig. 9 A flow chart of deformation defect detection according to an embodiment of the present application is shown.

[0041] Fig.10 A deformation defect detection result diagram of an example of the present application is shown.

[0042] Fig.11 A deformation defect detection result diagram of another example of the present application is shown.

[0043] Fig.12 A defect detection network structure diagram according to an embodiment of the present application is shown.

[0044] Fig.13 A diagram showing the crack defect detection result of an example of the present application is shown.

[0045] Fig.14 A graph showing a corrosion defect detection result of an example of the present application is shown.

[0046] Fig.15 A non-standard defect detection result diagram of an example of the present application is shown.

[0047] Fig.16 A component area detection result diagram of an example of the present application is shown.

[0048] Fig.17 A component area detection result diagram of another example of the present application is shown.

[0049] Fig.18 A visualization result diagram of defect detection results of a container panel image in an example of the present application is shown.

[0050] Fig.19 A block diagram of an object defect detection device according to an embodiment of the present application is shown.

[0051] Fig. 20 A block diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0053] It is understandable that in the specific implementation of the present application, data related to object images, user information, etc. are involved. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0054] Figure 1 FIG. 1 is a schematic diagram showing a system 100 to which an embodiment of the present application can be applied. Figure 1 As shown, the system 100 may include a server 101 and a terminal 102 .

[0055] Server 101 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. In one implementation of this example, server 101 is a cloud server, and server 101 can provide artificial intelligence cloud services, such as artificial intelligence cloud services for large item defect detection.

[0056] The terminal 102 may be any device, including but not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, VR / AR devices, smart watches, computers, etc. In one embodiment, the server 101 or the terminal 102 may be a node device in a blockchain network or a map vehicle networking platform.

[0057] In one implementation of this example, the server 101 or the terminal 102 may: obtain an object image of the object to be inspected; perform defect detection processing on the object image using at least two defect detection logics to obtain at least two types of object defect information, wherein the at least two defect detection logics are logics corresponding to different defect detection algorithms, the different defect detection algorithms are used to detect different defect types, and each type of object defect information corresponds to one defect type; and obtain a defect detection result of the object to be inspected based on the at least two types of object defect information.

[0058] Figure 2 The flowchart of the method for detecting object defects according to an embodiment of the present application is schematically shown. The execution subject of the method for detecting object defects can be any device, such as Figure 1 The server 101 or the terminal 102 is shown.

[0059] like Figure 2 As shown, the object defect detection method may include steps S210 to S230.

[0060] Step S210, obtaining an image of the object to be detected;

[0061] Step S220, using at least two defect detection logics to perform defect detection processing on the object image to obtain at least two types of object defect information, wherein the at least two defect detection logics are logics corresponding to different defect detection algorithms, and different defect detection algorithms are used to detect different defect types, and each type of object defect information corresponds to one defect type;

[0062] Step S230: obtaining a defect detection result of the object to be detected according to at least two types of object defect information.

[0063] The object to be inspected is the object to be inspected for defects, such as a container. The object image is the image of the object to be inspected, for example, the container object image may be a panel image of the top panel, front side, rear side, left side and right side of the container. The object image may be obtained in a specified manner, for example, obtaining a pre-collected object image from a predetermined storage location or receiving an object image taken in real time for the object to be inspected.

[0064] At least two defect detection logics are algorithm logics corresponding to different defect detection algorithms. Different defect detection algorithms are used to detect different defect types. Each item defect information corresponds to one defect type, that is, item defect information of one defect type can be detected under each defect detection logic.

[0065] For example, defect types may include deformation defect types and other defect types. Using at least two defect detection logics to perform defect detection processing on the object image to obtain at least two types of object defect information may include: using deformation defect detection logic to perform defect detection processing on the object image to obtain deformation defect information corresponding to the deformation defect type; using other object defect detection logics to perform defect detection processing on the object image to obtain other defect information corresponding to other object defect types.

[0066] After obtaining item defect information of at least two defect types, an integrated analysis may be performed based on the at least two item defect information to obtain a defect detection result of the item to be detected.

[0067] In this way, based on steps S210 to S230, at least two defect detection logics corresponding to different defect detection algorithms are used to perform defect detection processing on the object image corresponding to the defect type, respectively. The detection characteristics of different defect types can be effectively considered, and at least two object defect information of different defect types can be detected using appropriate defect detection logic. Finally, a defect detection result is obtained based on at least two object defect information of different defect types, thereby realizing overall defect detection of the object. Compared with manual detection or a single detection method of a single neural network, the accuracy of the defect detection result is effectively improved, thereby effectively improving the accuracy of object defect detection.

[0068] Described below Figure 1 There are other specific optional embodiments of the steps performed when the defect detection of an object is performed in the embodiment.

[0069] In one embodiment, Figure 3As shown, the defect types include deformation defect types and other item defect types; the at least two item defect information include deformation defect information and other defect information; step S220, using at least two defect detection logics to perform defect detection processing on the item image respectively, and obtaining at least two item defect information, including: step S310, using the deformation defect detection logic to perform defect detection processing on the item image, and obtaining deformation defect information corresponding to the deformation defect type; step S320, using other item defect detection logics to perform defect detection processing on the item image, and obtaining other defect information corresponding to other item defect types.

[0070] In this embodiment, defect types include deformation defect types and other item defect types. The deformation defect detection logic is the algorithm logic corresponding to the deformation defect detection algorithm. The other item defect detection logic is the algorithm logic corresponding to the other item defect detection algorithm. The deformation defect detection algorithm and the other item defect detection algorithm are different algorithms, which are used to detect deformation defect types and other item defect types respectively.

[0071] The deformation defect information detected by the deformation defect detection logic is the defect information of the deformation defect, such as the deformation defect area and the deformation defect degree information, etc. Other defect information can be detected by using other object defect detection logic, such as crack defect information or rust defect information, etc.

[0072] In this way, overall defect detection of the object is achieved from at least two perspectives: deformation defect type and other object defect types.

[0073] In one embodiment, the deformation defect information includes a deformation defect area; step S310, using deformation defect detection logic to perform defect detection processing on the object image to obtain deformation defect information corresponding to the deformation defect type, including:

[0074] A total feature map is extracted based on the object image, and a board background feature map and a candidate deformation feature map are extracted based on the total feature map; the board background feature map is pooled to obtain global features of the board and background in different dimensions; the global features are weighted fusion transformed to obtain an attention weight vector; the attention weight vector is dot-multiplied with the deformation feature map to obtain a target deformation feature map; the deformation defect area in the object image is segmented based on the target deformation feature map.

[0075] In this embodiment, a multi-branch image segmentation algorithm is designed for the deformation defect type to implement a deformation defect detection logic suitable for the deformation defect type. The deformation defect area can be accurately detected by using the deformation defect detection logic.

[0076] First, for the object image, the overall image features can be extracted through the image feature extraction network to obtain the overall feature map, wherein, optionally, the image feature extraction network can be a high-resolution network. Then, the overall feature map outputs the segmentation result of the deformation defect area through two branches and the attention mechanism.

[0077] Specifically, in the first branch, a board background feature map that can describe the layout and background information can be extracted based on the total feature map through the board background feature extraction network. In the second branch, a candidate deformation feature map that can describe the deformation information can be extracted based on the total feature map through the deformation feature extraction network. Further, an attention mechanism is used to generate a target deformation feature map, specifically: the board background feature map is pooled to obtain global features of different dimensions about the board and background, wherein the board is the board of the object to be detected, and the background is the background part outside the board in the captured image, and the board background feature map is pooled by performing maximum pooling and average pooling on the board background feature map; the global features are weighted fused and transformed to obtain an attention weight vector, wherein the global features are weighted fused and transformed by a shared connection layer to obtain an attention weight vector; the attention weight vector is point-multiplied with the deformation feature map to obtain the target deformation feature map. By classifying the features in the target deformation feature map, each pixel in the object image is classified. The pixels of the same category and connected can be divided into the same deformation defect area, and then the segmentation result of the deformation defect area is divided in the object image.

[0078] In this way, the relevant features of the board surface and the background in the first branch are used to effectively enhance the board surface information in the candidate deformation feature map in the second branch, and the background similar features are effectively suppressed, so as to effectively promote deformation detection and further effectively improve the detection accuracy of deformation defect areas.

[0079] In one embodiment, the deformation defect information also includes deformation defect degree information; and further includes: performing image classification processing on the deformation defect area to obtain deformation defect degree information corresponding to the deformation defect area.

[0080] In this embodiment, the deformation defect area is further subjected to image classification processing through image classification to obtain deformation defect degree information corresponding to the deformation defect area. The deformation defect program information can describe the deformation degree size corresponding to the deformation defect area, for example, information describing mild, severe and severe. Among them, the deformation defect area can be subjected to image classification processing based on a pre-trained deformation degree classification algorithm based on a residual network to obtain deformation defect degree information corresponding to the deformation defect area. Furthermore, when training the deformation degree classification algorithm based on a residual network, a difficult example mining loss can be used, that is, deformation defect area samples whose classification loss is greater than a predetermined loss are selected as difficult examples to participate in training, which can improve image classification accuracy.

[0081] In one embodiment, other item defect types include crack defect types, and other defect information includes crack defect information; step S320, using other item defect detection logic to perform defect detection processing on the item image to obtain other defect information corresponding to other item defect types, including: using crack defect detection logic to perform defect detection processing on the item image to obtain crack defect information corresponding to the crack defect type.

[0082] In this embodiment, other item defect types include crack defect types, other defect information includes crack defect information, crack defect detection logic is the algorithm logic corresponding to the crack defect detection algorithm, and the crack defect detection algorithm is used to detect the crack defect type, wherein the crack defect is, for example, a hole or damage. In this way, the algorithm logic corresponding to the adaptive crack defect detection algorithm can be used for detection of the crack defect type, and the overall defect detection of the item can be achieved from at least two perspectives: the deformation defect type and the crack defect type.

[0083] In one implementation, the crack defect information includes a crack defect area; and the crack defect detection logic is used to perform defect detection processing on the object image to obtain the crack defect information corresponding to the crack defect type, including:

[0084] The object image is divided into at least one regional image; each regional image is linearly represented to obtain at least one regional feature map; at least one regional feature map is multi-head self-attention operated to obtain an attention feature map corresponding to each regional image; the attention feature map corresponding to at least one regional image is downsampled to generate a breach feature map; and the breach defect area in the object image is determined based on the breach feature map.

[0085] In this embodiment, for the crack defect type, a target detection algorithm is designed to implement a crack defect detection logic that is suitable for the crack defect type. The crack defect area can be accurately detected by using the crack defect detection logic.

[0086] The breach defect detection logic can be composed of Fig.12 The defect detection network structure shown is executed as follows: First, the object image is divided into several regions in the region partition layer (Patch Partition) to obtain at least one region image, and each region corresponds to a region image. Then, each region image is linearly represented in the linear representation layer (Liner Embedding) to obtain at least one region feature map, and each region image corresponds to a region feature map. Then, at least one region feature map is multi-head self-attention operated in the attention module (Transformer Block) to obtain an attention feature map corresponding to each region image. Specifically, at least one region feature map can be normalized in the normalization layer (LayerNorm) in the attention module (Transformer Block) to obtain at least one normalized feature map, and at least one normalized feature map is multi-head self-attention operated in the multi-head self-attention layer (multi head self attention) in the attention module (Transformer Block) to obtain an attention feature map corresponding to each normalized feature map, that is, an attention feature map corresponding to each region image is obtained. Then, the attention feature map corresponding to at least one regional image is downsampled to merge the attention feature maps to generate a crack feature map; the crack defect category information may at least include board crack, board surface bad repair, corner piece crack, internal hole, bottom floor crack, floor crack, air vent crack, rubber strip crack, rubber strip loose and rubber strip missing; wherein, referring to Fig.12 , down-sampling the attention feature map corresponding to at least one regional image, and generating the step of the crack feature map, can be further executed in a loop: merging the attention feature maps of adjacent regional images in the regional merging layer (Patch Merging) to obtain at least one merged feature map, normalizing at least one merged feature map in the normalization layer (LayerNorm) in the attention module (Transformer Block) to obtain at least one normalized feature map, and performing multi-head self-attention operation on at least one normalized feature map in the multi-head self-attention layer (multihead self attention) in the attention module (Transformer Block) to obtain the attention feature map corresponding to each normalized feature map; until the loop is executed for a predetermined number of times, the attention feature map output in the attention module (TransformerBlock) is used as the crack feature map. Finally, the generated crack feature map can be classified by selecting a candidate matrix through a candidate box to determine whether the candidate box is a crack defect and the specific crack defect category information, and then, the crack defect area is divided in the object image by the candidate box corresponding to the crack defect.

[0087] In one embodiment, other item defect types include rust defect types, and other defect information includes rust defect information; step S320, using other item defect detection logic to perform defect detection processing on the item image to obtain other defect information corresponding to other item defects, including: using rust defect detection logic to perform defect detection processing on the item image to obtain rust defect information corresponding to the rust defect type.

[0088] In this embodiment, other item defect types include corrosion defect types, other defect information includes corrosion defect information, corrosion defect detection logic is the algorithm logic corresponding to the corrosion defect detection algorithm, and the corrosion defect detection algorithm is used to detect the corrosion defect type, wherein the corrosion defect is the defect of the item to be detected being corroded and rusted. In this way, the algorithm logic corresponding to the adaptive corrosion defect detection algorithm can be used for detection of the corrosion defect type, and the overall defect detection of the item can be achieved from at least two perspectives of deformation defect type and corrosion defect type.

[0089] In one embodiment, the rust defect information includes a rust defect area; a rust defect detection logic is used to perform defect detection processing on an object image to obtain rust defect information corresponding to the rust defect type, including: performing image segmentation processing on the object image to obtain a pixel-level segmentation result of the rust area; solving a connected domain for the pixel-level segmentation result to obtain a rust defect area in the object image.

[0090] In this embodiment, based on the image segmentation technology, a feature map can be extracted for the object image, and based on the classification of the features in the feature map, the pixels in the object image are classified to obtain the category of the pixels, and then the pixel-level segmentation result of the rust area is obtained, and then the connected domain is solved for this pixel-level segmentation result, and the pixels of the same category and connected are divided into the same area, so that the rust defect area in the object image can be accurately obtained. Furthermore, in some embodiments, the coordinate representation of each rust defect area in the object image can also be obtained, and the rust defect information can include the coordinate representation.

[0091] In one method, a pre-trained fully convolutional network (FCN) can be used to perform image segmentation on the object image to obtain pixel-level segmentation results of the rusted area, and solve the connected domain of the pixel-level segmentation results to obtain the rust defect area in the object image. The applicant has found that the use of a fully convolutional network (FCN) can effectively detect rust defects and obtain rust defect areas.

[0092] Among them, in the stage of training the fully convolutional network (FCN), a variety of data augmentation methods (such as image resolution transformation, small range angle rotation, image compression rate transformation, image blur degree transformation, etc.) can be performed on the training set images. Network training based on the augmented images can enhance the generalization ability of the network under the condition of limited data. When training the network, the cross entropy loss function can be used to measure the difference between the real annotation mask (i.e., the annotated rust defect area) of the image pre-calibrated and the predicted mask (i.e., the predicted rust defect area) of the fully convolutional network (FCN), and the network is continuously adjusted according to the difference until the training conditions are met; further, the predicted rust defect area can be given a larger loss weight than the background area (the area outside the predicted rust defect area in the image). For example, the loss weight of the rust defect area and the background area is set to 10:1. Since the predicted rust defect area is smaller than the background area, a larger loss weight is given to the predicted rust defect area, which can improve the network's detection effect on the rust defect area.

[0093] In one embodiment, a connected domain is solved for the pixel-level segmentation result to obtain a rust defect area in the object image, including: solving a connected domain for the pixel-level segmentation result to obtain a connected domain in the object image; filtering connected domains whose areas are smaller than a predetermined size and merging connected domains whose spatial positions are smaller than a predetermined distance to obtain a rust defect area in the object image.

[0094] Filtering the connected domains whose areas are smaller than a predetermined size and merging the connected domains whose spatial positions are smaller than a predetermined distance to form a corrosion defect region can further avoid false detection and further generate an accurate corrosion defect region.

[0095] In one embodiment, other item defect types include non-standard defect types, and other defect information includes non-standard defect information; other item defect detection logic is used to perform defect detection processing on item images to obtain other defect information corresponding to other item defects, including: non-standard defect detection logic is used to perform defect detection processing on item images to obtain non-standard defect information corresponding to non-standard defect types.

[0096] In this embodiment, other item defect types include non-standard defect types, other defect information includes non-standard defect information, non-standard defect detection logic is the algorithm logic corresponding to the non-standard defect detection algorithm, and the non-standard defect detection algorithm is used to detect non-standard defect types, wherein non-standard defects are defects formed by non-standard content in the signs on the items (such as dangerous goods signs, stickers, tapes, etc. that are not original signs of the container), wherein the signs on the items may include nameplates and labels in addition to non-standard. In this way, adaptive non-standard defect detection logic can be used for detection of non-standard defect types, and overall defect detection of items can be achieved at least from the two perspectives of deformation defect types and non-standard defect types.

[0097] In one embodiment, the non-standard defect information includes a non-standard defect area; a non-standard defect detection logic is used to perform defect detection processing on an object image to obtain non-standard defect information corresponding to a non-standard defect type, including: extracting features from the object image to obtain an object image feature map; performing target detection based on the object image feature map to obtain an alternative mark area in the object image; performing target detection on the alternative mark area in the object image to output a target mark area in the object image; and classifying the target mark area in the object image based on metric learning to obtain a non-standard defect area in the target mark area.

[0098] In this embodiment, for non-standard defect types, a two-stage target detection algorithm and a classification method based on metric learning are designed to implement a non-standard defect detection logic adapted to the non-standard defect types. The non-standard defect detection logic can accurately detect non-standard defect areas.

[0099] In the first stage, feature extraction is performed on the item image to obtain an item image feature map, and the regional features are located by selecting candidate boxes and classifying the regional features to achieve target detection, and the candidate mark area that may contain the target (i.e., mark) is classified; in the second stage, the regional feature map corresponding to the candidate mark area is located by selecting candidate boxes and classifying the regional features to achieve further target detection, which can more accurately classify and locate the target (i.e., mark) in the candidate mark area, and finally output the target mark area in each item image, which is the area corresponding to the detected mark. The two-stage target detection method can obtain a more accurate target mark area positioning effect compared to the single-stage method.

[0100] Specifically, the target detection network can be used to perform two-stage target detection in the first stage and the second stage. When training the target detection network, the target detection network can be used to perform two-stage target detection on the training image samples to output the prediction boxes of multiple target landmark areas and the prediction probabilities of the corresponding categories. The network loss is calculated based on the output results of the target detection network and the true labels of the training image samples, and the loss value is continuously back-propagated and the parameters of each layer of the target detection network are updated. After the training iteration converges, the trained target detection network is obtained.

[0101] Finally, based on metric learning, the similarity measurement of the target mark areas in the object image is performed, and similar target mark areas are divided into the same category, so that the target mark areas belonging to the non-standard category, namely the non-standard defect areas, are obtained.

[0102] Through two-stage target detection, the target mark area corresponding to all marks (such as nameplates, standards, and non-standards) in the object image is located. It is impossible to determine whether the target mark area is a non-standard defect area corresponding to the non-standard. The detected target mark area is further classified based on the metric learning method to determine the non-standard defect area. Specifically, a target classification network can be used to measure the similarity of the target mark area based on the metric learning method. At the same time, the target mark area is classified, and a preset loss function is used to shorten the distance between similar target mark areas and increase the distance between target mark areas of different categories. Similar target mark areas are divided into the same category to obtain target mark areas belonging to the non-standard category, that is, non-standard defect areas. Compared with the method of directly classifying the target mark area, the classification accuracy is greatly improved. Among them, in one method, the preset loss function can be a TripletLoss loss function, which is defined as:

[0103]

[0104] Among them, f(x) represents the nonlinear function represented by the network structure of the target classification network, represents the current sample (i.e. the current target mark area), Representation and Positive samples belonging to the same category (i.e., positive target landmark regions), Representation and Negative samples of different categories (i.e., negative target mark areas), α is a constant greater than 0, indicating the classification boundary. The larger the value of α, the more confident the target classification network is in distinguishing relatively similar target mark areas.

[0105] In one embodiment, Figure 4 As shown, step S230, obtaining a defect detection result of the object to be detected according to at least two types of object defect information, includes:

[0106] Step S410, performing integrated analysis based on at least two types of item defect information to determine the item defect information to be filtered; step S420, filtering the item defect information to be filtered from at least two types of item defect information to obtain filtered item defect information; step S430, generating a defect detection result of the item to be detected based on the filtered deformation defect information.

[0107] The defect information of the item to be filtered is the defect information that needs to be filtered. For example, the defect information of the item to be filtered may be defect information with characteristics such as invalidity or abnormal detection. Based on the integrated analysis of the at least two types of item defect information, the defect information of the item to be filtered can be combined with the defect information of items with different defect types to accurately determine the defect information of the item to be filtered. After filtering the defect information of the item to be filtered to obtain the filtered item defect information, the defect detection result of the item to be detected can be further accurately generated based on the filtered deformation defect information.

[0108] In one embodiment, at least two types of item defect information include deformation defect information and breach defect information, the deformation defect information includes a deformation defect area, and the breach defect information includes a breach defect area; step S410, performing integrated analysis based on at least two types of item defect information to determine the item defect information to be filtered, including: calculating an intersection-and-union ratio of the breach defect area and the deformation defect area to obtain a first intersection-and-union ratio; determining the deformation defect information corresponding to the deformation defect area corresponding to the first intersection-and-union ratio greater than a first threshold as the item defect information to be filtered.

[0109] The intersection-and-union ratio is calculated for the tear defect area and the deformation defect area of ​​each object image to obtain a first intersection-and-union ratio. The deformation defect area corresponding to the first intersection-and-union ratio greater than the first threshold is likely to be caused by severe deformation. The first threshold can be set according to actual conditions. In an example, the first threshold is 0.5. The deformation defect information corresponding to the deformation defect area corresponding to the first intersection-and-union ratio greater than the first threshold is determined as the defect information of the object to be filtered, and the defect detection results of the deformation and tear defects of the object to be detected can be accurately generated based on the filtered object defect information.

[0110] In one embodiment, at least two types of item defect information include non-standard defect information and breach defect information, the non-standard defect information includes a non-standard defect area, and the breach defect information includes a breach defect area; step S410, performing integrated analysis based on at least two types of item defect information to determine the item defect information to be filtered, including: calculating the intersection and union ratio of the breach defect area and the non-standard defect area to obtain a second intersection and union ratio; determining the non-standard defect information corresponding to the non-standard defect area corresponding to the second intersection and union ratio greater than a second threshold as the item defect information to be filtered.

[0111] The intersection-and-union ratio is calculated for the crack defect area and the non-standard defect area of ​​each item image to obtain a second intersection-and-union ratio. The non-standard defect area corresponding to the second intersection-and-union ratio greater than the second threshold is likely to be caused by poor repair of the crack (for example, repair by covering with cloth, etc.). The second threshold can be set according to actual conditions. In one example, the second threshold is 0.5. The non-standard defect information corresponding to the non-standard defect area corresponding to the second intersection-and-union ratio greater than the second threshold is determined as the defect information of the item to be filtered, and the defect detection results of the non-standard and crack defects of the item to be detected can be accurately generated based on the defect information of the filtered item.

[0112] In one embodiment, an integrated analysis is performed based on at least two types of item defect information to determine the item defect information to be filtered, including: obtaining the confidence of the item defect information corresponding to the same image area; and determining the item defect information to be filtered based on the confidence.

[0113] The same image area on the image of the object may detect at least two types of defect information of the object. For example, the same image area may detect crack defect information and non-standard defect information. By obtaining the confidence of the object defect information corresponding to the same image area, the object defect information with the highest confidence or higher than a predetermined threshold can be determined as valid object defect information according to the confidence, and the object defect information other than the valid object defect information is the object defect information to be filtered. Based on the filtered object defect information, the overall defect detection result of the object to be detected can be further accurately generated. Among them, the way to obtain the confidence of the object defect information corresponding to the same image area can be by querying a preset confidence table or by scoring the object defect information in the same image area through a preset scoring model based on machine learning.

[0114] In one embodiment, Figure 5 As shown, step S230, based on at least two kinds of item defect information, obtains the defect detection result of the item to be detected, including: step S510, performing component recognition processing on the item image to obtain the component recognition result of the component included in the item to be detected; step S520, based on at least two kinds of item defect information and the component recognition result, obtains the defect detection result of the item to be detected. By combining the component recognition result and the item defect information, an accurate defect detection result can be further obtained.

[0115] In one embodiment, the component recognition result includes a component area and a component type; step S510, performing component recognition processing on the object image to obtain a component recognition result of the component included in the object to be detected, including: segmenting the object image to obtain at least one pre-segmented pixel area, each pre-segmented pixel area corresponds to a component type; based on the pre-segmented pixel area corresponding to each component type, calculating the average pixel feature corresponding to each component type; calculating the contribution score of the average pixel feature corresponding to each component type to the current pixel point in the object image; for each current pixel point, weighted averaging the contribution score corresponding to each component type and the average pixel feature to obtain context feature information of each current pixel point; classifying the pixels according to the context feature information of each current pixel point to obtain at least one component area, each component area corresponds to a component type.

[0116] In this embodiment, a context-based semantic segmentation algorithm is designed to implement a two-stage component detection logic for component regions and component types. The component detection logic can efficiently utilize the features of similar pixels to avoid mis-segmentation and accurately detect component regions and component types.

[0117] In the first stage, the object image is segmented to obtain a coarse-grained segmentation result, that is, at least one pre-segmented pixel region is obtained, each pre-segmented pixel region corresponds to a component type, wherein the object image can be segmented based on a common decoder to obtain at least one pre-segmented pixel region X. In the second stage, first, based on the pre-segmented pixel region X corresponding to each component type, the average pixel feature corresponding to each component type is calculated, wherein the formula can be used Calculate the average pixel feature f corresponding to the k-th component type based on the pre-segmented pixel area X k , represents the probability that pixel i belongs to the kth class; then, the contribution score of the average pixel feature corresponding to each component type to the current pixel in the object image is calculated. The current pixel i is the pixel i traversed in the object image. The formula can be used to Calculate the average pixel feature f corresponding to each component type k Contribution score w to the current pixel in the object image i,k , K represents the total number of component types, κ(x,f)=Φ(x) Τ Ψ(f), Φ and Ψ are preset functions; then, for each current pixel point, the contribution score w corresponding to each component type is i,k and the average pixel feature f k Perform weighted averaging to obtain the context feature information of each current pixel, where the formula can be used The contribution score w corresponding to each component type ki,k and the average pixel feature f k Perform weighted averaging to obtain the context feature information y of each current pixel i i , ρ and δ are both nonlinear functions represented by neural networks. Finally, according to the context feature information y of each current pixel i i Pixel points are classified and pixels of the same component type are divided into a region to obtain the final fine-grained segmentation result, that is, at least one component region is obtained, and each component region corresponds to a component type, where component types include plates, floors, corner columns, bottom beams, and corner pieces.

[0118] In one embodiment, step S520, based on at least two types of item defect information and component identification results, obtains a defect detection result of the item to be inspected, including: filtering false detection information in at least two types of item defect information based on the component identification results to obtain target item defect information; and generating a defect detection result of the item to be inspected based on the target item defect information.

[0119] According to the component recognition result, the false detection information in at least two types of item defect information can be filtered out to obtain the target item defect information. The false detection information is the wrong item defect information. Based on the target item defect information from which the false detection information is filtered out, the defect detection result of the item to be inspected can be further accurately generated.

[0120] Among them, the corresponding false detection information can be determined according to the component recognition result, and the false detection information table can be queried to determine the false detection information corresponding to the component recognition result. For example, for a component area whose component recognition result is a panel, the corresponding false detection information can be floor cracks, bottom floor cracks, rubber cracks, missing rubber, loose rubber, and other item defect information; for a component area whose component recognition result is a floor, the corresponding false detection information can be internal holes, rubber cracks, missing rubber, loose rubber, and other item defect information; for a component area whose component recognition result is a background, the corresponding false detection information can be all item defect information.

[0121] In some embodiments, defect detection results of the object to be inspected are generated based on the filtered deformation defect information, which may be the case where the filtered deformation defect information is displayed in a predetermined form (e.g., a table or other custom form, etc.) to generate corresponding defect detection results. In some embodiments, defect detection results of the object to be inspected are generated based on the target object defect information, which may be the case where the target object defect information is displayed in a predetermined form (e.g., a table or other custom form, etc.) to generate corresponding defect detection results. In some embodiments, the union of the filtered deformation defect information and the target object defect information is displayed in a predetermined form (e.g., a table or other custom form, etc.) to generate corresponding defect detection results. The defect detection results may be stored in a predetermined location (e.g., Figure 1The data is transmitted to the server 101 shown in the figure) or to a predetermined device, etc.

[0122] The following further describes the aforementioned embodiment in conjunction with a scenario in which defect detection is performed on a container. In this scenario, by applying the aforementioned embodiment of the present application to perform defect detection on a container, the defect detection accuracy of the container is effectively improved compared to the existing solution, and the detection efficiency is high, the safety is high, and the human resource consumption is low. In addition, the container defect information obtained by the defect detection can be used to determine the type of defective component based on the recognition result of the corresponding component area, so that the defect type (i.e., container damage type) and the defect detection results of the component type where the container damage occurs can be given at the same time, which can meet the container inspection specification requirements of the ISO standard.

[0123] Among them, the existing scheme mainly relies on full manual on-site inspection of the defect location, defect type and degree of the container body, taking photos and recording, and reporting to the system. On the one hand, this method requires the container to be transported to a designated place, which not only consumes transportation costs, but also reduces the efficiency and convenience of container inspection. The inspector needs to conduct a detailed defect inspection around the container as a whole, and sometimes even needs to climb onto the top plate of the container to perform the corresponding inspection operations. It can be seen that each inspection requires a lot of manpower. At the same time, the inspection working environment is relatively harsh and there are safety risks. Especially in the typhoon season, containers placed at high places are prone to falling and injuring people; on the other hand, the definition standards for different defect types in different areas of the container are extremely complex. For example, the deformation of the corner piece needs to meet conditions a1, b1, and c1, while the deformation of the corrugated plate needs to meet conditions a1 and c2. Unskilled inspectors do not have an accurate grasp of these rules, resulting in some false detections and missed detections, which sometimes lead to major safety accidents.

[0124] Figure 6 The following is a system architecture diagram for performing defect detection on containers in this scenario. Figure 7 The flowchart of applying the above-mentioned embodiment of the present application to perform defect detection on a container in this scenario is shown. In this scenario, the object to be detected is a container, the object image is a container panel image, and the object defect information is container defect information.

[0125] See also Figure 6 In this scenario, an automated system for defect detection of containers is used. The automated system consists of a camera, a container defect detection host, and a display. The camera and the container defect detection host are connected through a network switching device. The camera can be a security camera deployed at a port terminal / yard (such as a camera at a smart gate and a seaside / roadside quay crane) or a worker's handheld device. The container defect detection host can be a Figure 1In the server 101 shown, an AI algorithm system for defect analysis can be deployed in the container defect detection host. The display can be any display device, and the AI ​​management platform can report the defect detection results in the container defect detection host to the container management system and display them on the display.

[0126] See also Figure 7 In this scenario, the process of performing defect detection on a container using the aforementioned embodiment of the present application may include steps S610 to S620.

[0127] In step S610, input the collected image: take pictures through a security camera or a worker's handheld device to collect the container panel image of the container, and transmit the container panel image to the container defect detection host through a network switching device.

[0128] See also Figure 8 In one method of this scenario, four cameras are deployed in the intelligent tallying scenario and installed on the four beams of the quay crane / yard crane. At the same time, a trigger device of the acquisition system is installed at the gate. When the trigger device detects the arrival of a vehicle, it triggers the camera to collect container surface images of the top plate, front side, rear side, left side and right side of the container. In addition, users can also use handheld devices to take images of container surface images of any part of the container.

[0129] In step S620, item defect detection: the container defect detection host runs the forward reasoning process of the AI ​​algorithm system according to the container panel image to obtain the defect detection result. The defect detection result may be information including defect area, defect type (i.e. container damage type) and component information of the component where the defect (i.e. container damage) occurs (such as tables or pictures).

[0130] Step S620, obtaining a container panel image of the container; performing defect detection processing on the container panel image using at least two defect detection logics to obtain at least two types of container defect information, wherein the at least two defect detection logics are logics corresponding to different defect detection algorithms, and different defect detection algorithms are used to detect different defect types, and each type of container defect information corresponds to a defect type; obtaining a container defect detection result based on the at least two types of container defect information. Different defect types may at least include deformation defect types and other item defect types.

[0131] In step S620, at least two defect detection logics are used to perform defect detection processing on the container panel image to obtain at least two types of container defect information, which may specifically include: steps S621 to S625.

[0132] Step S621, deformation defect analysis: the defect type includes the deformation defect type, the container defect information includes the deformation defect information, and the deformation defect detection logic is used to perform defect detection processing on the container panel image to obtain the deformation defect information corresponding to the deformation defect type.

[0133] Among them, the deformation defect information includes the deformation defect area; the deformation defect detection logic is used to perform defect detection processing on the container panel image to obtain deformation defect information corresponding to the deformation defect type, including: extracting a total feature map based on the container panel image, and extracting a panel background feature map and a candidate deformation feature map based on the total feature map; performing pooling processing on the panel background feature map to obtain global features of the panel and background in different dimensions; performing weight fusion transformation processing on the global features to obtain an attention weight vector; performing dot multiplication of the attention weight vector and the deformation feature map to obtain a target deformation feature map; and segmenting the deformation defect area in the container panel image based on the target deformation feature map.

[0134] Specifically, see Fig. 9, design a multi-branch image segmentation algorithm to implement the deformation defect detection logic adapted to the deformation defect type, and use the deformation defect detection logic to accurately detect the deformation defect area. First, in step S710 feature extraction: for the container panel image, the overall picture features can be extracted through the image feature extraction network to obtain a total feature map, wherein, optionally, the image feature extraction network can be a high-resolution network. Then, the total feature map outputs the segmentation result of the deformation defect area through two branches and an attention mechanism. In the first branch, in step S720 panel branch feature extraction: the panel background feature map that can describe the layout and background information can be extracted based on the total feature map through the layout background feature extraction network. In the second branch, in step S730 deformation branch feature extraction: the candidate deformation feature map that can describe the deformation information can be extracted based on the total feature map through the deformation feature extraction network. Furthermore, in step S740, an attention mechanism is used to generate a target deformation feature map, specifically: pooling is performed on the panel background feature map to obtain global features of the panel and background in different dimensions, wherein the panel is the panel of the container, and the background is the background part outside the panel in the captured image. Pooling of the panel background feature map may be performed by maximum pooling and average pooling of the panel background feature map; weight fusion transformation is performed on the global features to obtain an attention weight vector, wherein weight fusion transformation of the global features may be performed by fusing the weights of the global features through a shared connection layer to obtain an attention weight vector; and the attention weight vector is dot-multiplied with the deformation feature map to obtain a target deformation feature map. In step S750, each pixel in the container panel image is classified by classifying the features in the target deformation feature map, and pixels of the same category and connected can be divided into the same deformation defect area, and then the segmentation result of the deformation defect area (i.e., the deformation area segmentation result) is obtained in the container panel image. See. Fig.10 , Fig.10 The deformation defect area detected in the container panel image on the left is as follows: Fig.10 Further, in step S760, each pixel in the container panel image can be classified by classifying the features in the panel background feature map, and the pixels of the same category and connected can be divided into the same area, and then the segmentation result of the panel and background area (i.e., the panel area segmentation result) can be obtained in the container panel image.

[0135] The deformation defect information also includes deformation defect degree information; and further includes: performing image classification processing on the deformation defect area to obtain deformation defect degree information corresponding to the deformation defect area. Specifically, the deformation defect area is subjected to image classification processing through image classification to obtain deformation defect degree information corresponding to the deformation defect area. The deformation defect program information can describe the deformation degree size corresponding to the deformation defect area, for example, information describing mild, severe and severe. Fig.11 , Fig.11 The deformation degree of the deformation defect area in the box in the container panel image is mild, moderate and severe from left to right. Among them, the deformation defect area can be image classified based on the pre-trained residual network-based deformation degree classification algorithm to obtain the deformation defect degree information corresponding to the deformation defect area. Furthermore, when training the residual network-based deformation degree classification algorithm, the difficult example mining loss can be used, that is, the deformation defect area samples with classification loss greater than the predetermined loss are selected as difficult examples to participate in the training, so as to improve the image classification accuracy.

[0136] Step S622, breach defect analysis: other item defect types include breach defect types, and other defect information includes breach defect information; other item defect detection logic is used to perform defect detection processing on the container panel image to obtain other defect information corresponding to other item defect types, including: using breach defect detection logic to perform defect detection processing on the container panel image to obtain breach defect information corresponding to the breach defect type.

[0137] The breach defect information includes the breach defect area; the breach defect detection logic is used to perform defect detection processing on the container panel image to obtain the breach defect information corresponding to the breach defect type, including: dividing the container panel image into at least one regional image; performing linear representation processing on each regional image to obtain at least one regional feature map; performing multi-head self-attention operation processing on at least one regional feature map to obtain an attention feature map corresponding to each regional image; down-sampling the attention feature map corresponding to at least one regional image to generate a breach feature map; and determining the breach defect area in the container panel image based on the breach feature map.

[0138] Specifically, the target detection algorithm is designed to implement the crack defect detection logic suitable for the crack defect type, and the crack defect detection logic can be used to accurately detect the crack defect area. The crack defect detection logic can be composed of Fig.12The defect detection network structure shown is executed as follows: First, the container panel image is divided into several regions in the region partition layer (Patch Partition) to obtain at least one region image, and each region corresponds to a region image. Then, each region image is linearly represented in the linear representation layer (Liner Embedding) to obtain at least one region feature map, and each region image corresponds to a region feature map. Then, at least one region feature map is multi-head self-attention operated in the attention module (Transformer Block) to obtain an attention feature map corresponding to each region image. Specifically, at least one region feature map can be normalized in the normalization layer (LayerNorm) in the attention module (Transformer Block) to obtain at least one normalized feature map, and at least one normalized feature map is multi-head self-attention operated in the multi-head self-attention layer (multi head self attention) in the attention module (Transformer Block) to obtain an attention feature map corresponding to each normalized feature map, that is, an attention feature map corresponding to each region image is obtained. Then, the attention feature map corresponding to at least one regional image is downsampled to merge the attention feature maps to generate a crack feature map; the crack defect category information may at least include board crack, board surface bad repair, corner piece crack, internal hole, bottom floor crack, floor crack, air vent crack, rubber strip crack, rubber strip loose and rubber strip missing; wherein, referring to Fig.12 , down-sampling the attention feature map corresponding to at least one regional image to generate a breach feature map, can be further executed in a loop: merging the attention feature maps of adjacent regional images in the regional merging layer (Patch Merging) to obtain at least one merged feature map, normalizing at least one merged feature map in the normalization layer (LayerNorm) in the attention module (Transformer Block) to obtain at least one normalized feature map, and performing multi-head self-attention operation on at least one normalized feature map in the multi-head self-attention layer (multi head self attention) in the attention module (Transformer Block) to obtain an attention feature map corresponding to each normalized feature map; until the loop is executed a predetermined number of times, the attention feature map output in the attention module (Transformer Block) is used as the breach feature map. Finally, the generated breach feature map can be classified by selecting a candidate matrix through a candidate box to determine whether the candidate box is a breach defect and the specific breach defect category information, and then, the breach defect area is divided in the container panel image by the candidate box corresponding to the breach defect. See Fig.13 ,right Fig.13By performing a connected domain analysis on the rupture defect area caused by holes in the container panel image, the maximum circumscribed rectangle of the area (black rectangular frame) can be obtained. By performing a connected domain analysis on the rupture defect area caused by damage, the maximum circumscribed rectangle of the area (white rectangular frame) can be obtained.

[0139] Step S623, corrosion defect analysis: other item defect types include corrosion defect types, and other defect information includes corrosion defect information; other item defect detection logic is used to perform defect detection processing on the container panel image to obtain other defect information corresponding to other item defects, including: using corrosion defect detection logic to perform defect detection processing on the container panel image to obtain corrosion defect information corresponding to the corrosion defect type.

[0140] Among them, the corrosion defect information includes the corrosion defect area; the corrosion defect detection logic is used to perform defect detection processing on the container panel image to obtain the corrosion defect information corresponding to the corrosion defect type, including: performing image segmentation processing on the container panel image to obtain the pixel-level segmentation result of the corrosion area; solving the connected domain of the pixel-level segmentation result to obtain the corrosion defect area in the container panel image.

[0141] Specifically, based on the image segmentation technology, a feature map can be extracted for the container panel image, and based on the classification of the features in the feature map, the pixels in the container panel image are classified to obtain the category of the pixels, and then the pixel-level segmentation result of the rusted area is obtained, and then the connected domain is solved for this pixel-level segmentation result, and the pixels of the same category and connected are divided into the same area, so that the rust defect area in the container panel image can be accurately obtained. Further, the coordinate representation of each rust defect area in the container panel image can also be obtained, and the rust defect information can include the coordinate representation. Specifically, a pre-trained fully convolutional network (FCN) can be used: the container panel image is subjected to image segmentation processing to obtain the pixel-level segmentation result of the rusted area, and the connected domain is solved for the pixel-level segmentation result to obtain the rust defect area in the container panel image. The applicant has found that the use of a fully convolutional network (FCN) can be excellent for detecting rust defects and obtaining rust defect areas. In the stage of training the Fully Convolutional Network (FCN), a variety of data augmentation methods (such as image resolution transformation, small-range angle rotation, image compression rate transformation, image blur degree transformation, etc.) can be performed on the training set images. Network training based on the augmented images can enhance the generalization ability of the network under limited data. When training the network, the cross entropy loss function can be used to measure the difference between the real annotation mask (i.e., the annotated rust defect area) of the image and the predicted mask (i.e., the predicted rust defect area) of the image by the Fully Convolutional Network (FCN). According to the difference, the network is continuously adjusted until the training conditions are met; further, the predicted rust defect area can be given a larger loss weight than the background area (the area outside the predicted rust defect area in the image). For example, the loss weight of the rust defect area and the background area is set to 10:1. Since the predicted rust defect area is smaller than the background area, a larger loss weight is given to the predicted rust defect area, which can improve the network's detection effect on the rust defect area.

[0142] Among them, solving the connected domain for the pixel-level segmentation result to obtain the rust defect area in the container panel image can further include: solving the connected domain for the pixel-level segmentation result to obtain the connected domain in the container panel image; filtering the connected domains with an area smaller than a predetermined size and merging the connected domains with a spatial position smaller than a predetermined distance to obtain the rust defect area in the container panel image.

[0143] See also Fig.14 , Fig.14The circle in the container plate image shows the location result of the rust defect area.

[0144] Step S624, non-standard defect analysis: other item defect types include non-standard defect types, and other defect information includes non-standard defect information; other item defect detection logic is used to perform defect detection processing on the container panel image to obtain other defect information corresponding to other item defects, including: non-standard defect detection logic is used to perform defect detection processing on the container panel image to obtain non-standard defect information corresponding to non-standard defect types.

[0145] Among them, the non-standard defect information includes non-standard defect areas; non-standard defect detection logic is used to perform defect detection processing on the container panel image to obtain non-standard defect information corresponding to the non-standard defect type, including: feature extraction of the container panel image to obtain a container panel image feature map; target detection is performed based on the container panel image feature map to obtain an alternative mark area in the container panel image; target detection is performed on the alternative mark area in the container panel image to output the target mark area in the container panel image; and classification processing is performed on the target mark area in the container panel image based on metric learning to obtain a non-standard defect area in the target mark area.

[0146] Specifically, a two-stage target detection algorithm and a classification method based on metric learning are designed to implement a non-standard defect detection logic that is suitable for non-standard defect types. The non-standard defect area can be accurately detected using this non-standard defect detection logic.

[0147] In the first stage, the container panel image is feature extracted to obtain the container panel image feature map, and the regional features are located by selecting the candidate box and classifying the regional features to achieve target detection, and the candidate mark area that may contain the target (i.e., the mark) is classified; in the second stage, the regional feature map corresponding to the candidate mark area is located by selecting the candidate box and classifying the regional features to achieve further target detection, which can more accurately classify and locate the target (i.e., the mark) in the candidate mark area, and finally output the target mark area in each container panel image, which is the area corresponding to the detected mark. The two-stage target detection method can obtain a more accurate target mark area positioning effect compared to the single-stage method. Specifically, the target detection network is used to perform two-stage target detection in the first and second stages. Among them, when training the target detection network, the target detection network can be used to perform two-stage target detection on the training image samples to output the prediction boxes of multiple target landmark areas and the prediction probabilities of the corresponding categories. The network loss is calculated based on the output results of the target detection network and the true labels of the training image samples. The loss value is continuously back-propagated and the parameters of each layer of the target detection network are updated. After the training iteration converges, the trained target detection network is obtained.

[0148] Finally, based on metric learning, the target mark area in the container panel image is similarly measured, and similar target mark areas are divided into the same category to obtain target mark areas belonging to the non-standard category, that is, non-standard defect areas. Through two-stage target detection, the target mark area corresponding to all marks (such as nameplates, standards, and non-standards) in the container panel image is located. It is impossible to determine whether the target mark area is a non-standard defect area corresponding to the non-standard. The detected target mark area is further classified based on the metric learning method to determine the non-standard defect area. Specifically, a target classification network can be used to measure the similarity of the target mark area based on the metric learning method. At the same time, the target mark area is classified, and a preset loss function is used to shorten the distance between similar target mark areas and increase the distance between target mark areas of different categories. Similar target mark areas are divided into the same category to obtain target mark areas belonging to the non-standard category, that is, non-standard defect areas. Compared with the method of directly classifying the target mark area, the classification accuracy is greatly improved. Among them, in one method, the preset loss function can be a TripletLoss loss function, which is defined as: Where f(x) represents the nonlinear function represented by the network structure of the target classification network. represents the current sample (i.e. the current target mark area), Representation and Positive samples belonging to the same category (i.e., positive target landmark regions), Representation and Negative samples of different categories (i.e., negative target mark areas), α is a constant greater than 0, indicating the classification boundary. The larger the value of α, the more confident the target classification network is in distinguishing relatively similar target mark areas.

[0149] See also Fig.15 , Fig.15 The detection results of the non-standard defect area framed in the container panel image.

[0150] Step S625, component recognition: performing component recognition processing on the container panel image to obtain component recognition results of the components included in the container.

[0151] Among them, the component recognition result includes the component area and the component type; the component recognition processing is performed on the container panel image to obtain the component recognition result of the components included in the container, including: segmenting the container panel image to obtain at least one pre-segmented pixel area, each pre-segmented pixel area corresponds to a component type; based on the pre-segmented pixel area corresponding to each component type, the average pixel feature corresponding to each component type is calculated; the contribution score of the average pixel feature corresponding to each component type to the current pixel point in the container panel image is calculated; for each current pixel point, the contribution score and the average pixel feature corresponding to each component type are weighted averaged to obtain the context feature information of each current pixel point; the pixels are classified according to the context feature information of each current pixel point to obtain at least one component area, each component area corresponds to a component type.

[0152] Specifically, a context-based semantic segmentation algorithm is designed to implement a two-stage component detection logic of component area and component type. This component detection logic can efficiently utilize the features of similar pixels to avoid mis-segmentation and accurately detect component areas and component types.

[0153] In the first stage, the container panel image is segmented to obtain a coarse-grained segmentation result, that is, at least one pre-segmented pixel area is obtained, each pre-segmented pixel area corresponds to a component type, wherein the container panel image can be segmented based on a common decoder to obtain at least one pre-segmented pixel area X. In the second stage, first, based on the pre-segmented pixel area X corresponding to each component type, the average pixel feature corresponding to each component type is calculated, wherein the formula can be used Calculate the average pixel feature f corresponding to the k-th component type based on the pre-segmented pixel area X k , represents the probability that pixel i belongs to the kth class; then, the contribution score of the average pixel feature corresponding to each component type to the current pixel in the container panel image is calculated. The current pixel i is the pixel i traversed in the container panel image. The formula can be used to Calculate the average pixel feature f corresponding to each component type k Contribution score w to the current pixel in the container surface image i,k , K represents the total number of component types, κ(x,f)=Φ(x) T Ψ(f), Φ and Ψ are preset functions; then, for each current pixel point, the contribution score w corresponding to each component type is i,k and the average pixel feature f k Perform weighted averaging to obtain the context feature information of each current pixel, where the formula can be used The contribution score w corresponding to each component type ki,k and the average pixel feature f k Perform weighted averaging to obtain the context feature information y of each current pixel i i , ρ and δ are both nonlinear functions represented by neural networks. Finally, according to the context feature information y of each current pixel i i Pixel points are classified and pixels of the same component type are divided into a region to obtain the final fine-grained segmentation result, that is, at least one component region is obtained, and each component region corresponds to a component type, where component types include plates, floors, corner columns, bottom beams, and corner pieces.

[0154] See also Fig.16 , Fig.16 The component area detection results of the container panel image on the left are as follows: Fig.16 As shown in the image on the right, different colored areas correspond to different component types. Fig.17 , Fig.17 The component area detection results of the container panel image on the right are as follows: Fig.17 As shown in the image on the left, different color areas correspond to different component types.

[0155] Step S626, defect integration analysis: obtaining a defect detection result of the container based on at least two types of container defect information.

[0156] Wherein, obtaining the defect detection result of the container according to at least two types of container defect information may include:

[0157] (1) performing integrated analysis based on at least two types of container defect information to determine the container defect information to be filtered; filtering the container defect information to be filtered from the at least two types of container defect information to obtain filtered container defect information.

[0158] (2) Calculating the intersection-and-union ratio of the breach defect area and the deformation defect area to obtain a first intersection-and-union ratio; and determining the deformation defect information corresponding to the deformation defect area corresponding to the first intersection-and-union ratio greater than a first threshold as the container defect information to be filtered.

[0159] (3) Calculating the intersection-and-union ratio of the breach defect area and the non-standard defect area to obtain a second intersection-and-union ratio; and determining the non-standard defect information corresponding to the non-standard defect area corresponding to the second intersection-and-union ratio greater than a second threshold as the container defect information to be filtered.

[0160] (4) Obtaining the confidence level of the container defect information corresponding to the same image area; and determining the container defect information to be filtered according to the confidence level.

[0161] (5) Obtaining a defect detection result of the container based on at least two types of container defect information and component identification results. Obtaining a defect detection result of the container based on at least two types of container defect information and component identification results includes: filtering false detection information in at least two types of container defect information based on the component identification results to obtain target container defect information.

[0162] (6) Generate a defect detection result of the container based on the target container defect information, and generate a defect detection result of the container based on the filtered deformation defect information.

[0163] Generating the defect detection result of the container based on the filtered deformation defect information may be to generate the corresponding defect detection result according to a predetermined presentation form (e.g., a table form or other custom forms, etc.) of the filtered deformation defect information. Generating the defect detection result of the container based on the target container defect information may be to generate the corresponding defect detection result according to a predetermined presentation form (e.g., a table form or other custom forms, etc.) of the target container defect information. Further, the union of the filtered deformation defect information and the target container defect information may be generated according to a predetermined presentation form (e.g., a table form or other custom forms, etc.) to generate the corresponding defect detection result. The defect detection result may include information such as defect category, defect location (e.g., location of the defect area), type of defective component, and defect confidence.

[0164] See also Fig.18 , showing the visualization results of defect detection results of container panel images in an example. The container panel images are taken by mobile phones. The upper left picture shows the original image of the input container panel image, the upper right picture shows the component recognition results (the component types are all container inner panels), the middle left picture shows the deformation defect detection result, which is no deformation (nodeform), the middle right picture shows the crack defect detection result and the rust defect detection result, which are no cracks and rust (no brco), the lower left picture shows the non-standard detection result (the boxed area is the detected non-standard), and the lower right picture shows the relevant information of the audit form. The specific information can be specified according to actual needs.

[0165] Among them, the defect detection results can be saved in a predetermined location (for example Figure 1 The defect detection result can be sent to the client system through a network service, and the client pushes it to the relevant terminal device through the internal system. The defect detection result of each container can be stored in association with the unique identification information of the container (such as name or number, etc.), and the user can view the defect detection result of the container through the unique identification information.

[0166] In order to facilitate better implementation of the object defect detection method provided in the embodiment of the present application, the embodiment of the present application also provides an object defect detection device based on the above-mentioned object defect detection method. The meanings of the terms are the same as those in the above-mentioned object defect detection method, and the specific implementation details can refer to the description in the method embodiment. Fig.19 A block diagram of an object defect detection device according to an embodiment of the present application is shown.

[0167] like Fig.19 As shown, the object defect detection device 800 may include an acquisition module 810 , a detection module 820 and an analysis module 830 .

[0168] The acquisition module 810 can be used to acquire an object image of an object to be inspected; the detection module 820 can be used to perform defect detection processing on the object image using at least two defect detection logics to obtain at least two types of object defect information, wherein the at least two defect detection logics are logics corresponding to different defect detection algorithms, and the different defect detection algorithms are used to detect different defect types, and each type of object defect information corresponds to one defect type; the analysis module 830 can be used to obtain the defect detection result of the object to be inspected based on the at least two types of object defect information.

[0169] In some embodiments of the present application, the defect type includes a deformation defect type and other item defect types; the at least two types of item defect information include deformation defect information and other defect information; the detection module includes: a deformation detection unit, which is used to perform defect detection processing on the item image using a deformation defect detection logic to obtain deformation defect information corresponding to the deformation defect type; other detection units, which are used to perform defect detection processing on the item image using other item defect detection logics to obtain other defect information corresponding to other item defect types.

[0170] In some embodiments of the present application, the deformation defect information includes a deformation defect area; the deformation detection unit is used to: extract a total feature map based on the object image, and extract a board background feature map and a candidate deformation feature map based on the total feature map; perform pooling processing on the board background feature map to obtain global features of different dimensions about the board and background; perform weight fusion transformation processing on the global features to obtain an attention weight vector; perform dot multiplication of the attention weight vector and the deformation feature map to obtain a target deformation feature map; and segment the deformation defect area in the object image based on the target deformation feature map.

[0171] In some embodiments of the present application, the deformation defect information also includes deformation defect degree information; the deformation detection unit is used to: perform image classification processing on the deformation defect area to obtain the deformation defect degree information corresponding to the deformation defect area.

[0172] In some embodiments of the present application, the other item defect types include a crack defect type, and the other defect information includes crack defect information; the other detection units include a crack detection unit, which is used to: use a crack defect detection logic to perform defect detection processing on the item image to obtain crack defect information corresponding to the crack defect type.

[0173] In some embodiments of the present application, the gap defect information includes a gap defect area; the gap detection unit is used to: segment the object image into at least one area image; perform linear representation processing on each of the area images to obtain at least one area feature map; perform multi-head self-attention operation processing on the at least one area feature map to obtain an attention feature map corresponding to each of the area images; downsample the attention feature map corresponding to at least one of the area images to generate a gap feature map; and determine the gap defect area in the object image based on the gap feature map.

[0174] In some embodiments of the present application, the other item defect types include rust defect types, and the other defect information includes rust defect information; the other detection units include a rust detection unit, which is used to: use rust defect detection logic to perform defect detection processing on the item image to obtain rust defect information corresponding to the rust defect type.

[0175] In some embodiments of the present application, the rust defect information includes a rust defect area; the rust detection unit is used to: perform image segmentation processing on the object image to obtain a pixel-level segmentation result of the rust area; and solve the connected domain of the pixel-level segmentation result to obtain the rust defect area in the object image.

[0176] In some embodiments of the present application, the rust detection unit is used to: solve the connected domain for the pixel-level segmentation result to obtain the connected domain in the object image; filter the connected domains whose area is smaller than a predetermined size and merge the connected domains whose spatial position is smaller than a predetermined distance to obtain the rust defect area in the object image.

[0177] In some embodiments of the present application, the other item defect types include non-standard defect types, and the other defect information includes non-standard defect information; the other detection units include non-standard detection units, which are used to: use non-standard defect detection logic to perform defect detection processing on the item image to obtain non-standard defect information corresponding to the non-standard defect type.

[0178] In some embodiments of the present application, the non-standard defect information includes a non-standard defect area; the non-standard detection unit is used to: perform feature extraction on the object image to obtain an object image feature map; perform target detection based on the object image feature map to obtain an alternative mark area in the object image; perform target detection on the alternative mark area in the object image to output a target mark area in the object image; perform classification processing on the target mark area in the object image based on metric learning to obtain a non-standard defect area in the target mark area.

[0179] In some embodiments of the present application, the analysis module includes: an integrated analysis unit, used to perform integrated analysis based on at least two types of item defect information to determine the item defect information to be filtered; an information determination unit, used to filter the item defect information to be filtered from the at least two types of item defect information to obtain filtered item defect information; and a result generation unit, used to generate a defect detection result of the item to be detected based on the filtered deformation defect information.

[0180] In some embodiments of the present application, the at least two types of item defect information include deformation defect information and breach defect information, the deformation defect information includes a deformation defect area, and the breach defect information includes a breach defect area; the integration analysis unit is used to: calculate the intersection-and-union ratio of the breach defect area and the deformation defect area to obtain a first intersection-and-union ratio; and determine the deformation defect information corresponding to the deformation defect area corresponding to the first intersection-and-union ratio greater than a first threshold as the item defect information to be filtered.

[0181] In some embodiments of the present application, the at least two types of item defect information include non-standard defect information and breach defect information, the non-standard defect information includes a non-standard defect area, and the breach defect information includes a breach defect area; the integrated analysis unit is used to: calculate the intersection and union ratio of the breach defect area and the non-standard defect area to obtain a second intersection and union ratio; and determine the non-standard defect information corresponding to the non-standard defect area corresponding to the second intersection and union ratio greater than a second threshold as the item defect information to be filtered.

[0182] In some embodiments of the present application, the integrated analysis unit is used to: obtain the confidence of the item defect information corresponding to the same image area; and determine the item defect information to be filtered according to the confidence.

[0183] In some embodiments of the present application, the analysis module includes: a component identification unit, used to perform component identification processing on the object image to obtain a component identification result of the component included in the object to be inspected; and a result generation unit, used to obtain a defect detection result of the object to be inspected based on the at least two types of object defect information and the component identification result.

[0184] In some embodiments of the present application, the component recognition result includes a component area and a component type; the component recognition unit is used to: segment the object image to obtain at least one pre-segmented pixel area, each pre-segmented pixel area corresponds to a component type; based on the pre-segmented pixel area corresponding to each of the component types, calculate the average pixel features corresponding to each of the component types; calculate the contribution score of the average pixel features corresponding to each of the component types to the current pixel point in the object image; for each current pixel point, perform weighted averaging of the contribution score and the average pixel features corresponding to each of the component types to obtain context feature information of each current pixel point; classify the pixels according to the context feature information of each current pixel point to obtain at least one component area, each component area corresponds to a component type.

[0185] In some embodiments of the present application, the result generating unit is used to: filter the false detection information in the at least two types of item defect information according to the component identification result to obtain the target item defect information; and generate the defect detection result of the item to be inspected based on the target item defect information.

[0186] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0187] In addition, an embodiment of the present application further provides an electronic device, which may be a terminal or a server. Fig. 20 As shown, it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application, specifically:

[0188] The electronic device may include components such as a processor 901 with one or more processing cores, a memory 902 with one or more computer-readable storage media, a power supply 903, and an input unit 904. Those skilled in the art will appreciate that Fig. 20 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0189] The processor 901 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 902, and calling data stored in the memory 902, it executes various functions of the computer device and processes data, thereby detecting the electronic device. Optionally, the processor 901 may include one or more processing cores; preferably, the processor 901 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user pages and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 901.

[0190] The memory 902 can be used to store software programs and modules. The processor 901 executes various functional applications and data processing by running the software programs and modules stored in the memory 902. The memory 902 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 902 may also include a memory controller to provide the processor 901 with access to the memory 902.

[0191] The electronic device also includes a power supply 903 for supplying power to each component. Preferably, the power supply 903 can be logically connected to the processor 901 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 903 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0192] The electronic device may further include an input unit 904, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0193] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 901 in the electronic device will load the executable files corresponding to the processes of one or more computer programs into the memory 902 according to the following instructions, and the processor 901 will run the computer programs stored in the memory 902, thereby realizing the various functions of the aforementioned embodiments of the present application.

[0194] For example, the processor 901 may execute: obtaining an image of an object to be inspected; performing defect detection processing on the object image using at least two defect detection logics to obtain at least two types of object defect information, wherein the at least two defect detection logics are logics corresponding to different defect detection algorithms, the different defect detection algorithms are used to detect different defect types, and each type of object defect information corresponds to one defect type; and obtaining a defect detection result of the object to be inspected based on the at least two types of object defect information.

[0195] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0196] To this end, an embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any method provided in the embodiment of the present application.

[0197] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0198] Since the computer program stored in the computer-readable storage medium can execute the steps in any method provided in the embodiments of the present application, the beneficial effects that can be achieved by the method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0199] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations in the above embodiments of the present application.

[0200] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0201] It should be understood that the present application is not limited to the embodiments that have been described above and shown in the accompanying drawings, but various modifications and changes may be made without departing from the scope thereof.

Claims

1. A method for detecting defects in an article, characterized in that: include: Acquire an object image of the object to be detected; At least two defect detection logics are used to perform defect detection processing on the item image to obtain at least two types of item defect information, wherein the at least two defect detection logics are logics corresponding to different defect detection algorithms, the different defect detection algorithms are used to detect different defect types, and each type of item defect information corresponds to one of the defect types; the defect types include deformation defect types and other item defect types; the other item defect types include crack defect types, rust defect types, and non-standard defect types; The at least two types of item defect information include deformation defect information and other defect information; the other defect information includes crack defect information, corrosion defect information and non-standard defect information; The adopting at least two defect detection logics to respectively perform defect detection processing on the item image to obtain at least two types of item defect information includes: adopting deformation defect detection logic to perform defect detection processing on the item image to obtain deformation defect information corresponding to the deformation defect type; adopting other item defect detection logic to perform defect detection processing on the item image to obtain other defect information corresponding to other item defect types; The adopting other object defect detection logic to perform defect detection processing on the object image to obtain other defect information corresponding to other object defect types includes: Using crack defect detection logic to perform defect detection processing on the object image to obtain crack defect information corresponding to the crack defect type; Using corrosion defect detection logic to perform defect detection processing on the object image to obtain corrosion defect information corresponding to the corrosion defect type; Using non-standard defect detection logic to perform defect detection processing on the object image to obtain non-standard defect information corresponding to the non-standard defect type; Obtaining a defect detection result of the object to be detected according to the at least two types of object defect information; The obtaining the defect detection result of the to-be-detected object according to the at least two kinds of object defect information comprises: performing integrated analysis according to the at least two kinds of object defect information to determine the to-be-filtered object defect information; filtering the to-be-filtered object defect information from the at least two kinds of object defect information to obtain filtered object defect information; and generating the defect detection result of the to-be-detected object based on the filtered object defect information; The at least two types of item defect information include: deformation defect information, crack defect information, and non-standard defect information; the deformation defect information includes a deformation defect area, the crack defect information includes a crack defect area, and the non-standard defect information includes a non-standard defect area; performing integrated analysis based on the at least two types of item defect information to determine the item defect information to be filtered includes: Calculate the intersection-and-union ratio of the breach defect area and the deformation defect area to obtain a first intersection-and-union ratio; determine the deformation defect information corresponding to the deformation defect area corresponding to the first intersection-and-union ratio greater than a first threshold as the defect information of the item to be filtered; or Calculate the intersection-and-union ratio of the breach defect area and the non-standard defect area to obtain a second intersection-and-union ratio; determine the non-standard defect information corresponding to the non-standard defect area corresponding to the second intersection-and-union ratio greater than a second threshold as the defect information of the item to be filtered; or Obtaining the confidence of the item defect information corresponding to the same image area; determining the item defect information to be filtered according to the confidence, including: if at least two types of item defect information correspond to the same image area, obtaining the confidence of the item defect information of each defect type, and determining the item defect information with the highest confidence or the confidence higher than a predetermined threshold as the valid item defect information, and the item defect information other than the valid item defect information is the item defect information to be filtered.

2. The method according to claim 1, characterized in that The deformation defect information includes a deformation defect area; the deformation defect detection logic is used to perform defect detection processing on the object image to obtain deformation defect information corresponding to the deformation defect type, including: Extracting a total feature map based on the object image, and extracting a board background feature map and a candidate deformation feature map based on the total feature map; Performing pooling processing on the board surface background feature map to obtain global features of the board surface and background in different dimensions; Performing weight fusion transformation processing on the global features to obtain an attention weight vector; Performing a dot multiplication of the attention weight vector and the deformation feature map to obtain a target deformation feature map; The deformation defect area in the object image is segmented based on the target deformation feature map.

3. The method according to claim 1, characterized in that: The deformation defect information also includes deformation defect degree information; the method also includes: Image classification processing is performed on the deformation defect area to obtain deformation defect degree information corresponding to the deformation defect area.

4. The method according to claim 1, characterized in that: The crack defect information includes a crack defect area; the crack defect detection logic is used to perform defect detection processing on the object image to obtain the crack defect information corresponding to the crack defect type, including: Segmenting the object image into at least one region image; Performing linear characterization processing on each of the regional images to obtain at least one regional feature map; Performing a multi-head self-attention operation on the at least one regional feature map to obtain an attention feature map corresponding to each of the regional images; Downsampling the attention feature map corresponding to at least one of the regional images to generate a breach feature map; A crack defect area in the object image is determined based on the crack feature map.

5. The method according to claim 1, characterized in that The rust defect information includes a rust defect area; The method of performing defect detection processing on the object image by using the corrosion defect detection logic to obtain corrosion defect information corresponding to the corrosion defect type includes: Performing image segmentation processing on the object image to obtain a pixel-level segmentation result of the rusted area; The connected domain is solved for the pixel-level segmentation result to obtain the rust defect area in the object image.

6. The method according to claim 5, characterized in that Solving the connected domain for the pixel-level segmentation result to obtain the rust defect area in the object image includes: Solving the connected domain for the pixel-level segmentation result to obtain the connected domain in the object image; Connected domains with an area smaller than a predetermined size are filtered and connected domains with a spatial position smaller than a predetermined distance are merged to obtain the rust defect area in the object image.

7. The method according to claim 1, characterized in that The non-standard defect information includes a non-standard defect area; The adopting non-standard defect detection logic to perform defect detection processing on the object image to obtain non-standard defect information corresponding to the non-standard defect type includes: Extracting features from the object image to obtain an object image feature map; Performing target detection based on the feature map of the object image to obtain a candidate landmark region in the object image; Performing target detection on the candidate mark area in the object image to output the target mark area in the object image; The target mark area in the object image is classified based on metric learning to obtain a non-mark defect area in the target mark area.

8. The method according to claim 1, wherein obtaining the defect detection result of the object to be detected according to the at least two types of object defect information comprises: Performing component recognition processing on the object image to obtain component recognition results of the components included in the object to be detected; A defect detection result of the object to be detected is obtained according to the at least two types of object defect information and the component identification result.

9. The method according to claim 8, characterized in that The component recognition result includes a component area and a component type; the component recognition processing is performed on the object image to obtain a component recognition result of the component included in the object to be detected, including: Segmenting the object image to obtain at least one pre-segmented pixel region, each pre-segmented pixel region corresponding to a component type; Based on the pre-segmented pixel area corresponding to each of the component types, calculating the average pixel feature corresponding to each of the component types; Calculate the contribution score of the average pixel feature corresponding to each component type to the current pixel point in the object image; For each current pixel, weighted average the contribution score and average pixel feature corresponding to each component type to obtain context feature information of each current pixel; Pixels are classified according to context feature information of each current pixel to obtain at least one component region, where each component region corresponds to a component type.

10. The method according to claim 8, characterized in that The obtaining the defect detection result of the object to be detected according to the at least two types of object defect information and the component identification result includes: filtering the false detection information in the at least two types of item defect information according to the component recognition result to obtain the target item defect information; A defect detection result of the object to be detected is generated based on the target object defect information.

11. An article defect detection device, characterized in that: include: An acquisition module, used for acquiring an image of an object to be detected; A detection module, used to perform defect detection processing on the item image using at least two defect detection logics to obtain at least two types of item defect information, wherein the at least two defect detection logics are logics corresponding to different defect detection algorithms, the different defect detection algorithms are used to detect different defect types, and each type of item defect information corresponds to one of the defect types; the defect types include deformation defect types and other item defect types; the other item defect types include crack defect types, rust defect types, and non-standard defect types; The at least two types of item defect information include deformation defect information and other defect information; the other defect information includes crack defect information, corrosion defect information and non-standard defect information; The detection module is specifically used to perform defect detection processing on the object image using deformation defect detection logic to obtain deformation defect information corresponding to the deformation defect type; and to perform defect detection processing on the object image using other object defect detection logic to obtain other defect information corresponding to other object defect types; the detection module is specifically used to: Using crack defect detection logic to perform defect detection processing on the object image to obtain crack defect information corresponding to the crack defect type; Using corrosion defect detection logic to perform defect detection processing on the object image to obtain corrosion defect information corresponding to the corrosion defect type; Using non-standard defect detection logic to perform defect detection processing on the object image to obtain non-standard defect information corresponding to the non-standard defect type; An analysis module is used to obtain a defect detection result of the item to be detected according to the at least two types of item defect information; the analysis module is specifically used to: perform integrated analysis according to the at least two types of item defect information to determine the item defect information to be filtered; filter the item defect information to be filtered from the at least two types of item defect information to obtain filtered item defect information; generate the defect detection result of the item to be detected based on the filtered item defect information; The at least two types of item defect information include: deformation defect information, crack defect information, and non-standard defect information; the deformation defect information includes a deformation defect area, the crack defect information includes a crack defect area, and the non-standard defect information includes a non-standard defect area; performing integrated analysis based on the at least two types of item defect information to determine the item defect information to be filtered includes: Calculate the intersection-and-union ratio of the breach defect area and the deformation defect area to obtain a first intersection-and-union ratio; determine the deformation defect information corresponding to the deformation defect area corresponding to the first intersection-and-union ratio greater than a first threshold as the defect information of the item to be filtered; or Calculate the intersection-and-union ratio of the breach defect area and the non-standard defect area to obtain a second intersection-and-union ratio; determine the non-standard defect information corresponding to the non-standard defect area corresponding to the second intersection-and-union ratio greater than a second threshold as the defect information of the item to be filtered; or Obtaining the confidence of the item defect information corresponding to the same image area; determining the item defect information to be filtered according to the confidence, including: if at least two types of item defect information correspond to the same image area, obtaining the confidence of the item defect information of each defect type, and determining the item defect information with the highest confidence or the confidence higher than a predetermined threshold as the valid item defect information, and the item defect information other than the valid item defect information is the item defect information to be filtered.

12. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • A method and an apparatus for generating information

    CN109165572A

  • Wood board deformation detection method and system based on deep learning and 3D point cloud data

    CN113674204A

  • Defect detection method and related apparatus, device, storage medium, and computer program product

    WO2022036953A1