Copper alloy element quality detection method based on deep learning
Through the deep learning-based copper alloy component quality detection method, combined with laser scanning, bilateral filtering and deep learning network, the problems of low efficiency and large error in the existing technology are solved, and high accuracy and efficient quality detection are achieved.
Patent Information
- Application Number
- CN202411414591.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-11
AI Technical Summary
The prior art has low efficiency and large errors in the quality detection of copper alloy components, especially in detecting small size defects and dimensional accuracy, which affects the factory rate and causes economic losses.
The copper alloy component quality detection method is adopted based on deep learning, point cloud data is collected through laser scanning, and pre-processed using a bilateral filtering algorithm, combined with the PointNet network for size detection and classification, and improved on the YOLOv7 network model to increase attention mechanism and Lightweight treatment to realize surface defect detection.
It realizes high accuracy and high precision copper alloy components quality inspection, reduces manual errors, improves detection efficiency, and can effectively detect small-size defects and dimensional accuracy, meeting the real-time needs of industrial production.
Smart Images

Figure CN119444673A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of copper alloy component quality detection, and in particular to a copper alloy component quality detection method based on deep learning. Background Art
[0002] Copper alloy has become a key material for the production of heat dissipation components due to its outstanding thermal conductivity. However, its production process is complicated, and there are many factors that affect the quality of copper alloy components. This may lead to defects in the surface appearance of copper alloy components, component dimensions exceeding the specified value, and other quality problems, thereby affecting the factory rate of copper alloy components and causing economic losses. At present, copper alloy processing still relies on manual visual inspection, which is inefficient and has large errors. According to research, when the defect size of the target is less than 0.5mm or the optical deformation is small, the defect cannot be detected by manual visual methods. In addition, when manual dimensional inspection is performed, it is often measured by measuring tools such as micrometers. In this process, the accuracy of the measuring tools and human subjectivity will have a great impact on the measurement. One of the key tasks for my country to achieve intelligent manufacturing is to accelerate the development of artificial intelligence technology in the quality inspection of the manufacturing industry. Therefore, in order to reduce the errors caused by manual labor, it is necessary to introduce more efficient, reliable and objective detection methods. With the rapid development of deep learning technology and its application in the industrial field, the introduction of deep learning into factory production is regarded as an important direction of industrial intelligence. Summary of the invention
[0003] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide a copper alloy component quality detection method based on deep learning that meets the requirements of high accuracy, high precision, and real-time performance.
[0004] In order to achieve the above object, the present invention provides the following technical solution: a copper alloy component quality detection method based on deep learning, comprising the following steps:
[0005] S1: Collect initial point cloud data of copper alloy components through laser scanning;
[0006] S2: Use bilateral filtering algorithm to pre-process the collected data to obtain the denoised point cloud data of the copper alloy component;
[0007] S3: Perform size detection and classification of copper alloy components based on deep learning to obtain size detection results;
[0008] S4: Copper alloy components with qualified sizes enter the surface defect detection. In the surface defect detection, the YOLOv7 network model is improved, and the attention mechanism is added while lightweighting it. The surface defect detection is performed based on the improved YOLOv7 network model to obtain the detection results.
[0009] Furthermore, the bilateral filtering in S2 uses a combination of two Gaussian filters, one for calculating the weight of spatial proximity, and the other for calculating the weight of pixel value similarity. The simultaneous action of the two Gaussian filters is bilateral filtering, and the expression is as follows:
[0010]
[0011] Where g(i,j) represents the output point; S(i,j) represents the range of (2N+1)(2N+1) centered at (i,j); f(k,l) represents the input point; w(i,j,k,l) represents the value calculated by two Gaussian functions;
[0012] W=W s *W r ,w s is a spatial proximity Gaussian function, which measures the distance between two points p(i,j) and q(k,l). The farther the distance, the lower the weight. r is the pixel value similarity Gaussian function, which measures the similarity of the pixel values between points p and q. The more similar, the greater the weight.
[0013]
[0014] Where f(i,j) represents the pixel value corresponding to p(i,j), σ s is the spatial domain standard deviation, σ r is the standard deviation of the range.
[0015] Furthermore, in S3, the size detection and classification of copper alloy components based on deep learning includes the following steps:
[0016] The PointNet network is used to classify the preprocessed point cloud data. The input points pass through the spatial transformation network, use the multi-layer perceptron MLP and feature transformation, and then input into another multi-layer perceptron to extract the overall features through the maximum pooling operation, and then obtain the classification results through the multi-layer perceptron.
[0017] Furthermore, S4 introduces a triple attention mechanism to improve the network structure. The triple attention mechanism includes the following three levels of attention calculation:
[0018] Global attention: Global attention is calculated on the lowest or most primitive representation of the input data. At this level, the model tries to understand the context of the entire input and calculates the importance of each part.
[0019] Inter-group attention: Inter-group attention is calculated based on the representation obtained by global attention. It divides the global representation into different groups and then calculates the attention weights between these groups.
[0020] Intra-group attention: Intra-group attention is calculated based on the representation obtained by inter-group attention. It calculates attention weights within each group to capture the importance and relevance of the parts within the group.
[0021] The Z-pool layer is responsible for reducing the C-dimensional tensor to 2 dimensions, connecting the average pooled features and the maximum pooled features on this dimension, expressed as follows:
[0022] Z-pool(X)=[MaxPool 0d (X),AvgPool 0d (X)] (5)
[0023] Where 0d is the 0th dimension where the max and average pooling operations occur;
[0024] Given an input tensor X∈R C×H×W ,First, it is passed to the three branches in the triple attention module;
[0025] In the first branch, an interaction is established between the C dimension and the W dimension. The input tensor X is rotated 90° counterclockwise along the W axis. This rotated tensor The shape represented is (H×C×W), and then the tensor after Z-Pool (2×C×W), then passes through a standard convolutional layer with a kernel size of k×k, and then through a batch normalization layer to provide an intermediate output of dimension (1×C×W); after that, the tensor is passed through sigmoid to generate the attention weight; at the end, the output is rotated 90° clockwise along the W axis to keep the same shape as the input;
[0026] In the second branch, an interaction is established between the H dimension and the C dimension. The input tensor X is rotated 90° counterclockwise along the H axis. This rotated tensor The shape represented is (W×H×C), and then the tensor after Z-Pool The shape of is (2×H×C), then it passes through a standard convolutional layer with a kernel size of k×k, and then through a batch normalization layer to provide an intermediate output of dimension (1×H×C); then, the tensor is passed through sigmoid to generate the attention weight; at the end, the output is rotated 90° clockwise along the H axis to keep the same shape as the input;
[0027] In the third branch, an interaction is established between the H and W dimensions: the channels of the input tensor X are simplified to 2 through Z-pool, and this simplified tensor of shape (2×H×W) is simplified and passed through a standard convolution layer defined by a kernel size of k×k, and then through a batch normalization layer; the output is passed through a sigmoid activation layer to generate an attention weight of shape (1×H×W), which is applied to the input X to obtain the result Then the refined tensors (C×H×W) produced by the three branches are aggregated together by simple averaging;
[0028] The final output tensor is:
[0029]
[0030] Where σ represents the sigmoid activation function; and Represents the standard 2D convolutional layers defined by kernel size k in the three branches of triple attention.
[0031] Furthermore, S4 uses MobileNetV3 to lighten the network structure. MobileNet modifies the standard convolution and designs the depth-wise separable convolution. The depth-wise separable convolution structure is composed of two groups of convolutions: depth-wise convolution and point-wise convolution. The depth-wise convolution uses a convolution kernel with one channel, and each convolution kernel is responsible for a separate channel, that is, the number of convolution kernels is consistent with the input channel output. The convolution kernel size of the point convolution is 1x 1, which performs dimension increase and decrease on the feature map.
[0032] Depth convolution: The convolution kernel size D of depth convolution K ×D K ×1, the number is M, each one needs to do D F ×D F times multiplication and addition operation, the amount of calculation is:
[0033] D k ×D k ×D F ×D F ×M (7)
[0034] The convolution kernel size of the point convolution is 1×1×M, the number is N, and each one needs to do D F ×D F times multiplication and addition operation, the amount of calculation is:
[0035] D F ×D F ×M×N (8)
[0036] The computational cost of depth-wise separable convolution is:
[0037] D k×D k ×D F ×D F ×M+D F ×D F ×M×N (9)
[0038] The beneficial effects of the present invention are:
[0039] The present invention uses deep learning to detect the surface quality and dimensional quality of copper alloy components. In terms of surface quality detection, the present invention has made targeted improvements on the original YOLOv7 based on the actual application scenarios and the characteristics of the copper alloy surface defects studied, so that the network can be more adaptable to defects of small size and large scale changes. At the same time, in order to meet the factory's accuracy and real-time requirements, the network has been lightweighted and easier to deploy. In terms of dimensional quality detection, the present invention has designed a dimensional quality detection framework based on deep learning, which directly learns the specification features of the copper alloy component point cloud model through a deep learning method, compares and classifies the features with the standard components, and realizes the judgment of the component specifications. Since there is no need to measure specific data, the method of the present invention greatly reduces the dimensional quality detection time, and the present invention also has a high detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is the overall flow chart of the present invention;
[0041] Figure 2 It is a diagram of the spatial transformation network structure;
[0042] Figure 3 This is the PointNet network structure diagram;
[0043] Figure 4 This is the branch model diagram of the triple attention mechanism;
[0044] Figure 5 A comparison chart of depth-wise separable convolution and standard convolution;
[0045] Figure 6 This is the specific expression diagram of the H-swish activation function. DETAILED DESCRIPTION
[0046] The present invention is further described below in conjunction with specific embodiments, but the protection scope of the present invention is not limited thereto.
[0047] A copper alloy component quality inspection method based on deep learning. First, laser scanning is used to obtain point cloud data of parts. Then, bilateral filtering is used to remove noise in the data to avoid affecting the results of subsequent classification. Then, the point cloud model classification based on deep learning is used to perform dimensional quality inspection. Components with qualified dimensional quality enter surface defect inspection. In surface defect quality inspection, the present invention uses yolo as the basic model. In order to meet the actual detection speed and high-precision requirements, the present invention makes targeted improvements on the yolo basic model, making the entire model more lightweight and capable of extracting features more efficiently. The overall flow chart is as follows: Figure 1 As shown, the following steps are included:
[0048] S1: Collect initial point cloud data of copper alloy components through laser scanning;
[0049] S2: Use bilateral filtering algorithm to pre-process the collected data to obtain the denoised point cloud data of the copper alloy component;
[0050] For the produced copper alloy components, there are many places that need manual visual inspection, such as length, width, thickness, fillet radius, etc. In order to improve the detection efficiency and save detection time, the present invention uses a method based on deep learning to extract the point cloud data features of the standard components, compare them with the data features of the components being tested, and directly determine whether the component is qualified.
[0051] Due to the influence of the scanning environment, the collected point cloud data may generate noise, which will interfere with the subsequent detection. Therefore, the collected point cloud data must be preprocessed first. The preprocessing operation uses the bilateral filtering algorithm.
[0052] Bilateral filtering is a type of nonlinear filtering. This is a method that combines the spatial proximity of an image with the similarity of pixel values. When filtering, this filtering method considers both spatial proximity information and color similarity information, filtering out noise, smoothing the image, and preserving edges. Bilateral filtering uses a combination of two Gaussian filters. One is responsible for calculating the weight of spatial proximity, which is the commonly used Gaussian filter principle. The other is responsible for calculating the weight of pixel value similarity. Under the simultaneous action of two Gaussian filters, it is bilateral filtering, and the expression is as follows:
[0053]
[0054] Where g(i,j) represents the output point; S(i,j) represents the range of (2N+1)(2N+1) centered at (i,j); f(k,l) represents (multiple) input points; w(i,j,k,l) represents the value calculated by two Gaussian functions.
[0055] W=W s *Wr ,w s is a spatial proximity Gaussian function, which measures the distance between two points p(i,j) and q(k,l). The farther the distance, the lower the weight. r is the pixel value similarity Gaussian function, which measures the similarity of the pixel values between points p and q. The more similar, the greater the weight.
[0056]
[0057] Where f(i,j) represents the pixel value corresponding to p(i,j), σ s is the spatial domain standard deviation, σ r is the standard deviation of the range.
[0058] w is w s and w r The product of. s For example, this is a normal Gaussian filter function, where the coordinates are substituted, σ is the program input value, and the function is calculated based on spatial proximity. r It is to calculate the similarity of pixel values (color space). Note that this is the Gaussian function substituting into the coordinate value. Above is the norm, which is ‖f(i,j)-f(k,l)‖ 2 . That is, the square of the absolute value of the difference between the pixel values of two points.
[0059] All points in the point cloud are processed through step S2 to finally obtain denoised point cloud data.
[0060] S3: Perform size detection and classification on copper alloy components based on deep learning to obtain size detection results.
[0061] According to step S2, the denoised component point cloud data is obtained. In step S3, the denoised data needs to be input into the model for classification to obtain the result of whether the component size is qualified. The size quality detection proposed in the present invention is also based on the deep learning-based 3D point cloud model classification concept of step S3. In the present invention, the shape of the copper alloy component to be detected is relatively simple, and there are high requirements for detection speed and accuracy, so the PointNet network with high computational efficiency and good global feature extraction capability is selected to classify the pre-processed point cloud data.
[0062] For a point cloud, the same object should still be represented after translation and rotation. In order to solve this problem, the pointnet network used in the present invention newly introduces a T-Net network to learn the rotation of the point cloud and calibrate the object, so that the subsequent network only needs to classify the calibrated point cloud information. For the rotation of three-dimensional points, it only needs to be multiplied by a 3×3 rotation matrix to correct it; similarly, after mapping the point cloud to the K-dimensional redundant space, a k×k rotation matrix is also learned. This matrix optimizes the network's performance in classifying point clouds, making the network invariant to the rotation and position of the input point cloud. In PointNet, in order to solve the problem of rotation invariance of point cloud data, two spatial transformation networks are introduced. The first input transformation is to adjust the point cloud in space and rotate it to an angle that is more conducive to classification, such as turning the object to the front; the second feature transformation is to align the extracted 64-dimensional features, that is, to transform the point cloud at the feature level. The structure is as follows Figure 2 shown.
[0063] A point cloud is essentially a long list of points (nx3 matrix, where n is the number of points). Geometrically, the order of the points does not affect its representation of the overall shape in space. In PointNet, after the network extracts a certain degree of features for each point, the maximum pooling operation can be used to extract global features for the entire point cloud.
[0064] The overall process of dimensional detection and classification of copper alloy components based on deep learning is as follows: the input point passes through the spatial transformation network, and then uses the multi-layer perceptron (MLP) and feature transformation to input into another multi-layer perceptron to extract the overall features through the maximum pooling operation, and then obtains the classification result through the multi-layer perceptron. Figure 3 shown.
[0065] S4: Copper alloy components with qualified sizes enter the surface defect detection. In the surface defect detection, the YOLOv7 network model is improved, and the attention mechanism is added while lightweighting it. The surface defect detection is performed based on the improved YOLOv7 network model to obtain the detection results.
[0066] Object detection is an important research direction in the field of computer vision. Traditional object detection methods require two steps: object recognition and object location. These steps usually require a lot of computing resources and time. In recent years, object detection methods based on deep learning have been widely used. Among them, the YOLO algorithm has become a highly concerned object detection technology due to its fast and accurate characteristics.
[0067] Aiming at the situation that small-scale defects are difficult to detect in actual production, the present invention designs a model based on the improved attention mechanism.
[0068] In the actual production process, there are several different defects on the surface of copper alloy components, such as dents and scratches, and the shapes and sizes of various defects are different. This requires the network to be able to adapt to defects of different sizes, and at the same time, it needs to have good extraction capabilities for tiny surface defect features.
[0069] On this basis, the present invention introduces a triple attention mechanism to improve the network structure. The feature fusion module in the model uses the attention mechanism, which helps the model focus on feature extraction of surface defects. The triple attention mechanism usually includes the following three levels of attention calculation:
[0070] Global Attention: Global attention is usually calculated on the lowest or most primitive representation of the input data, at this level, the model tries to understand the context of the entire input and calculate the importance of each part.
[0071] Inter-group attention: Inter-group attention is calculated on top of the representation obtained by global attention. It divides the global representation into different groups and then calculates attention weights between these groups. This level of attention helps the model better understand the relationship and interaction between different parts of the input data.
[0072] Intra-group attention: Intra-group attention is calculated based on the representation obtained by inter-group attention. It calculates attention weights within each group to capture the importance and relevance of the parts within the group. This level of attention helps the model better understand the intrinsic structure and semantic information of each part within the group.
[0073] The Z-pool layer is responsible for reducing the C-dimensional tensor to 2 dimensions, concatenating the average pooled features and the maximum pooled features on that dimension. This enables the layer to retain the rich representation of the actual tensor while reducing its depth to make further computations lighter. It can be expressed as follows:
[0074] Z-pool(X)=[MaxPool 0d (X),AvgPool 0d (X)] (5)
[0075] Where 0d is the 0th dimension where the max and average pooling operations occur;
[0076] Given an input tensor X∈R C×H×W ,First, it is passed to the three branches in the triple attention module.
[0077] In the first branch, an interaction is established between the C and W dimensions. To achieve this, the input tensor X is rotated 90° counterclockwise along the W axis. This rotated tensor The shape represented is (H×C×W), and then the tensor after Z-Pool (2×C×W), then passes through a standard convolutional layer with a kernel size of k×k, and then through a batch normalization layer to provide an intermediate output of dimension (1×C×W). After that, the tensor is passed through sigmoid to generate the attention weights. At the end, the output is rotated 90° clockwise along the W axis to keep the same shape as the input.
[0078] In the second branch, an interaction is established between the H and C dimensions. To achieve this, the input tensor X is rotated 90° counterclockwise along the H axis. This rotated tensor The shape represented is (W×H×C), and then the tensor after Z-Pool The shape of is (2×H×C), then it passes through a standard convolutional layer with a kernel size of k×k, and then through a batch normalization layer to provide an intermediate output of dimension (1×H×C). The tensor is then passed through a sigmoid to generate the attention weights. At the end, the output is rotated 90° clockwise along the H axis to keep the same shape as the input.
[0079] In the third branch, an interaction is established between the H and W dimensions: the channels of the input tensor X are reduced to 2 through Z-pool. This simplified tensor of shape (2×H×W) is simplified and passed through a standard convolution layer with a kernel size of k×k, and then through a batch normalization layer. The output passes through a sigmoid activation layer to generate an attention weight of shape (1×H×W), which is applied to the input X to obtain the result The refined tensors (C×H×W) produced by the three branches are then aggregated together by simple averaging.
[0080] The structure diagram is as follows Figure 4 As shown, the final output tensor is:
[0081]
[0082] Where σ represents the sigmoid activation function; and Represents the standard 2D convolutional layers defined by kernel size k in the three branches of triple attention.
[0083] Based on the above improvements, in view of the fact that most of the factories in actual production are mobile or embedded devices and computing resources are relatively tight, the present invention designs a lightweight YOLO model to reduce the parameters and complexity of the model.
[0084] The new model designed by the present invention adopts MobileNetV3 to lighten the network structure. MobileNet modifies the standard convolution and designs a deep separable convolution. Through this improvement, the computational complexity of the network is reduced. The deep separable convolution structure is composed of two groups of convolutions: deep convolution and point convolution. The deep convolution uses a convolution kernel with a channel number of one, and each convolution kernel is responsible for a separate channel, that is, the number of convolution kernels is consistent with the input channel output; at this time, point convolution is required to connect the channels. The convolution kernel size of the point convolution is 1x 1, and the feature map is increased or decreased in dimension so that the model can pay attention to the channel information. Since the convolution operation is split into two parts, the computational complexity and parameter quantity are reduced.
[0085] MobileNetV3 inherits the deep separable convolution structure of V1, and through this design, the convolution operation is divided into two parts, namely deep convolution and point convolution. This design can reduce the amount of network calculation and parameters, and separate the channel information for better use of the channel information later. V3 also inherits the residual structure with linear bottleneck of V2; this structure is conducive to better feature extraction. In addition, V3 initially integrates the SE attention mechanism and optimizes the use of channel information. Compared with before, it can better extract the features of surface defects in the data set; at the same time, the activation function is also optimized.
[0086] A comparison of depth-wise separable convolution and standard convolution is shown in Figure 5 shown.
[0087] The present invention decomposes the standard convolution kernel of the original network to form a single-channel approach. While not modifying the depth of the input feature image, the convolution operation is implemented on each channel. This method obtains an output feature map with the same number of channels as the input feature map. Then, point convolution is used to achieve the purpose of dimensionality enhancement and dimensionality reduction of the feature map, and obtain sufficient effective information.
[0088] Depth convolution: The convolution kernel size D of depth convolution K ×D K ×1, the number is M, each one needs to do D F ×D F times of multiplication and addition operations, so the amount of calculation is:
[0089] D k ×D k ×D F ×D F ×M (7)
[0090] The convolution kernel size of the point convolution is 1×1×M, the number is N, and each one needs to do D F ×D F times of multiplication and addition operations, so the amount of calculation is:
[0091] D F ×D F ×M×N (8)
[0092] Therefore, the computational complexity of the modified depthwise separable convolution of the present invention is:
[0093] D k ×D k ×D F ×D F ×M+D F ×D F ×M×N (9)
[0094] In standard convolution, the size of the convolution kernel is D K ×D K ×M, there are N in total, each of which needs to undergo D F ×D F operations (assuming the output feature map size is also D F ×D F ), so the computational complexity of the standard convolution is D K ×D K ×M×N×D F ×D F .
[0095] If the common 3×3 convolution kernel is used, the number of parameters and the amount of computation using depthwise separable convolution are reduced to about one ninth of the original (N is large, can be ignored), the ratio of the calculated amount is as follows:
[0096]
[0097] Activation function optimization. In the traditional YOLOv7 network, the initial activation function is the SiLU function. However, this activation function has the risk of gradient vanishing, and the value range of this function is between (0, 1), which may cause information loss. Based on the above situation, the present invention selects the H-swish activation function to replace the SiLU function. The H-swish activation function has the characteristics of lower bound, no upper bound, smoothness, and non-monotonicity, which effectively improves the shortcomings of the SiLU function and can suppress problems such as gradient vanishing. The specific expression of the H-swish activation function is as follows: Figure 6 shown.
[0098]
[0099] The ordinary residual structure first performs a dimensionality reduction operation through point convolution, then uses 3×3 convolution to extract features, and finally performs a dimensionality increase operation through point convolution. In the inverted residual structure used in the present invention, a dimensionality increase operation is first performed through point convolution, and then a 3×3 channel-by-channel convolution is used to extract features. At this time, ordinary 3×3 convolution is not used, and finally the dimensionality reduction operation is achieved by using point convolution. In this process, the inverted residual structure changes the order of dimensionality increase and decrease, and replaces the 3x3 standard convolution with DW convolution. Using an inverted residual structure can expand the number of channels, making it easier to meet the computing resource requirements of the backbone network and facilitating the extraction of features by the model.
[0100] The above is only a preferred embodiment of the present invention, which is used to illustrate the technical solution of the present invention, but not to limit the present invention. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present invention, some of the technical features therein are modified and replaced, and they will not depart from the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
Claims
1. A copper alloy component quality detection method based on deep learning, characterized in that: The steps include: S1: Collect initial point cloud data of copper alloy components through laser scanning; S2: Use bilateral filtering algorithm to pre-process the collected data to obtain the denoised point cloud data of the copper alloy component; S3: Perform size detection and classification of copper alloy components based on deep learning to obtain size detection results; S4: Copper alloy components with qualified sizes enter the surface defect detection. In the surface defect detection, the YOLOv7 network model is improved, and the attention mechanism is added while lightweighting it. The surface defect detection is performed based on the improved YOLOv7 network model to obtain the detection results.
2. A copper alloy component quality detection method based on deep learning according to claim 1, characterized in that: The bilateral filtering in S2 uses a combination of two Gaussian filters, one is responsible for calculating the weight of spatial proximity, and the other is responsible for calculating the weight of pixel value similarity. Under the simultaneous action of two Gaussian filters, it is bilateral filtering, and the expression is as follows: Where g(i,j) represents the output point; S(i,j) represents the range of (2N+1)(2N+1) centered at (i,j); f(k,l) represents the input point; w(i,j,k,l) represents the value calculated by two Gaussian functions; w=w s *w r ,w s is a spatial proximity Gaussian function, which measures the distance between two points p(i,j) and q(k,l). The farther the distance, the lower the weight. r is the pixel value similarity Gaussian function, which measures the similarity of the pixel values between points p and q. The more similar, the greater the weight. Where f(i,j) represents the pixel value corresponding to p(i,j), σ s is the spatial domain standard deviation, σ r is the standard deviation of the range.
3. A copper alloy component quality detection method based on deep learning according to claim 2, characterized in that: In S3, the dimensional detection and classification of copper alloy components based on deep learning includes the following steps: The PointNet network is used to classify the preprocessed point cloud data. The input points pass through the spatial transformation network, use the multi-layer perceptron MLP and feature transformation, and then input into another multi-layer perceptron to extract the overall features through the maximum pooling operation, and then obtain the classification results through the multi-layer perceptron.
4. A copper alloy component quality detection method based on deep learning according to claim 3, characterized in that: S4 introduces a triple attention mechanism to improve the network structure. The triple attention mechanism includes the following three levels of attention calculation: Global attention: Global attention is calculated on the lowest or most primitive representation of the input data. At this level, the model tries to understand the context of the entire input and calculate the importance of each part. Inter-group attention: Inter-group attention is calculated based on the representation obtained by global attention. It divides the global representation into different groups and then calculates the attention weights between these groups. Intra-group attention: Intra-group attention is calculated based on the representation obtained by inter-group attention. It calculates attention weights within each group to capture the importance and relevance of the parts within the group. The Z-pool layer is responsible for reducing the C-dimensional tensor to 2 dimensions, connecting the average pooled features and the maximum pooled features on this dimension, expressed as follows: Z-pool(X)=[MaxPool 0d (X),AvgPool 0d (X)] (5) Where 0d is the 0th dimension where the max and average pooling operations occur; Given an input tensor X∈R C×H×W ,First, it is passed to the three branches in the triple attention module; In the first branch, an interaction is established between the C dimension and the W dimension. The input tensor X is rotated 90° counterclockwise along the W axis. This rotated tensor The shape represented is (H×C×W), and then the tensor after Z-Pool Then, it passes through a standard convolutional layer with a kernel size of k×k, and then through a batch normalization layer to provide an intermediate output of dimension (1×C×W); after that, the tensor is passed through sigmoid to generate the attention weight; at the end, the output is rotated 90° clockwise along the W axis to keep the same shape as the input; In the second branch, an interaction is established between the H dimension and the C dimension. The input tensor X is rotated 90° counterclockwise along the H axis. This rotated tensor The shape represented is (W×H×C), and then the tensor after Z-Pool The shape of is (2×H×C), then it passes through a standard convolutional layer with a kernel size of k×k, and then through a batch normalization layer to provide an intermediate output of dimension (1×H×C); then, the tensor is passed through sigmoid to generate the attention weight; at the end, the output is rotated 90° clockwise along the H axis to keep the same shape as the input; In the third branch, an interaction is established between the H and W dimensions: the channels of the input tensor X are simplified to 2 through Z-pool, and this simplified tensor of shape (2×H×W) is simplified and passed through a standard convolution layer defined by a kernel size of k×k, and then through a batch normalization layer; the output is passed through a sigmoid activation layer to generate an attention weight of shape (1×H×W), which is applied to the input X to obtain the result Then the refined tensors (C×H×W) produced by the three branches are aggregated together by simple averaging; The final output tensor is: Where σ represents the sigmoid activation function; and Represents the standard 2D convolutional layers defined by kernel size k in the three branches of triple attention.
5. A copper alloy component quality detection method based on deep learning according to claim 4, characterized in that: S4 uses MobileNetV3 to lighten the network structure. MobileNet modifies the standard convolution and designs the depth-wise separable convolution. The depth-wise separable convolution structure is composed of two groups of convolutions: depth-wise convolution and point-wise convolution. The depth-wise convolution uses a convolution kernel with one channel, and each convolution kernel is responsible for a separate channel, that is, the number of convolution kernels is consistent with the input channel output. The convolution kernel size of the point convolution is 1x 1, which increases or decreases the dimension of the feature map. Depth convolution: The convolution kernel size D of depth convolution K ×D K ×1, the number is M, each one needs to do D F ×D F times multiplication and addition operation, the amount of calculation is: D k ×D k ×D F ×D F ×M(7) The convolution kernel size of the point convolution is 1×1×M, the number is N, and each one needs to do D F ×D F times multiplication and addition operation, the amount of calculation is: D F ×D F ×M×N(8) The computational cost of depth-wise separable convolution is: D k ×D k ×D F ×D F ×M+D F ×D F ×M×N(9)。
Citation Information
Patent Citations
FE-YOLO-based copper pipe surface defect detection method and device
CN114638784A
LED bonding wire point cloud classification method and device based on deep learning
CN115471693A
Steel surface defect detection algorithm based on deep learning
CN116664478A
Point cloud data processing method and device, computer device, and storage medium
US20220292728A1
Cited By
Hospital first-aid channel parking monitoring and warning method, system and device and medium
CN121330920A