An ancient coin identification method and system
Patent Information
- Application Number
- CN202610825129.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-09
- Publication Date
- 2026-08-28
AI Technical Summary
然而,随着考古发掘的不断推进,每年都有大量新类别古钱币出土,传统闭集方法只能识别训练集中已有的类别,无法应对持续涌现的新类别;同时,部分类增量学习方法虽能扩展模型识别范围,但大多依赖旧样本回放来缓解灾难性遗忘,在文物数据隐私受限、存储成本高昂且标注稀缺的场景下难以实际部署
[0015] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a method and system for ancient coin identification. By constructing a feature extraction framework with global shape and local inscription as two branches, an attention mechanism is embedded in the local inscription branch to focus on the text area and suppress the interference of rust and wear. The adaptive complementarity of the two types of features is achieved by using branch cross interaction and dynamic gating fusion. A cosine classification head is used to eliminate the scale difference between features and weights. The backbone network parameters are completely frozen in the incremental learning stage, and the classification head is updated only with the feature mean of the new category samples as the prototype. Thus, continuous category expansion is achieved without accessing or replaying any old samples. This invention overcomes the practical bottleneck of not being able to preserve old samples due to limitations in data privacy protection and storage costs, and avoids the catastrophic forgetting problem in traditional incremental learning. By specifically modeling the global shape and fine-grained features of local inscriptions on ancient coins, it improves the ability to distinguish similar categories with minimal inter-class differences, distinguished only by the strokes of characters. At the same time, the lightweight attention mechanism and adaptive fusion strategy ensure the training stability and generalization performance of the model under the condition of only a small number of samples in each class, providing an efficient, safe, and sustainable general technical path for cultural heritage image recognition.
Smart Images

Figure CN122657592A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and more specifically to a method and system for identifying ancient coins. Background Technology
[0002] Currently, as a core cultural heritage embodying Chinese civilization, ancient coins face an increasingly urgent need for digital preservation and intelligent identification. Deep learning-based closed-set image recognition technology has been widely applied in the field of cultural relics. However, with the continuous advancement of archaeological excavations, a large number of new categories of ancient coins are unearthed every year. Traditional closed-set methods can only identify categories already present in the training set and cannot cope with the continuous emergence of new categories. Meanwhile, while partial-class incremental learning methods can expand the model's recognition range, they mostly rely on replaying old samples to mitigate catastrophic forgetting, making them difficult to deploy practically in scenarios where cultural relic data privacy is limited, storage costs are high, and annotations are scarce.
[0003] However, while existing general-purpose few-shot incremental learning (FSCIL) methods attempt to achieve replay-free incremental learning by freezing the backbone network, they are primarily designed for natural images, focusing on global feature extraction and completely ignoring the most discriminative local inscription features of ancient coins. Ancient coin recognition faces three major challenges: minimal inter-class differences, the crucial role of local inscriptions as core discriminative features, and sample scarcity. Many different versions of coins differ only slightly in the strokes of their inscriptions, and general-purpose FSCIL methods lack the ability to model these fine-grained local features, severely limiting their performance on ancient coin recognition tasks.
[0004] Therefore, how to propose a method and system for identifying ancient coins that can achieve continuous incremental learning with only a small number of samples of each class without accessing any old samples, and effectively model the global shape features and local fine-grained features of inscriptions of ancient coins, is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention provides a method and system for ancient coin identification, which realizes automated identification and incremental updating of ancient coins without playback, with few samples, high accuracy and low forgetting.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: On the one hand, this invention proposes a method for identifying ancient coins, including the following steps: The ancient coin image is acquired and preprocessed to obtain the standard input image; The standard input image is input into the pre-trained backbone network to obtain a shared high-level feature map; The shared high-level feature map is input into the global form branch and the local inscription branch respectively; the global form branch uses the shared high-level feature map as the global form feature; the local inscription branch applies an inscription attention mechanism to the shared high-level feature map and outputs the local inscription feature. By performing branching and cross-interaction between global form features and local inscription features, an enhanced feature map is obtained; Enhanced global features and enhanced local features are obtained based on the enhanced feature map. The weights are adaptively learned through dynamic gating operation to complete the feature fusion of enhanced global features and enhanced local features, and the final discriminative features are obtained. The final discriminant features are input into the cosine classification head, the cosine distance with the prototype of each category is calculated, and the ancient coin category recognition result is output. When a new category of ancient coins is added, incremental learning of the category is completed based on the non-replay incremental update strategy.
[0007] Preferably, the backbone network is a residual network ResNet18, and the shared high-level feature map is the feature map output by the fourth convolutional layer of ResNet18.
[0008] Preferably, the local inscription branch applies an inscription attention mechanism to the shared high-level feature map and outputs local inscription features, including: The shared high-level feature map is input into the convolutional layer for channel compression to obtain the attention weight map; A normalization function is applied to the attention weight map to map the values of the attention weight map to a fixed interval; The normalized attention weight map is multiplied element-wise with the shared high-level feature map to obtain the local inscription features.
[0009] Preferably, the global form features and local inscription features are branched and cross-interacted to obtain an enhanced feature map, including: The global form features and local inscription features are spliced together at the channel dimension to generate channel spliced features; Perform convolution and activation operations on the channel splicing features to generate channel fusion weights; The global form features and local inscription features are weighted and fused according to the channel fusion weights to obtain an enhanced feature map.
[0010] Preferably, enhanced global features and enhanced local features are obtained based on the enhanced feature map. Weights are adaptively learned through dynamic gating operations to complete the feature fusion of the enhanced global features and enhanced local features, resulting in the final discriminative features, including: Global average pooling is performed on the enhanced feature map to obtain the enhanced global feature and enhanced local feature vectors, respectively. The enhanced global features and enhanced local features are concatenated to generate gated input features; Fully connected operations and activation operations are sequentially performed on the gated input features to generate adaptive fusion weights; The enhanced global features and enhanced local features are weighted and fused according to the adaptive fusion weights to obtain the final discriminative features.
[0011] Preferably, the final discriminative features are input into the cosine similarity classification head, the cosine distance with the prototype of each category is calculated, and the ancient coin category recognition result is output, including: Normalization is performed on the final discriminant features; Normalize the weights of the category headers; Calculate the cosine similarity between the normalized final discriminative features and the normalized classifier head weights; The ancient coin category recognition result is output based on cosine similarity.
[0012] Preferably, the no-replay incremental update strategy includes: When a new ancient coin category is added, all parameters corresponding to the backbone network, global shape branch, local inscription branch, inscription attention operation, branch cross interaction operation, and dynamic gating operation are frozen, and the cosine classification head is updated using samples of the new category.
[0013] Preferably, updating the cosine classification head with new category samples includes: Input the new category samples into the frozen network structure to obtain the final discriminative features corresponding to the new category samples; The mean of all final discriminant features corresponding to the new category samples is calculated to obtain the category prototype corresponding to the new category. Add the category prototype corresponding to the new category to the cosine category header to complete the expansion and update of the cosine category header.
[0014] On the other hand, the present invention also proposes an ancient coin identification system, comprising: The image preprocessing unit is used to acquire images of ancient coins and perform preprocessing to obtain a standard input image. The feature extraction unit is used to input the standard input image into the pre-trained backbone network to obtain a shared high-level feature map; A dual-branch feature processing unit is used to input the shared high-level feature map into a global form branch and a local inscription branch respectively; the global form branch uses the shared high-level feature map as the global form feature; the local inscription branch applies an inscription attention mechanism to the shared high-level feature map and outputs local inscription features; The branching and cross-interaction unit is used to perform branching and cross-interaction between global shape features and local inscription features to obtain an enhanced feature map; The dynamic gating fusion unit is used to obtain enhanced global features and enhanced local features based on the enhanced feature map. Through dynamic gating operation, the weights are adaptively learned to complete the feature fusion of enhanced global features and enhanced local features to obtain the final discriminative features. The cosine classification and recognition unit is used to input the final discrimination features into the cosine classification head, calculate the cosine distance with the prototype of each category, and output the ancient coin category recognition result. The incremental update unit is used to complete class incremental learning based on the no-playback incremental update strategy when a new ancient coin category is added.
[0015] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a method and system for ancient coin identification. By constructing a feature extraction framework with global shape and local inscription as two branches, an attention mechanism is embedded in the local inscription branch to focus on the text area and suppress the interference of rust and wear. The adaptive complementarity of the two types of features is achieved by using branch cross interaction and dynamic gating fusion. A cosine classification head is used to eliminate the scale difference between features and weights. The backbone network parameters are completely frozen in the incremental learning stage, and the classification head is updated only with the feature mean of the new category samples as the prototype. Thus, continuous category expansion is achieved without accessing or replaying any old samples. This invention overcomes the practical bottleneck of not being able to preserve old samples due to limitations in data privacy protection and storage costs, and avoids the catastrophic forgetting problem in traditional incremental learning. By specifically modeling the global shape and fine-grained features of local inscriptions on ancient coins, it improves the ability to distinguish similar categories with minimal inter-class differences, distinguished only by the strokes of characters. At the same time, the lightweight attention mechanism and adaptive fusion strategy ensure the training stability and generalization performance of the model under the condition of only a small number of samples in each class, providing an efficient, safe, and sustainable general technical path for cultural heritage image recognition. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0017] Figure 1 A flowchart of the method provided by the present invention; Figure 2 Performance comparison charts for different sample sizes; Figure 3 Visualization plot of the t-SNE feature space of the method in this embodiment under 5×8-way 5-shot; Figure 4Visualize the t-SNE feature space of the FACT method under 5×8-way 5-shot; Figure 5 Visualize the t-SNE feature space of the TOPIC method under 5×8-way 5-shot; Figure 6 A comparison of the channel average activation heatmaps of the native ResNet-18 for a specific coin and the attention module used in this embodiment; Figure 7 The channel-average activation heatmaps of the native ResNet-18 for another currency are compared with those of the attention module used in this embodiment. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] This embodiment follows the standard problem definition in the field of few-shot incremental learning (FSCIL). The model needs to learn a series of tasks T0, T1, ..., T1 in sequence. t T0 is the basic task, containing a large number of labeled samples; T1 to T t As an incremental task, each task contains only a small number of labeled samples.
[0020] Specifically, the training set for the basic task T0 is: ,in , basic category set, . No. Incremental tasks The training set is ,in , For the first A set of categories for incremental tasks, and Each incremental category contains only One labeled sample, i.e. ,in The number of categories for each incremental task.
[0021] This embodiment employs a no-sample-replay, completely frozen backbone setting. That is, during the incremental phase, the model cannot access any old class samples, and the feature extractor parameters remain unchanged; only the classifier is updated. The experiment in this embodiment is set with 60 base classes and 40 incremental classes. The task division for the incremental session follows the mainstream N-way K-shot method in the FSCIL scenario. For example, in a 5-way 5-shot configuration, the incremental session will be divided into 8 incremental tasks, each containing N=5 classes, with K=5 training images per class. That is, each incremental task contains 5 new classes, with 5 samples per class.
[0022] On one hand, embodiments of the present invention disclose a method for identifying ancient coins, the overall process of which is as follows: Figure 1 As shown, it mainly consists of three parts: a dual-branch feature extractor, an inscription attention module, and a prototype classifier. The entire learning process is divided into two stages: a basic training stage and an incremental learning stage.
[0023] During the basic training phase, the model is trained using basic category data while simultaneously optimizing the dual-branch feature extractor and the prototype classifier. The dual-branch feature extractor extracts global shape features and local inscription features separately, which are then weighted by the inscription attention module and fused to obtain the final feature representation. The prototype classifier performs classification based on the fused features, using cross-entropy loss and prototype loss for joint optimization.
[0024] During the incremental learning phase, all parameters of the dual-branch feature extractor are frozen. Only the mean feature value of each new class is calculated using samples from the new class as the class prototype. The new class prototype is then added to the prototype classifier, thus completing the incremental update of the model. This update method is computationally highly efficient and does not require access to old samples at all, making it perfectly suited for privacy-preserving scenarios involving cultural relic data.
[0025] This embodiment specifically includes the following steps: S1. Obtain the image of the ancient coin and perform preprocessing to obtain the standard input image.
[0026] The process involves acquiring the obverse and reverse images of the ancient coin, stitching them together into a single image, scaling it to a preset size (e.g., 256×512 pixels), and normalizing it using the mean and standard deviation of the image dataset to obtain a standard input image. During the basic training phase, data augmentation techniques such as random horizontal flipping, random rotation, and random cropping can also be employed.
[0027] S2. Input the standard input image into the pre-trained backbone network to obtain a shared high-level feature map; The shared high-level feature map is input into the global form branch and the local inscription branch respectively; the global form branch uses the shared high-level feature map as the global form feature; the local inscription branch applies an inscription attention mechanism to the shared high-level feature map and outputs the local inscription feature.
[0028] The information for identifying ancient coins mainly comes from two aspects: first, the overall form, including the size, shape, and edges of the coin; second, the local inscriptions, i.e., the characters on the coin, which are crucial features for distinguishing different versions. The general FSCIL method uses a single-branch network to extract global features, often neglecting important inscription details. Therefore, addressing the core requirement of balancing global form discriminative power with fine-grained local inscription features in ancient coin identification tasks, and adapting to the anti-forgetting constraints of the FSCIL scenario, this embodiment designs an architecture of a global-to-local dual-branch feature extraction network with a single shared backbone. This avoids the parameter expansion and overfitting risks in small-sample scenarios caused by dual independent backbones, while simultaneously achieving decoupled modeling and complementary enhancement of global form information and local inscription information. The local dual-branch network consists of a global form branch and a local inscription branch.
[0029] The global shape branch directly uses the high-level feature map output from the fourth convolutional layer (layer 4) of the backbone network ResNet18 as the output, focusing on the global semantic information such as the overall outline, arrangement, and edge state of the ancient coin, providing basic global feature support for category discrimination.
[0030] The local inscription branch, which is one of the two branches parallel to the global shape branch, also takes the same feature map output by the fourth convolutional layer (layer 4) of ResNet18 as input. It first passes through the inscription attention mechanism to enhance the features of the text region and suppress noise. The inscription attention mechanism is based on a simplified CBAM structure to realize the cascaded attention calibration of the channel and space, achieving automatic focusing and noise suppression of the inscription region with extremely low parameter overhead.
[0031] The calculation process of the inscription attention mechanism is as follows: 1. First, the fused features output by the dual-branch feature extractor are... The input is fed into a 1×1 convolutional layer, which compresses the number of channels to 1, resulting in an attention weight map. .
[0032] 2. Then, for the attention weight map Apply the sigmoid function to normalize its value to the [0,1] interval: ; 3. Finally, the attention weight map Features of original fusion Perform element-wise multiplication to obtain the weighted features. : ; In this way, the model can automatically focus on the inscription area, making the inscription features dominant in the final feature representation.
[0033] The feature maps output by the two branches are subjected to global average pooling and flattening operations, resulting in a 512-dimensional global shape feature vector and a 512-dimensional local inscription feature vector. Finally, adaptive fusion of the two branch features is achieved through branch cross-interaction processing and dynamic gating fusion operations, outputting the final 512-dimensional image feature representation. To address the catastrophic forgetting problem in the FSCIL scenario, the network strictly adheres to a two-stage training constraint. In the base class training phase, all dual-branch modules are enabled, and all parameters of the backbone network, all feature enhancement modules, and the classification head are trained end-to-end, allowing the dual branches to complete feature alignment and semantic decoupling on sufficient base class data. In the incremental training phase, the parameters of the backbone network and all feature enhancement modules are completely frozen, and only the classification head is incrementally expanded and fine-tuned to avoid catastrophic forgetting of old class knowledge caused by updating the feature extractor in small sample scenarios.
[0034] S3. Perform branching and cross-interaction between global shape features and local inscription features to obtain an enhanced feature map.
[0035] Employing a lightweight channel-level feature interaction design, this module learns only the channel importance weights of two feature paths, preserving the prior local features learned by the ResNet backbone. With an overall parameter count below 100k, it maintains training stability even in small-sample scenarios. The module concatenates the global shape feature map and the local inscription feature map along the channel dimension, then uses a 1×1 convolution and sigmoid activation to obtain channel-level fusion weights. Finally, it adaptively fuses the two features according to these weights, outputting an enhanced feature map that simultaneously considers global semantics and fine-grained local details. The calculation logic is as follows:
[0036] in This is a global shape feature diagram. This is a partial image of the inscription features. For the learned channel fusion weights, This is the output enhanced feature map.
[0037] S4. Based on the enhanced feature map, obtain enhanced global features and enhanced local features. Through dynamic gating operation, adaptively learn the weights to complete the feature fusion of enhanced global features and enhanced local features, and obtain the final discriminative features.
[0038] Global average pooling is performed on the enhanced feature maps to obtain the enhanced global features. With enhanced local feature vectors .
[0039] Will enhance global features With enhanced local features After concatenation, enhanced local features are learned through two fully connected layers and sigmoid activation. Adaptive weights Finally, the two features are fused according to their weights. The calculation logic is as follows: in This is the final discriminative feature vector.
[0040] S5. Input the final discrimination features into the cosine classification head, calculate the cosine distance with the prototype of each category, and output the ancient coin category recognition result.
[0041] In the FSCIL scenario, the base class has sufficient training samples, while the incremental class has only a small number of samples, which can easily lead to an imbalance in the weight scale of the old and new classes in the classification head, thus causing classification bias. To address this, this embodiment uses a classification head based on cosine similarity to eliminate the scale difference between features and weights, and measures the matching degree between features and categories only through angular similarity, fundamentally alleviating the scale imbalance problem between the old and new classes.
[0042] The calculation process of the cosine similarity classifier is as follows: L2 normalization is applied to the input image features and classifier weights to eliminate scale differences; the linear product of the normalized features and normalized weights is calculated to obtain the cosine similarity; a learnable temperature coefficient is introduced to scale the similarity, and the final output is the classification. The calculation logic is as follows: T ; in The normalized image features, The normalized class head weights, This is the temperature coefficient, set to 20.0 by default.
[0043] When a new category of ancient coins is added, incremental learning of the category is completed based on the non-replay incremental update strategy.
[0044] For incremental learning scenarios in FSCIL, this embodiment adopts a strategy of freezing the feature extractor and only incrementally updating the classification head, completely avoiding catastrophic forgetting caused by updating the feature extractor with small samples. The specific process is as follows: Base class training phase: Based on 60 base class data, a dual-branch feature extraction network and a cosine classification head are trained end-to-end. Cross-entropy CE loss is used to optimize all parameters and learn the general feature representation and classification boundary of the base classes. Incremental task phase: For each N-way K-shot incremental task, firstly, based on the original classification head, the output neurons corresponding to the newly added categories are expanded, and the weights of the new categories are initialized using the Kaiming normal distribution; then, all parameters of the dual-branch feature extraction network are completely frozen, and only 5-shot samples of the new categories in the current incremental task are used to fine-tune the newly added weights of the classification head to complete the incremental update.
[0045] This strategy is highly computationally efficient, with updates for a single incremental task taking only a few seconds. At the same time, it retains the feature knowledge learned by the base class to the greatest extent, fundamentally alleviating the catastrophic forgetting problem in the FSCIL scenario.
[0046] This embodiment also demonstrates the effectiveness and robustness of the method through comprehensive comparative and ablation experiments.
[0047] 1. Introduction to the dataset
[0048] This embodiment constructs a dataset containing 100 categories of coins from the Qing Dynasty to the Republic of China period, covering the main varieties from Guangxu Yuanbao to Republic of China silver coins. The dataset contains a total of 5227 images, with 25-75 images per category. All images were taken and labeled by professionals, and all images in the dataset are sourced from auction companies. During image acquisition, the obverse and reverse images of the coins were uniformly stitched together into a single image, with resolutions ranging from approximately 512×1024 pixels to approximately 1024×2048 pixels.
[0049] To simulate a real-world incremental learning scenario, the dataset was divided into 60 base classes and 40 incremental classes. The base classes contained 3659 images, used to train the feature extractor and base classifier; the 40 incremental classes were divided into 8 incremental tasks, each containing 5 classes and 5 samples per class, used to evaluate the model's incremental learning performance.
[0050] For data preprocessing, all images were scaled to 256×512 pixels and normalized using the mean and standard deviation of the ImageNet dataset. During the basic training phase, random viewpoint changes and random rotations were employed. Data augmentation techniques such as random cropping can be used to improve the model's generalization ability.
[0051] 2. Experimental Setup
[0052] To ensure a fair comparison, this embodiment employs an experimental setup similar to that of mainstream FSCIL methods such as FACT and TOPIC. All methods use ResNet18 as the backbone network, are trained for 100 epochs in the basic training phase, with a batch size of 64, an SGD optimizer, and the official pre-trained weights. The initial learning rate is 0.005, which is multiplied by 0.1 at the 70th and 85th epochs, respectively.
[0053] This embodiment selects the following five mainstream methods as comparison baselines: 1. iCaRL: A classic replay-based incremental learning method 2. FACT: The State-of-the-Art (SOTA) Method for FSCIL without Replay 3. TOPIC: Topology-preserving, playback-free FSCIL method 4. CEC: The FSCIL method for continuous evolution classifiers without replay 5. SAVC: A no-replay FSCIL method for semantically aware virtual contrast constraints 6. CLOM: A no-replay FSCIL method based on marginal constraints to mitigate class-level overfitting. 7. FINTEUNE: A method for comparing performance limits with only minor tweaking. The evaluation metrics adopted are standard metrics in the FSCIL domain: Average Incremental Accuracy (AIA), Average Forgetting (AF), Harmonic Mean (HM), and Overall Accuracy (OA). AIA is the model's average accuracy across all classes after all incremental tasks are completed; AF is the rate of accuracy decline on the old classes, with a smaller value indicating less forgetting; HM is the base accuracy (BA) and novel accuracy (NA) calculated as follows: 2 (BA NA) / (BA+NA) is obtained; OA is the final accuracy of the model on all known classes after the base class training and all incremental tasks are completed.
[0054] 3. Benchmark Comparison Experiment
[0055] Table 1 shows the performance comparison between the method of this embodiment and all baseline methods under a 5×8-way 5-shot setting. As can be seen from Table 1, the method of this embodiment achieves an average incremental accuracy of 80.13%, which is 8.2 percentage points higher than the second-place FACT method and 9.8 percentage points higher than TOPIC, demonstrating a significant advantage. Simultaneously, the average forgetting rate of the method of this embodiment is 4.15%, significantly lower than other methods, indicating that the method of this embodiment can better retain old knowledge while learning new categories.
[0056] Table 1 Performance metrics of various methods under 5×8-way 5-shot
[0057] All non-replay methods significantly outperform the replay-based method iCaRL. This is because, under a few-sample setting, iCaRL can only save a small number of old samples during the incremental phase, failing to effectively retain old knowledge. In contrast, the method in this embodiment significantly improves the discriminative power of features through a dual-branch structure and inscription attention mechanism. Furthermore, the cosine classification head assigns the same weight to both the old and new classes, thus achieving better performance during the incremental phase.
[0058] 4. Ablation test
[0059] To verify the effectiveness of each step proposed in this embodiment, detailed ablation experiments were conducted, and the results are shown in Table 2. The experiments used the original ResNet-18 (with CEC as an incremental module) as a baseline, and the modules proposed in this paper were added step by step.
[0060] Table 2 Ablation Experiment Results
[0061] The results of the ablation experiment show that: (1) Adding the inscription attention module separately improved the AIA by 3.62 percentage points, indicating that the attention mechanism can effectively suppress noise and improve the discriminative power of features.
[0062] (2) Using the dual-branch structure alone improved the AIA by 5.02 percentage points, proving the effectiveness of the dual-branch structure in fine-grained feature modeling.
[0063] (3) The combination of the dual-branch structure and the inscription attention module achieved the best AIA effect (80.13%), indicating that the two modules have a synergistic effect.
[0064] (4) Adding a cosine classification head further reduced the forgetting rate, but did not significantly improve AIA.
[0065] 5. Different k-shot experiments
[0066] To verify the performance of the method of the present invention under different sample sizes, this embodiment compares the experimental results under 1-shot, 5-shot, and 10-shot settings, as follows: Figure 2 As shown in the figure, the performance of all methods improves with the increase of the number of shots, but the method in this embodiment consistently maintains its lead. It is particularly noteworthy that the advantage of this embodiment is most pronounced under the 1-shot setting, with an AIA of 68.72%, which is 12.3 percentage points higher than FACT. This indicates that the method in this embodiment can more effectively utilize limited sample information and is very suitable for scenarios where samples are scarce, such as ancient coins.
[0067] 6. Feature Visualization Analysis
[0068] To visually demonstrate the feature learning effect of the method in this embodiment, the t-SNE algorithm was used to visualize the feature space. Forty classes were randomly selected from the dataset proposed in this embodiment for plotting, and the feature distributions of the method in this embodiment were compared with those of the FACT and TOPIC methods. Figure 3 , 4 As shown in Figure 5, the feature distribution of the FACT method is rather chaotic, with significant overlap between features of different categories. In contrast, the feature distribution of the method in this embodiment is clearer, with similar features more compact and dissimilar features more separated. This demonstrates that the dual-branch structure and inscription attention mechanism can effectively improve the discriminative power of features, enabling the model to better distinguish similar ancient coin categories.
[0069] 7. Visual analysis of channel average heatmaps for the attention module
[0070] To visually verify the effectiveness of the dual-branch network and inscription attention module in this embodiment, a channel average activation heatmap is used to visualize the model's feature attention regions. This method calculates the mean of all channels in the target feature layer to obtain the activation level of the model for different regions of the input image; the brighter the color, the greater the contribution of that region to the model's classification result.
[0071] For the selection of feature layers, the output layer of the inscription attention module proposed in this embodiment and the output layer of the last convolutional layer Layer 4 of ResNet18 are compared. The images are preprocessed in the same way and uniformly scaled to 256×512 pixels. The preprocessed images are input into the trained model, and the feature map of the target layer is obtained through forward propagation. The mean of the feature map in the channel dimension is calculated to obtain the single-channel activation map. After normalizing the activation map to the [0,1] interval, bilinear interpolation is used to upsample it to the same size as the original image. The normalized activation map is superimposed on the original image with a transparency of 0.5, and the Jet color mapping is used for rendering. The final visualization result is output. In this embodiment, 5 images are randomly selected from each category for visualization. The results all show similar attention distribution patterns, which proves the stability and reliability of the method in this embodiment.
[0072] Figure 6 and Figure 7The heatmaps comparing the average channel activation of the native ResNet-18 and the attention module used in this implementation are presented separately. To ensure fairness, both models used identical training configurations, data partitioning, and hyperparameter settings; the only difference was the backbone network structure. Visualization results show that the inscription attention module designed in this embodiment guides the model to focus its attention on the Region of Interest (ROI) that contributes most to the classification decision. The spatial distribution of feature activation is highly consistent with the core discriminative features of ancient coins. In contrast, the native ResNet-18 lacks a targeted fine-grained feature guidance mechanism; its attention exhibits a globally diffuse distribution, with a large amount of activation concentrated in areas unrelated to category distinction, such as shape and background. Experimental results demonstrate that this more discriminative attention distribution allows the method in this embodiment to more effectively extract fine-grained features, thereby achieving better classification performance and a lower forgetting rate during the incremental learning phase.
[0073] On the other hand, the present invention also proposes an ancient coin identification system, comprising: The image preprocessing unit is used to acquire images of ancient coins and perform preprocessing to obtain a standard input image. The feature extraction unit is used to input the standard input image into the pre-trained backbone network to obtain a shared high-level feature map; A dual-branch feature processing unit is used to input the shared high-level feature map into a global form branch and a local inscription branch respectively; the global form branch uses the shared high-level feature map as the global form feature; the local inscription branch applies an inscription attention mechanism to the shared high-level feature map and outputs local inscription features; The branching and cross-interaction unit is used to perform branching and cross-interaction between global shape features and local inscription features to obtain an enhanced feature map; The dynamic gating fusion unit is used to obtain enhanced global features and enhanced local features based on the enhanced feature map. Through dynamic gating operation, the weights are adaptively learned to complete the feature fusion of enhanced global features and enhanced local features to obtain the final discriminative features. The cosine classification and recognition unit is used to input the final discrimination features into the cosine classification head, calculate the cosine distance with the prototype of each category, and output the ancient coin category recognition result. The incremental update unit is used to complete class incremental learning based on the no-playback incremental update strategy when a new ancient coin category is added.
[0074] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0075] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for identifying ancient coins, characterized in that, Includes the following steps: The ancient coin image is acquired and preprocessed to obtain the standard input image; The standard input image is input into the pre-trained backbone network to obtain a shared high-level feature map; The shared high-level feature map is input into the global form branch and the local inscription branch respectively; the global form branch uses the shared high-level feature map as the global form feature; the local inscription branch applies an inscription attention mechanism to the shared high-level feature map and outputs the local inscription feature. By performing branching and cross-interaction between global form features and local inscription features, an enhanced feature map is obtained; Enhanced global features and enhanced local features are obtained based on the enhanced feature map. The weights are adaptively learned through dynamic gating operation to complete the feature fusion of enhanced global features and enhanced local features, and the final discriminative features are obtained. The final discriminant features are input into the cosine classification head, the cosine distance with the prototype of each category is calculated, and the ancient coin category recognition result is output. When a new category of ancient coins is added, incremental learning of the category is completed based on the non-replay incremental update strategy.
2. The method for identifying ancient coins according to claim 1, characterized in that, The backbone network is a residual network ResNet18, and the shared high-level feature map is the feature map output by the fourth convolutional layer of ResNet18.
3. The method for identifying ancient coins according to claim 1, characterized in that, The local inscription branch applies an inscription attention mechanism to the shared high-level feature map, outputting local inscription features, including: The shared high-level feature map is input into the convolutional layer for channel compression to obtain the attention weight map; A normalization function is applied to the attention weight map to map the values of the attention weight map to a fixed interval; The normalized attention weight map is multiplied element-wise with the shared high-level feature map to obtain the local inscription features.
4. The method for identifying ancient coins according to claim 1, characterized in that, By branching and intersecting global form features and local inscription features, an enhanced feature map is obtained, including: The global form features and local inscription features are spliced together at the channel dimension to generate channel spliced features; Perform convolution and activation operations on the channel splicing features to generate channel fusion weights; The global form features and local inscription features are weighted and fused according to the channel fusion weights to obtain an enhanced feature map.
5. The method for identifying ancient coins according to claim 1, characterized in that, Enhanced global and enhanced local features are obtained based on the enhanced feature map. Weights are adaptively learned through dynamic gating operations to complete the feature fusion of the enhanced global and enhanced local features, resulting in the final discriminative features, including: Global average pooling is performed on the enhanced feature map to obtain the enhanced global feature and enhanced local feature vectors, respectively. The enhanced global features and enhanced local features are concatenated to generate gated input features; Fully connected operations and activation operations are sequentially performed on the gated input features to generate adaptive fusion weights; The enhanced global features and enhanced local features are weighted and fused according to the adaptive fusion weights to obtain the final discriminative features.
6. The method for identifying ancient coins according to claim 1, characterized in that, The final discriminant features are input into the cosine similarity classification head, which calculates the cosine distance to the prototype of each category, and outputs the ancient coin category recognition results, including: Normalization is performed on the final discriminant features; Normalize the weights of the category headers; Calculate the cosine similarity between the normalized final discriminative features and the normalized classifier head weights; The ancient coin category recognition result is output based on cosine similarity.
7. The method for identifying ancient coins according to claim 1, characterized in that, The no-replay incremental update strategy includes: When a new ancient coin category is added, all parameters corresponding to the backbone network, global shape branch, local inscription branch, inscription attention operation, branch cross interaction operation, and dynamic gating operation are frozen, and the cosine classification head is updated using samples of the new category.
8. The method for identifying ancient coins according to claim 7, characterized in that, The cosine classifier head is updated using samples from the new class, including: Input the new category sample into the frozen network structure to obtain the final discriminative features corresponding to the new category sample; The mean of all final discriminant features corresponding to the new category samples is calculated to obtain the category prototype corresponding to the new category. Add the category prototype corresponding to the new category to the cosine category header to complete the expansion and update of the cosine category header.
9. An ancient coin identification system, characterized in that, include: The image preprocessing unit is used to acquire images of ancient coins and perform preprocessing to obtain a standard input image. The feature extraction unit is used to input the standard input image into the pre-trained backbone network to obtain a shared high-level feature map; A dual-branch feature processing unit is used to input the shared high-level feature map into the global form branch and the local inscription branch respectively; the global form branch uses the shared high-level feature map as the global form feature; The local inscription branch applies an inscription attention mechanism to the shared high-level feature map and outputs local inscription features; The branching and cross-interaction unit is used to perform branching and cross-interaction between global shape features and local inscription features to obtain an enhanced feature map; The dynamic gating fusion unit is used to obtain enhanced global features and enhanced local features based on the enhanced feature map. Through dynamic gating operation, the weights are adaptively learned to complete the feature fusion of enhanced global features and enhanced local features to obtain the final discriminative features. The cosine classification and recognition unit is used to input the final discrimination features into the cosine classification head, calculate the cosine distance with the prototype of each category, and output the ancient coin category recognition result. The incremental update unit is used to complete class incremental learning based on the no-playback incremental update strategy when a new ancient coin category is added.