Method and device for detecting defects on machined surfaces based on multi-image information fusion

Through the multi-light source detection device and image information fusion technology, combined with the noise generator, the problems of low surface defect detection accuracy and insufficient samples are solved, and high-precision surface defect detection under complex lighting conditions is achieved.

CN118014936BActive Publication Date: 2024-09-27ZHEJIANG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410024561.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-08
Publication Date
2024-09-27
Estimated Expiration
2044-01-08

AI Technical Summary

Technical Problem

Existing surface defect detection technology has low detection accuracy on complex curved surfaces, and due to insufficient defect samples, the detection effect is limited, especially under various lighting conditions, which is difficult to detect accurately.

Method used

Using a multi-light source defect detection device, the normal vector and depth information are obtained through the photometric stereo vision model and depth estimation model, combined with multi-dimensional image information fusion, and input into the anomaly discriminator and classification network for high-precision detection, and a noise generator is used to simulate defect samples to improve detection accuracy.

Benefits of technology

It improves the accuracy and recognition rate of curved surface defect detection, adapts to complex lighting conditions and curved surface shapes, solves the problem of insufficient defect samples, and achieves high-quality curved surface defect detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118014936B
    Figure CN118014936B
Patent Text Reader

Abstract

The present invention discloses a method and device for detecting defects on a machined surface based on multi-image information fusion, which belongs to the field of image processing technology, and includes: constructing a multi-light source defect acquisition device, obtaining a to-be-classified image under different light source angles, inputting a photometric stereo vision model, obtaining a normal vector map, inputting the to-be-classified image and the normal vector map into a depth estimation model, and obtaining a depth map; inputting the to-be-classified image, the normal vector map, and the depth map into a feature extractor, generating original domain features, and inputting the original domain features into a feature adapter after channel cascading to obtain target domain features; passing the target domain features through an anomaly discriminator to distinguish abnormal features from normal features, and locating abnormal features; and performing fine-grained defect classification on the located abnormal features through a classification network to obtain the defect types of the machined surface. The present invention utilizes the multi-image information fusion of visible light images, normal vector maps, and depth maps under multiple light source angles to improve the detection accuracy of surface defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and in particular relates to a method and device for detecting defects on a processed surface based on multi-image information fusion. Background Art

[0002] Accurate evaluation of complex surfaces is an indispensable part of high-precision manufacturing and is related to the final processing quality. Among them, defect detection on complex surfaces is a very important task with many application scenarios, such as metal processing, semiconductor processing, integrated circuits, and aerospace industries. Therefore, it has very important application prospects.

[0003] However, in actual detection, due to the wide variety of defects, different locations, and various surface shapes and lighting conditions of the objects where the defects are located, it is difficult to detect. Conventional surface defect detection solutions generally use visible light images or visible light images and normal vector maps, and perform defect detection through deep neural networks. However, different defects have different imaging effects under visible light, some are very obvious and some are invisible.

[0004] In addition, conventional detection methods are highly dependent on training data, but in fact defect data only occupies a small part of industrial data sets, and most of the data is normal data. Therefore, some defect data needs to be artificially synthesized. However, defects do not have much commonality in the image space, and data synthesis is difficult. In addition, there is a large gap with the actual defects. Therefore, the current detection effect is greatly affected by these factors.

[0005] In view of the above problems, the patent document with publication number CN111344553A discloses a defect detection method and detection system for curved surface objects, including: S1) controlling a light source (11) to generate multiple coherent laser beams; S2) controlling multiple coherent laser beams to illuminate the detection area of ​​the curved surface object (4) from multiple illumination angles; S3) receiving the coherent laser signal reflected or scattered by the curved surface object (4) through a photoelectric sensor (2) and generating a speckle image (5); and S4) judging whether the curved surface object (4) has defects and the type of defects according to the speckle image (5). However, the invention only detects curved surface defects through coherent laser beams, and different defects have different response degrees to coherent laser beams. Obviously, the final detection accuracy is difficult to guarantee.

[0006] The patent document with publication number CN106127780A discloses a method and device for automatically detecting surface defects of curved surfaces, including: (1) training stage: collecting sample images, constructing a training set, performing artificial defect recognition on the images in the training set, and marking the areas where all defects appear; performing a defect pre-location step for each image in the training set to obtain the area R where all defects may appear; comparing R with the areas where all defects appear that are manually marked, and dividing negative samples and positive samples according to the overlap between the two; performing offline training of a deep neural network model based on the positive samples and negative samples, and outputting the category and specific coordinates of the defect area; (2) online detection stage: collecting the current surface image of the curved surface to be detected, performing a defect pre-location step, obtaining a set R, and inputting the set R into the network model to obtain the category and specific coordinates of the defect area. However, the invention requires a large number of defect training samples in the training stage to ensure the final detection effect. However, in reality, there are fewer surface defect samples, and it is difficult to ensure a sufficient number of training samples, thereby failing to ensure the final detection accuracy. Summary of the invention

[0007] The purpose of the present invention is to provide a method and device for detecting machining surface defects based on multi-image information fusion. By constructing a multi-light source defect detection device, visible light images under different illumination angles are obtained, and then normal vector information and depth information are indirectly obtained through a photometric stereo vision model and a depth estimation model. The multi-image information is fused and input into an anomaly identifier and classification network to perform high-precision surface defect positioning and classification tasks.

[0008] In order to achieve the above-mentioned invention object, the technical solution provided by the present invention is as follows:

[0009] In a first aspect, an embodiment of the present invention provides a method for detecting defects on a machined surface based on multi-image information fusion, comprising the following steps:

[0010] Step 1: Build a multi-light source defect acquisition device, obtain the image to be classified of the processed surface under different light source angles, input the image to be classified, or the image to be classified and its corresponding object mask image into the photometric stereo vision model to obtain the surface normal vector map, input the image to be classified and the surface normal vector map into the depth estimation model to obtain the depth map;

[0011] Step 2: Input the image to be classified, the surface normal vector image and the depth image into the pre-trained feature extractor to generate the original domain features, and then input the original domain features into the feature adapter after channel concatenation to obtain the target domain features;

[0012] Step 3: Generate defect features through the abnormal feature generator, add them to the target domain features respectively, obtain local abnormal features, use the target domain features as positive samples and the local abnormal features as negative samples to complete the training of the abnormal discriminator, use the trained abnormal discriminator to distinguish the abnormal features and normal features in the target domain features, and locate the abnormal features;

[0013] Step 4: The located abnormal features are cropped according to the minimum bounding box to obtain cropped features, and the cropped features are input into the classification network for fine-grained defect classification to obtain the defect types of the processed surface.

[0014] The present invention designs a multi-light source defect acquisition device, which acquires images to be classified at different light source angles on the surface to be inspected. Furthermore, the influence of illumination on some defects can be compensated according to the normal vector, and the depth information can further compensate for the local depth change of defects in the image. The present invention proposes a photometric stereo vision device for obtaining the surface normal vector map corresponding to the image to be classified. The present invention also adopts a depth estimation model to obtain a depth map according to the image to be classified and the surface normal vector map. By fusing the multi-image information of the image to be classified, the surface normal vector map and the depth map, the deficiencies in the prior art are compensated and the defect detection accuracy is improved.

[0015] Taking into account the shortage of training data for surface defect detection in the prior art, the present invention proposes an abnormal feature generator based on a noise generator. The abnormal feature generator simulates defect samples by superimposing noise on target domain features and uses the samples as negative samples to train the abnormal discriminator. The abnormal discriminator proposed in the present invention solves the problem of insufficient defect samples in the field of surface defect detection.

[0016] For surface defect detection, the present invention proposes a two-stage detection approach, first positioning and then classification. The anomaly identifier proposed in the present invention can distinguish abnormal features from normal features in the target domain features and locate abnormal features; for the located abnormal features, the present invention further uses a residual classification network to classify the defect categories and obtain the defect types on the surface to be detected.

[0017] Furthermore, in step 1, the multi-light source defect acquisition device comprises:

[0018] A hemispherical cover;

[0019] A camera is set in the center of the dome and faces vertically downward;

[0020] Several LED light sources, one of which is set near the camera, and the others are selected and installed on the hemispherical cover according to the Fibonacci ball sampling method. During actual data collection, only one LED light source is allowed to light up at a time, and each LED light source corresponds to a sampling point.

[0021] The longitude and latitude coordinates on the hemispherical surface are expressed by the formula:

[0022]

[0023] Lon i =2πiφ -1

[0024] Among them, Lat i Indicates the latitude corresponding to the i-th sampling point, Lon i Indicates the longitude corresponding to the i-th sampling point, m is used to control the density of the sampling points, i∈[-m,m] indicates that φ=1.618 is the golden ratio, which is used to ensure the uniformity of the sampling point positions and remove some close positions;

[0025] The hemispherical cover, the camera, and a plurality of LED light sources form a multi-light source defect collection device, which is placed on a three-axis coordinate machine and moves in space along with the moving axis.

[0026] Furthermore, in step 1, the step of inputting the image to be classified, or the image to be classified and its corresponding object mask image into the photometric stereo vision model to obtain a surface normal vector map includes:

[0027] The image to be classified Or the image to be classified and its corresponding object mask image In the input photometric stereo model, H, W, and C represent the height, width, and number of channels of the image, respectively. represents the set of real numbers;

[0028] The photometric stereo vision model consists of a preprocessing module, a scale-invariant spatial-illumination feature encoder, a pixel-sampled Transformer non-local interaction module, and a normal vector regression module.

[0029] Among them, the preprocessing module is used to treat the classification graph Or the image to be classified and its corresponding object mask image Perform cropping and normalization processing to crop some background information in the image to be classified, and obtain a cropped image with an image size that is a multiple of 32;

[0030] A scale-invariant spatial-illumination feature encoder that extracts the corresponding global illumination feature map from the cropped image at each light source angle;

[0031] The Transformer non-local interaction module of pixel sampling is used to perform feature sampling on the global illumination feature map to obtain sampled features, perform feature interpolation on the sampled features and perform feature aggregation with the corresponding pixels in the image to be classified to obtain aggregated features, and obtain enhanced normal vector features by using the aggregated features based on Transformer non-local interaction;

[0032] The normal vector regression module is used to obtain the surface normal vector map of the sampling point by passing the enhanced normal vector features through a normal vector regression module based on a multi-layer perceptron, and sample each pixel to obtain the surface normal vector map of each pixel sampling point.

[0033] Furthermore, in step 1, the step of inputting the image to be classified and the surface normal vector image into the depth estimation model to obtain the depth map includes:

[0034] Pass the image to be classified through an encoder and a Laplacian pyramid decoder to obtain the initial deep features;

[0035] The surface normal vector map passes through a convolution layer and a bilateral normal vector integration module to obtain a normal vector integral feature map;

[0036] The initial depth feature and the normal vector integral feature map are fused to obtain the depth map.

[0037] Furthermore, in step 2, the step of inputting the image to be classified, the surface normal vector image and the depth image into a pre-trained feature extractor to generate original domain features includes:

[0038] The pre-trained feature extractor is a discrete autoencoder network based on visible light image-depth-normal vector, which includes two encoders and two decoders in sequence. During the training phase, 3D simulated depth data, simulated normal vector data and ImageNet dataset are used for supervised training. The pre-training of the feature extractor is realized according to the preset usage batch, learning rate and maximum number of iterations.

[0039] The original domain features include a local visible light feature map corresponding to the image to be classified, a local normal vector feature map corresponding to the surface normal vector map, and a local depth feature map corresponding to the depth map.

[0040] Furthermore, in step 2, the original domain features are cascaded through channels and then input into the feature adapter to obtain the target domain features, including:

[0041] The feature adapter uses a fully convolutional neural network to operate the local visible light feature map, the local normal vector feature map and the local depth feature map after channel cascading in the form of group convolution to obtain the target domain feature Where C1, C2 and C3 represent the local visible light features in the target domain, respectively. Local Normal Vector Features and local depth features The number of channels is large, and different features remain relatively independent.

[0042] Furthermore, in step 3, the abnormal feature generator includes two noise generators, namely a Gaussian noise generator and a Perlin noise generator:

[0043] The Gaussian Noise Generator generates three-dimensional Gaussian noise that conforms to a standard normal distribution. and As defect features, they are respectively compared with the local visible light features in the target domain Local Normal Vector Features Performing an addition operation to obtain local visible light abnormality features and local normal vector abnormality features;

[0044] Perlin Noise Generator Generates Perlin noise As defect features, and local deep features in the target domain Perform an addition operation to obtain local depth anomaly features;

[0045] The local abnormal features are composed of local visible light abnormal features, local normal vector abnormal features and local depth abnormal features.

[0046] Furthermore, in step 3, the target domain features are used as positive samples and the local abnormal features are used as negative samples to complete the training of the abnormal discriminator, including:

[0047] The anomaly discriminator D f is a binary classification network;

[0048] The positive and negative samples are fed into the anomaly discriminator D together. f In the example, the anomaly discriminator D f Estimate the normality of (H, W) on each pixel feature in positive and negative samples. The normal feature pixel is m∈H×W, the abnormal feature pixel is Anomaly Discriminator D f It is expected that the normal feature output is 1 and the abnormal feature output is 0. The abnormal feature is located according to the position of the 0 pixel point. During the training process, the loss function uses the relative loss function L, which is expressed by the formula:

[0049]

[0050] Among them, Ε represents expectation, S represents sigmoid function;

[0051] The training of the anomaly discriminator is completed by minimizing the relative loss function L.

[0052] Furthermore, step 4 is specifically as follows:

[0053] The abnormal features located on the target domain features are cropped according to the minimum bounding box to obtain cropped features;

[0054] Performing data enhancement on the cropped features, including flipping, rotating, scaling, and jittering;

[0055] The clipping features after data enhancement are input into the residual classification network for defect classification to obtain the defect types of the machined surface.

[0056] In the second aspect, in order to achieve the above-mentioned invention object, the embodiment of the present invention also provides a machined surface defect detection device based on multi-image information fusion, including a multi-image information acquisition module, a local feature extraction and feature domain conversion module, an abnormal feature positioning module, and a defect fine-grained classification module;

[0057] The multi-image information acquisition module is used to construct a multi-light source defect acquisition device, obtain a to-be-classified image of the processed surface under different light source angles, input the to-be-classified image, or the to-be-classified image and its corresponding object mask image into a photometric stereo vision model to obtain a surface normal vector image, and input the to-be-classified image and the surface normal vector image into a depth estimation model to obtain a depth map;

[0058] The local feature extraction and feature domain conversion module is used to input the image to be classified, the surface normal vector image and the depth image into the pre-trained feature extractor to generate the original domain features, and then input the original domain features into the feature adapter after channel cascading to obtain the target domain features;

[0059] The abnormal feature positioning module is used to generate defect features through an abnormal feature generator, add them to the target domain features respectively, obtain local abnormal features, use the target domain features as positive samples and the local abnormal features as negative samples, complete the training of the abnormal discriminator, use the trained abnormal discriminator to distinguish abnormal features and normal features in the target domain features, and locate the abnormal features;

[0060] The defect fine-grained classification module is used to perform cropping processing on the located abnormal features according to the minimum bounding box to obtain cropping features, and the cropping features are input into the classification network for fine-grained defect classification to obtain the defect types of the processed surface.

[0061] The beneficial effects of the present invention are as follows:

[0062] (1) The present invention fully utilizes the advantages of visible light images, normal vector images and depth images in characterizing defects under different conditions, and is suitable for workpieces under various complex lighting conditions, complex curved surfaces and surface roughness;

[0063] (2) The present invention simultaneously adopts a two-stage detection scheme with different granularities, first locating the anomaly and then further identifying the defect category through a classification model, which can improve the recognition rate;

[0064] (3) The method proposed in the present invention can solve the problem of the small amount of actual defect data in industrial scenarios. It utilizes the characteristics that different defects present different distributions in the feature space, adds noise to the feature space to simulate defects and adds it to training, so as to more effectively improve the richness and diversity of defect samples, thereby completing high-quality surface defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 It is a flow chart of a method for detecting defects on a machined surface based on multi-image information fusion provided by an embodiment of the present invention.

[0066] Figure 2 It is a schematic diagram of the structure of a multi-light source defect detection device provided in an embodiment of the present invention.

[0067] Figure 3 It is a flow chart of the photometric stereo vision model provided by an embodiment of the present invention.

[0068] Figure 4 It is a flow chart of a network structure for abnormal feature detection and positioning provided by an embodiment of the present invention.

[0069] Figure 5 It is a structural schematic diagram of a machined surface defect detection device based on multi-image information fusion provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

[0071] The inventive concept of the present invention is: in view of the problem that in the existing field of curved surface defect detection technology, conventional visible light images have low accuracy in curved surface defect detection, and a large number of defect samples are required when using deep neural network methods for defect detection, but it is difficult to collect a large number of samples in practice, the present invention proposes.

[0072] Figure 1 FIG. 1 is a flow chart of a method for detecting defects on a machined surface based on multi-image information fusion provided by an embodiment of the present invention. Figure 1 As shown, the embodiment provides a method for detecting defects on a machined surface based on multi-image information fusion, comprising the following steps:

[0073] S110, construct a multi-light source defect acquisition device, obtain the image to be classified of the processed surface under different light source angles, input the image to be classified, or the image to be classified and its corresponding object mask image into the photometric stereo vision model to obtain a surface normal vector map, input the image to be classified and the surface normal vector map into the depth estimation model to obtain a depth map.

[0074] In this embodiment, a multi-light source defect detection device is first constructed, including a camera, a hemispherical cover and k=27 LED light sources, such as Figure 2 As shown, the camera is located directly above the center of the hemispherical cover, facing vertically downward. An LED light source is set next to the camera. The remaining LED light sources are selected and installed on the hemispherical cover according to the Fibonacci ball sampling method. The longitude and latitude position coordinates on the hemispherical cover can be determined by the following formula:

[0075]

[0076] Lon i =2πiφ -1

[0077] Among them, Lat i Indicates the latitude corresponding to the i-th sampling point, Lon i represents the longitude corresponding to the i-th sampling point, m is used to control the density of the sampling points, i∈[-m,m], φ=1.618 is the golden ratio, which is used to ensure that the sampling positions are relatively uniform and remove some close positions.

[0078] The camera internal parameters and light intensity are calibrated. During actual measurement, only one LED light source is allowed to emit light at a time, and then the corresponding image is captured to obtain k images to be classified under different light source angles. H, W, and C are the height, width, and number of channels of the image, respectively. Represents a real number set. The multi-light source defect detection device can be placed on a three-axis coordinate machine and move in space with the moving axis, thus having more measurement space.

[0079] In this embodiment, in order to improve the detection accuracy of processed surface defects, k images to be classified under different light source angles are Or the image to be classified and its corresponding object mask image Input the photometric stereo vision model to obtain the surface normal vector map. The flow chart is as follows Figure 3 As shown, the photometric stereo vision device includes a preprocessing module, a scale-invariant spatial-illumination feature encoder, a pixel-sampling Transformer non-local interaction module, and a normal vector regression module based on a multi-layer perceptron.

[0080] The preprocessing module in the photometric stereo vision device processes the input and Cropping and normalization are performed to crop off some background information so that the image size is a multiple of 32. The scale-invariant spatial-illumination feature encoder extracts the corresponding global illumination feature map from the image information of each illumination direction. In this embodiment, the scale-invariant spatial-illumination feature encoder is based on the Swin Transformer backbone network. The input image and its corresponding mask image are input into the Swin Transformer backbone network for feature extraction to obtain a hierarchical feature map. After that, the same scale of the hierarchical feature map is exchanged and fused to finally obtain a global illumination feature map.

[0081] The Transformer non-local interaction module of pixel sampling includes feature sampling operations on the global illumination feature map, feature interpolation of the obtained sampled features, and feature aggregation with the corresponding pixels of the image to be classified at different light source angles, and then the enhanced normal vector features are obtained through the Transformer non-local interaction. The enhanced normal vector features are used to obtain the surface normal vector map of the sampling point through the normal vector regression module based on the multi-layer perceptron, and the normal vector of each pixel can be obtained by sampling each pixel.

[0082] Then, the image to be classified and the surface normal features under different light source angles are respectively input into the pre-built depth estimation model. The image passes through a commonly used encoder and Laplacian pyramid decoder to obtain the initial depth feature map; the surface normal features pass through a convolutional layer and a bilateral normal vector integral module to obtain a normal vector integral feature map, which is fused with the initial depth feature map to obtain an optimized depth map.

[0083] S120, input the image to be classified, the surface normal vector image and the depth image into the pre-trained feature extractor to generate original domain features, and input the original domain features into the feature adapter after channel cascading to obtain target domain features.

[0084] In this embodiment, a discrete autoencoder network based on visible light image-depth-normal vector is trained, using a conventional two-stage discretization architecture, including two encoders and two decoders, and supervised training using 3D depth data, simulated normal vector data and ImageNet dataset. A batch size of 64 and a learning rate of 0.0002 are used for 120,000 iterations. The trained discrete autoencoder network based on visible light image-depth-normal vector is used as a feature extractor and as a pre-trained model during feature extraction, and its weight remains unchanged.

[0085] like Figure 4The images to be classified under different light source angles are visible light images. The visible light image, normal vector map and depth map are input into a pre-trained feature extractor to obtain local visible light feature map, local normal vector feature map and local depth feature map respectively. These three types of local features are channel cascaded to obtain a cascade feature map which is input into a feature adapter to convert the local features into target domain features.

[0086] Specifically, the feature adapter uses a fully convolutional neural network to operate the local visible light feature map, local normal vector feature map and local depth feature map in the form of group convolution to obtain the target domain features. Different features remain relatively independent, where C1, C2, and C3 represent the local visible light features in the target domain. Local Normal Vector Features and local depth features The number of channels.

[0087] S130, generate defect features through the abnormal feature generator, add them to the target domain features respectively, obtain local abnormal features, use the target domain features as positive samples and the local abnormal features as negative samples, complete the training of the abnormal discriminator, use the trained abnormal discriminator to distinguish the abnormal features and normal features in the target domain features, and locate the abnormal features.

[0088] In this embodiment, Figure 4 As shown, an abnormal feature generator is constructed, which includes two noise generators, namely Gaussian noise generator and Perlin noise generator. The Gaussian noise generator generates three-dimensional Gaussian noise that conforms to the standard normal distribution. and Respectively with the local visible light feature map Local normal feature map An addition operation is performed to obtain local visible light abnormality features and local normal vector abnormality features.

[0089] The Perlin noise generator is used to generate various local smooth textures, which can better simulate the gradual change of depth. It is processed by randomizing affine transformation to simulate subtle local changes and different average object distances. and local depth feature map Perform addition operation to obtain local depth anomaly features.

[0090] The local visible light feature map, local normal vector feature map and local depth feature map are used as positive samples, and the local visible light abnormal feature, local normal vector abnormal feature and local depth abnormal feature are used as negative samples. Since the negative samples are generated at the same time as the positive samples, the positive samples and the negative samples are input into the abnormal feature discriminator D together. fIn, it is used to train the abnormal feature discriminator D f .

[0091] During the training process, anomalies were only generated on foreground objects, using a batch size of 32 and a learning rate of 0.0002 for 50,000 iterations. f As a two-classification network, a conventional residual network is used to directly estimate the normality of (H, W) on each pixel feature. The normal feature pixel is m∈H×W, the abnormal feature pixel is Abnormal feature discriminator D f It is expected that the normal feature output is 1 and the abnormal feature output is 0. The abnormal feature is located according to the position of the 0 pixel point. The training loss function uses the relative loss function L, which is expressed as follows:

[0092]

[0093] Where Ε represents expectation and S represents the sigmoid function.

[0094] S140, the located abnormal features are clipped according to the minimum bounding box to obtain clipped features, and the clipped features are input into a classification network to perform fine-grained defect classification to obtain defect types of the processed surface.

[0095] When using anomaly feature discriminators for actual reasoning, the target domain features are passed through an anomaly discriminator D f , used to distinguish whether each pixel area belongs to an abnormal feature or a normal feature, and locate the abnormal feature. The obtained abnormal feature is cropped according to the minimum bounding box, and the cropped feature is subjected to data enhancement operations, including flipping, rotation, scaling, and jitter processing, and is input into the residual classification network for more fine-grained defect classification.

[0096] Based on the same inventive concept, the embodiment of the present invention also provides a processing surface defect detection device 500 based on multi-image information fusion, such as Figure 5 As shown, it includes a multi-image information acquisition module 510, a local feature extraction and feature domain conversion module 520, an abnormal feature positioning module 530, and a defect fine-grained classification module 540;

[0097] Among them, the multi-image information acquisition module 510 is used to construct a multi-light source defect acquisition device, obtain the image to be classified of the processed surface under different light source angles, input the image to be classified, or the image to be classified and its corresponding object mask image into the photometric stereo vision model to obtain a surface normal vector map, and input the image to be classified and the surface normal vector map into the depth estimation model to obtain a depth map;

[0098] The local feature extraction and feature domain conversion module 520 is used to input the image to be classified, the surface normal vector image and the depth image into the pre-trained feature extractor to generate the original domain features, and then input the original domain features into the feature adapter after channel cascading to obtain the target domain features;

[0099] The abnormal feature location module 530 is used to generate defect features through an abnormal feature generator, add them to the target domain features respectively, obtain local abnormal features, use the target domain features as positive samples and the local abnormal features as negative samples, complete the training of the abnormal discriminator, use the trained abnormal discriminator to distinguish the abnormal features and normal features in the target domain features, and locate the abnormal features;

[0100] The defect fine-grained classification module 540 is used to perform cropping processing on the located abnormal features according to the minimum bounding box to obtain cropping features, and input the cropping features into the classification network to perform fine-grained defect classification to obtain the defect type of the processed surface.

[0101] As for the machined surface defect detection device based on multi-image information fusion provided by the embodiment of the present invention, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without creative work.

[0102] It should be noted that the processing surface defect detection device based on multi-image information fusion provided in the above-mentioned embodiment and the processing surface defect detection method embodiment based on multi-image information fusion belong to the same concept. The specific implementation process is detailed in the processing surface defect detection method embodiment based on multi-image information fusion, which will not be repeated here.

[0103] The above is only a preferred implementation case of the present invention and does not limit the present invention in any form. Although the implementation process of the present invention is described in detail above, for those familiar with the art, they can still modify the technical solutions recorded in the above examples, or replace some of the technical features therein with equivalents. All modifications, equivalent replacements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting defects on a machined surface based on multi-image information fusion, characterized in that: The following steps are involved: Step 1: Build a multi-light source defect acquisition device, obtain the image to be classified of the processed surface under different light source angles, input the image to be classified, or the image to be classified and its corresponding object mask image into the photometric stereo vision model to obtain the surface normal vector map, input the image to be classified and the surface normal vector map into the depth estimation model to obtain the depth map; Step 2: Input the image to be classified, the surface normal map and the depth map into the pre-trained feature extractor to generate the original domain features. After channel concatenation, the original domain features are input into the feature adapter to obtain the target domain features, including: The pre-trained feature extractor is a discrete autoencoder network based on visible light image-depth-normal vector, which includes two encoders and two decoders in sequence. In the training stage, 3D simulated depth data, simulated normal vector data and ImageNet data set are used for supervised training. The pre-training of the feature extractor is realized according to the preset usage batch, learning rate and maximum number of iterations; the original domain features include the local visible light feature map corresponding to the image to be classified, the local normal feature map corresponding to the surface normal map and the local depth feature map corresponding to the depth map; The feature adapter uses a fully convolutional neural network to operate the local visible light feature map, the local normal vector feature map and the local depth feature map after channel cascading in the form of group convolution to obtain the target domain feature , , Respectively represent the height and width of the image. , and Represent the local visible light features in the target domain , local normal vector features and local depth features The number of channels is large, and different features remain relatively independent; Step 3: Generate defect features through the abnormal feature generator, add them to the target domain features respectively, and obtain local abnormal features, including: abnormal feature generator, including Gaussian noise generator and Perlin noise generator, Gaussian noise generator generates three-dimensional Gaussian noise that conforms to the standard normal distribution and , as defect features, respectively compared with the local visible light features in the target domain , local normal vector features Perform addition operation to obtain local visible light abnormality features and local normal vector abnormality features; Perlin noise generator generates Perlin noise , as defect features, and local deep features in the target domain Performing an addition operation to obtain a local depth anomaly feature; the local visible light anomaly feature, the local normal vector anomaly feature and the local depth anomaly feature constitute the local anomaly feature; The target domain features are used as positive samples and the local abnormal features are used as negative samples to complete the training of the abnormal discriminator. The trained abnormal discriminator is used to distinguish the abnormal features and normal features in the target domain features and locate the abnormal features. Step 4: The located abnormal features are cropped according to the minimum bounding box to obtain cropped features, and the cropped features are input into the classification network for fine-grained defect classification to obtain the defect types of the processed surface.

2. The method for detecting defects on a machined surface based on multi-image information fusion according to claim 1, characterized in that: In step 1, the multi-light source defect acquisition device comprises: A hemispherical cover; A camera is set in the center of the dome and faces vertically downward; Several LED light sources, one of which is set near the camera, and the others are selected and installed on the hemispherical cover according to the Fibonacci ball sampling method. During actual data collection, only one LED light source is allowed to light up at a time, and each LED light source corresponds to a sampling point. The longitude and latitude coordinates on the hemispherical surface are expressed by the formula: ; ; in, Indicates i The latitude corresponding to the sampling point, Indicates i The longitude corresponding to the sampling point, m Used to control the density of sampling points. , It is the golden ratio, which is used to ensure the uniformity of the sampling point positions and remove some close positions; The hemispherical cover, the camera, and a plurality of LED light sources form a multi-light source defect collection device, which is placed on a three-axis coordinate machine and moves in space along with the moving axis.

3. The method for detecting defects on machined surfaces based on multi-image information fusion according to claim 1, characterized in that: In step 1, the step of inputting the image to be classified, or the image to be classified and its corresponding object mask image into the photometric stereo vision model to obtain a surface normal vector map includes: The image to be classified , or the graph to be classified and its corresponding object mask image Input photometric stereo vision model, Indicates the number of channels of the image, represents the set of real numbers; The photometric stereo vision model consists of a preprocessing module, a scale-invariant spatial-illumination feature encoder, a pixel-sampled Transformer non-local interaction module, and a normal vector regression module. Among them, the preprocessing module is used to treat the classification graph , or the image to be classified and its corresponding object mask image Perform cropping and normalization processing to crop some background information in the image to be classified, and obtain a cropped image with an image size that is a multiple of 32; A scale-invariant spatial-illumination feature encoder that extracts the corresponding global illumination feature map from the cropped image at each light source angle; The Transformer non-local interaction module of pixel sampling is used to perform feature sampling on the global illumination feature map to obtain sampled features, perform feature interpolation on the sampled features and perform feature aggregation with the corresponding pixels in the image to be classified to obtain aggregated features, and obtain enhanced normal vector features by using the aggregated features based on Transformer non-local interaction; The normal vector regression module is used to obtain the surface normal vector map of the sampling point by passing the enhanced normal vector features through a normal vector regression module based on a multi-layer perceptron, and sample each pixel to obtain the surface normal vector map of each pixel sampling point.

4. The method for detecting defects on machined surfaces based on multi-image information fusion according to claim 1, characterized in that: In step 1, the image to be classified and the surface normal vector image are input into the depth estimation model to obtain the depth map, including: Pass the image to be classified through an encoder and a Laplacian pyramid decoder to obtain the initial deep features; The surface normal vector map passes through a convolution layer and a bilateral normal vector integration module to obtain a normal vector integral feature map; The initial depth feature and the normal vector integral feature map are fused to obtain the depth map.

5. The method for detecting defects on a machined surface based on multi-image information fusion according to claim 1 or 2, characterized in that: In step 3, the target domain features are used as positive samples and the local abnormal features are used as negative samples to complete the training of the abnormal discriminator, including: The anomaly discriminator is a binary classification network; The positive and negative samples are input into the anomaly discriminator together, that is, the anomaly discriminator In the anomaly discriminator Estimate the normality of (H, W) on each pixel feature in positive and negative samples. The normal feature pixel is , the abnormal feature pixel is , anomaly discriminator It is expected that the normal feature output is 1 and the abnormal feature output is 0. The abnormal feature is located according to the position of the 0 pixel point. During the training process, the loss function uses the relative loss function. L , expressed as: ; in, Indicates expectation, S indicates Activation function, through relative loss function L The minimization of completes the training of the anomaly discriminator.

6. The method for detecting defects on machined surfaces based on multi-image information fusion according to claim 1, characterized in that: Step 4 is as follows: The abnormal features located on the target domain features are cropped according to the minimum bounding box to obtain cropped features; Performing data enhancement on the cropped features, including flipping, rotating, scaling, and jittering; The clipping features after data enhancement are input into the residual classification network for defect classification to obtain the defect types of the machined surface.

7. A machined surface defect detection device based on multi-image information fusion, characterized in that: It includes multi-image information acquisition module, local feature extraction and feature domain conversion module, abnormal feature location module, and defect fine-grained classification module; The multi-image information acquisition module is used to construct a multi-light source defect acquisition device, obtain a to-be-classified image of the processed surface under different light source angles, input the to-be-classified image, or the to-be-classified image and its corresponding object mask image into a photometric stereo vision model to obtain a surface normal vector image, and input the to-be-classified image and the surface normal vector image into a depth estimation model to obtain a depth map; The local feature extraction and feature domain conversion module is used to input the image to be classified, the surface normal vector image and the depth image into the pre-trained feature extractor to generate the original domain features, and then input the original domain features into the feature adapter after channel cascading to obtain the target domain features, including: The pre-trained feature extractor is a discrete autoencoder network based on visible light image-depth-normal vector, which includes two encoders and two decoders in sequence. In the training stage, 3D simulated depth data, simulated normal vector data and ImageNet data set are used for supervised training. The pre-training of the feature extractor is realized according to the preset usage batch, learning rate and maximum number of iterations; the original domain features include the local visible light feature map corresponding to the image to be classified, the local normal feature map corresponding to the surface normal map and the local depth feature map corresponding to the depth map; The feature adapter uses a fully convolutional neural network to operate the local visible light feature map, the local normal vector feature map and the local depth feature map after channel cascading in the form of group convolution to obtain the target domain feature , , Respectively represent the height and width of the image. , and Represent the local visible light features in the target domain , local normal vector features and local depth features The number of channels is large, and different features remain relatively independent; The abnormal feature positioning module is used to generate defect features through an abnormal feature generator, and add them to the target domain features to obtain local abnormal features, including: an abnormal feature generator, including a Gaussian noise generator and a Perlin noise generator, the Gaussian noise generator generates three-dimensional Gaussian noise that conforms to the standard normal distribution and , as defect features, respectively compared with the local visible light features in the target domain , local normal vector features Perform addition operation to obtain local visible light abnormality features and local normal vector abnormality features; Perlin noise generator generates Perlin noise , as defect features, and local deep features in the target domain Performing an addition operation to obtain a local depth anomaly feature; the local visible light anomaly feature, the local normal vector anomaly feature and the local depth anomaly feature constitute the local anomaly feature; The target domain features are used as positive samples and the local abnormal features are used as negative samples to complete the training of the abnormal discriminator. The trained abnormal discriminator is used to distinguish the abnormal features and normal features in the target domain features and locate the abnormal features. The defect fine-grained classification module is used to perform cropping processing on the located abnormal features according to the minimum bounding box to obtain cropping features, and the cropping features are input into the classification network for fine-grained defect classification to obtain the defect types of the processed surface.