Point Cloud Deep Learning for Defect Detection in Sealing Nails of Traction Battery Packs

The rising global demand for electric vehicles has intensified the need for high-performance and safe traction battery packs. In particular, the sealing nail, which serves as the final closure of the electrolyte filling hole, is critical to the reliability of a traction battery pack. During the laser welding process, tiny defects such as burst points, pinholes, incompletely welded areas, and shifting of the sealing nail may appear. These defects can directly induce electrolyte leakage and cause catastrophic failure of the traction battery pack. Detecting these defects with high precision is therefore essential for quality assurance in battery manufacturing. Traditional inspection methods rely on manual visual inspection or two-dimensional image algorithms, but they are often slow and unable to quantify the micro-scale geometry of defects. In this work, I investigated a point cloud deep learning framework to detect welding defects on the sealing nail of traction battery packs, aiming to improve the automation level and detection accuracy in production lines.

Motivation and Research Objectives

Contemporary battery manufacturing of traction battery packs relies on sealed cells. After injecting electrolyte, a sealing nail is welded onto the filling hole. Because of the narrow dimensions of the sealing nail and the complex surface reflection, defect detection is challenging. Common laser scan data provide three-dimensional point clouds that encode the surface height distribution. However, the acquired point cloud often contains interference from non-target regions, such as the battery top cover and substrate. Moreover, the defects are extremely small when compared to the whole captured area, leading to a serious class imbalance in the data. To deal with these issues, I planned the following research tasks. The first task is to accurately extract the sealing nail and welding area from the raw point cloud of traction battery packs. The second task is to develop a deep semantic segmentation network that recognizes small defects robustly. The third task is to design a density-feature fusion mechanism that improves the detection of micro-sized defects. Finally, a software platform is built for automated inspection. In this article, I present each of these components and discuss the experimental results.

Data Acquisition and Preprocessing

I used a laser line-scan camera to collect three-dimensional point clouds of the sealing nail region from traction battery packs. The camera operates with a 405 nm laser and has a nominal working distance of 23 mm. The measured region spans approximately 14.5 mm along the X-axis and 5.2 mm along the Z-axis. The point cloud resolution reaches the micrometer scale, which is sufficient to capture the small morphology of welding defects. The original point clouds consist of X, Y, Z coordinates only; normal vectors and other attributes are absent. The point cloud density is not perfectly uniform because of surface reflectance changes and the viewing geometry. Therefore, preprocessing must normalize the data in terms of noise removal and region of interest extraction.

My preprocessing pipeline includes two main stages: statistical filtering for denoising, and an improved RANSAC segmentation for extracting the top of the sealing nail and the welding ring. The origin of noise lies in the surface roughness of the weld bead, stray reflections, and external light interference. These noise points can confuse deep-learning models. I applied a statistical outlier removal method. Suppose we have a point \(p_i\) with a set of \(k\) neighboring points \(p_{ij}\). The mean distance from \(p_i\) to its neighbors is

$$ \tilde{d}_i = \frac{1}{k} \sum_{j=1}^{k} \sqrt{(x_i – x_{ij})^2 + (y_i – y_{ij})^2 + (z_i – z_{ij})^2}. $$

For a point cloud with \(n\) points, the global mean and standard deviation of these distances are computed as

$$ \mu = \frac{1}{n} \sum_{i=1}^{n} \tilde{d}_i, \quad \sigma = \sqrt{ \frac{1}{n} \sum_{i=1}^{n} (\tilde{d}_i – \mu)^2 }. $$

Points whose mean neighbor distance satisfies \(\tilde{d}_i > \theta \sigma + \mu\) are rejected as outliers. This filter is effective on the point clouds of traction battery pack sealing nails because most noise points are isolated and have a significantly larger \(\tilde{d}_i\). After filtering, the point set becomes cleaner, and the shape of the weld area is preserved.

Improved RANSAC for Welding Area Extraction

The raw point cloud of traction battery packs includes not only the sealing nail but also the surrounding battery cover and substrate. The battery cover point cloud generates a large background, and includes points that belong to the flat base plane of the top cover. In contrast, the sealing nail and weld bead are small elevated regions. Correctly identifying them is a prerequisite for the subsequent defect detection. The classic RANSAC algorithm randomly selects seed points to fit a plane, but the process is inefficient and can lead to incorrect planes when the data contain multiple geometric structures. I improved the RANSAC segmentation strategy in three respect, which together form the method described below.

Seed Point Selection Based on Local Sampling

In the point cloud of a traction battery pack sealing nail, the top-cover plane and the sealing nail plane are predominantly horizontal when the pack is aligned with the user coordinate system. For each point, I estimated a normal vector through the eigendecomposition of the covariance matrix around a local neighborhood. Let \(X\) be the set of neighboring points of \(p_i\) and \(\bar{x}\) the centroid. The covariance matrix is

$$ C = \frac{1}{n} \sum_{i=1}^{n} (p_i – \bar{x})(p_i – \bar{x})^T . $$

If the normal vectors at all points in a spherical neighborhood of radius \(r\) are nearly parallel to the vertical vector \(n_v = (0,0,1)\), the region is likely part of one planar face. I computed the average cosine similarity

$$ \gamma = \frac{1}{n} \sum_{i=1}^{n} n_v \cdot n_i $$

where \(n_i\) are the estimated normals of the points in the sphere. If \(\gamma\) surpassed a pre-described threshold, three points from that local set were chosen as the minimal sample for plane fitting. This local sampling procedure avoids fitting planes that traverse multiple structures, reduces the number of iterations, and accelerates the registration of the correct sealing nail plane.

Misclassification Correction

After repeated RANSAC runs, the extracted planar patches can contain points from neighboring patches. For example, the large top-cover plane may contain a region that belongs to the sealing nail. I corrected such misclassified points. The algorithm begins by calculating, for every point in a given patch, the signed distance \(d_1\) to the reference plane of the alternative patch and the distance \(d_2\) to the centroid of that patch. When both distances are below user-defined thresholds, the point is marked as a misclassified point. Then a k-d tree radius search is applied, and the point is reassigned to the patch that contains the greatest number of its neighbors. This correction preserves the geometric boundary between the sealing nail and the top cover.

Merging Oversegmented Patches via Euclidean Clustering

If the threshold for plane fitting is extremely small, the sealing nail can be over-segmented into several fragments. To address this, I applied Euclidean clustering on the entire set of patches after the misclassification correction. Euclidean clustering groups points whose mutual distances are below a threshold. For two patches that correspond to the same geometric plane and that are spatially adjacent, they will be merged into one cluster. After the merging process, the point cloud is divided into two main clusters: the battery top cover and the sealing nail. By locating the centroid \(\bar{c}\) of the sealing nail cluster, I could further isolate the weld-affected zone as an annulus with radii from 5 mm to 6.5 mm around \(\bar{c}\).

I validated the improved RANSAC algorithm on 196 manually annotated point clouds of sealing nails. The annotation separated the sealing-nail face from the battery cover face. I evaluated precision, recall, and \(F_1\)-score. The experimental results are shown in the following table.

Segmentation Algorithm Time (s) Precision (%) Recall (%) \(F_1\)-score (%)
Classic RANSAC 6.82 76.24 82.19 79.10
Region Growing 8.73 83.10 81.57 82.33
Euclidean Clustering 3.45 36.23 99.73 53.15
Improved RANSAC (Ours) 6.14 82.44 93.76 87.74

The improved RANSAC achieved the highest \(F_1\)-score of 87.74% among tested methods. While Euclidean clustering is fast, it seriously under-segments the data. Region growing has the highest precision but requires a long execution time. The proposed algorithm balances accuracy and runtime, providing a reliable basis for extracting the target region from the point cloud of traction battery packs.

Deep Learning Based Defect Detection Network

After extracting the welding area, the next task is to classify every point into either a background point or one of the five defect categories: burst point, pit, molten bead, lifted nail, and pinhole. These categories are defined by their geometry. Burst points and molten beads are elevations that protrude above the normal height region; pits and pinholes are downward concavities. A lifted nail appears as a global tilt of the sealing nail relative to the top cover. Because many defects are tiny, the class distribution is heavily imbalanced. Table below shows the proportion of point counts in the created dataset.

Category Number of Original Scans
Normal 655
Burst 406
Pit 271
Molten bead 248
Lifted nail (Warpage) 316
Pinhole 361

For detailed per-point analysis, I sampled every scan to a maximum of 100,000 points during preprocessing. The annotated point clouds were stored with seven columns: X, Y, Z, normal_X, normal_Y, normal_Z, and label. To increase the amount of training data, I applied augmentation through random rotation, translation, flipping, and scaling. During the training phase, I also added random point jitter and randomly disabled the normal vector channel with some probability. After augmentation, the total sample number increased to 2787 scans. From them, 90% were used for training and validation, and 10% for testing. The actual per-point numbers were highly unbalanced: most points belonged to the background. I counted the point-level distribution for 600 scans as:

Point type Number of points
Background 62,931,445
Burst 93,601
Pit 165,430
Molten bead 48,789
Lifted nail 1,793,618
Pinhole 64,363

The small numbers for burst, molten bead, and pinhole make them easy to miss. Therefore, I chose a semantic segmentation network that directly works with sparse point clouds and pays attention to local structural features.

Baseline: GACNet

My starting point was GACNet, which applies graph attention convolution to point cloud semantic segmentation. In GACNet, the point cloud is converted into a directed graph \(\mathcal{G}=(\mathcal{V},\mathcal{E})\), where each point is a vertex. The graph is built by centering a ball of radius \(\rho\) on every node and selecting a fixed number of neighboring points. The graph attention convolution learns a function \(g: \mathbb{R}^{F} \mapsto \mathbb{R}^{K}\) that maps the input features to a new feature set. For a vertex \(i\), the attention weight from a neighbor \(j\) is computed as

$$ e_{ij} = M_{\alpha}\big([\Delta p_{ij} \| \Delta h_{ij}]\big), \quad j \in \mathcal{N}(i) , $$

where \(\Delta p_{ij} = p_i – p_j\) indicates the coordinate difference, and \(\Delta h_{ij} = M_g(h_i) – M_g(h_j)\) is the difference of transformed features. The final weights are normalized by a softmax function

$$ a_{ij} = \frac{\exp(e_{ij})}{\sum_{l \in \mathcal{N}(i)} \exp(e_{il})} . $$

The convolution result is then

$$ h_i’ = \sum_{j \in \mathcal{N}(i)} a_{ij} \odot M_g(h_j) + b_i . $$

GACNet aggregates features along a graph pyramid. It applies farthest point sampling to coarsen the point cloud, applies graph pooling to reduce resolution, and uses skip connections to merge features from different scales. Although GACNet performs well on several benchmark datasets, I found two limitations in traction battery pack sealing nail defect detection. First, the attention generates its weights by concatenating coordinate difference and feature difference, which may blur the distinction between spatial coordinates and learned features. Second, the pooling stage loses spatial details and the skip connections are too simple to fuse features of very different densities. Therefore, I proposed the LGANet architecture with two new modules.

Local Graph Attention Filter

I designed a module called Local Graph Attention Filter (LGAF) to model the correlation among vertices while preserving the spatial relationship. In this module, the graph adjacency matrix is built from point coordinates, and a distance-aware attention filter controls how much information flows from each neighbor. The initial correlation between vertex \(i\) and its neighbor \(j\) is computed as the difference between a linear projection of the center feature and a linear projection of the coordinate-related difference:

$$ C_{ij} = \phi_q(x_i) – \phi_k(x_i – x_j). $$

To suppress information from distant neighbors, I used a Gaussian-distance weighted adjacency matrix

$$ \hat{A}_{ij} = A_{ij} \cdot e^{-\|p_i – p_j\|^2}, \quad A’ = D^{-\frac{1}{2}} \hat{A} D^{-\frac{1}{2}} $$

where \(A_{ij}\) is the original binary adjacency indicator and \(D\) is the degree matrix. In addition, a learnable spatial weight

$$ \sigma_{ij} = M_p(p_i – p_j) $$

is added to preserve geometric information. The attention weight is calculated as

$$ e_{ij} = M_e\big( C_{ij} \cdot A’_{ij} \big) , \quad a_{ij} = \frac{\exp(e_{ij})}{\sum_{l\in \mathcal{N}(i)} \exp(e_{il})}. $$

The output of this filter module becomes

$$ y_i = \psi(x_i) + \sum_{j\in \mathcal{N}(i)} a_{ij} \odot \big( \phi_v(x_i – x_j) + \sigma_{ij} \big). $$

Here \(\psi, \phi_v,\) and \(M_p, M_e\) are trainable mappings. The main difference with GACNet is that the distance-weighted graph and the learnable spatial weight allow the network to maintain complementary information from feature space and coordinate space.

Spatial Attention Graph Pooling

In the graph pyramid, pooling is needed to reduce the point cardinality while preserving meaningful information about the local cloud geometry. Instead of using a standard max-pooling operation, I proposed the Spatial Attention Graph Pooling (SAG Pooling). This module takes the pool of candidate vertices generated by farthest point sampling. For each new vertex \(i\), I first find its neighbors in the original graph. The attention weight from a neighbor \(j\) relies on the coordinate vectors:

$$ \hat{r}_{ij} = M_w\big( \varphi_q(p_i) – \varphi_k(p_j) \big), $$
$$ r_{ij} = \frac{\exp(\hat{r}_{ij})}{\sum_{l\in\mathcal{N}(i)} \exp(\hat{r}_{il})}. $$

The output feature at vertex \(i\) is

$$ F_i = \sum_{j \in \mathcal{N}(i)} r_{ij} \odot \varphi_v(F_{ij}), $$

where \(F_{ij}\) indicates the feature of neighbor \(j\) in the original graph. This pooling step uses spatial relationships to guide feature aggregation, thereby retaining the edge information and local shape details after multiple down-sampling operations.

Loss Function with Class Imbalance

Because the dataset of traction battery packs contains too few defect points relative to the background, I applied balanced weights to the standard cross-entropy loss. Let \(n_{\max}\) be the largest number of points among all categories, and \(n_i\) be the number of points of the \(i\)-th category. The base weight is

$$ \hat{w}_i = \left(\frac{n_{\max}}{n_i}\right)^{1/2}, \quad w_i = \frac{\hat{w}_i}{\sum_{j=1}^{K} \hat{w}_j}, $$

where \(K\) is the total number of categories. The final weighted cross-entropy loss is

$$ Loss = – \sum_{i=1}^{K} w_i \log \frac{\exp(x_i)}{\sum_{l=1}^{K}\exp(x_l)} \cdot y_i . $$

With this linear weighting, the loss gives more influence to rare classes, and the network is forced to recognize small defects rather than maximizing the background accuracy only.

Cross-Density Feature Fusion for Small Defects

Even with the LGAF and SAG Pooling modules, the network is still challenged by extremely small defects such as pinholes. The reason is that many down-sampling and up-sampling cycles cause a loss of fine-grained details. To reconstruct these details, I developed a Cross-Attention-Based Cross Density Feature Fusion module, denoted as CDF. The idea is to fuse features at three different density levels in the graph pyramid. At layer \(l\), the module receives three sets of features: the current scale feature \(A\), the high-resolution dense feature \(C\) from layer \(l-1\), and the low-resolution sparse feature \(B\) from layer \(l+1\). The high-resolution information contains detailed geometric edges; the low-resolution feature contains abstract global semantics. The CDF module first transforms the input features through a linear projection and then performs cross-attention to extract relevant information.

Densities are matched through down-sampling or up-sampling. The high-resolution features from layer \(l-1\) are first spatially aligned with the layer \(l\) positions by interpolating and finding neighbors. The interpolation uses inverse-distance weighting:

$$ x_{l-1,i} = \frac{1}{\mathrm{norm}} \sum_{j \in \mathcal{P}(i)} \frac{x_{l,j}}{\|p_{l-1,i} – p_{l,j}\|^2}, \quad \mathrm{norm} = \sum_{j \in \mathcal{P}(i)} \frac{1}{\|p_{l-1,i} – p_{l,j}\|^2}, $$

where \(\mathcal{P}(i)\) is the set of nearest neighbors of \(p_{l-1,i}\) in \(p_l\). For the downward path, the module applies graph pooling to \(l-1\) layer features, and for the upward path it uses interpolation-up-sampling on the \(l+1\) layer features. The resulting features are then passed into a cross-attention mechanism. For the upward flow, the attention output is

$$ y_{l-1,i} = \sum_{j \in \mathcal{N}_{l-1}(i)} \rho\left( \chi_q(x_l) \cdot \chi_k^{l-1}(x_{l-1}) \right) \cdot \chi_v^{l-1}(x_{l-1}) , $$

where \(\rho\) denotes a softmax operation. This expression focuses on matching the most relevant local details from the high-density scale. For the downward flow, the feature fusion uses element-wise subtraction to retain semantic context:

$$ y_{l+1,i} = \sum_{j \in \mathcal{N}_{l+1}(i)} \rho\left( M\left( \chi_q(x_l) – \chi_k^{l+1}(x_{l+1}) \right) \right) \odot \chi_v^{l+1}(x_{l+1}). $$

After obtaining the two enhanced feature streams, the module stacks them with the base feature and uses a multilayer perceptron to reduce the dimension. The resulting feature \(F\) is the fused output. This cross-density fusion can be represented compactly as

$$ F = \mathrm{MLP}\left( \left[ A \oplus y_{l-1} \oplus y_{l+1} \right] \right), $$

where \(\oplus\) denotes concatenation. The entire network with these modules is named LGANet-CDF. The network has a five-layer graph pyramid. Starting from the second layer, the fusion module is placed at each scale. In the final architecture, the first layer only uses a simple skip connection.

Training and Evaluation Setup

I implemented the proposed networks in PyTorch. The operating system was Ubuntu 22.04, using an NVIDIA RTX 4070 GPU and PyTorch version 2.2.1. In all experiments, each point cloud sample was uniformly subsampled to 16384 points before being fed to the network. The batch size was 8, and the number of epochs was 300. The AdamW optimizer was selected with an initial learning rate of 0.01. The learning rate decay followed a multi-step schedule. The experiment parameters are listed below.

Training Parameter Value
Epoch 300
Batch size 8
Number of input points 16384
Optimizer AdamW
Initial learning rate 0.01
Scheduler Multi-step decay

Evaluation included overall accuracy (OA), class mean accuracy (mAcc), mean intersection-over-union (mIoU), and per-class IoU. The equations are as follows. Let \(n_{ij}\) represent the number of points belonging to class \(i\) that are predicted as class \(j\), and let \(K\) be the number of classes. Overall accuracy is

$$ OA = \frac{\sum_{i=1}^{K} n_{ii}}{\sum_{i=1}^{K} \sum_{j=1}^{K} n_{ij}}, $$

and class mean accuracy is

$$ mAcc = \frac{1}{K} \sum_{i=1}^{K} \frac{n_{ii}}{\sum_{j=1}^{K} n_{ij}}. $$

The per-class IoU for class \(i\) is calculated as

$$ IoU_i = \frac{n_{ii}}{\sum_{j=1}^{K} n_{ij} + \sum_{j=1}^{K} n_{ji} – n_{ii}}, $$

and the mean IoU is simply the average of \(IoU_i\) over all classes. These metrics together allow a thorough comparison of the network behavior on imbalanced defect data.

Comparison with State-of-the-Art Networks

I compared the proposed LGANet-CDF with several popular point cloud segmentation networks, including PointNet, PointNet++, Point Transformer v1 (PTv1), Point Transformer v3 (PTv3), OA-CNN, and the original GACNet. All models were trained under identical conditions on the sealing nail dataset of traction battery packs. The quantitative results are shown in the following table.

Model OA (%) mAcc (%) mIoU (%) Burst IoU (%) Pit IoU (%) Molten bead IoU (%) Lifted nail IoU (%) Pinhole IoU (%)
PointNet 82.66 72.46 45.74 28.33 30.01 21.53 62.64 34.95
PointNet++ 89.33 84.65 62.67 47.91 59.32 42.37 81.64 46.53
PTv1 98.77 90.96 72.83 68.54 62.83 58.37 89.67 58.87
PTv3 99.03 94.96 75.13 77.32 67.98 60.44 89.17 56.21
OA-CNN 98.72 91.13 74.04 64.89 66.91 64.87 88.37 60.04
GACNet 96.68 87.96 70.85 56.88 67.52 54.64 87.93 59.37
LGANet-CDF (Ours) 99.13 96.20 81.25 80.06 71.91 75.99 89.89 70.03

The results clearly show that the proposed LGANet-CDF reaches the highest OA, mAcc, mIoU, and per-class IoU values, except for the lifted-nail class where it is also superior to the original GACNet. In particular, the IoU values for burst and molten bead improve from 56.88% to 80.06% and from 54.64% to 75.99%, respectively. The pinhole IoU improves from 59.37% to 70.03%. This improvement demonstrates that the cross-density feature fusion module helps the network recover small but crucial defect patterns in traction battery pack sealing nails.

Ablation Study of the Proposed Modules

To verify the contribution of each module, I performed ablation studies. First, I tested whether the Local Graph Attention Filter and the Spatial Attention Graph Pooling are independently beneficial. Table below provides the results under exactly the same training setting.

Method LGAF SAG Pooling OA (%) mAcc (%) mIoU (%)
GACNet ✗ ✗ 96.68 87.96 70.85
GACNet+LGAF ✓ ✗ 97.38 90.14 77.17
GACNet+SAG Pooling ✗ ✓ 97.96 88.95 74.81
LGANet ✓ ✓ 99.47 92.68 79.23

According to this table, the combination of LGAF and SAG Pooling yields a mIoU improvement of 8.38% over the baseline GACNet. The improvement in mAcc is 4.72%. This proves that the proposed attention modules are complementary. The Local Graph Attention Filter improves the local feature discriminability, while the Spatial Attention Graph Pooling retains structural information during the down-sampling stage.

Next, I conducted an ablation study to evaluate the effects of the bottom-up and top-down feature streams in the CDF module. I denote LGANet as the network without the CDF module. Two intermediate versions were constructed: one containing only the downward information flow (LGANet-CDF(a)) and the other only the upward flow (LGANet-CDF(b)). The two-flow full version is LGANet-CDF.

Model Down flow Up flow Burst IoU (%) Pit IoU (%) Molten bead IoU (%) Lifted nail IoU (%) Pinhole IoU (%)
LGANet ✗ ✗ 78.17 72.17 71.33 91.61 64.95
LGANet-CDF(a) ✓ ✗ 79.63 71.24 74.31 87.64 71.37
LGANet-CDF(b) ✗ ✓ 76.62 73.81 71.12 92.94 63.14
LGANet-CDF ✓ ✓ 80.06 71.91 75.99 89.89 70.03

The table indicates that the downward flow is more important for improving pinhole detection. In LGANet-CDF(a), pinhole IoU increases by 6.42% with respect to the baseline LGANet. The upward flow, in turn, supports the detection of pit defects. However, to maintain overall robustness and preserve the global context of the lifted nail, both flows need to be combined. The final LGANet-CDF obtains the highest performance among all four configurations.

A third ablation study was carried out to determine where the CDF module should be inserted in the graph pyramid. Let network a be the plain LGANet, and let network d be the version that applies CDF at every fusion node from layer 2 to layer 4. Networks b, c, and e represent intermediate allocation strategies. The final comparison is shown below.

Architecture ID mAcc (%) mIoU (%) ΔmIoU (%)
a 92.68 79.23 —
b 92.32 78.96 -0.27
c 94.03 80.11 +0.88
d 96.20 81.25 +2.02
e 94.97 80.69 +1.46

Architecture d, which corresponds to the final design, achieves the largest gain of 2.02% in mIoU compared with the plain LGANet. This demonstrates that the CDF module is most effective when it is consistently applied in the middle levels of the graph pyramid, where both detailed geometry and abstract semantic features are sufficiently rich.

Robustness and Computational Complexity

I further evaluated the robustness of the proposed network to the number of points in the input cloud. The models were tested with 16384, 8192, 4096, and 2048 random points per scan. The accuracy of LGANet-CDF remained almost unchanged when the input was downsampled from 16384 to 4096 points. In particular, the drop in mAcc was less than 2%. At the same time, the original GACNet and other baselines degraded much faster. This robustness is crucial in an industrial environment where traction battery packs on the production line may not be perfectly aligned and the point cloud density may vary.

In table below, I list the inference parameter count and average forward latency for several models. The computational measurements were taken on the same NVIDIA RTX 4070 GPU with a batch size of 1 and input point size 16384. Although the proposed LGANet-CDF is slightly slower than the original GACNet, it still meets the near-real-time requirement for offline inspection. Further engineering optimization could reduce the latency through tensorRT acceleration.

Model Number of parameters (M) Latency (ms per sample)
GACNet 2.41 34
PointNet++ 1.48 22
PTv1 7.53 78
OA-CNN 5.90 63
LGANet-CDF (Ours) 3.06 41

Even with feature fusion, the parameter count remains moderate compared with transformer-based methods. The network can therefore be deployed on a workstation-class computer with a conventional GPU, which is the architecture commonly available in battery factories.

Visual Quality of the Segmentation Results

I compared the visual segmentation performance among GACNet, OA-CNN, PTv3, and the proposed LGANet on several typical defect samples. The original GACNet often predicts disconnected regions around the defect boundaries, and it occasionally misses entire small defects. OA-CNN and PTv3 perform better but still confuse a pinhole with a normal background in uneven lighting or shadow-rich areas. The proposed network generates the most continuous and accurate boundary predictions. The detected defects match the annotated ground truth closely. For lifted nail defects, the entire tilted surface is correctly recognized with clean borders. For small burst and molten bead defects, LGANet-CDF generates compact predicted regions without merging adjacent normal points. These qualitative improvements indicate that the modules do not simply improve the statistical indexes but also produce a better representation of geometric edges.

Software Platform for Sealing Nail Inspection

To make the proposed defect detection technique usable in practice, I developed a software platform based on PyQt. The user interface contains a model selection button, an image selection area, a fitting button for the weld region, a detection start button, a save-button, and two display windows. The user first loads a pre-trained network weight file in the .pth format. Then, the user selects one point cloud scan, which is converted into a depth image and displayed on the left window. To isolate the welding region, the user sets the inner radius and outer radius of the sealing-nail weld bead according to the given geometry of the traction battery pack sealing nail. Upon clicking the region-fitting button, the system computes the position centroid of the sealing nail point cloud and displays the welding annular region with a green overlay. Finally, the defect detection button invokes the trained network and marks the predicted defect points with colored overlays on the right window. If the defect is a lifted nail, the entire sealing nail is evaluated directly without the welding-area step.

After the detection process finishes, the user can save the defect data. The platform automatically generates a text file whose name is the same as the input point cloud. The file records the detected defect types, defect counts, and additional remarks. This development is intended to help operators who are not machine-vision specialists to inspect the sealing nails of traction battery packs with a simplified workflow. The scripted platform thus bridges the gap between a complex deep-learning model and the production floor.

Discussion

From the data collected from many sealing-nail point clouds of traction battery packs, I found several factors that affect the segmentation performance. First, the presence of a highly reflective surface can produce artificial spikes in the point cloud. The improved RANSAC reduces the influence of these spikes during the base-plane fitting. Second, the class imbalance is often more severe than initially expected. For different defect types, the point counts differ by orders of magnitude. The weighted cross-entropy loss with square-root scaling balances the categories without disproportionately amplifying noise. Third, the semantic segmentation of micro defects requires multi-scale features. The cross-density fusion module aggregates high-resolution spatial details with low-resolution semantic information, enabling the network to retain the small but important border points of pinholes and molten beads.

In the future, the extension from offline detection to online inspection is possible by deploying the model with optimized inference libraries. One promising direction is knowledge distillation, where the proposed network could teach a lightweight student network for real-time acceleration. A second direction is to introduce additional sensors, such as infrared cameras or 2D color cameras, and use multi-modal data to increase the confidence of the defect classification. A third direction is to design an online learning layer that gradually adapts to new defect patterns that appear in a production run without the need for complete retraining.

Conclusions

In this article, I presented a complete point cloud deep learning framework for detecting welding defects in sealing nails located in traction battery packs. I first improved the RANSAC-based region extraction to accurately isolate the sealing nail and welding region from the battery top cover. The improved algorithm achieved an \(F_1\)-score of 87.74%, higher than other conventional segmentation methods. Then I built a semantic segmentation network, LGANet-CDF, on the basis of GACNet. The proposed Local Graph Attention Filter and Spatial Attention Graph Pooling strengthen the relation between spatial coordinates and features. The cross-density feature fusion module combines information from different graph pyramid layers, allowing small defects to remain detectable after extensive down-sampling. On the collected data set of traction battery pack sealing nails, the final network reached a mIoU of 81.25% and a mAcc of 96.20%. This result is superior to the original GACNet by 10.4% and 8.24%, respectively. The biggest gains occurred in the hard-to-detect classes: burst, molten bead, and pinhole. The improved detection forms the theoretical basis for an automated inspection software platform. I also built a PyQt-based software system that performs the whole pipeline, from point cloud loading and welding-region analysis to defect visualization, and automatically saves the results. This work provides a feasible solution for the quality control of sealing nails in traction battery packs and contributes to the automation of lithium-battery manufacturing.

Scroll to Top