Anode copper plate surface impurity detection and drilling control method based on end-to-end technology

Through polarization cameras and end-to-end deep learning models, the problem of impurities interference on the surface of the anode copper plate is solved, high-precision drilling positioning and automated control are achieved, and production efficiency is improved.

CN120451058APending Publication Date: 2025-08-08KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510482932.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Traditional machine vision methods are difficult to effectively distinguish the impurities on the surface of the anode copper plate and the drilling position, resulting in large drilling positioning errors and affecting processing quality and production efficiency.

Method used

RGB images and AoP images were captured using polarization cameras, impurity detection and drilling control were combined with end-to-end deep learning models, and precise positioning was achieved through feature extraction, segmentation and regression networks, and weighted Dice loss, Smooth L1 loss and rejection loss optimization models were used.

Benefits of technology

It improves the degree of automation and accuracy of drilling positioning of anode copper plates, achieves fast and accurate drilling operations, and improves production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451058A_ABST
    Figure CN120451058A_ABST
Patent Text Reader

Abstract

The invention provides an anode copper plate surface impurity detection and drilling control method based on an end-to-end technology, and belongs to the technical field of computer vision and robots, and the method comprises the steps: carrying out the shooting through a polarization camera, synchronously obtaining an RGB image and a polarization angle AoP image of an anode copper plate, carrying out the preprocessing of the RGB image and the AoP image, and obtaining a processed RGB image and a processed AoP image; inputting the processed RGB image and AoP image into a pre-established end-to-end deep learning model for anode copper plate impurity detection and drilling, wherein the end-to-end deep learning model comprises a feature extraction network, a segmentation network and a regression branch network; extracting image features through a feature extraction network, and inputting the image features into a segmentation network and a regression branch network; performing impurity region segmentation on the image features through a segmentation network to obtain an impurity probability graph; predicting drilling position coordinates according to the image features through a regression branch network; and according to the drilling position coordinates, a machine tool drilling control instruction is output, and a machine tool is controlled to conduct drilling operation on the anode copper plate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of computer vision and robotics technology, and in particular to an end-to-end technology-based method for detecting impurities on the surface of an anode copper plate and controlling drilling. Background Art

[0002] The drilling and positioning process for anode copper plates presents a complex technical challenge. Various impurities on the copper plates, such as oxides and dirt, severely hinder accurate identification of the drilling locations. Traditional machine vision methods struggle to effectively distinguish between impurities and the actual drilling locations, resulting in large positioning errors. Furthermore, uneven lighting and reflections on the anode copper plates further complicate image processing. These issues result in low drilling positioning accuracy, impacting subsequent processing quality. Furthermore, the high-speed operation of the copper plates on the production line requires real-time positioning algorithms, but increasing algorithm complexity often reduces processing speed, creating a conflict between accuracy and efficiency. Overcoming surface impurities in complex industrial environments to achieve rapid and precise drilling positioning for massive quantities of copper plates has become a core technical challenge that needs to be addressed. This not only impacts the processing quality of individual copper plates but also the efficiency and product yield of the entire production line, thus having significant implications for enhancing corporate competitiveness. Summary of the Invention

[0003] The present invention provides a method for detecting impurities on the surface of an anode copper plate and controlling drilling holes based on end-to-end technology, which mainly includes:

[0004] A polarization camera is used to synchronously obtain an RGB image and a polarization angle AoP image of the anode copper plate, and the RGB image and the AoP image are preprocessed to obtain a processed RGB image and an AoP image; the processed RGB image and the AoP image are input into a pre-established end-to-end deep learning model for impurity detection and drilling of the anode copper plate, and the end-to-end deep learning model includes a feature extraction network, a segmentation network and a regression branch network; image features are extracted through the feature extraction network, and the image features are respectively input into the segmentation network and the regression branch network; the image features are segmented into impurity areas through the segmentation network to obtain an impurity probability map; the drilling position coordinates are predicted according to the image features through the regression branch network; according to the drilling position coordinates, a machine tool drilling control instruction is output to control the machine tool to perform drilling operations on the anode copper plate.

[0005] Furthermore, the RGB image and AoP image are preprocessed, including: polarization filtering of the AoP image to extract the reflective component after highlight removal; using the Retinex algorithm to separate the reflective component of the RGB image; performing contrast-limited adaptive histogram equalization (CLAHE) on the reflective component with a block size of 32×32 and a contrast limit of 2.0; removing noise using a lightweight FFDNet denoising model (inference time <5ms), the inference time of the denoising model is less than 5ms; and inputting the RGB reflective component and the AoP image into a dual-stream encoder for feature fusion using cross-modal attention fusion.

[0006] Furthermore, the feature extraction network includes: a Stem convolution layer for extracting shallow features of the image; multiple MBConv modules, each module consists of dilated convolution, depthwise separable convolution, SE attention and point convolution, for extracting deep features of the image; the input of the Stem convolution layer is the processed RGB image, and the input of the MBConv module is the output of the previous module.

[0007] Furthermore, the segmentation network includes: multiple transposed convolutional layers and a 1x1 convolutional layer, which fuse the shallow features and deep features of the feature extraction network to generate an impurity probability map; each pixel value in the impurity probability map represents the probability that the position is an impurity.

[0008] Furthermore, the regression branch network includes: a 1x1 convolutional layer to generate a spatial weight map; a global average pooling layer to compress the weighted feature map; multiple fully connected layers to predict the coordinates of the drilling location; the input of the 1x1 convolutional layer is the output feature map of the feature extraction network, and the input of the fully connected layer is the output of the global average pooling layer.

[0009] Furthermore, multiple sets of anode copper plate images are obtained in advance as training datasets, each set containing RGB images and corresponding drill hole position truth values; the end-to-end deep learning model is trained using the training dataset, and the model parameters are optimized through a joint loss function, which includes segmentation loss and regression loss; the segmentation loss is denoted as L seg The standard Dice loss is weighted by the distance weighting coefficient, and its calculation formula is: where P∈[0,1] H×W represents the impurity probability map predicted by the model, G∈[0,1] H×W Represents the binary mask image of the true annotation, distance weighting coefficient d ij Represents the Euclidean distance from pixel (i, j) to the nearest impurity boundary, weight amplification coefficient α = 5, control weight decay rate σ = 10; regression loss is recorded as L reg Including heatmap loss L heatmap , smooth L1 loss and the rejection loss L repel , and its calculation formula is: where β i is the weight coefficient, i=1, 2, 3.

[0010] Furthermore, the standard Dice loss is defined as the loss between the predicted impurity probability map and the impurity ground-truth binary map, and the distance weighting coefficient is used to enhance the attention to small impurities and edge regions.

[0011] Furthermore, the smooth L1 loss is defined as the difference between the predicted coordinates and the true coordinates, which is robust to outliers. The rejection loss applies a repulsive force to the predicted coordinates through the true impurity center coordinates to avoid the drilling point being close to the impurity area.

[0012] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:

[0013] The present invention discloses a method for drilling hole positioning of an anode copper plate. The method uses deep learning technology to solve the problems of impurity interference on the surface of the anode copper plate and precise positioning of the drilling position. By constructing an end-to-end deep learning model including a feature extraction network, an impurity segmentation network and a regression branch network, the function of directly outputting the drilling position coordinates from the RGB image is realized. During the model training process, an optimization strategy combining weighted Dice loss, Smooth L1 loss and rejection loss is adopted to effectively improve the accuracy of impurity segmentation and coordinate prediction. After the training is completed, the model can quickly process the RGB image of the anode copper plate to be detected, output accurate drilling position coordinates, and directly control the machine tool to perform drilling operations. The present invention significantly improves the degree of automation and accuracy of drilling hole positioning of the anode copper plate, which is of great significance to improving production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 This is a flow chart of a method for detecting impurities on the surface of an anode copper plate and controlling drilling holes based on end-to-end technology of the present invention;

[0015] Figure 2 This is a schematic diagram of the anode copper plate drilling sampling scenario in the present invention;

[0016] Figure 3 This is a schematic diagram of the end-to-end deep learning model structure in the present invention. DETAILED DESCRIPTION

[0017] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0018] like Figure 1 In this embodiment, a method for detecting impurities on the surface of an anode copper plate and controlling drilling holes based on end-to-end technology may specifically include:

[0019] S101: Use a polarization camera to synchronously obtain an RGB image and an AoP image of the anode copper plate, and pre-process the image to obtain a processed RGB image and AoP image.

[0020] like Figure 2 As shown, in the schematic diagram of the anode copper plate drilling sampling scene in the present invention, a polarization camera is used to capture the RGB image and AoP image of the anode copper plate, which can ensure that the resolution accuracy of the image can meet the requirements of subsequent processing. A ring light source is used to provide uniform lighting to reduce shadow interference. The preprocessing of RGB images and AoP images includes: polarization filtering the AoP image to extract the reflection component after removing the highlight; using the Retinex algorithm to separate the reflection component of the RGB image; performing CLAHE (contrast limited adaptive histogram equalization) on the reflection component, with the block size set to 32×32 and the contrast limit of 2.0; eliminating noise through a lightweight FFDNet denoising model (inference time <5ms); inputting the RGB reflection component and the AoP image into the dual-stream encoder, and fusing the features through cross-modal attention, the formula is Where σ is the Sigmoid function and e is the pixel-by-pixel multiplication.

[0021] S102. Input the processed RGB image and AoP image into a pre-established end-to-end deep learning model for anode copper plate impurity detection and drilling. The end-to-end deep learning model includes a shared shallow feature extraction network, a segmentation branch network, and a regression branch network.

[0022] An end-to-end deep learning model for detecting impurities on the surface of anode copper plates and drilling holes was established. This model consists of a feature extraction network, a segmentation branch network, and a regression branch network. The feature extraction network serves as the backbone network, while the segmentation branch network and the regression branch network serve as the two branch networks. The RGB image generated by S101 is passed through these three networks to ultimately generate drilling control instructions for the machine tool to drill the anode copper plates.

[0023] The established end-to-end deep learning model is pre-trained using the training dataset, and the model parameters are optimized through a joint loss function. The joint loss function includes segmentation loss and regression loss. The segmentation loss uses the distance weighting coefficient to weight the standard Dice loss to obtain the distance-weighted Dice loss, and the regression loss uses the smooth L1 loss and the rejection loss.

[0024] The standard Dice loss is defined as the loss between the predicted impurity probability map and the ground-truth impurity binary map, where the ground-truth impurity binary map refers to the actual annotated binary mask image. A distance weighting coefficient is used to increase the focus on small impurities and edge regions. The smoothed L1 regression loss is defined as the difference between the predicted and true coordinates, making it robust to outliers. The rejection loss applies a repulsive force to the predicted coordinates using the true impurity center coordinates to prevent drilling points from being too close to impurity regions.

[0025] The dataset consists of 2,000 sets of copper plate images, each of which contains an RGB image and the coordinates of the machine tool drilling positions. The loss function is used to measure the gap between the predicted value and the true value. The AdamW optimizer (initial learning rate 0.001, weight decay 0.05), batch size 32, and number of training rounds are used. Through training and learning, the loss function value is gradually reduced, thereby improving the accuracy of the model.

[0026] Specifically, the joint loss function L total The formula is: L total =λL seg +(1-λ)L reg , where L reg is the regression loss, including the heatmap loss L heatmap , smooth L1 loss Rejection loss L repel , L seg is the segmentation loss, and λ is the weight coefficient.

[0027] Segmentation loss L seg The calculation formula is: where P∈[0,1] H×W represents the impurity probability map predicted by the model, G∈[0,1] H×W Represents the binary mask image of the true annotation, distance weighting coefficient d ij Represents the Euclidean distance from pixel (i, j) to the nearest impurity boundary, the weight amplification coefficient α = 5, and the weight decay rate σ = 10.

[0028] The regression loss consists of three parts, which respectively optimize the heat map distribution, coordinate accuracy and obstacle avoidance constraints. where β i is the weight coefficient;

[0029] The formula for heatmap loss is: p i is the model’s predicted probability for the true category, α t is the class balance weight, the default value is usually 0.25; μ is the modulation factor, the default value is usually 2; N is the total number of pixels involved in the calculation;

[0030] The formula for smoothed L1 loss is: Among them, p = (x, y) represents the normalized coordinates predicted by the model (range [-1, 1]), p * represents the real coordinates;

[0031] In order to avoid the drilling point being close to the impurity area, the rejection loss is introduced: Where l represents the coordinate set of all impurity centers (calculated by segmentation results), and the safety distance threshold (normalized coordinate system) is γ = 0.1;

[0032] S103. Extract image features through a shared shallow feature extraction network, and input the image features into the segmentation branch network and the regression branch network respectively.

[0033] The shared shallow feature extraction network includes: a Stem convolution layer for fast downsampling and capturing low-level features (such as edges and brightness changes); multiple MBConv modules, each of which consists of dilated convolution, depth-separable convolution, SE attention and point convolution, for extracting mid-level features and balancing computational complexity and expression ability; the input of the Stem convolution layer is the processed RGB image, and the input of the MBConv module is the output of the previous module.

[0034] The specific structure of the shared shallow feature extraction network is as follows Figure 3 As shown in the figure, the feature extraction network serves as the backbone network, including a Stem convolution layer and two MBConv modules (Stage 1-2). The input shape is (h, w, C), the output at the Stem convolution layer is (h / 2, w / 2, 24), the output at Stage 1 is (h / 4, w / 4, 24), and the output at Stage 2 is (h / 4, w / 4, 32). The specific structure is as follows:

[0035] Stem convolution layer, the convolution kernel size is 3 ×3, stride 2, padding 1, input shape (h, w, C), output shape (h / 2, w / 2, 24); BatchNorm normalization is performed on the output of the convolutional layer to make the data distribution more stable, thereby alleviating the gradient vanishing and gradient exploding problems; Adding the SiLU activation function after the convolutional layer improves the introduction of nonlinearity so that the neural network can learn complex patterns, while also alleviating the gradient vanishing problem and improving the training effect of deep networks; This layer can quickly downsample and capture low-level features (such as edges and brightness changes);

[0036] MBConv module Stage 1 includes 1 MBConv1 module with an input shape of (h / 2, w / 2, 24) and an output shape of (h / 4, w / 4, 24). The specific structure of a single module is as follows: the first layer is dilated convolution, 1×1 convolution, and the expansion ratio is 1 (no channel expansion); the second layer is depthwise separable convolution, 3×3 convolution, stride 1, and the number of groups = the number of input channels; the third layer is SE attention, with a compression ratio of 4; the fourth layer is 1×1 convolution, and the output channel is 24.

[0037] MBConv module Stage 2, including two MBConv4 modules with input shape of (h / 4, w / 4, 24) and output shape of (h / 4, w / 4, 32). The specific structure of a single module is as follows: the first layer is dilated convolution, 1×1 convolution, and the expansion ratio is 4 (channel expansion to 96); the second layer is depth-separable convolution, 3×3 convolution, stride 2, group number = 96; the third layer is SE attention, with a compression ratio of 4 (intermediate channel 24); the fourth layer is 1×1 convolution, with 32 output channels.

[0038] S104: Segment the image features into impurity regions through a segmentation branch network to obtain a high-precision impurity probability map, marking restricted areas to be avoided.

[0039] The segmentation network includes: a deep feature extraction layer and a feature fusion layer, which fuses the deep features with the shallow features of the shared shallow feature extraction network to generate a high-precision impurity probability map; each pixel value in the impurity probability map represents the probability that the position is an impurity.

[0040] The specific structure of the segmentation network is as follows Figure 3 As shown in the figure, the segmentation network is one of the branch networks, including a deep feature extraction layer (MBConv module Stage 3-5), a feature fusion layer, a transposed convolution layer (3 layers) and a 1×1 convolution layer. The low-level features (h / 4, w / 4, 32) output by Stage 2 and the deep features (h / 8, w / 8, 192) output by Stage 5 are fused to obtain the feature (h / 4, w / 4, 96), which is used as input and outputs a single-channel probability map (h, w, 1). The specific structure is as follows:

[0041] MBConv module Stage 3, including 3 MBConv6 modules, with an input shape of (h / 4, w / 4, 32) and an output shape of (h / 8, w / 8, 48). The specific structure of a single module is as follows: the first layer is dilated convolution, 1×1 convolution, and the expansion ratio is 6 (channel expansion to 192); the second layer is depthwise separable convolution, 3×3 convolution, stride 1, and the number of groups = the number of input channels; the third layer is SE attention, with a compression ratio of 4 (48 intermediate channels);

[0042] The fourth layer is a 1×1 convolution with 48 output channels.

[0043] MBConv module Stage 4, including 3 MBConv6 modules, with an input shape of (h / 8, w / 8, 48) and an output shape of (h / 8, w / 8, 96). The specific structure of a single module is as follows: the first layer is dilated convolution, 1×1 convolution, and the expansion ratio is 6 (channel expansion to 288); the second layer is depthwise separable convolution, 3×3 convolution, stride 1, and the number of groups = the number of input channels; the third layer is SE attention, with a compression ratio of 4 (72 for the middle channel);

[0044] The fourth layer is a 1×1 convolution with 96 output channels.

[0045] MBConv module Stage 5, including 5 MBConv6 modules, with an input shape of (h / 8, w / 8, 96) and an output shape of (h / 8, w / 8, 192). The specific structure of a single module is as follows: the first layer is dilated convolution, 1×1 convolution, and the expansion ratio is 6 (channel expansion to 576); the second layer is depth-separable convolution, 3×3 convolution, stride 1, and the number of groups = the number of input channels; the third layer is SE attention, with a compression ratio of 4 (intermediate channel 144); the fourth layer is 1×1 convolution, and the output channel is 192.

[0046] The deep features are sampled from (h / 8, w / 8, 192) to (h / 4, w / 4, 96) by transposed convolution (step 2, 3×3 kernel); the low-level features (h / 4, w / 4, 32) output by Stage 2 are adjusted to 96 channels using 1×1 convolution to make them consistent with the number of channels of the deep features; the upsampled deep features (h / 4, w / 4, 96) and the adjusted shallow features (h / 4, w / 4, 96) are added channel by channel, and the formula is: F fused =F deep +F shallow , BatchNorm+SiLU activation is performed on the fused features to enhance the nonlinear expression ability.

[0047] The fused features (h / 4, w / 4, 96) are gradually restored to the original image resolution (h, w, 1) through the subsequent three layers of transposed convolutional layers, and the impurity probability map P is output. seg ∈[0,1] h×w Specifically, the first layer is a 3×3 transposed convolution with a step size of 2, a padding of 1, an output channel of 48, and a feature map size restored to (h / 4, w / 4, 48); the second layer is a 3×3 transposed convolution with a step size of 2, a padding of 1, an output channel of 24, and a feature map size restored to (h, w, 24); the third layer is a 3×3 transposed convolution with a step size of 1, a padding of 1, an output channel of 24, and a feature map size restored to (h, w, 24), further refining the features and eliminating the edge jaggedness caused by upsampling.

[0048] The feature (h,w,24) is compressed to 1 through a 1×1 convolution layer, and a single-channel feature map (h,w,1) is output. The eigenvalue is mapped to the [0,1] interval through the Sigmoid activation function to generate the impurity segmentation probability map P. seg ∈[0,1] h×w .

[0049] S105 , predicting the sub-pixel drilling position coordinates away from the impurity area from the image features through a regression branch network.

[0050] The regression branch network includes: 1 spatial attention weighted layer, which generates a spatial mask to suppress the response of the impurity area; 1 spatial pyramid pooling layer, which captures contextual information of different ranges through multi-scale pooling operations; 1 fully convolutional coordinate heat map prediction layer, which generates the drilling probability heat map H map ∈[0,1] h×w , which represents the probability of each pixel being a drilling point; finally, sub-pixel coordinates are calculated and sub-pixel coordinates are extracted from the heat map through peak detection and quadratic polynomial fitting.

[0051] The specific structure of the regression branch network is as follows Figure 3 As shown in the figure, the regression branch network is another branch network, including 1 spatial attention weighted layer, 1 spatial pyramid pooling layer, 1 full convolution coordinate heat map prediction layer and sub-pixel coordinate calculation, and the input is the impurity segmentation probability map P seg ∈[0,1] h×w And Stage 2 output features (h / 4,w / 4,32), the output shape is normalized coordinates (2); the specific structure is as follows:

[0052] Spatial attention weighted layer, input is impurity segmentation probability map P seg ∈[0,1] h×w And Stage 2 output feature F shared =(h / 4,w / 4,32); use bilinear interpolation to convert P seg Downsample to P seg ′=(h / 4,w / 4,1); generate mask M=1-P seg ′, suppress the characteristic response of the impurity area; perform feature weighting and multiply the mask with the original feature map pixel by pixel: F reg =F shared e M, get the weighted feature map F reg =(h / 4,w / 4,32); the weight of the impurity area is reduced by the mask, guiding the regression network to focus on the clean area.

[0053] Spatial pyramid pooling layer (SPP), the input is the weighted feature map F reg=(h / 4,w / 4,32), the output is a feature map (h / 4,w / 4,256); the spatial pyramid pooling layer uses parallel pooling, using four different sizes of pooling kernels (1×1, 3×3, 5×5, 7×7) to perform maximum pooling on the input feature map to extract multi-scale features; the outputs of the four pooling operations are spliced along the channel dimension, the formula is

[0054] F SPP =Concat(MaxPool 1×1 (F reg ),MaxPool 3×3 (F reg ),MaxPool 5×5 (F reg ),MaxPool 7×7 (F reg )), the output size is (h / 4,w / 4,128); finally, the channel is compressed to 256 through 1×1 convolution, resulting in (h / 4,w / 4,256), which enhances the expression ability; the specific pooling layers are:

[0055] The first layer is a 1×1 pooling kernel with a stride of 1 and padding of 0. The input size is (h / 4, w / 4, 32) and the output size is (h / 4, w / 4, 32). The second layer is a 3×3 pooling kernel with a stride of 1 and padding of 1. The input size is (h / 4, w / 4, 32) and the output size is (h / 4, w / 4, 32). The third layer is a 5×5 pooling kernel with a stride of 1 and padding of 2. The input size is (h / 4, w / 4, 32) and the output size is (h / 4, w / 4, 32). The fourth layer is a 7×7 pooling kernel with a stride of 1 and padding of 3. The input size is (h / 4, w / 4, 32) and the output size is (h / 4, w / 4, 32).

[0056] Full convolution coordinate heat map prediction layer, the input is SPP output feature (h / 4,w / 4,256), the output is drilling probability heat map H map ∈[0,1] h×w ; Includes 1 layer of 3×3 convolution layer, 1 layer of 1×1 convolution layer, 1 layer of transposed convolution layer and 1 activation function; 3×3 convolution layer, output channel 128, keep the resolution unchanged, output shape is (h / 4,w / 4,128); 1×1 convolution layer, output channel 64, keep the resolution unchanged, output shape is (h / 4,w / 4,64); transposed convolution layer uses 3×3 transposed convolution (step size 2, padding 1) to gradually restore the resolution to (h,w,1); finally, use Sigmoid activation function to generate heat map H map ∈[0,1] h×w .

[0057] Sub-pixel coordinate calculation, heat map Hmap ∈[0,1] h×w For peak detection, use the non-maximum suppression (NMS) method to slide a 3×3 window on the heat map and extract the local maximum point (x peak ,y peak ), only candidate points with heat map values greater than 0.5 are retained through threshold filtering; sub-pixel correction, with the peak point as the center, the heat map values of the 3×3 neighborhood {h i,j}, perform quadratic surface fitting h(x,y)=ax 2 +by 2 +cxy+dx+ey+f, solve the coefficients by the least squares method and calculate the sub-pixel offset Finally, coordinate mapping is performed, the formula is x sub =x peak +Δx,y sub =y peak +Δy, get the sub-pixel coordinates (x sub ,y sub )∈R 2 .

[0058] S106. Output a machine tool drilling control instruction according to the drilling position coordinates, and control the machine tool to perform a drilling operation on the anode copper plate.

[0059] The present invention provides a method for detecting impurities on the surface of an anode copper plate and controlling drilling holes based on end-to-end technology, which has the following beneficial effects: an end-to-end deep learning model for detecting impurities and drilling holes on the surface of an anode copper plate is designed, and an RGB image is input, and the model can directly output control instructions for a machine tool; at the same time, the model can automatically learn features from the data, avoiding the tediousness and potential deviations of manually designed features. The model directly optimizes the final control target (such as drilling accuracy), avoiding the final control accuracy drop due to the accumulation of errors in each module, and the model can learn a more accurate mapping relationship through deep learning. The model can achieve real-time reasoning through GPU acceleration and model compression technology, avoiding the high latency caused by the series operation of multiple modules. Through model training and model optimization, the model can output machine tool control instructions for precise drilling of anode copper plates (avoiding impurity areas).

[0060] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for detecting impurities on the surface of an anode copper plate and controlling drilling holes based on end-to-end technology, characterized in that: include: Using a polarization camera to synchronously obtain an RGB image and a polarization angle AoP image of the anode copper plate, and preprocessing the RGB image and the AoP image to obtain a processed RGB image and AoP image; Inputting the processed RGB image and AoP image into a pre-established end-to-end deep learning model for anode copper plate impurity detection and drilling, wherein the end-to-end deep learning model includes a feature extraction network, a segmentation network, and a regression branch network; Extracting image features through the feature extraction network, and inputting the image features into the segmentation network and the regression branch network respectively; Performing impurity region segmentation on the image features through the segmentation network to obtain an impurity probability map; Predicting the coordinates of the drilling position according to the image features through the regression branch network; According to the drilling position coordinates, a machine tool drilling control instruction is output to control the machine tool to perform a drilling operation on the anode copper plate.

2. The method according to claim 1, wherein The preprocessing of the RGB image and the AoP image includes: Apply polarization filtering to the AoP image and extract the reflected component after removing highlights; Use the Retinex algorithm to separate the reflection component of the RGB image; Contrast limited adaptive histogram equalization (CLAHE) is performed on the reflection component, with the block size set to 32×32 and the contrast limit set to 2.0; Noise removal through a lightweight FFDNet denoising model (inference time < 5ms), which has an inference time of less than 5ms; The RGB reflection component and the AoP image are fed into a two-stream encoder for feature fusion via cross-modal attention fusion.

3. The method according to claim 1, wherein The feature extraction network includes: A Stem convolution layer, used to extract shallow features of the image; Multiple MBConv modules, each composed of dilated convolution, depthwise separable convolution, SE attention, and pointwise convolution, are used to extract deep image features; The input of the Stem convolution layer is the processed RGB image, and the input of the MBConv module is the output of the previous module.

4. The method according to claim 1, wherein The segmentation network includes: Multiple transposed convolutional layers and one 1x1 convolutional layer fuse shallow features and deep features of the feature extraction network to generate the impurity probability map; Each pixel value in the impurity probability map represents the probability that the position is an impurity.

5. The method according to claim 1, wherein The regression branch network includes: A 1x1 convolutional layer to generate a spatial weight map; A global average pooling layer to compress the weighted feature map; Multiple fully connected layers to predict drilling location coordinates; The input of the 1x1 convolutional layer is the output feature map of the feature extraction network, and the input of the fully connected layer is the output of the global average pooling layer.

6. The method according to claim 1, wherein Multiple sets of anode copper plate images are obtained in advance as training datasets, each set containing RGB images and corresponding drill hole position truth values; Training the end-to-end deep learning model using the training dataset, and optimizing model parameters using a joint loss function, wherein the joint loss function includes a segmentation loss and a regression loss; The segmentation loss is denoted as L seg The standard Dice loss is weighted by the distance weighting coefficient, and its calculation formula is: where P∈[0,1] H×W represents the impurity probability map predicted by the model, G∈[0,1] H×W Represents the binary mask image of the true annotation, distance weighting coefficient d ij Represents the Euclidean distance from pixel (i, j) to the nearest impurity boundary, weight amplification coefficient α = 5, and weight decay rate σ = 10; The regression loss is denoted as L reg Including heatmap loss L heatmap , smooth L1 loss and the rejection loss L repel , and its calculation formula is: where β i is the weight coefficient, i=1, 2, 3.

7. The method according to claim 6, wherein The standard Dice loss is defined as the loss between the predicted impurity probability map and the impurity ground truth binary map, and the distance weighting coefficient is used to enhance the focus on small impurities and edge regions.

8. The method according to claim 6, wherein The smooth L1 loss is defined as the difference between the predicted coordinates and the true coordinates, and is robust to outliers. The repulsion loss applies a repulsive force to the predicted coordinates through the true impurity center coordinates to avoid the drilling point being close to the impurity area.