An Automated Inspection Method for Firing Pin Marks on Shot Cartridges Based on Deep Learning

By using a multi-scale attention-enhanced PointMLP network and a Siamese network architecture SPMA, the problem of insufficient local-global feature fusion in the examination of firing pin marks on bullet casings is solved, enabling efficient discrimination of microscopic differences among firearms of the same model and improving the accuracy of physical evidence comparison in criminal cases.

CN120726345BActive Publication Date: 2025-10-31SICHUAN POLICE COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511158536.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2025-10-31
Estimated Expiration
2045-08-19

AI Technical Summary

Technical Problem

Existing technologies for examining firing pin marks on bullet casings suffer from insufficient fusion of local and global features and sensitivity to geometric transformations, making it difficult to effectively distinguish microscopic differences between firearms of the same model, resulting in insufficient discrimination capabilities.

Method used

Feature extraction is performed using a multi-scale attention-enhanced PointMLP network (PMA), combined with a Siamese network architecture (SPMA). Robustness is enhanced through a geometric affine module, and the local feature extraction module and the global feature fusion module are optimized collaboratively. Automatic similarity determination is achieved by utilizing Euclidean distance and statistical learning decision thresholds.

Benefits of technology

It significantly improves the ability to distinguish firing pin marks on bullet casings with similar shapes, enhances classification accuracy and generalization performance, effectively distinguishes microscopic differences between firearms of the same model, and improves the accuracy of physical evidence comparison in criminal cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120726345B_ABST
    Figure CN120726345B_ABST
Patent Text Reader

Abstract

This invention relates to the field of criminal investigation, specifically to an automated method for examining firing pin marks on bullet casings based on deep learning. Addressing the low accuracy and insufficient robustness of traditional manual examination, this method proposes a PMA network integrating PointMLP and multi-scale attention mechanisms. A geometric affine module enhances data robustness, and local feature extraction and global feature fusion capture the details and overall distribution of the marks. An SPMA Siamese network architecture is constructed, extracting depth features through shared weight branches, calculating Euclidean distance, and combining it with an adaptive threshold to achieve similarity determination. This provides an efficient solution for bullet casing mark comparison in criminal investigation and offers new insights into 3D point cloud data analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of criminal investigation, specifically to an automatic inspection method for firing pin marks on bullet casings based on deep learning. Background Technology

[0002] With the development of forensic technology, the analysis of bullet casings plays a crucial role in case solving, crime scene reconstruction, and legal identification, and has become one of the key research directions in the field of criminal investigation. The examination of traces in bullet casings mainly involves firing pin marks and ejector marks, among which firing pin marks, due to their high stability and identifiability, have significant research value. Firing pin marks are indentations formed by the firing pin striking the primer. They contain rich microscopic feature information, which, after extraction and analysis, can be used for evidence comparison in criminal cases. Common firing pin mark shapes include circular, flat, and triangular, with the specific shape depending on the firing pin structure. In different types of firearms, due to significant differences in firing pin structure, the resulting mark features are easily distinguishable, and similarity testing can rely on overall characteristics. However, even within the same type of firearm, although theoretically the firing pin structure and firing bias should be consistent, making the firing pin marks ideally identical, factors such as firing pin installation errors, wear, and loose parts can still cause individual differences in the actual marks. Even for firearms of the same model, there may be subtle variations in the shape and location of the firing pin marks. These microscopic differences can be used for firearm identification and provide important physical evidence for criminal convictions.

[0003] Commonly used methods for examining firing pin marks include the following: First, manual inspection, which uses physical imprinting, micro-CT tomography, and laser confocal microscopy to obtain morphological features of firing pin marks, and then compares them visually based on expert experience. However, this method is highly subjective and has low repeatability. Second, geometric analysis, which quantifies feature similarity through geometric representations such as conjugate matching units, hierarchical feature matching degrees, and fitting likelihood ratio distributions. While this method is interpretable, it lacks the ability to model complex nonlinear features. Third, traditional machine learning methods, which rely on manually designed local geometric descriptors and topologically invariant features, combined with classifier models such as support vector machines, random probability matching, and K-nearest neighbors for classification. Their performance is limited by the completeness of feature modeling. Fourth, deep learning-based algorithms, which use end-to-end architectures (such as hierarchical neural networks, connected neural networks, convolutional neural networks, and Transformers) to automatically learn high-dimensional features. However, existing methods suffer from insufficient local-global feature fusion, sensitivity to geometric transformations, and shortcomings in judging highly similar samples. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide an automatic inspection method for firing pin marks on bullet casings based on deep learning, comprising the following steps:

[0005] Step 1: Obtain the three-dimensional point cloud data of the firing pin marks of the cartridge case. Transform the three-dimensional point cloud data of the firing pin marks of the cartridge case using a geometric affine module to generate a geometrically perturbed three-dimensional point cloud data sample of the firing pin marks of the cartridge case.

[0006] Step 2: The PointMLP network PMA with multi-scale attention enhancement is used to extract features from the three-dimensional point cloud data samples of firing pin marks after geometric perturbation. The PMA network captures both local detail features and global distribution characteristics of the firing pin marks through the collaborative optimization of the local feature extraction module, the deep feature extraction module and the global feature fusion module.

[0007] Step 3: Construct a twin network architecture SPMA. Input the point cloud data of the two cartridge firing pin marks to be tested into the two PMA branches with shared weights of the SPMA. After extracting the depth features, calculate the Euclidean distance and combine it with the decision threshold of statistical learning to realize the automatic similarity determination.

[0008] Furthermore, the acquisition of three-dimensional point cloud data of the firing pin marks from the cartridge case involves transforming the three-dimensional point cloud data of the firing pin marks from the cartridge case using a geometric affine module, including:

[0009] The transformations in the geometric affine module include one of the following: translation, rotation, scaling, and shearing. A global affine transformation is applied to each striker mark sample, and the same transformation parameters are used for all points in the sample data. The transformation parameters are generated by random sampling from a uniform or normal distribution to enhance the robustness of the model to geometric transformations.

[0010] Furthermore, the local feature extraction module of the PMA network uses farthest point sampling and k-nearest neighbor algorithm to select geometrically representative key points, and extracts shallow geometric features by combining cascaded multilayer perceptrons with residual connections.

[0011] Furthermore, the global feature fusion module adopts a multi-scale attention mechanism with residual connections, which includes three parallel convolutional branches with progressively larger receptive fields. It captures local textures through point convolution, obtains medium-scale geometric patterns through spatial correlation, integrates global contextual information through a large receptive field, and dynamically weights multi-scale features through a channel attention mechanism.

[0012] Furthermore, the SPMA Siamese network is trained using a contrastive loss function, the expression of which is:

[0013]

[0014] Where yi∈{0,1} indicates whether the i-th sample pair matches, Di is its Euclidean distance, N is the total number of sample pairs used during training, and m is the minimum separation threshold for non-matching pairs.

[0015] Furthermore, the step of inputting the point cloud data of the two cartridge firing pin marks to be examined into the two PMA branches of the SPMA with shared weights, extracting depth features, calculating Euclidean distance, and combining the decision threshold of statistical learning to achieve automatic similarity determination includes:

[0016] Input sample pairs (P-, P+) are processed by two feature extraction networks with shared parameters to obtain comparable embedding representations (F-, F+):

[0017] F-=Gp1(P-;θ)

[0018] F+=Gp2(P+;θ)

[0019] Where Gp1(·,θ) and Gp2(·,θ) represent feature extractors with shared parameters, θ is the set of shared parameters, and the similarity of sample pairs is quantified by Euclidean distance D(·):

[0020]

[0021] The smaller the distance, the higher the similarity. The final judgment is controlled by the contrast loss function, and the judgment threshold τ is determined based on the statistical optimization strategy to achieve automated comparison.

[0022]

[0023] in τ The threshold is represented by the method of traversing different distance threshold intervals and evaluating the comparison results to select the optimal threshold. τ When the Euclidean distance is less than or equal to τ If the sample is in a matching pair, it is considered a matching sample pair; otherwise, it is considered a non-matching sample pair.

[0024] The beneficial effects of this invention are: it proposes a PMA network that integrates PointMLP and multi-scale attention mechanisms, enhances data robustness through a geometric affine module, and captures trace details and overall distribution by utilizing local feature extraction and global feature fusion. It constructs an SPMA Siamese network architecture, extracts deep features through shared weight branches, calculates Euclidean distance, and combines an adaptive threshold to achieve similarity determination. Attached Figure Description

[0025] Figure 1 This is a flowchart illustrating an automatic inspection method for firing pin marks on bullet casings based on deep learning.

[0026] Figure 2 This is a schematic diagram of threshold discrimination;

[0027] Figure 3With the same network architecture and parameters, and margins of 10, 20, and 30, the diagram shows the changes in the OA index of the model on the test set for the similarity test of the firing cartridge case as training progresses. The training epoch is set to 400.

[0028] Figure 4 This diagram illustrates the changes in the OA index for testing the similarity of firing cartridge cases on the test set for PMA at various depths, with the same training hyperparameters and margin=30. Detailed Implementation

[0029] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings, but the scope of protection of the present invention is not limited to the following description.

[0030] The features and performance of the present invention will be further described in detail below with reference to embodiments.

[0031] like Figure 1 As shown, an automatic inspection method for firing pin marks on bullet casings based on deep learning includes the following steps:

[0032] Step 1: Obtain the three-dimensional point cloud data of the firing pin marks of the cartridge case. Transform the three-dimensional point cloud data of the firing pin marks of the cartridge case using a geometric affine module to generate a geometrically perturbed three-dimensional point cloud data sample of the firing pin marks of the cartridge case.

[0033] Step 2: The PointMLP network PMA with multi-scale attention enhancement is used to extract features from the three-dimensional point cloud data samples of firing pin marks after geometric perturbation. The PMA network captures both local detail features and global distribution characteristics of the firing pin marks through the collaborative optimization of the local feature extraction module, the deep feature extraction module and the global feature fusion module.

[0034] Step 3: Construct a twin network architecture SPMA. Input the point cloud data of the two cartridge firing pin marks to be tested into the two PMA branches with shared weights of the SPMA. After extracting the depth features, calculate the Euclidean distance and combine it with the decision threshold of statistical learning to realize the automatic similarity determination.

[0035] The acquisition of three-dimensional point cloud data of the firing pin marks from a cartridge case, and the transformation of the three-dimensional point cloud data of the firing pin marks from the cartridge case using a geometric affine module, includes:

[0036] The transformations in the geometric affine module include one of the following: translation, rotation, scaling, and shearing. A global affine transformation is applied to each striker mark sample, and the same transformation parameters are used for all points in the sample data. The transformation parameters are generated by random sampling from a uniform or normal distribution to enhance the robustness of the model to geometric transformations.

[0037] The local feature extraction module of the PMA network uses farthest point sampling and k-nearest neighbor algorithm to select geometrically representative key points, and extracts shallow geometric features by combining cascaded multilayer perceptrons with residual connections.

[0038] The global feature fusion module adopts a multi-scale attention mechanism with residual connections, which includes three parallel convolutional branches with progressively larger receptive fields. It captures local textures through point convolution, obtains medium-scale geometric patterns through spatial correlation, integrates global contextual information through a large receptive field, and dynamically weights multi-scale features through a channel attention mechanism.

[0039] The SPMA twin network is trained using a contrastive loss function, the expression of which is:

[0040]

[0041] Where yi∈{0,1} indicates whether the i-th sample pair matches, Di is its Euclidean distance, N is the total number of sample pairs used during training, and m is the minimum separation threshold for non-matching pairs.

[0042] The process involves inputting the point cloud data of the firing pin marks from the two cartridge cases to be examined into two PMA branches of the SPMA with shared weights, extracting depth features, calculating the Euclidean distance, and combining this with a decision threshold learned through statistical learning to automatically determine similarity. This includes:

[0043] Input sample pairs (P-, P+) are processed by two feature extraction networks with shared parameters to obtain comparable embedding representations (F-, F+):

[0044] F-=Gp1(P-;θ)

[0045] F+=Gp2(P+;θ)

[0046] Where Gp1(·,θ) and Gp2(·,θ) represent feature extractors with shared parameters, θ is the set of shared parameters, and the similarity of sample pairs is quantified by Euclidean distance D(·):

[0047]

[0048] The smaller the distance, the higher the similarity. The final judgment is controlled by the contrast loss function, and the judgment threshold τ is determined based on the statistical optimization strategy to achieve automated comparison.

[0049]

[0050] in τ The threshold is represented by the method of traversing different distance threshold intervals and evaluating the comparison results to select the optimal threshold. τWhen the Euclidean distance is less than or equal to τ If the sample is in a matching pair, it is considered a matching sample pair; otherwise, it is considered a non-matching sample pair.

[0051] Specifically, we propose PMA, an enhanced architecture that optimizes the network structure and feature extraction mechanism. The key improvement of PMA lies in enhancing the ability to distinguish between morphologically similar samples, thereby improving classification accuracy and generalization performance.

[0052] The overall structure of the PMA network can be divided into three stages:

[0053] In the first phase, PMA introduces a diverse geometric affine transformation module to enhance geometric robustness. This module introduces perturbations such as scaling, rotation, resampling, and shearing, thereby improving the model's invariance to spatial transformations and ensuring the stability of feature representations.

[0054] In the second stage, PMA extracts features of the firing pin marks through N stages, each consisting of four modules. After geometric enhancement, Farthest Point Sampling (FPS) and k-Nearest Neighbor (k-NN) algorithms are used to extract key points layer by layer in the geometric space. Subsequently, cascaded Multilayer Perceptron (MLP) modules achieve hierarchical abstraction of features, amplifying local geometric details through progressive nonlinear transformations and preserving the integrity of shallow geometric information through residual connections. Furthermore, a multi-scale attention mechanism dynamically fuses features from different receptive fields, achieving synergistic optimization of fine-grained local structures and global patterns.

[0055] In the third stage, the classifier compresses the feature space. Ultimately, the PMA outputs a deep, multi-level feature representation with high geometric discriminativeness, providing a robust and discriminative feature space for subsequent similarity matching.

[0056] The 3D point cloud sample of the firing pin primer can be represented as follows:

[0057] P={pi∈R3|i=1,2,...,M}(1)

[0058] Where pi = [xi, yi, zi]T represents the three-dimensional coordinates of the i-th point, and M is the total number of points in the sample. The PMA framework can be formally represented as:

[0059] g=C(Q(D(P)))(2)

[0060] Where P∈RM×3 represents the point set of the input cartridge case samples. A diversified geometric affine module D(·) applies a random affine transformation to the input data, thereby generating geometrically perturbed samples. This geometric enhancement strategy achieves two key objectives: first, to expand the diversity of data distribution; and second, to introduce geometric invariance during feature learning, thereby enhancing the robustness and generalization ability of the model.

[0061] Q(·) is the core module for abstracting and constructing high-dimensional geometric information, consisting of four sub-modules: geometric construction, local feature extraction, deep feature extraction, and global feature fusion. Thanks to the interaction between the geometric space and the abstract space, Q(·) can simultaneously capture local features and global contextual patterns in the striker marks.

[0062] Finally, after compression and refinement by classifier C(·), the data is encoded into a high-dimensional vector containing all the effective information.

[0063] Geometric Affine of Primer Samples

[0064] To improve the model's robustness to geometric transformations and partial data loss in real-world scenarios, we introduce a controllable geometric affine transformation during the data preprocessing stage. Specifically, a global affine transformation is applied to each firing pin mark sample P, using the same transformation parameters for all points in the sample. This transformation comprises the following components:

[0065] 1. Translation Transformation: Sampling a random translation vector from a uniform distribution:

[0066] t∼U(-tmax,tmax)3

[0067] And apply it evenly to all points:

[0068]

[0069] 2. Rotation Transformation: Independently sample the rotation angle for each axis:

[0070] θx,θy,θz∼U(-θmax,θmax)

[0071] Construct a composite rotation matrix R ∈ R3×3 using these angles, and apply the following transformation:

[0072]

[0073] Scaling transformation: Samples three independent scaling factors:

[0074] sx, sy, sz ∼ U(smin, smax)

[0075] Construct a diagonal scaling matrix S = diag(sx, sy, sz) and apply the following transformation:

[0076]

[0077] Shearing Transform: The shearing operation is defined as follows:

[0078]

[0079] Where I is the identity matrix, U,V∈R3 are random unit vectors, and α∼N(0,σ2) is a random scalar controlling the shear strength. This transformation is used to simulate physical deformation caused by external forces, thereby further improving the model's robustness to geometric perturbations.

[0080] These global transformations improve the model's ability to generalize to spatial variations while maintaining consistency within each point cloud sample.

[0081] Abstraction and construction of primer samples

[0082] The processing flow for this step can be summarized as follows:

[0083] Pi=Ai(Ψdeepi(Ψloci(Gi(Pi-1),i=1,...,K)))(3)

[0084] Branch index i controls the layer-by-layer refinement of features, achieving multi-stage optimization through a loop structure to further enhance the model's expressive power. The geometry construction module Gi(·) employs a hybrid strategy after the affine transformation, combining Farthest Point Sampling (FPS) and k-Nearest Neighbors (k-NN) methods to select geometrically representative keypoints from the enhanced data and construct geometric features. Subsequently, two fine-tuning parameters αk and βk are used to perform geometric correction on the keypoints. Following this, the two-stage residual MLP modules Ψloci(·) and Ψdeepi(·) work sequentially: the local feature extraction module Ψloci(·) extracts shallow geometric features through convolution operations and nonlinear transformations; the deep feature extraction module Ψdeepi(·) gradually abstracts deep semantic representations, including local microstructures and abstract geometric information, through multi-level nonlinear mappings. The dual residual MLP modules Ψloci(·) and Ψdeepi(·) use N identical basic building blocks, namely Residual Feature Extractors (RFeaEs). Each module consists of a convolutional layer, a normalization layer, an activation function, and residual skip connections. This structure effectively alleviates the gradient vanishing problem and preserves the integrity of shallow geometric information during propagation in deep networks.

[0085] After local and deep feature extraction, the point cloud representation Pkb∈RM×C contains rich geometric details. Although the residual skip connections in the early stage preserve the shallow geometric integrity, this information is still insufficient to support accurate discrimination for the striker mark matching task, which relies on global patterns. Therefore, we introduce a global feature fusion module in the final stage to collaboratively integrate local details and global structure. The fusion module employs a multi-scale attention mechanism with residual connections, consisting of three parallel convolutional branches with progressively increasing receptive fields. Branches S1×1 to Sn×n collaboratively extract multi-scale features: capturing fine local textures through point convolution, obtaining mid-scale geometric patterns through spatial correlation, and integrating global contextual information using a larger receptive field. All branches retain residual connections to enhance gradient stability and dynamically weight the contribution of multi-scale features through a channel attention mechanism, thereby achieving hierarchical feature extraction and fusion from local to global semantics.

[0086] Compression and Reconstruction of Primer Samples

[0087] P k =F(2k-1)×(2k-1)(P),k∈{1,2,...,n}(4)

[0088] Where F(2k-1)×(2k-1) represents a multilayer perceptron (MLP) of size (2k-1)×(2k-1). The fused features are represented as:

[0089] (5)

[0090] Where P1, P2, ..., P n Let each represent an output feature from one of the n branches, and let Gcat(·) denote the feature concatenation operation. Then, global convolution is used to compress the features:

[0091] Pconv=Ψconv(Pcat)∈RM×1(6)

[0092] Subsequently, the activation function σ(·) is subjected to a nonlinear transformation to enhance the model's ability to fit the data distribution:

[0093] Pglobal=σ(Pconv)∈RM×1(7)

[0094] Finally, the fused output is obtained through matrix multiplication:

[0095] Pout=Pd⊗Pglobal∈RM×C(8)

[0096] Where ⊗ represents matrix multiplication. This design enables the joint extraction of local geometric details and global distribution features, significantly improving the performance of feature extraction in similarity comparison tasks.

[0097] The SPMA framework employs a weight-sharing twin structure, overcoming the limitation of traditional single-branch networks in modeling relationships between samples. For example... Figure 2 As shown, the input sample pair (P-, P+) is processed by two feature extraction networks with shared parameters to obtain comparable embedding representations (F-, F+):

[0098] F-=Gp1(P-;θ),F+=Gp2(P+;θ)(9)

[0099] Where Gp1(·,θ) and Gp2(·,θ) represent feature extractors with shared parameters, and θ is the set of shared parameters. This structure ensures consistent encoding of different samples in the same latent space. Subsequently, the similarity of sample pairs is quantified by the Euclidean distance D(·).

[0100] (10)

[0101] A smaller distance indicates a higher similarity, and the final judgment is controlled by the contrastive loss function. Finally, a judgment threshold τ is determined based on a statistical optimization strategy to achieve automated comparison.

[0102] (11)

[0103] Where τ represents the threshold. By traversing different distance threshold intervals and evaluating the comparison effect under each distance threshold interval, the value corresponding to the optimal similarity is selected as the final threshold.

[0104] To enhance the model's ability to distinguish between matched and unmatched sample pairs, the SPMA framework employs a contrastive loss function for optimization during the training phase. This loss function brings matched sample pairs closer together while imposing a minimum distance constraint m on unmatched sample pairs.

[0105] (12)

[0106] Where y i ∈{0,1} indicates whether the i-th sample pair matches, D i Let be the Euclidean distance, N be the total number of sample pairs used during training, and m be the minimum separation threshold for non-matching pairs. This loss function effectively improves the accuracy of similarity matching by compressing the intra-class distribution and expanding the inter-class margin.

[0107] In our experiment, we systematically explored the impact of margin on performance.

[0108] During training, the PMA network is initialized with a Gaussian random distribution and optimized using stochastic gradient descent (SGD) with momentum set to 0.9 and an initial learning rate of 0.01. Weight decay is introduced to prevent overfitting and improve generalization ability. Cosine annealing is used to dynamically adjust the learning rate, improving stability while ensuring convergence efficiency.

[0109] In practical deployment, the adaptively selected threshold τ serves as the key discrimination boundary. Compared with the traditional fixed threshold strategy, this method can better match the data distribution characteristics and significantly improve the accuracy of similarity judgment.

[0110] The dataset used was collected and constructed by the team itself, containing 4 models, 25 different guns, and 427 cartridge cases. The cartridge cases collected from each gun belong to one category. The classification of the collected cartridge cases is shown in Table 1.

[0111] Table 1: Data Category Classification

[0112]

[0113] The cartridge case firing pin mark data were acquired using a line laser acquisition device. Each cartridge case sample in the raw data sample has 1024x1024 data points, with an X-axis resolution of 29.5 micrometers, a Y-axis resolution of 28.0 micrometers, and a Z-axis resolution of 0.9 micrometers, as shown in Table 2.

[0114] Table 2: Data Characteristics

[0115]

[0116] In the experimental phase, the cartridge case firing pin mark samples were first paired to construct sample pairs: two samples from the same gun were positive samples, and two samples from different guns of the same model or different models of guns were negative samples. Since the number of combinations of different guns is much greater than the number of combinations of the same gun, using them directly would result in a significantly larger number of negative samples than positive samples, making the model overly sensitive to negative samples and insufficient in its ability to distinguish positive samples.

[0117] To address this issue, the experiment randomly selected negative samples based on the number of positive samples to achieve a balance between the number of positive and negative samples. Subsequently, the sample pairs in the dataset were divided into training and test sets in a 7:3 ratio, as shown in Table 3. This equalization process effectively avoided model bias caused by imbalanced sample distribution and balanced the model's ability to distinguish between positive and negative samples.

[0118] Table 3: Dataset Partition Results

[0119]

[0120] Experimental Analysis

[0121] Evaluation indicators

[0122] To verify the effectiveness of the network model, the experiment compared 30,352 training sample pairs of cartridge case firing pin marks and 9,106 test sample pairs, covering 25 categories of classification data. The evaluation metrics included: OA, mAcc, F1 score, and recall.

[0123] 1. Confusion Matrix: Used to visualize the model's prediction results across various categories. Each element of the matrix represents a combination of the actual and predicted categories, helping to analyze which categories the model performs well on or has problems with. The confusion matrix is ​​shown in Table 4.

[0124] Table 4: Confusion Matrix

[0125]

[0126] Overall accuracy (OA): represents the proportion of samples correctly classified by the model. The calculation formula is:

[0127]

[0128] 3. Average precision mAcc: Represents the precision for each class, then averaged. For class i, the precision mAcc is calculated as follows:

[0129]

[0130] in, , , , These represent the number of true positives, true negatives, false positives, and false negatives for category i, respectively.

[0131] 4. Recall: This measures the model's ability to identify positive samples. The formula is:

[0132]

[0133] 5. Accuracy: Also used to measure the model's ability to identify positive class samples. The calculation formula is:

[0134]

[0135] 6. F1 score: This is the harmonic mean of precision and recall, taking into account both the model's precision and recall capabilities. The calculation formula is:

[0136]

[0137] The F1 score ranges from 0 to 1, with a higher value indicating better model performance.

[0138] Experimental Results Analysis

[0139] To improve classification performance, loss function optimization is needed to explicitly drive the model to maximize inter-class feature distance and minimize intra-class feature differences. The setting of the margin parameter has a decisive impact on model performance. When the parameter is too small, the inter-class separation constraint is insufficient, leading to blurred decision boundaries between different classes of samples in the feature space. The model struggles to distinguish subtle changes between similar data, resulting in an increased false positive rate. Conversely, when the parameter is too large, excessive separation forces features of similar samples to be pushed away from the boundary region, leading to an increased false negative rate. Table 5 shows the test metrics for data similarity testing of the model under a unified architecture and hyperparameter configuration with different distance threshold margins.

[0140] Table 5: Experimental results under different margins

[0141]

[0142] Observing the experimental results, under the condition of fixed model architecture and parameters, when the distance parameter margin in the loss function is set to 20, the overall accuracy (OA) is 98.86%, recall is 99.03%, and F1 score is 98.86%, all reaching optimal values. Setting margin=20 significantly reduces the false negative rate to 0.97% through a balanced separation constraint mechanism, while simultaneously increasing the F1 score to 98.86%, an improvement of 1.36–1.60% compared to other configurations. This indicates that it achieves an optimal trade-off between precision and recall, avoiding intra-class overlap caused by excessively loose margins while suppressing oversegmentation caused by excessively tight margins, demonstrating a strong ability to capture subtle differences in cartridge case firing pin marks. Notably, the model exhibits high reliability in predicting positive class samples under all configurations, with stable precision and a fluctuation of only 1.37%, fully validating the framework's robustness in extracting features from cartridge case firing pin marks.

[0143] When the margin parameter in the loss function is set to 10, the inter-class boundaries become blurred, increasing the false positive rate and causing similar samples to be misclassified as outliers. When the margin is 30, excessive separation forces features of similar samples to be pushed into non-overlapping regions, increasing the false negative rate and disrupting intra-class consistency. A suitable margin threshold of 20, through a multi-scale attention mechanism, enhances the model's ability to capture subtle differences during global feature fusion. Simultaneously, the loss function constraint suppresses feature space distortion, maintaining intra-class compactness and inter-class separability, enabling near-complete identification of all positive samples, thus significantly improving the model's ability to discriminate against cartridge case firing pin trace data.

[0144] To analyze the performance changes of the model during training in greater depth and to explore the impact of different distance margin parameters on the model's training dynamics, we recorded the training and validation results for each epoch under different distance margin parameters in the experiment in detail. The results are as follows: Figure 3 As shown.

[0145] Experimental results show that the margin parameter has a significant impact on convergence speed and discriminative ability. During the initial training phase (0-150 epochs), the model's similarity discrimination ability improved rapidly across all configurations, with the overall accuracy (OA) quickly exceeding 90%, validating the framework's effectiveness in extracting basic features from regular samples. Notably, the convergence rate with margin=20 was significantly better than other configurations. This is because a moderate inter-class margin accelerates feature space reorganization in the initial stage, while avoiding loose intra-class features due to too small a margin, or optimization lag caused by too large a margin.

[0146] When margin=10, it can quickly separate significantly different samples in the early stage, but it cannot refine slightly different samples, resulting in weak optimization in the later stage. When margin=30, the strict margin constraint forces the model to consume more iterations to meet the separation condition, which slows down the convergence speed and limits the model's ability to dynamically adjust the feature space. On the other hand, margin=20, through an appropriate distance threshold, ensures intra-class compactness while gradually expanding inter-class separability, thereby further realizing robust judgment of extreme samples, and finally the judgment accuracy is higher than that of margin=10 and margin=30.

[0147] The experiment also explored the effectiveness and depth complexity relationship between local feature extractors and deep feature extractors in PMA. In the depth information table, the length of the column represents the number of extractors, and the value of the column represents the number of RFEaE-blocks in each extractor. The distance threshold margin was set to 30 during the experiment. The results are shown in Table 6.

[0148] Table 6: Experimental results at different model depths (margin=30)

[0149]

[0150] Experimental results show that when the margin parameter is fixed at margin=30, the model depth has a non-linear impact on the similarity detection performance of cartridge case firing pin marks. With a shallow configuration of [2,2,2,2], the overall model accuracy is 97.25%, which, along with the F1 score of 97.26%, is close to the upper limit of task performance, indicating that the basic network can effectively capture the macroscopic geometric features of cartridge case marks. When the network depth is increased to [3,3,3,3] and [4,4,4,4], the network extraction capability is enhanced, and it becomes more sensitive to irrelevant features, leading to overfitting to some extent. There is always some overlap between the segmentation boundaries of positive and negative samples. In the shallow network architecture [2,2,2,2], the inter-class separation is relatively low, and misclassified samples are concentrated in the vicinity of the decision boundary. As the network depth increases, the increased model complexity gradually leads to overfitting, resulting in a distortion of the feature space distribution. The distribution of misclassified samples shows a discretization trend, the overlap range of the decision region expands, and the number of false positive samples increases significantly.

[0151] This phenomenon indicates that while increasing network depth can enhance the ability to abstract local features, excessive complexity can disrupt the geometric consistency of the feature space, causing the misclassification distribution to evolve into a discrete distribution. Therefore, the network depth needs to be controlled within a reasonable range to balance inter-class separability with the concentration of misclassification distribution, thereby ensuring the reliability of the striking pin mark similarity determination results.

[0152] like Figure 4 As shown in the figure, the training curve analysis indicates that network depth has a significant impact on the convergence speed and training stability of the model.

[0153] In the early stages of training (0-100 epochs), shallow networks [2,2,2,2] converge faster due to their lower network complexity, quickly achieving an overall accuracy (OA) of approximately 90%. In contrast, deeper models (such as networks with a depth of 2 or 3) converge more slowly due to longer gradient propagation paths and reduced parameter update efficiency. When training reaches 300 epochs, model performance generally stabilizes. However, with increasing network depth, while the computational complexity increases, the model's ability to discriminate sample similarity decreases, and training time and computational resource consumption also increase significantly. It is worth noting that although deeper networks incur higher computational costs, they exhibit a more stable convergence trend during training, enhancing the model's robustness to some extent.

[0154] Experimental results show that when the network depth reaches [2,2,2,2], the model's performance in the striker similarity detection task is close to the theoretical saturation point. Further increasing the depth only leads to increased computational cost without translating into improved accuracy. Therefore, a shallow network design is adopted for striker mark similarity testing to balance model efficiency and testing reliability.

[0155] Comparative experiment

[0156] To validate the effectiveness of the model framework, we compared the performance of various algorithms on the strike pin mark similarity detection task based on evaluation metrics for deep learning classification tasks. Specifically, we replaced the feature extraction module in the SPMA network with other deep learning models, including PointNet, PointNet++, Point-NN, and PointMLP, while keeping the overall framework of the Siamese network unchanged.

[0157] Furthermore, we compared classic algorithms based on geometric analysis: ICP and RANSAC. PointCNN, proposed by Li et al., is a model that extracts point cloud features using a convolutional neural network, but it has a high computational cost. PointNet, proposed by Qi et al., is a deep learning model for processing unordered 3D point cloud data. It achieves invariance to unordered point cloud data by applying a multilayer perceptron (MLP) to each point and combining it with symmetric functions such as max pooling to extract global feature vectors. PointNet++ improves upon PointNet by dividing local regions into hierarchical structures and gradually fusing local features, significantly enhancing its ability to process complex point cloud data and outperforming PointNet in similarity detection tasks. PointMLP, proposed by Ma et al., is an efficient point cloud processing model that obtains representative point cloud data through farthest point sampling and K-nearest neighbor sampling, and combines local and deep feature extractors to extract detailed features, significantly reducing computational cost while maintaining classification performance. Point-NN, proposed by Zhao et al., is a parameter-free neural network that extracts point cloud features by performing high-dimensional encoding, farthest point sampling, and max pooling operations on the input data, completing the similarity discrimination task with extremely low computational cost. In geometry-based algorithms, the ICP algorithm iteratively matches the nearest points in the source and target point clouds and calculates the optimal rigid transformation to achieve point cloud alignment. The RANSAC algorithm, on the other hand, fits a model to a randomly selected subset of data and evaluates the consistency between the data points and the model. Through repeated iterations, it identifies and removes outliers, thus achieving precise alignment of the sample data. After alignment, similarity is determined by calculating the Chamfer and Hausdorff distances between samples and considering the distance distributions between samples of the same and different classes.

[0158] Before the comparative experiment, we also verified the similarity of the cartridge case firing pin data using traditional geometric algorithms: we registered the firing pin trace data using the ICP and RANSAC algorithms and their combined algorithm, and then calculated the Hausdorff distance and Chamfer distance of the registered data.

[0159] The results show that the distances between registered data of the same and different types are very close, making it difficult for traditional geometric algorithms to analyze data similarity.

[0160] The experiment recorded the results of the above comparison methods in the task of cartridge case similarity testing, with all models trained using the same hyperparameter settings. The ICP and RANSAC algorithms were used for similarity evaluation under Hausdorff distance and Chamfer distance, respectively. PointNet, PointNet++, PointMLP, PointCNN, Point-NN, and PMA were all tested for similarity within the SPMA model framework. The results are shown in Table 7.

[0161] Table 7: Experimental results of different feature extraction networks for bullet casing similarity testing

[0162]

[0163] Experimental results show that traditional algorithms (ICP, RANSAC) are unable to extract deep relationships between highly similar firing pin data, exhibiting limited capabilities and low similarity detection accuracy. Within the SPMA framework, the PMA model demonstrates higher detection accuracy compared to other comparative models when handling highly similar data such as cartridge case firing pins. The success of the SPMA framework and PMA model in the cartridge case similarity detection task indicates that by introducing a multi-scale attention mechanism, the model can effectively capture the global distribution characteristics of the data while deeply exploring local features, and by combining the constraints of the loss function, it can effectively amplify subtle differences between data. Ultimately, the model achieves similarity detection accuracies of 97.026% and 98.509% on the training and test sets, respectively, outperforming the comparative methods.

[0164] ablation experiment

[0165] The similarity comparison experiment initially verified the effectiveness of the model. To further verify the effectiveness of the PMA network, the PMA network was split and ablation experiments were performed.

[0166] Compared to PointMLP, PMA adds a diverse geometric affine module and a global feature fusion module, improving the accuracy of similarity testing. We used the PMA model as a benchmark to conduct experimental evaluations in the following aspects: removal of the diverse geometric affine module and removal of the global feature module. The ablation experiment results are shown in Table 8.

[0167] Table 8: Component Ablation Experiment Results

[0168]

[0169] Analysis of the experimental results reveals that the baseline model achieves an accuracy of 98.51% across the entire dataset (including the training and test sets). However, when the diverse geometric affine transformation module is removed, the model's accuracy slightly decreases to 97.26%, indicating that geometric affine transformation has a limited impact on improving model performance, although it still contributes to data diversity enhancement and geometric robustness. In contrast, when the multi-scale attention mechanism (i.e., the global feature fusion module) is removed, the model's accuracy significantly decreases to 95.83%, a substantial drop, demonstrating the crucial role this module plays in improving model performance.

[0170] Ablation studies demonstrate that the global feature fusion module is a core component for PMA models in capturing subtle features. While most models achieve high accuracy when processing highly similar data, the global feature fusion module significantly enhances the model's ability to distinguish extreme samples through multi-scale feature extraction and the fusion of global contextual information. This enables the model to achieve more accurate similarity discrimination in complex scenarios. Therefore, the global feature fusion module is not only key to improving the overall performance of the model but also an important factor in enhancing its ability to distinguish extreme data.

Claims

1. A method for automatic inspection of firing pin marks on bullet casings based on deep learning, characterized in that, Includes the following steps: Step 1: Obtain the three-dimensional point cloud data of the firing pin marks of the cartridge case. Transform the three-dimensional point cloud data of the firing pin marks of the cartridge case using a geometric affine module to generate a geometrically perturbed three-dimensional point cloud data sample of the firing pin marks of the cartridge case. Step 2: The PointMLP network PMA with multi-scale attention enhancement is used to extract features from the three-dimensional point cloud data samples of firing pin marks after geometric perturbation. The PMA network captures both local detail features and global distribution characteristics of the firing pin marks through the collaborative optimization of the local feature extraction module, the deep feature extraction module and the global feature fusion module. Step 3: Construct a twin network architecture SPMA. Input the point cloud data of the two cartridge firing pin marks to be tested into the two PMA branches with shared weights of the SPMA. After extracting the depth features, calculate the Euclidean distance and combine it with the decision threshold of statistical learning to realize the automatic similarity determination.

2. The method for automatic inspection of firing pin marks on bullet casings based on deep learning according to claim 1, characterized in that, The acquisition of three-dimensional point cloud data of the firing pin marks from a cartridge case, and the transformation of the three-dimensional point cloud data of the firing pin marks from the cartridge case using a geometric affine module, includes: The transformations in the geometric affine module include one of the following: translation, rotation, scaling, and shearing. A global affine transformation is applied to each striker mark sample, and the same transformation parameters are used for all points in the sample data. The transformation parameters are generated by random sampling from a uniform or normal distribution to enhance the robustness of the model to geometric transformations.

3. The method for automatic inspection of firing pin marks on bullet casings based on deep learning according to claim 1, characterized in that, The local feature extraction module of the PMA network uses farthest point sampling and k-nearest neighbor algorithm to select geometrically representative key points, and extracts shallow geometric features by combining cascaded multilayer perceptrons with residual connections.

4. The method for automatic inspection of firing pin marks on bullet casings based on deep learning according to claim 1, characterized in that, The global feature fusion module adopts a multi-scale attention mechanism with residual connections, which includes three parallel convolutional branches with progressively larger receptive fields. It captures local textures through point convolution, obtains medium-scale geometric patterns through spatial correlation, integrates global contextual information through a large receptive field, and dynamically weights multi-scale features through a channel attention mechanism.

5. The method for automatic inspection of firing pin marks on bullet casings based on deep learning according to claim 1, characterized in that, The SPMA twin network is trained using a contrastive loss function, the expression of which is: Where yi∈{0,1} indicates whether the i-th sample pair matches, Di is its Euclidean distance, N is the total number of sample pairs used during training, and m is the minimum separation threshold for non-matching pairs.

6. The method for automatic inspection of firing pin marks on bullet casings based on deep learning according to claim 1, characterized in that, The process involves inputting the point cloud data of the firing pin marks from the two cartridge cases to be examined into two PMA branches of the SPMA with shared weights, extracting depth features, calculating the Euclidean distance, and combining this with a decision threshold learned through statistical learning to automatically determine similarity. This includes: Input sample pairs (P-, P+) are processed by two feature extraction networks with shared parameters to obtain comparable embedding representations (F-, F+): F-=Gp1(P-;θ) F+=Gp2(P+;θ) Where Gp1(·,θ) and Gp2(·,θ) represent feature extractors with shared parameters, θ is the set of shared parameters, and the similarity of sample pairs is quantified by Euclidean distance D(·): The smaller the distance, the higher the similarity. The final judgment is controlled by the contrast loss function, and the judgment threshold τ is determined based on the statistical optimization strategy to achieve automated comparison. in τ The threshold is represented by the method of traversing different distance threshold intervals and evaluating the comparison results to select the optimal threshold. τ When the Euclidean distance is less than or equal to τ If the sample is in a matching pair, it is considered a matching sample pair; otherwise, it is considered a non-matching sample pair.