Three-dimensional industrial anomaly detection method and apparatus, storage medium, and electronic device

By combining the feature fusion of RGB images and three-dimensional point cloud images, the problem of unused three-dimensional shape information in the existing technology is solved, the accuracy and performance of industrial anomaly detection are improved, and the cost of manual annotation and quality inspection is reduced.

WO2024179409A9PCT designated stage expired Publication Date: 2024-10-24TENCENT TECH SHANGHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/078580
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-02
Filing Date
2024-02-26
Publication Date
2024-10-24

AI Technical Summary

Technical Problem

Existing industrial anomaly detection methods are based on two-dimensional images and are difficult to effectively utilize three-dimensional shape information, resulting in poor detection performance and low accuracy of detection results. Especially in the case of multi-modal input, feature interference is serious, affecting detection accuracy.

Method used

The three-dimensional industrial anomaly detection method is used to obtain RGB images and three-dimensional point cloud images, perform preprocessing and feature extraction, generate point cloud feature maps and RGB features, and perform feature fusion through multi-layer perceptrons to improve feature interactivity and reduce high-dimensionality Feature interference to achieve more accurate anomaly prediction.

Benefits of technology

It improves the detection performance and accuracy of detection results, reduces manual annotation and quality inspection costs, and carries out preliminary screening in an unsupervised manner, reducing the burden of manual quality inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024078580_24102024_PF_FP_ABST
    Figure CN2024078580_24102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a three-dimensional industrial anomaly detection method and apparatus, a storage medium, and an electronic device. The method comprises: preprocessing a three-dimensional point cloud map of an object to be detected, to obtain a plurality of point cloud groups; performing feature extraction on the plurality of point cloud groups by means of a first feature extractor to obtain point cloud feature groups, generating a point cloud feature map according to the point cloud feature groups and the three-dimensional point cloud map, and projecting the point cloud feature map to form a point cloud projection map with the same size as an RGB image of said object; performing feature extraction on the RGB image by means of a second feature extractor to obtain RGB features; respectively performing feature extraction on the RGB features and point cloud features of the point cloud projection map by means of a multi-layer perceptron, and fusing feature information output by the multi-layer perceptron to obtain a fused feature; and performing anomaly prediction on said object according to the RGB features, the point cloud features and the fused feature to obtain a prediction result of said object. According to the present application, industrial anomalies can be preliminarily screened, and the labor cost of industrial quality inspection is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Three-dimensional industrial anomaly detection method, device, storage medium and electronic equipment

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 2, 2023, application number 202310194447.6, and application name “Three-dimensional industrial anomaly detection method, device, storage medium and electronic device”, all contents of which are incorporated by reference into this application. Technical Field

[0002] The present application belongs to the field of anomaly detection technology, and specifically relates to three-dimensional industrial anomaly detection technology. Background Art

[0003] Industrial anomaly detection aims to detect abnormal areas of products and plays an important role in industrial quality inspection.

[0004] In the quality inspection of industrial products, inspectors use both 3D shape and color features to determine whether it is a defective product. 3D shape information is very important and necessary for correct detection. However, existing industrial anomaly detection methods are mostly based on 2D images. Multimodal industrial anomaly detection based on 3D point clouds and RGB images still has many untouched areas, which leads to poor detection performance and poor accuracy of detection results.

[0005] Summary of the Invention

[0006] The purpose of this application is to provide a three-dimensional industrial anomaly detection method, device, storage medium and electronic equipment, which can overcome the problems of poor detection performance and poor accuracy of detection results in multimodal industrial anomaly detection in related technologies.

[0007] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.

[0008] According to one aspect of an embodiment of the present application, a three-dimensional industrial anomaly detection method is provided, which is executed by an electronic device and includes: obtaining an RGB image and a three-dimensional point cloud map of an object to be detected, and preprocessing the three-dimensional point cloud map to obtain multiple point cloud groups; performing feature extraction on the multiple point cloud groups by a first feature extractor to obtain point cloud feature groups of the multiple point cloud groups, generating a point cloud feature map based on the point cloud feature groups and the three-dimensional point cloud map, and projecting the point cloud feature map to form a point cloud projection map of the same size as the RGB image; performing feature extraction on the RGB image by a second feature extractor to obtain RGB features of the RGB image; performing feature extraction on the RGB features and the point cloud features of the point cloud projection map respectively by a multilayer perceptron, and fusing the feature information output by the multilayer perceptron to obtain fused features; performing anomaly prediction on the object to be detected based on the RGB features, the point cloud features, and the fused features to obtain a prediction result of the object to be detected.

[0009] According to one aspect of an embodiment of the present application, a three-dimensional industrial anomaly detection device is provided, which is deployed on an electronic device and includes: a preprocessing module for acquiring an RGB image and a three-dimensional point cloud map of an object to be detected, and preprocessing the three-dimensional point cloud map to obtain multiple point cloud groups; a registration module for performing feature extraction on the multiple point cloud groups through a first feature extractor to obtain point cloud feature groups of the multiple point cloud groups, generating a point cloud feature map based on the point cloud feature groups and the three-dimensional point cloud map, and projecting the point cloud feature map to form a point cloud projection map of the same size as the RGB image; performing feature extraction on the RGB image through a second feature extractor to obtain RGB features of the RGB image; a fusion module for performing feature extraction on the RGB features and the point cloud features of the point cloud projection map respectively through a multilayer perceptron, and fusing the feature information output by the multilayer perceptron to obtain fused features; and a decision module for performing anomaly prediction on the object to be detected based on the RGB features, the point cloud features, and the fused features to obtain a prediction result of the object to be detected.

[0010] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the three-dimensional industrial anomaly detection method in the above technical solution is implemented.

[0011] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing a computer program of the processor; wherein the processor is configured to execute the three-dimensional industrial anomaly detection method as in the above technical solution by executing the computer program.

[0012] According to one aspect of an embodiment of the present application, a computer program product is provided, which includes a computer program. When the computer program is run on a computer, the computer executes the three-dimensional industrial anomaly detection method as in the above technical solution.

[0013] The three-dimensional industrial anomaly detection method provided by the embodiment of the present application obtains the RGB image and the three-dimensional point cloud map of the object to be detected, first pre-processes the three-dimensional point cloud map to obtain multiple point cloud groups; then uses a first feature extractor to extract features from the multiple point cloud groups to obtain point cloud feature groups, generates a point cloud feature map based on the point cloud feature groups and the three-dimensional point cloud map, and projects the point cloud feature map to form a point cloud projection map of the same size as the RGB image; at the same time, uses a second feature extractor to extract features from the RGB image to obtain RGB features; then uses a multi-layer perceptron to extract features from the RGB features and the point cloud features of the point cloud projection map, respectively, and fuses the feature information output by the multi-layer perceptron to obtain fused features; finally, anomaly prediction is performed on the object to be detected based on the RGB features, point cloud features, and fused features to obtain a prediction result of the object to be detected. On the one hand, the present application can perform multimodal industrial anomaly detection based on three-dimensional point cloud maps and RGB images, and by fusing RGB features and point cloud features, it improves the interactivity between features and reduces the mutual interference between high-dimensional features. In this way, when anomaly prediction is performed on the object to be detected based on RGB features, point cloud features and fusion features, a more accurate prediction result can be obtained, thereby improving the detection performance and the accuracy of the detection results. On the other hand, the present application adopts an unsupervised form, and no manual labeling is required before detecting anomalies, thereby reducing the cost of manual labeling, and by adopting the technical solution of the present application for initial screening of industrial anomalies, the cost of manual quality inspection can be reduced.

[0014] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort.

[0016] FIG1 schematically shows a schematic diagram of the structure of a system architecture for applying a three-dimensional industrial anomaly detection method according to an embodiment of the present application;

[0017] FIG2 schematically shows a flow chart of the steps of a three-dimensional industrial anomaly detection method according to an embodiment of the present application;

[0018] FIG3 schematically shows a flow chart of projecting and generating a point cloud projection image in an embodiment of the present application;

[0019] FIG4 schematically shows a structural diagram of a three-dimensional industrial anomaly detection system in an embodiment of the present application;

[0020] FIG5 schematically shows a flow chart of anomaly detection for a cable gland using a three-dimensional industrial anomaly detection system in an embodiment of the present application;

[0021] FIG6 schematically shows an abnormality representation map and an abnormality location map determined after abnormality detection is performed on various objects to be detected in an embodiment of the present application;

[0022] FIG7 schematically shows a flow chart of an unsupervised training feature fusion module in an embodiment of the present application;

[0023] FIG8 schematically shows a block diagram of a three-dimensional industrial anomaly detection device according to an embodiment of the present application;

[0024] FIG9 schematically shows a block diagram of a computer system structure of an electronic device suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION

[0025] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.

[0026] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0027] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0028] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0029] In the related art of this application, in industrial scenarios, it is easy to obtain a large number of normal instances, but it is difficult to obtain defective instances. Most current industrial anomaly detection methods are unsupervised methods, that is, they only train on normal instances and only test on detection instances during the inference process.

[0030] Most of the industrial anomaly detection methods offered by related technologies are based on two-dimensional images, leaving much untapped ground for multimodal industrial anomaly detection based on three-dimensional point clouds and RGB images. However, in the quality inspection of industrial products, inspectors use both three-dimensional shape and color features to determine whether a product is defective, with three-dimensional shape information being crucial and essential for accurate detection. While some multimodal industrial anomaly detection methods exist in the related art, these methods directly concatenate multimodal features. This can lead to strong interference between features when the feature dimensions are high, compromising detection performance.

[0031] The core idea of ​​unsupervised anomaly detection is to find the difference between anomaly and normal representations. Current industrial anomaly detection methods can be divided into two categories: reconstruction-based methods and pre-trained feature extractor-based methods. When using reconstruction-based methods for industrial anomaly detection, for single-modal input (2D images or 3D point clouds), reconstruction-based methods are easy to implement, but for multimodal input, it is difficult to find a reconstruction target. When using pre-trained feature extractor-based methods for industrial anomaly detection, the extracted features are mapped to a normal distribution, and the feature that exceeds the distribution is found as an anomaly point. Compared with reconstruction-based methods, since the pre-trained feature extractor does not need to be retrained, directly using the pre-trained feature extractor does not involve the design of a multimodal reconstruction target, making it a better choice for multimodal tasks.

[0032] In response to the relevant technologies in this field, the embodiment of the present application proposes a three-dimensional industrial anomaly detection method, which is a multimodal industrial anomaly detection method. In this application, a pre-trained feature extractor is used for industrial anomaly detection to improve the accuracy of industrial anomalies and abnormal area positioning.

[0033] Before describing the three-dimensional industrial anomaly detection method in this application in detail, the technical terms that may be involved in this application are first explained.

[0034] 1. Anomaly detection: In data mining, it refers to the identification of items, events, or observations that do not match the expected pattern or other items in the data set.

[0035] 2. Point cloud: A collection of point data on the product surface obtained through measuring instruments in reverse engineering.

[0036] 3. Farthest Point Sampling: Farthest Point Sampling is a commonly used sampling algorithm used to uniformly sample M points on a point cloud of N points so that these points can better represent the overall outline of the point cloud.

[0037] 4. Inverse Distance Weighted Interpolation: A commonly used and simple spatial interpolation method, it uses the distance between the interpolation point and the sample point as the weight for weighted averaging. The closer the sample point is to the interpolation point, the greater the weight is assigned.

[0038] 5. One-Class Support Vector Machine: One-Class SVM, also known as one-class support vector machine, has only one type of training samples, either positive samples or negative samples. It calculates a hypersphere with the smallest radius among the training samples and contains all test samples inside this hypersphere. When this hypersphere is used to classify the test set, the samples falling inside the hypersphere are the first class, and the samples falling outside the hypersphere are the second class.

[0039] Next, an exemplary system architecture applying the technical solution of this application is described.

[0040] FIG1 schematically shows a block diagram of an exemplary system architecture applying the technical solution of the present application.

[0041] As shown in Figure 1, the system architecture 100 may include a terminal device 101, a server 102, and a network 103. The terminal device 101 may be any electronic device having both a display screen and a camera unit, such as a smartphone, tablet computer, laptop computer, smart TV, or smart car terminal. In addition, the terminal device 101 may also include an electronic device having a display screen and a camera connected to the electronic device. The server 102 may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. The network 103 may be a communication medium of various connection types capable of providing a communication link between the terminal device 101 and the server 102, such as a wired communication link or a wireless communication link.

[0042] Depending on the implementation requirements, the system architecture in the embodiments of the present application can have any number of terminal devices, networks, and servers. For example, the server can be a server group consisting of multiple server devices. In addition, the technical solutions provided in the embodiments of the present application can be applied to the terminal device 101.

[0043] In one embodiment of the present application, an object to be detected is photographed by a photographing device or a photographing unit to obtain an RGB image and an initial point cloud map of the object to be detected. The photographed RGB image and the initial point cloud map can then be sent to an electronic device with a display screen in the terminal device 101, and the electronic device can send the RGB image and the initial point cloud map to the server 102 via the network 103. For the initial point cloud map, the server 102 can only retain the point coordinate information therein to form a three-dimensional point cloud map. The three-dimensional point cloud map can then be pre-processed to obtain multiple point cloud groups corresponding to the three-dimensional point cloud map through farthest point sampling and nearest neighbor sampling. All point cloud groups are then encoded by a first feature extractor to obtain point cloud feature groups. Finally, the point cloud feature groups are interpolated back to the three-dimensional point cloud map to generate a point cloud feature map, and the point cloud feature map is projected to form a point cloud projection map of the same size as the RGB image. For the RGB image, the server 102 can input it into a second feature extractor for encoding to obtain RGB features. Next, in server 102, the RGB features and the point cloud features in the point cloud projection image can be input into a multilayer perceptron for feature extraction, and the feature information output by the multilayer perceptron can be fused to obtain fused features. Finally, an anomaly prediction is performed on the object to be detected based on the RGB features, point cloud features, and fused features to obtain a prediction result for the object to be detected. The prediction result can reflect whether the object to be detected has an anomaly. The prediction result here is the detection result of industrial anomaly detection. The embodiment of this application does not limit the content of the prediction result. In one possible implementation, the prediction result can include at least one of an anomaly score and an anomaly representation map.

[0044] In one embodiment of the present application, the first feature extractor and the second feature extractor are pre-trained feature extractors, which belong to a machine learning model. The machine learning model involves artificial intelligence, and three-dimensional industrial anomaly detection is automatically realized through artificial intelligence. During the three-dimensional industrial anomaly detection process, the first feature extractor and the second feature extractor are trained through machine learning in artificial intelligence technology, and feature extraction is realized through computer vision technology in artificial intelligence technology.

[0045] In one embodiment of the present application, the server 102 in the present application may be a cloud server that provides cloud computing services, that is, the present application involves cloud storage and cloud computing technologies.

[0046] Cloud storage is a new concept that has been extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.

[0047] Cloud computing is a computing model that distributes computing tasks across a resource pool consisting of a large number of computers, enabling various application systems to access computing power, storage space, and information services as needed. The network that provides these resources is called the "cloud." To users, these resources appear infinitely scalable and can be accessed at any time, used on demand, expanded at any time, and paid for on a per-use basis.

[0048] The following is a detailed description of the technical solutions provided in this application, including the three-dimensional industrial anomaly detection method, three-dimensional industrial anomaly detection device, computer-readable medium, and electronic device, in combination with specific implementation methods.

[0049] FIG2 schematically illustrates a flow chart of the steps of a three-dimensional industrial anomaly detection method according to one embodiment of the present application. The three-dimensional industrial anomaly detection method is executed by a server, which may specifically be server 102 in FIG1 . As shown in FIG2 , the three-dimensional industrial anomaly detection method according to the embodiment of the present application may primarily include the following steps S210 to S240 .

[0050] S210: Acquire an RGB image and a three-dimensional point cloud image of the object to be detected, and pre-process the three-dimensional point cloud image to obtain multiple point cloud groups;

[0051] S220: performing feature extraction on the multiple point cloud groups using a first feature extractor to obtain point cloud feature groups of the multiple point cloud groups, generating a point cloud feature map based on the point cloud feature groups and the three-dimensional point cloud map, and projecting the point cloud feature map to form a point cloud projection map of the same size as the RGB image; performing feature extraction on the RGB image using a second feature extractor to obtain RGB features of the RGB image;

[0052] S230: extracting features from the RGB features and the point cloud features of the point cloud projection image respectively through a multilayer perceptron, and fusing the feature information output by the multilayer perceptron to obtain a fused feature;

[0053] S240: Performing abnormality prediction on the object to be detected based on the RGB features, the point cloud features, and the fusion features to obtain a prediction result of the object to be detected.

[0054] In the three-dimensional industrial anomaly detection method provided in the embodiment of the present application, after obtaining the RGB image and the three-dimensional point cloud map of the object to be detected, the three-dimensional point cloud map is first preprocessed to obtain multiple point cloud groups; then, a first feature extractor is used to extract features from the multiple point cloud groups to obtain point cloud feature groups, a point cloud feature map is generated based on the point cloud feature groups and the three-dimensional point cloud map, and the point cloud feature map is projected to form a point cloud projection map of the same size as the RGB image; at the same time, a second feature extractor is used to extract features from the RGB image to obtain RGB features; then, a multi-layer perceptron is used to extract features from the RGB features and the point cloud features of the point cloud projection map, respectively, and the feature information output by the multi-layer perceptron is fused to obtain fused features; finally, anomaly prediction is performed on the object to be detected based on the RGB features, point cloud features and fused features to obtain a prediction result of the object to be detected. On the one hand, the present application can perform multimodal industrial anomaly detection based on three-dimensional point cloud maps and RGB images, and by fusing RGB features and point cloud features, it improves the interactivity between features and reduces the mutual interference between high-dimensional features. In this way, when anomaly prediction is performed on the object to be detected based on RGB features, point cloud features and fusion features, a more accurate prediction result can be obtained, thereby improving the detection performance and the accuracy of the detection results. On the other hand, the present application adopts an unsupervised form, and no manual labeling is required before detecting anomalies, thereby reducing the cost of manual labeling, and by adopting the technical solution of the present application for initial screening of industrial anomalies, the cost of manual quality inspection can be reduced.

[0055] The specific implementation of each method step of the three-dimensional industrial anomaly detection method in the embodiment of the present application is described in detail below.

[0056] In S210 , an RGB image and a three-dimensional point cloud image of the object to be detected are obtained, and the three-dimensional point cloud image is preprocessed to obtain a plurality of point cloud groups.

[0057] In one embodiment of the present application, the object to be inspected can be any object that needs to be inspected in an industrial quality inspection scenario, such as machine parts, fruits and vegetables, processed foods, handicrafts, ropes, etc. After obtaining the object to be inspected, different cameras can be used to photograph it to obtain an initial point cloud image and RGB image of the object to be inspected. Specifically, a two-dimensional camera, such as an area array camera, can be used to photograph the object to be inspected to obtain an RGB image, and a three-dimensional camera, such as a laser line scan camera, can be used to photograph the object to be inspected to obtain an initial point cloud image.

[0058] In one embodiment of the present application, after obtaining the initial point cloud image, a coordinate preservation process can be performed on it to form a point cloud image, and the three-dimensional point cloud image can be preprocessed to obtain multiple point cloud groups corresponding to the three-dimensional point cloud image. Among them, the coordinate preservation process is a process of preserving the coordinates of the points in the initial point cloud image and deleting other information, such as deleting the color information in the initial point cloud image or deleting the color information and laser reflection information in the initial point cloud image; the preprocessing can specifically be a secondary sampling of the three-dimensional point cloud image, specifically, firstly sampling the farthest point of the three-dimensional point cloud image to obtain a first number of sampling points; then sampling the nearest neighbor points with the sampling points as the center points to obtain a second number of feature points related to each sampling point; finally, forming a point cloud group based on each sampling point and the feature points related to each sampling point; wherein the first number and the second number are integers greater than one, and the first number and the second number are both less than the number of points contained in the three-dimensional point cloud image. In the embodiment of the present application, the nearest neighbor sampling is to obtain the point closest to the center point and use it as a feature point.

[0059] In S220, feature extraction is performed on the multiple point cloud groups by a first feature extractor to obtain point cloud feature groups of the multiple point cloud groups, a point cloud feature map is generated based on the point cloud feature groups and the three-dimensional point cloud map, and the point cloud feature map is projected to form a point cloud projection map with the same size as the RGB image; feature extraction is performed on the RGB image by a second feature extractor to obtain RGB features of the RGB image.

[0060] In one embodiment of the present application, after obtaining multiple point cloud groups obtained through preprocessing, the point cloud group sequence formed by the point cloud groups can be input into a first feature extractor for feature extraction to obtain three-dimensional representations corresponding to each point cloud group. According to the three-dimensional representations corresponding to each point cloud group, a point cloud feature group corresponding to the three-dimensional point cloud image can be formed.

[0061] In an embodiment of the present application, when multiple point cloud groups form a point cloud group sequence, the positions in the point position sequence formed by all points in the three-dimensional point cloud image can be sorted and generated according to the center point in each point cloud group. The first feature extractor is a pre-trained feature extractor. Specifically, the self-attention network Transformer model can be used as the first feature extractor. After the point cloud group sequence is input into the Transformer model, the Transformer model can encode the point cloud group according to the information of other point cloud groups related to a certain point cloud group to output a feature vector corresponding to the point cloud group. Since the Transformer model can encode each point cloud group, it can also output the same number of point cloud features accordingly. When M sampling points are obtained by farthest point sampling, and M point cloud groups are obtained based on the M sampling points through nearest neighbor sampling, the M point cloud groups can be encoded by the Transformer model and M point cloud features can be output. Furthermore, the M point cloud features constitute a point cloud feature group. In addition, since each point cloud group is obtained by performing nearest neighbor sampling with any one of the M sampling points as the center point, each point cloud feature in the point cloud feature group can be regarded as the feature of the corresponding center point. It is worth noting that the first feature extractor can also be other pre-trained feature extractors, such as ResNet, Swin-Transformer, etc., and this embodiment of the application does not specifically limit this.

[0062] Since the sampling points are not evenly distributed in space after sampling at the farthest point, the density of the point features is unbalanced, and there is spatial inconsistency with the grid form of the RGB image. In order to align the spatial positions of the point cloud features and the image features of the RGB image, and facilitate the subsequent fusion of the color features of the RGB image and the point cloud features of the three-dimensional point cloud image, the point cloud features need to be registered first. In one possible implementation method, the registration method can be to interpolate the point cloud feature group back into the three-dimensional point cloud image based on the inverse distance weight to obtain a point cloud feature map, and then project the point cloud feature map to form a point cloud projection map of the same size as the RGB image. The point cloud features in the point cloud projection map can then be aligned with the spatial positions of the image features of the RGB image.

[0063] Next, the method of generating a point cloud feature map by interpolation and generating a point cloud projection map by projection is described in detail.

[0064] In one embodiment of the present application, the inverse distance weighted interpolation method is used to interpolate the point cloud feature group back to the three-dimensional point cloud image to generate a point cloud feature map. Assume that the point cloud feature group G output by the Transformer module contains M point cloud features gi (i = 1, 2, ..., M), and the M point cloud features correspond to M sampling points (center points) ci (i = 1, 2, ..., M), and the three-dimensional point cloud image contains N points pj (j = 1, 2, ..., N). By interpolating the M point cloud features back to the three-dimensional point cloud image, a rasterized point cloud feature map can be generated. The point cloud feature corresponding to each point in the point cloud feature map is p′ j (j=1,2,…,N).

[0065] In one embodiment of the present application, the point cloud feature p′ j and weight α i , sampling point c i The corresponding point cloud feature gi and the first quantity M satisfy the first relationship: And, the weight α i With sampling point c i , point cloud feature map and sampling point c i The corresponding point p j , minimum constant ε, all sampling points c k And all points p in the 3D point cloud t Satisfies the second relation:

[0066] By analyzing the first and second equations, we can see that the sampling point c i The corresponding weight α i It is calculated based on the first and second norms, where the first norm is obtained by sampling point c i The coordinates of the sampling point c in the 3D point cloud i The corresponding point p j The second norm is determined by the coordinates of all sampling points c k The coordinates of all points p in the 3D point cloud t The minimum constant ε is set to avoid the denominator being 0.

[0067] It is worth noting that During the calculation, for each sampling point c k , both need to calculate the sampling point c k The coordinates of p t The two norms between the coordinates of (t=1,2,……,N), and then traverse each c when k=1,2,……,M based on this logic k , and then get the final calculation result. k and pt Is constant, so each time the weight α is calculated i The denominator of the second expression is the same. i The corresponding weight α i After that, we can use the weight α i For sampling point c i The corresponding point cloud feature gi is interpolated to obtain the same value as point p j The corresponding interpolated point cloud feature p′ j .

[0068] In one embodiment of the present application, after interpolation, the point cloud feature map still corresponds to a feature map in three-dimensional space. To facilitate spatial alignment with the image features of the RGB image, the point cloud feature map needs to be projected onto a two-dimensional plane to construct a point cloud projection map of the same size as the RGB image. During projection, the point cloud features in the point cloud feature map can be projected onto the two-dimensional plane based on the point coordinates and camera parameters.

[0069] Figure 3 schematically shows a flow chart of projecting and generating a point cloud projection map. As shown in Figure 3, in S301, first camera parameters corresponding to the RGB image and second camera parameters corresponding to the three-dimensional point cloud map are obtained; in S302, a transfer matrix is ​​determined based on the first camera parameters and the second camera parameters; in S303, point coordinates in the point cloud feature map are projected based on the transfer matrix to obtain two-dimensional coordinates corresponding to the point coordinates, and a point cloud projection map is determined based on the two-dimensional coordinates and the point cloud features corresponding to the point coordinates.

[0070] Since the shooting devices used to generate the RGB image and the three-dimensional point cloud map are different, the corresponding camera parameters are also different. The camera parameters may include, for example, focal length, aperture, camera coordinate system, etc. For the convenience of description, the camera parameters corresponding to the RGB image are used as the first camera parameters, and the camera parameters corresponding to the three-dimensional point cloud map are used as the second camera parameters. After obtaining the first camera parameters and the second camera parameters, a transfer matrix can be determined based on the first camera parameters and the second camera parameters. The transfer matrix can convert the point coordinates of the three-dimensional space into the point coordinates in the two-dimensional plane. Then, based on the transfer matrix, the point coordinates of each point in the point cloud feature map can be projected onto the two-dimensional plane, and the point cloud feature p′ corresponding to the point coordinates can be calculated. j It is also projected to the corresponding point coordinates in the two-dimensional plane. The point cloud projection image can be determined according to the two-dimensional coordinates corresponding to the point coordinates and the point cloud features, and the size of the point cloud projection image is the same as that of the RGB image.

[0071] In one embodiment of the present application, since the point cloud may be sparse, there are points in the two-dimensional plane that match the point cloud feature map and there are also points that do not match it. Therefore, during projection, the pixels of the points in the point cloud projection map that match the point cloud feature map can be set to non-zero values, and the pixels of the points in the point cloud projection map that do not match the point cloud feature map can be set to 0. For example, the position where the object to be detected does not exist in the two-dimensional plane is an unmatched point, so it can be marked as 0.

[0072] In one embodiment of the present application, while preprocessing the three-dimensional point cloud image to obtain multiple point cloud groups, performing feature extraction on the point cloud groups using a first feature extractor to obtain point cloud feature groups, performing inverse distance weighted interpolation processing on the three-dimensional point cloud image based on the point cloud feature groups to generate a point cloud feature map, and projecting the point cloud feature map to generate a point cloud projection map, a second feature extractor can also be used to extract features from the RGB image to obtain RGB features. The second feature extractor is also a pretrained feature extractor, for example, a pretrained self-attention network Transformer model, or other pretrained self-attention network models, which are not specifically limited in this application.

[0073] In one embodiment of the present application, since the purpose of the present application is to detect industrial anomalies, in order to more accurately reflect the location of the anomaly of the object to be detected, the prediction result may include an anomaly score and an anomaly characterization map. In order to obtain the anomaly score of the object to be detected and locate the abnormal part, the anomaly characterization map is output. Therefore, during the detection process, the point cloud projection map and the RGB image can be divided into blocks, the point cloud projection map can be divided into multiple blocks, and the RGB image can be divided into multiple spots. Then, industrial anomaly detection is performed based on the block point cloud features corresponding to the blocks and the RGB features corresponding to the spots. In the embodiment of the present application, the standards for dividing the point cloud projection map and the RGB image into blocks are the same, so that the blocks in the point cloud projection map and the spots in the RGB image are one-to-one corresponding, and the point cloud features and the RGB features can be aligned.

[0074] In one embodiment of the present application, the point cloud projection image can be divided into multiple tiles according to a preset division standard, and then the point cloud projection images corresponding to each tile are average pooled to obtain the tile point cloud features corresponding to each tile. Accordingly, the point cloud features of the point cloud projection image can be obtained based on the tile point cloud features corresponding to all tiles. Similarly, the RGB image can be divided according to the preset division standard to obtain spots corresponding to the RGB image, and then each spot is simultaneously input into the second feature extractor. The second feature extractor performs feature extraction on each spot separately to obtain the RGB features corresponding to each spot. The RGB features corresponding to the RGB image can be obtained based on the RGB features corresponding to all spots.

[0075] In one embodiment of the present application, when obtaining the three-dimensional point cloud map and RGB image corresponding to the object to be detected, the blocks in the point cloud projection map and the spots in the RGB image are one-to-one corresponding, that is, each block corresponds to a spot, different blocks correspond to different spots, and the corresponding blocks and the spots have the same index. In other words, an index i can be set for the three-dimensional point cloud map and RGB image of the object to be detected, and when the three-dimensional point cloud map is processed to generate a point cloud projection map, the index i remains unchanged; after the point cloud feature map is divided to generate blocks and the RGB image is divided to generate spots, an index j can be set for each block and spot according to a certain sequence rule, and the blocks and spots corresponding to the same position in the point cloud projection map and the RGB image have the same index. According to the index i and the index j, a block can be uniquely determined in the point cloud projection map corresponding to the index i, and a spot can be uniquely determined in the RGB image corresponding to the index i, and then the point cloud features corresponding to the block and the RGB features corresponding to the spot can be fused to extract the interactive information between the two modalities.

[0076] In S230 , feature extraction is performed on the RGB features and the point cloud features of the point cloud projection image respectively through a multilayer perceptron, and feature information output by the multilayer perceptron is fused to obtain fused features.

[0077] In one embodiment of the present application, after completing the division and index setting of the point cloud projection map and the RGB image, the RGB features and the point cloud features in the point cloud projection map can be respectively input into a multi-layer perceptron for feature extraction, and then the feature information output by the multi-layer perceptron is fused to obtain fused features that are fused with color information and position information. Since the blocks in the point cloud projection map and the spots in the RGB image are one-to-one corresponding, and the blocks and spots with corresponding relationships have the same index, the RGB features of the spots with corresponding relationships and the block point cloud features of the blocks can be feature extracted by the multi-layer perceptron to obtain first feature information of the spots with corresponding relationships and second feature information of the blocks. Furthermore, the first feature information of the spots with corresponding relationships and the second feature information of the blocks can be fused to obtain fused features, which include the color features of the spots with corresponding relationships and the point cloud features of the blocks. In other words, the fused features include interactive information between the two modalities.

[0078] For ease of description, in the embodiment of the present application, the point cloud features corresponding to the blocks are marked as The RGB feature corresponding to the patch is marked as The fusion feature is marked as Where i is the index of the object to be detected, j is the index of the patch or block; the multilayer perceptron includes a first multilayer perceptron χ for extracting feature of the point cloud pt and the second multilayer perceptron χ rgb , accordingly,

[0079] By extracting and fusing the RGB features corresponding to all image spots and the point cloud features corresponding to all image blocks, the fusion features corresponding to the RGB image and the point cloud projection image can be obtained.

[0080] In S240 , an abnormality prediction is performed on the object to be detected based on the RGB features, the point cloud features, and the fusion features to obtain a prediction result of the object to be detected.

[0081] In one embodiment of the present application, after obtaining the RGB features corresponding to the RGB image, the point cloud features corresponding to the point cloud projection map, and the fusion features corresponding to the RGB image and the point cloud projection map, they can be input into the decision layer. The decision layer is provided with three memory banks, namely the first memory bank, the second memory bank, and the third memory bank, wherein the first memory bank is used to store the original color features of the detected object, the second memory bank is used to store the point cloud features of the detected object, and the third memory bank is used to store the fusion features of the detected object. When the RGB features, point cloud features, and fusion features corresponding to the object to be detected are input into the decision layer, an abnormality prediction can be performed on the object to be detected based on the memory bank in the decision layer, the RGB features, point cloud features, and fusion features corresponding to the object to be detected, and a prediction result of the object to be detected can be obtained. In this case, the prediction result includes an abnormality score and an abnormality representation map. An abnormality prediction of the object to be detected based on the memory bank in the decision layer, the RGB features, point cloud features, and fusion features corresponding to the object to be detected can improve the accuracy of anomaly detection.

[0082] In one embodiment of the present application, since the three memory banks correspond to the original color features, point cloud features and fusion features respectively, the abnormality prediction of the object to be detected can be performed from the color dimension according to the first memory bank and RGB features, the abnormality prediction of the object to be detected can be performed from the position dimension according to the second memory bank and point cloud features, and the abnormality prediction of the object to be detected can be performed from the feature fusion dimension according to the third memory bank and fusion features, and then the prediction information of the three dimensions can be integrated to obtain the abnormality score and abnormality representation map corresponding to the object to be detected.

[0083] Since the prediction of anomaly scores and anomaly representation maps are two tasks, two learnable single-class support vector machines Da and Ds can be used in an embodiment of the present application to make decisions on anomaly scores and anomaly representation maps. Specifically, when predicting anomaly scores, a first anomaly score of the object to be detected can be determined based on a first scoring function, a first memory bank, and RGB features, a second anomaly score of the object to be detected can be determined based on a first scoring function, a second memory bank, and point cloud features, and a third anomaly score of the object to be detected can be determined based on a first scoring function, a third memory bank, and fusion features; then, the first anomaly score, the second anomaly score, and the third anomaly score are input into a first single-class support vector machine Da to obtain the anomaly score of the object to be detected.

[0084] When predicting the abnormal representation map, the first abnormal segmentation map score of the object to be detected can be determined according to the second scoring function, the first memory bank and the RGB features, the second abnormal segmentation map score of the object to be detected can be determined according to the second scoring function, the second memory bank and the point cloud features, and the third abnormal segmentation map score of the object to be detected can be determined according to the second scoring function, the third memory bank and the fusion features; then the first abnormal segmentation map score, the second abnormal segmentation map score and the third abnormal segmentation map score are input into the second single-class support vector machine Ds to obtain the segmentation map of the object to be detected with abnormalities; finally, the segmentation map with abnormalities is marked with a color different from the normal segmentation map to obtain the abnormal representation map.

[0085] Among them, the expression of the first scoring function is: Among them, f (i,j),* , M is the first memory bank, the second memory bank or the third memory bank, f is the RGB feature, the point cloud feature or the fusion feature, η is the weight parameter, i is the index corresponding to the RGB image or the point cloud projection map, and j is the index corresponding to the image spot in the RGB image or the image block in the point cloud projection map;

[0086] The expression of the second scoring function is: Where M is the first memory bank, the second memory bank or the third memory bank, f is the RGB feature, the point cloud feature or the fusion feature, i is the index of the RGB image, and j is the index corresponding to the spot in the RGB image.

[0087] According to the expression of the first scoring function, when f is the RGB feature When the first memory bank M is obtained rgb ,according to and M rgb Each original color feature in Take the minimum value of m rgb As m* and taking the maximum value As f (i,j),* , and then according to the weight parameters η, m* and f (i,j),* It can be determined that the first abnormal score φ(M rgb ,f rgb ); when f is the point cloud feature When the second memory bank M is available pt ,according to and M pt Each point cloud feature in Take the minimum value of m pt As m* and taking the maximum value As f (i,j),* , and then according to the weight parameters η, m* and f (i,j),* The second abnormality score φ(M pt ,f pt ); Accordingly, when f is the fusion feature When the third memory bank M is available fs ,according to and M fs Each fusion feature in Take the minimum value of m fs As m* and taking the maximum value As f (i,j),* , and then according to the weight parameters η, m* and f (i,j),* It can be determined that the third abnormality score φ(M fs ,f fs ).

[0088] According to the expression of the second scoring function, when f is the RGB feature When the first memory bank M is obtained rgb ,according to and M rgb Each original color feature in Take the minimum value of m rgb As the first abnormal segmentation map score When f is the point cloud feature When the second memory bank M is available pt ,according to and M pt Each point cloud feature in Take the minimum value of m pt As the second abnormal segmentation map score Correspondingly, when f is the fusion feature When the third memory bank M is available fs ,according to and Mfs Each fusion feature in Take the minimum value of m fs As the third abnormal segmentation map score

[0089] When obtaining the first anomaly score φ(M rgb ,f rgb ), the second abnormality score φ(M pt ,f pt ) and the third anomaly score φ(M fs ,f fs ), it can be input into the first single-class support vector machine to obtain the abnormality score, which is expressed as: a=Da(φ(M rgb ,f rgb ),φ(M pt ,f pt ),φ(M fs ,f fs )). At the same time, when obtaining the first abnormal segmentation map score Second abnormal segmentation map score and the third abnormal segmentation map score After that, it can be input into the single-class support vector machine to obtain the abnormal segmentation map, which is expressed as:

[0090] The three-dimensional industrial anomaly detection in the embodiment of the present application can identify the possible anomalies in the object to be detected. In some cases, the object to be detected may have gaps, cracks, etc. In order to avoid misjudgment caused by identifying it as an anomaly, the three-dimensional industrial anomaly detection method in the embodiment of the present application can be used for the initial screening of industrial anomalies. After obtaining the prediction results of the object to be detected (such as anomaly scores and anomaly characterization diagrams), manual quality inspection can also be performed to determine whether the object to be detected really has an anomaly. Although manual quality inspection is still required after obtaining the anomaly score and anomaly characterization diagram using the technical solution of the present application, since the present application can perform industrial anomaly detection based on three-dimensional point clouds and color information, the accuracy of anomaly prediction is improved, and manual quality inspection only needs to be performed on the detection objects that are determined to have anomalies, and there is no need to perform quality inspection on all objects to be detected, thus greatly saving the cost of manual quality inspection.

[0091] In one embodiment of the present application, the memory banks are generated by random sampling. Specifically, the first memory bank, the second memory bank, and the third memory bank are generated by randomly sampling RGB features, point cloud features, or fusion features from a large number of samples. Random sampling, which selects a portion of data from a large amount of data to form a memory bank, can reduce the amount of data to be processed and improve data processing efficiency.

[0092] The three-dimensional industrial anomaly detection method in the present application can be implemented by a three-dimensional industrial anomaly detection system. Figure 4 schematically shows a structural diagram of the three-dimensional industrial anomaly detection system. As shown in Figure 4, the three-dimensional industrial anomaly detection system 400 includes a point cloud feature space registration module 401, a feature fusion module 402 and a decision layer fusion module 403, wherein the point cloud feature space registration module 401 is used to process the three-dimensional point cloud image to generate a point cloud projection image of the same size as the RGB image, the feature fusion module 402 is used to fuse the RGB features in the RGB image and the point cloud features in the point cloud projection image to generate fusion features, and the decision layer fusion module 403 is used to perform anomaly prediction on the object to be detected based on the RGB features, point cloud features, fusion features and preset memory library to obtain anomaly scores and anomaly representation images corresponding to the object to be detected.

[0093] Next, taking the three-dimensional industrial anomaly detection of cable sealing sleeves as an example, the detection process of the three-dimensional industrial anomaly detection system is explained in detail.

[0094] FIG5 schematically shows a flow chart of abnormality detection of a cable gland by using a three-dimensional industrial abnormality detection system. As shown in FIG5 , in S501, after obtaining the RGB image and the initial point cloud image corresponding to the cable gland, the initial point cloud image is processed to obtain a three-dimensional point cloud image containing only point coordinate information; in S502, the three-dimensional point cloud image is input into the point cloud feature space registration module, and S503-S508 are executed on the three-dimensional point cloud image through the point cloud feature space registration module; in S503, the farthest point sampling and the nearest neighbor sampling are performed on the three-dimensional point cloud image to generate multiple point cloud groups; in S504, the multiple point cloud groups are arranged according to a preset sorting rule to form a point cloud group sequence; in S505 , input the point cloud group sequence into the first feature extractor for feature extraction to obtain a point cloud feature group; in S506, interpolate the point cloud feature group back to the three-dimensional point cloud image to generate a point cloud feature map; in S507, project the point cloud feature map to generate a point cloud projection map of the same size as the RGB image; in S508, divide the point cloud projection map into multiple blocks according to the preset division standard, and perform average pooling on the point cloud features corresponding to each block to obtain the block point cloud features corresponding to each block; in S509, input the RGB image into the feature fusion module, and execute S510-S513 on the RGB image through the feature fusion module; in S510, divide the RGB image into multiple blocks according to the preset division standard The image spots are extracted and the image spot sequence formed by the multiple image spots is input into the second feature extractor; in S511, the second feature extractor performs feature extraction and outputs the RGB features corresponding to each image spot; in S512, the image point cloud features corresponding to each image block are input into the first multi-layer perceptron for feature extraction to obtain the first feature information, and the RGB features corresponding to each image spot are input into the second multi-layer perceptron for feature extraction to obtain the second feature information; in S513, the first feature information and the second feature information corresponding to the same position are fused to obtain the fused features; in S514, the RGB features corresponding to each image spot, the image point cloud features corresponding to each image block and the image point cloud features corresponding to each image spot / block are fused. The fused features are input to the decision layer fusion module, and S515-S522 are executed on the RGB features, point cloud features and fused features through the decision layer fusion module; in S515, a first anomaly score corresponding to the cable gland is determined according to the first scoring function, the first memory library and the RGB features; in S516, a second anomaly score corresponding to the cable gland is determined according to the first scoring function, the second memory library and the point cloud features; in S517, a third anomaly score corresponding to the cable gland is determined according to the first scoring function, the third memory library and the fused features; in S518, a first anomaly segmentation map score corresponding to the cable gland is determined according to the second scoring function, the first memory library and the RGB features;In S519, a second abnormal segmentation map score corresponding to the cable gland is determined based on the second scoring function, the second memory bank, and the point cloud features. In S520, a third abnormal segmentation map score corresponding to the cable gland is determined based on the second scoring function, the third memory bank, and the fusion features. In S521, the first abnormality score, the second abnormality score, and the third abnormality score are input into a first one-class support vector machine to obtain an abnormality score corresponding to the cable gland. In S522, the first abnormal segmentation map score, the second abnormal segmentation map score, and the third abnormal segmentation map score are input into a second one-class support vector machine to obtain an abnormal segmentation map corresponding to the cable gland, and the abnormal segmentation map is marked with a color that is different from a normal segmentation map to obtain an abnormality representation map.

[0095] At this point, the anomaly score and anomaly representation map corresponding to the object to be detected can be obtained. Further, FIG5 may also include S523: setting the pixels at the position where the anomaly exists in the anomaly representation map to 255 and setting the pixels at the position where the anomaly does not exist to 0 to obtain an anomaly location map.

[0096] Although the above embodiment performs three-dimensional industrial anomaly detection on the cable sealing sleeve, it is understandable that the three-dimensional industrial anomaly detection method in the present application can also be applied to other types of industrial anomaly detection scenarios. Figure 6 schematically shows the anomaly representation map and anomaly location map determined after anomaly detection is performed on a variety of objects to be detected using the three-dimensional industrial anomaly detection method in the present application. As shown in Figure 6, the objects to be detected are bagels, cable sealing sleeves, carrots, biscuits, dowels, foam, peaches, potatoes, ropes, and tires. The first row is the RGB image corresponding to each object to be detected, the second row is the three-dimensional point cloud map corresponding to each object to be detected, the third row is the anomaly representation map corresponding to each object to be detected generated by the three-dimensional industrial anomaly detection, and the fourth row is the anomaly location map corresponding to each object to be detected generated by the three-dimensional industrial anomaly detection.

[0097] In one embodiment of the present application, before using a three-dimensional industrial anomaly detection system to perform anomaly detection on an object to be detected, it is necessary to train each module in the three-dimensional industrial anomaly detection system to obtain a three-dimensional industrial anomaly detection system with stable performance. Since the point cloud feature space registration module only contains a first feature extractor, which is a pre-trained feature extractor, there is no need to train the point cloud feature space registration module. The feature fusion module contains a second feature extractor, a first multi-layer perceptron, and a second multi-layer perceptron. Although the second feature extractor is a pre-trained feature extractor, the parameters in the first multi-layer perceptron and the second multi-layer perceptron still need to be optimized. In other words, the feature fusion module needs to be trained. The decision layer fusion module contains three memory banks, a learnable first single-class support vector machine, and a learnable second single-class support vector machine. Therefore, the decision layer fusion module also needs to be trained. In the embodiment of the present application, the training of the feature fusion module and the decision layer fusion module is performed asynchronously, and both adopt an unsupervised training mode. Since both adopt an unsupervised training mode, no manual labeling is required before training, thereby reducing the cost of manual labeling.

[0098] In one embodiment of the present application, the feature fusion module uses a contrast loss based on spots to train the feature fusion module so that the feature fusion module can fully learn the intrinsic relationship between the two modes of color and three-dimensional point cloud in the training data. rgb and point cloud features f pt ,The training goal is to encourage features of different modalities at the same position to have more corresponding information, while features at different positions have less corresponding information.

[0099] When obtaining training samples, an index can be set for the training samples. Since multimodal information needs to be extracted from the RGB image and 3D point cloud map of each training sample, the RGB image and 3D point cloud map corresponding to the same training sample, as well as the point cloud projection map generated by processing the 3D point cloud map, all correspond to the same index. Furthermore, the feature fusion module is trained using a contrast loss based on patches, so the RGB image and point cloud projection map also need to be segmented, and the segmentation standards used are the same to ensure that the patches formed by the RGB image segmentation and the blocks formed by the point cloud projection map segmentation are one-to-one corresponding, thereby achieving spatial position alignment of the RGB features and the point cloud features.

[0100] Similar to the method for performing three-dimensional industrial anomaly detection on the object to be detected in the above embodiment, the embodiment of the present application adopts To represent the RGB features of the spots, we use To represent the point cloud features of the tile, where m is the index of the training sample and n is the index of the corresponding patch and tile. After obtaining the RGB features and point cloud features corresponding to the training sample, the multilayer perceptron (MLP) layer { rgb ,χ pt} to extract the interaction information between the two modalities and use the fully connected layer {σ rgb ,σ pt} to map the processed features to the query or key vector, the mapping feature is represented as

[0101] FIG7 schematically shows a flow chart of the unsupervised training feature fusion module. As shown in FIG7 : in S701, the three-dimensional point cloud image corresponding to the batch training samples is input into the point cloud feature space registration module, and the three-dimensional point cloud image corresponding to the batch training samples is subjected to farthest point sampling, nearest neighbor sampling, encoding, interpolation, projection, blocking and average pooling processing through the point cloud feature space registration module; in S702, the point cloud feature space registration module outputs a plurality of image blocks constituting the point cloud projection image and the image block point cloud features corresponding to each image block; in S703, the image block point cloud features corresponding to each image block are input into the first multi-layer perceptron; in S704, the first multi-layer perceptron outputs the first feature information corresponding to the image block, and the first feature information is input into the first fully connected layer; in S705, The first fully connected layer outputs the first mapping feature; in S706, the RGB image corresponding to the batch training samples is divided into multiple spots, and the spot sequence corresponding to each training sample is input into the second feature extractor; in S707, the second feature extractor outputs the RGB feature corresponding to the spot sequence; in S708, the RGB feature corresponding to each spot is input into the second multi-layer perceptron; in S709, the second multi-layer perceptron outputs the second feature information corresponding to the spot, and the second feature information is input into the second fully connected layer; in S710, the second fully connected layer outputs the second mapping feature to determine the contrast loss function based on the first mapping feature and the second mapping feature, and adjusts the parameters of the feature fusion module according to the loss function to obtain a feature fusion module with stable performance.

[0102] Among them, the contrast loss function in S710 is the InfoNCE loss function, and the specific expression is:

[0103] Among them, N b is the batch size, N pis the number of non-zero tiles, and T is the transposed sign. It is worth noting that the batch size is the number of training samples contained in the batch training sample, and each training sample has a different index. The number of non-zero tiles is the number of patches formed by dividing the RGB image into blocks or the number of blocks formed by dividing the point cloud projection image into blocks.

[0104] After completing the parameter adjustment of the feature fusion module according to the contrast loss function, a feature fusion module with stable performance can be obtained. Based on this feature fusion module, a large amount of corresponding information can be extracted for the features of different modes at the same position, while no corresponding information will be extracted for the features of different modes at different positions, or the amount of extracted corresponding information is very small. As shown in the contrast matrix in Figure 7, the blocks in the diagonal position of the matrix correspond to the corresponding information extracted for the features of different modes at the same position, and the blocks in the non-diagonal position correspond to the corresponding information extracted for the features of different modes at different positions. The dark color of the diagonal blocks indicates rich corresponding information, and the light color of the non-diagonal blocks indicates missing corresponding information.

[0105] After completing the training of the feature fusion module, the first feature information and the second feature information can be fused to obtain the fused feature f fs , as shown by the dotted line in Figure 7.

[0106] In one embodiment of the present application, after completing the training of the feature fusion module, the decision layer fusion module can be trained. rgb 、M fp 、M fs The anomaly score and anomaly segmentation map scoring results corresponding to all training samples are given, and then the anomaly score and anomaly segmentation map scoring results are used as the training input of the first single-class support vector machine and the second single-class support vector machine respectively, realizing unsupervised training with only positive examples.

[0107] The three-dimensional industrial anomaly detection method in the present application obtains the RGB image and the three-dimensional point cloud map of the object to be detected, first pre-processes the three-dimensional point cloud map to obtain multiple point cloud groups; then uses a first feature extractor to extract features from the multiple point cloud groups to obtain point cloud feature groups, generates a point cloud feature map based on the point cloud feature groups and the three-dimensional point cloud map, and projects the point cloud feature map to form a point cloud projection map of the same size as the RGB image; at the same time, uses a second feature extractor to extract features from the RGB image to obtain RGB features; then uses a multi-layer perceptron to extract features from the RGB features and the point cloud features of the point cloud projection map respectively, and fuses the feature information output by the multi-layer perceptron to obtain fused features; finally, anomaly prediction is performed on the object to be detected based on the RGB features, point cloud features and fused features to obtain a prediction result of the object to be detected. On the one hand, the present application can perform multimodal industrial anomaly detection based on three-dimensional point cloud maps and RGB images, and by fusing RGB features and point cloud features, it improves the interactivity between features and reduces the mutual interference between high-dimensional features. In this way, when anomaly prediction is performed on the object to be detected based on RGB features, point cloud features and fusion features, a more accurate prediction result can be obtained, thereby improving the detection performance and the accuracy of the detection results. On the other hand, the present application adopts an unsupervised form, and no manual labeling is required before detecting anomalies, thereby reducing the cost of manual labeling, and by adopting the technical solution of the present application for initial screening of industrial anomalies, the cost of manual quality inspection can be reduced.

[0108] It should be noted that although the steps of the method of the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all steps must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0109] The following describes an embodiment of the device of the present application, which can be used to implement the three-dimensional industrial anomaly detection method in the above-mentioned embodiment of the present application. Figure 8 schematically shows a block diagram of the structure of the three-dimensional industrial anomaly detection device provided in an embodiment of the present application. As shown in Figure 8, the three-dimensional industrial anomaly detection device 800 includes: a preprocessing module 810, a registration module 820, a fusion module 830, and a decision module 840. Specifically:

[0110] A preprocessing module is used to obtain an RGB image and a three-dimensional point cloud map of the object to be detected, and preprocess the three-dimensional point cloud map to obtain multiple point cloud groups; a registration module is used to perform feature extraction on the multiple point cloud groups through a first feature extractor to obtain point cloud feature groups of the multiple point cloud groups, generate a point cloud feature map based on the point cloud feature group and the three-dimensional point cloud map, and project the point cloud feature map to form a point cloud projection map of the same size as the RGB image; feature extraction is performed on the RGB image through a second feature extractor to obtain RGB features of the RGB image; a fusion module is used to perform feature extraction on the RGB features and the point cloud features of the point cloud projection map respectively through a multi-layer perceptron, and fuse the feature information output by the multi-layer perceptron to obtain fused features; a decision module is used to perform abnormality prediction on the object to be detected based on the RGB features, the point cloud features and the fused features to obtain a prediction result of the object to be detected.

[0111] In some embodiments of the present application, based on the above technical solution, the preprocessing module 810 is configured to: perform farthest point sampling on the three-dimensional point cloud image to obtain a first number of sampling points; perform nearest neighbor sampling with the sampling point as the center point to obtain a second number of feature points related to each of the sampling points; form the multiple point cloud groups based on each of the sampling points and the feature points related to each of the sampling points; wherein the first number and the second number are integers greater than one.

[0112] In some embodiments of the present application, based on the above technical solution, the registration module 820 includes: an interpolation unit, configured to interpolate the point cloud feature group back into the three-dimensional point cloud image based on an inverse distance weight to obtain the point cloud feature image.

[0113] In some embodiments of the present application, based on the above technical solution, the interpolation unit is configured as follows: the point cloud feature p′ in the point cloud feature map j and weight α i , the point cloud feature gi corresponding to the sampling point and the first quantity M satisfy the first relationship: The weight α i With sampling point c i , the point cloud feature map and the sampling point c i The corresponding point p j , the minimum constant ε, all the sampling points c k And all points p in the three-dimensional point cloud t Satisfies the second relation:

[0114] In some embodiments of the present application, based on the above technical solution, the registration module 820 is configured to: obtain first camera parameters corresponding to the RGB image and second camera parameters corresponding to the three-dimensional point cloud image; determine a transfer matrix based on the first camera parameters and the second camera parameters; project the point coordinates in the point cloud feature map based on the transfer matrix to obtain two-dimensional coordinates corresponding to the point coordinates, and determine the point cloud projection map based on the two-dimensional coordinates and the point cloud features corresponding to the point coordinates.

[0115] In some embodiments of the present application, based on the above technical solution, the registration module 820 is further configured to: when there is a point in the point cloud projection image that does not match the point cloud feature map, set the pixel at the position corresponding to the point to 0.

[0116] In some embodiments of the present application, based on the above technical solution, the three-dimensional industrial anomaly detection device 800 also includes: a first blocking module, used to divide the point cloud projection map into multiple blocks according to a preset division standard, and perform average pooling on the point cloud projection map corresponding to each block to obtain the block point cloud features corresponding to each block; and obtain the point cloud features of the point cloud projection map based on the block point cloud features corresponding to all the blocks.

[0117] In some embodiments of the present application, based on the above technical solution, the registration module 820 is configured to: divide the RGB image according to the preset division standard to obtain the spots of the RGB image; perform feature extraction on each of the spots through the second feature extractor to obtain the RGB features corresponding to each of the spots; and obtain the RGB features of the RGB image based on the RGB features corresponding to all the spots.

[0118] In some embodiments of the present application, each tile corresponds to a spot, different tiles correspond to different spots, and the corresponding tiles and spots have the same index; based on the above technical solution, the fusion module 830 is configured as follows: through the multi-layer perceptron, feature extraction is performed on the RGB features of the spots with corresponding relationships and the block point cloud features of the tiles to obtain first feature information of the spots with corresponding relationships and second feature information of the tiles; the first feature information of the spots with corresponding relationships and the second feature information of the tiles are fused to obtain the fused features.

[0119] In some embodiments of the present application, based on the above technical solution, the decision module 840 is configured to: determine the first abnormality score of the object to be detected according to the first scoring function, the first memory bank and the RGB features, determine the second abnormality score of the object to be detected according to the first scoring function, the second memory bank and the point cloud features, and determine the third abnormality score of the object to be detected according to the first scoring function, the third memory bank and the fusion features; input the first abnormality score, the second abnormality score and the third abnormality score into the first single-class support vector machine to obtain the abnormality score of the object to be detected; wherein, the first memory bank is used to store the original color features of the detected object, the second memory bank is used to store the point cloud features of the detected object, and the third memory bank is used to store the fusion features of the detected object.

[0120] In some embodiments of the present application, based on the above technical solution, the decision module 840 is configured to: determine the first abnormal segmentation map score of the object to be detected according to the second scoring function, the first memory bank and the RGB feature, determine the second abnormal segmentation map score of the object to be detected according to the second scoring function, the second memory bank and the point cloud feature, and determine the third abnormal segmentation map score of the object to be detected according to the second scoring function, the third memory bank and the fusion feature; input the first abnormal segmentation map score, the second abnormal segmentation map score and the third abnormal segmentation map score into the second single-class support vector machine to obtain a segmentation map with an abnormality corresponding to the object to be detected; mark the segmentation map with an abnormality with a color different from the normal segmentation map to obtain the abnormal representation map.

[0121] In some embodiments of the present application, based on the above technical solution, the expression of the first scoring function is: Among them, f (i,j),* , M is the first memory bank, the second memory bank or the third memory bank, f is the RGB feature, the point cloud feature or the fusion feature, η is the weight parameter, i is the index corresponding to the RGB image or the point cloud projection map, and j is the index corresponding to the spot in the RGB image or the block in the point cloud projection map.

[0122] In some embodiments of the present application, based on the above technical solution, the expression of the second scoring function is: Wherein M is the first memory bank, the second memory bank or the third memory bank, f is the RGB feature, the point cloud feature or the fusion feature, i is the index corresponding to the RGB image or the point cloud projection map, and j is the index corresponding to the spot in the RGB image or the block in the point cloud projection map.

[0123] The specific details of the three-dimensional industrial anomaly detection device provided in each embodiment of the present application have been described in detail in the corresponding method embodiments and will not be repeated here.

[0124] FIG9 schematically shows a block diagram of a computer system structure of an electronic device for implementing an embodiment of the present application. The electronic device may be the terminal device 101 and the server 102 shown in FIG1 .

[0125] It should be noted that the computer system 900 of the electronic device shown in FIG9 is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0126] As shown in Figure 9, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 902 or the program loaded from the storage part 908 into the random access memory (RAM) 903. Various programs and data required for system operation are also stored in the random access memory 903. The CPU 901, the read-only memory 902, and the random access memory 903 are connected to each other via a bus 904. An input / output interface 905 (i.e., an I / O interface) is also connected to the bus 904.

[0127] In some embodiments, the following components are connected to the input / output interface 905: an input section 906 including a keyboard, a mouse, and the like; an output section 907 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a local area network card or a modem. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like, is installed in the drive 910 as needed so that a computer program read therefrom can be installed into the storage section 908 as needed.

[0128] In particular, according to an embodiment of the present application, the processes described in the various method flow charts can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the methods shown in the flow charts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 909 and / or installed from a removable medium 911. When the computer program is executed by the central processing unit 901, the various functions defined in the system of the present application are performed.

[0129] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium or a computer-readable medium or any combination of the two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples of computer-readable media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0130] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

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

[0132] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable an electronic device to execute the method according to the embodiments of the present application.

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

[0134] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A three-dimensional industrial anomaly detection method, the method being performed by an electronic device, comprising: Acquire an RGB image and a three-dimensional point cloud image of the object to be detected, and preprocess the three-dimensional point cloud image to obtain a plurality of point cloud groups; Performing feature extraction on the multiple point cloud groups by a first feature extractor to obtain point cloud feature groups of the multiple point cloud groups, generating a point cloud feature map according to the point cloud feature groups and the three-dimensional point cloud map, and projecting the point cloud feature map to form a point cloud projection map with the same size as the RGB image; performing feature extraction on the RGB image by a second feature extractor to obtain RGB features of the RGB image; Extracting features of the RGB features and the point cloud features of the point cloud projection image respectively through a multi-layer perceptron, and fusing the feature information output by the multi-layer perceptron to obtain fused features; Anomaly prediction is performed on the object to be detected according to the RGB features, the point cloud features and the fusion features to obtain a prediction result of the object to be detected.

2. According to the method of claim 1, the preprocessing of the three-dimensional point cloud image to obtain a plurality of point cloud groups comprises: Performing farthest point sampling on the three-dimensional point cloud image to obtain a first number of sampling points; Performing nearest neighbor point sampling with the sampling point as the center point to obtain a second number of feature points related to each of the sampling points; forming the plurality of point cloud groups according to the sampling points and the feature points associated with the sampling points; The first number and the second number are integers greater than one.

3. The method according to claim 1, generating a point cloud feature map according to the point cloud feature group and the three-dimensional point cloud map, comprising: The point cloud feature group is interpolated back to the three-dimensional point cloud image based on the inverse distance weight to obtain the point cloud feature image.

4. According to the method according to any one of claims 1 to 3, projecting the point cloud feature map to form a point cloud projection map with the same size as the RGB image comprises: Acquire a first camera parameter corresponding to the RGB image and a second camera parameter corresponding to the three-dimensional point cloud image; determining a transfer matrix according to the first camera parameters and the second camera parameters; The point coordinates in the point cloud feature map are projected based on the transfer matrix to obtain two-dimensional coordinates corresponding to the point coordinates, and the point cloud projection map is determined according to the two-dimensional coordinates and the point cloud features corresponding to the point coordinates.

5. The method according to claim 4, further comprising: When there is a point in the point cloud projection image that does not match the point cloud feature map, the pixel at the position corresponding to the point is set to 0.

6. The method according to claim 1, further comprising: The point cloud projection image is divided into a plurality of blocks according to a preset division standard, and the point cloud projection images corresponding to each block are average pooled to obtain block point cloud features corresponding to each block; The point cloud features of the point cloud projection image are obtained according to the block point cloud features corresponding to all the blocks.

7. The method according to claim 6, wherein extracting features from the RGB image by a second feature extractor to obtain RGB features of the RGB image comprises: Divide the RGB image according to the preset division standard to obtain spots of the RGB image; The second feature extractor performs feature extraction on each of the image spots to obtain RGB features corresponding to each of the image spots; The RGB features of the RGB image are obtained according to the RGB features corresponding to all the spots.

8. The method according to claim 7, wherein each block corresponds to a spot, different blocks correspond to different spots, and the corresponding blocks and spots have the same index; The extracting features of the RGB features and the point cloud features of the point cloud projection image respectively by a multilayer perceptron, and fusing the feature information output by the multilayer perceptron to obtain fused features, comprises: Extracting the RGB features of the spots and the point cloud features of the blocks with corresponding relationships through the multi-layer perceptron to obtain first feature information of the spots and second feature information of the blocks with corresponding relationships; The first feature information of the image spots and the second feature information of the image blocks having a corresponding relationship are fused to obtain the fused feature.

9. According to the method according to any one of claims 1 to 3, the prediction result of the object to be detected includes an abnormality score of the object to be monitored, and the abnormality prediction of the object to be detected based on the RGB feature, the point cloud feature and the fusion feature to obtain the prediction result of the object to be detected includes: Determine a first abnormality score of the object to be detected according to the first scoring function, the first memory library and the RGB feature, determine a second abnormality score of the object to be detected according to the first scoring function, the second memory library and the point cloud feature, and determine a third abnormality score of the object to be detected according to the first scoring function, the third memory library and the fusion feature; Inputting the first abnormality score, the second abnormality score and the third abnormality score into a first single-class support vector machine to obtain an abnormality score of the object to be detected; The first memory bank is used to store original color features of the detected object, the second memory bank is used to store point cloud features of the detected object, and the third memory bank is used to store fusion features of the detected object.

10. The method according to claim 9, wherein the prediction result of the object to be detected includes an abnormal characterization map of the object to be monitored, and the abnormality prediction of the object to be detected based on the RGB feature, the point cloud feature and the fusion feature to obtain the prediction result of the object to be detected includes: Determine a first abnormal segmentation map score of the object to be detected according to the second scoring function, the first memory bank and the RGB feature, determine a second abnormal segmentation map score of the object to be detected according to the second scoring function, the second memory bank and the point cloud feature, and determine a third abnormal segmentation map score of the object to be detected according to the second scoring function, the third memory bank and the fusion feature; Inputting the first abnormal segmentation map score, the second abnormal segmentation map score and the third abnormal segmentation map score into a second single-class support vector machine to obtain a segmentation map with abnormalities corresponding to the object to be detected; The abnormal segmentation map is marked with a color different from that of the normal segmentation map to obtain the abnormal representation map.

11. A three-dimensional industrial anomaly detection device, the device being deployed on an electronic device, comprising: A preprocessing module is used to obtain an RGB image and a three-dimensional point cloud image of the object to be detected, and preprocess the three-dimensional point cloud image to obtain multiple point cloud groups; A registration module, configured to perform feature extraction on the plurality of point cloud groups through a first feature extractor to obtain a point cloud feature group of the plurality of point cloud groups, generate a point cloud feature map according to the point cloud feature group and the three-dimensional point cloud map, and project the point cloud feature map to form a point cloud projection map of the same size as the RGB image; perform feature extraction on the RGB image through a second feature extractor to obtain an RGB feature of the RGB image; A fusion module, used to extract the RGB features and the point cloud features of the point cloud projection image respectively through a multi-layer perceptron, and fuse the feature information output by the multi-layer perceptron to obtain a fusion feature; The decision module is used to perform abnormality prediction on the object to be detected according to the RGB features, the point cloud features and the fusion features to obtain a prediction result of the object to be detected.

12. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the three-dimensional industrial anomaly detection method according to any one of claims 1 to 10.

13. An electronic device comprising: processor; as well as Memory for storing computer programs; The processor executes the computer program stored in the memory to implement the three-dimensional industrial anomaly detection method according to any one of claims 1 to 10.

14. A computer program product, comprising a computer program, which, when executed on a computer, enables the computer to execute the three-dimensional industrial anomaly detection method according to any one of claims 1 to 10.