SealVerifier: Seal Verification System Based on Dual-stream Model
-
摘要: 印章在文书认证、合同签署等场景中具有重要的法律效力,是确保文件真实性和合法性的重要标志。然而,随着数字技术的快速发展,印章伪造手段日益精进,对现有的印章核验技术提出了新的挑战,尤其是在图像质量不佳或存在模糊的情况下,核验难度显著增加。为应对此问题,该文提出一种基于双流模型的印章自动核验系统SealVerifier。该系统结合了EfficientNet与高效视觉Transformer(SViT),SViT在Transformer编码器中引入高维多层感知器和去归一化机制,以增强特征表示能力和泛化能力。此外,该文引入数据分布适配器以应对实际场景中多样化的印章,并采用双重损失函数提升模型的精度和泛化能力。在包含30 699对图像的自建中文印章数据集上,SealVerifier的精确率、召回率和F1值分别达到了91.34%, 96.83%和93.57%,显著优于现有的印章核验技术。
-
关键词:
- 印章自动核验 /
- 双流模型 /
- Transformer /
- 数据分布适配器
Abstract:Objective Seals serve a critical legal function in scenarios such as document authentication and contract execution, acting as essential markers of document authenticity and legitimacy. However, the increasing sophistication of seal forgery techniques, driven by advances in digital technology, presents new challenges to existing verification methods. In particular, low-quality or blurred seal images substantially reduce the accuracy and reliability of traditional approaches, limiting their practical utility. To address these limitations, this study proposes SealVerifier, an automatic seal verification system based on a dual-stream model. The method is designed to improve recognition accuracy, generalization ability, and robustness to noise. SealVerifier contributes to the intelligent development of seal verification and offers technical support for secure digital document authentication, thereby facilitating the broader deployment of reliable seal verification technologies. Methods SealVerifier comprises an image enhancement module and a dual-stream verification model, designed to improve the accuracy and robustness of seal authentication. The framework follows a two-stage pipeline: image preprocessing and authenticity verification. In the preprocessing stage, the DeARegNet module is introduced to correct degradation caused by uneven stamping pressure, scanner variability, paper background complexity, and interference from document content. DeARegNet integrates a Denoising Adversarial Network (DAN) and a GeomPix alignment module to enhance seal image clarity and consistency. DAN employs an adversarial training, consisting of a denoiser and a discriminator. The denoiser uses a multi-level residual dense connection module to extract fine-grained features and eliminate noise, thereby improving image resolution. The discriminator enforces denoising reliability by distinguishing between clean and denoised images using an adversarial loss. The GeomPix alignment module exploits geometric characteristics of circular and elliptical seals. It relies on a central pentagram positioning marker and the radial fan-shaped pixel density distribution to achieve high-precision alignment, significantly improving the accuracy and stability of image correction. In the verification stage, a dual-stream architecture combining EfficientNet and Streamlining Vision Transformer (SViT) is employed to extract local detail features and global structural information. EfficientNet performs efficient multi-scale feature extraction via compound scaling, capturing textures, edge contours, and subtle defects. SViT models global dependencies through self-attention mechanisms and enhances feature learning with high-dimensional multilayer perceptrons and denormalization techniques, thereby improving verification accuracy. To improve generalization and reduce inter-domain discrepancies among seal datasets, a Data Distribution Adapter (DDA) and Gradient Reversal Layer (GRL) are incorporated. These components use adversarial training to support the seal authenticity classifier—comprising EfficientNet and SViT—in learning domain-invariant features. This approach enhances robustness and adaptability in diverse application scenarios. Results and Discussions Experimental results demonstrate that the integration of the dual-stream architecture—EfficientNet for local detail extraction and SViT for global structural representation—enables SealVerifier to significantly improve verification accuracy. On a custom Chinese seal dataset comprising 30,699 image pairs, SealVerifier achieved precision, recall, and F1 scores of 91.34%, 96.83%, and 93.57%, respectively, outperforming existing methods ( Table 3 ). The incorporation of a DDA and a dual loss function further reduced distributional discrepancies across seal datasets using adversarial training, enhancing both recognition accuracy and generalization performance (Table 4 ). Under noise interference, SealVerifier maintained high verification accuracy, confirming its robustness and applicability in real-world scenarios (Table 2 ).Conclusions This study proposes SealVerifier, a dual-stream model for fully automated seal authenticity verification. A Chinese seal dataset with complex backgrounds is constructed, and nine-fold cross-validation confirms the method’s effectiveness. SealVerifier integrates DeARegNet for image enhancement and combines EfficientNet and SViT to capture both fine-grained details and global semantic features. To address the limitations of conventional Vision Transformer (ViT) models, high-dimensional multilayer perceptrons and denormalization techniques are introduced, improving the model’s capacity to learn complex features and enhancing generalization and robustness. A DDA and dual loss function are also incorporated to mitigate dataset variability, enabling stable classification performance across heterogeneous seal images. Experimental results show that SealVerifier achieves precision, recall, and F1 scores of 91.34%, 96.83%, and 93.57%, respectively, demonstrating its performance advantage in seal verification tasks. Future work explores high-precision alignment strategies for multi-view seal images to further reduce error and improve image correction accuracy under challenging imaging conditions. -
1 计算矫正角度
输入:图像I 输出:旋转角度θ (1)根据图像I获取自适应的二值化阈值T (2)根据阈值T得到二值化图像 (3)根据图像外接圆得到图像中心点O (4)根据连通区域面积得到中心图案 (5)中心图案边缘检测算法得到两个对齐控制点A和B (6)计算A,B两点与中心点O的角度,θ1和θ2 (7)θ=θ1–θ2 (8)return θ 表 1 中文印章真实性数据集
印章数据 图像数量 正样本对 负样本对 印章1 63 967 986 印章2 94 2 162 2 209 印章3 95 2 209 2 256 印章4 96 2 256 2 304 印章5 80 1 561 1 599 印章6 80 1 564 1 596 印章7 95 2 209 2 256 印章8 71 1 225 1 260 印章9 65 1 026 1 054 表 2 基于SealVerifier的图像增强对比实验结果(%)
图像增强 精确率 召回率 F1值 – 51.34 99.53 67.25 HSV 77.44 98.51 86.12 DeARegNet 91.34 96.83 93.57 表 3 基于不同分类模型的印章真伪核验性能
模型 精确率(%) 召回率(%) F1值(%) FLOPS (G) fps Swin Transformer[31] 74.86 72.09 73.45 4.71 2.07 ViT-Base-P16-400[30] 83.04 60.67 65.78 2.10 1.53 RepViT_m0_6[27] 63.54 89.07 71.22 1.29 7.57 Res2Net50[29] 82.31 75.05 76.41 13.90 10.25 RMT_T3[28] 70.33 95.20 79.85 7.67 13.04 EfficientNetB0[24] 76.26 95.74 83.62 0.09 7.88 SealVerifier 91.34 96.83 93.57 0.48 9.44 表 4 模型结构消融实验结果
ViT SViT DDA 精确率(%) 召回率(%) F1值(%) FLOPS (G) fps × × × 76.26 95.74 83.62 0.09 7.88 √ × × 84.63 95.89 90.70 0.23 9.29 × √ × 87.23 96.25 91.51 0.47 11.10 √ × √ 90.89 96.41 92.67 0.24 9.76 × √ √ 91.34 96.83 93.57 0.48 9.44 -
[1] ENGIN D, KANTARCI A, ARSLAN S, et al. Offline signature verification on real-world documents[C]. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, Seattle, USA, 2020: 808–809. doi: 10.1109/CVPRW50498.2020.00412. [2] SU Yuchen, UENG Y, and CHUNG W H. SVM-based seal imprint verification using edge difference[C]. 2019 IEEE International Conference on Acoustics, Speech and Signal Processing, Brighton, UK, 2019: 1567–1571. doi: 10.1109/ICASSP.2019.8682810. [3] TAN Weijun, GUO Hongwei, and YAO Qi. Seal imprint verification using SVM classifier and unmatched key point features[C]. 2021 IEEE 6th International Conference on Signal and Image Processing, Nanjing, China, 2021: 148–153. doi: 10.1109/ICSIP52628.2021.9688941. [4] YOU Yang, LOU Yujing, SHI Ruoxi, et al. PRIN/SPRIN: On extracting point-wise rotation invariant features[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022, 44(12): 9489–9502. doi: 10.1109/TPAMI.2021.3130590. [5] LI Meng and MA Li. Learning asymmetric and local features in multi-dimensional data through wavelets with recursive partitioning[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022, 44(11): 7674–7687. doi: 10.1109/TPAMI.2021.3110403. [6] CHEN Zewei, GU An, ZHANG Xin, et al. Authentication and inference of seal stamps on Chinese traditional painting by using multivariate classification and near-infrared spectroscopy[J]. Chemometrics and Intelligent Laboratory Systems, 2017, 171: 226–233. doi: 10.1016/j.chemolab.2017.10.017. [7] LI Yuqiang, WANG Xinjie, YU Huijing, et al. Pattern-coupled baseline correction method for near-infrared spectroscopy multivariate modeling[J]. IEEE Transactions on Instrumentation and Measurement, 2023, 72: 1003609. doi: 10.1109/TIM.2023.3265101. [8] 余彪, 万水龙, 刘进, 等. 基于Krawtchouk-RBF的印章图像分类识别[J]. 微型机与应用, 2014, 33(6): 44–47. doi: 10.19358/j.issn.1674-7720.2014.06.015.YU Biao, WAN Shuilong, LIU Jin, et al. Classification and recognition of seal image based on Krawtchouk-RBF[J]. Microcomputer & its Applications, 2014, 33(6): 44–47. doi: 10.19358/j.issn.1674-7720.2014.06.015. [9] HUŠEK P. On monotonic radial basis function networks[J]. IEEE Transactions on Cybernetics, 2024, 54(2): 717–727. doi: 10.1109/TCYB.2022.3185827. [10] PRIYA R K S, MURUGESWARI K, BIJU J, et al. Machine learning algorithms for detecting fake reviews–A study[C]. 2023 IEEE International Conference on ICT in Business Industry & Government, Indore, India, 2023: 1–5. doi: 10.1109/ICTBIG59752.2023.10456019. [11] LEE J, KONG S G, LEE Y S, et al. Forged seal detection based on the seal overlay metric[J]. Forensic Science International, 2012, 214(1/3): 200–206. doi: 10.1016/j.forsciint.2011.08.009. [12] CHUNG W H, WU Muen, UENG Y L, et al. Forged seal imprint identification based on regression analysis on imprint borders and metrics comparisons[C]. 2018 IEEE Conference on Dependable and Secure Computing, Kaohsiung, China, 2018: 1–5. doi: 10.1109/DESEC.2018.8625152. [13] LI Yunxiang, SHAO H C, LIANG Xiao, et al. Zero-shot medical image translation via frequency-guided diffusion models[J]. IEEE Transactions on Medical Imaging, 2024, 43(3): 980–993. doi: 10.1109/TMI.2023.3325703. [14] SU Yuchen, UENG Y L, and CHUNG W H. Automatic seal imprint verification systems using edge difference[J]. IEEE Access, 2019, 7: 145302–145312. doi: 10.1109/ACCESS.2019.2945045. [15] 丁世飞, 孙玉婷, 梁志贞, 等. 弱监督场景下的支持向量机算法综述[J]. 计算机学报, 2024, 47(5): 987–1009. doi: 10.11897/SP.J.1016.2024.00987.DING Shifei, SUN Yuting, LIANG Zhizhen, et al. Survey on Support Vector Machine algorithms in weakly supervised scenarios[J]. Chinese Journal of Computers, 2024, 47(5): 987–1009. doi: 10.11897/SP.J.1016.2024.00987. [16] YAN Leiming, CHEN Kai, TONG Shikun, et al. Identifying forged seal imprints using positive and unlabeled learning[J]. Multimedia Tools and Applications, 2021, 80(20): 30761–30773. doi: 10.1007/s11042-020-10171-6. [17] ZHANG Shichao and LI Jiaye. KNN classification with one-step computation[J]. IEEE Transactions on Knowledge and Data Engineering, 2023, 35(3): 2711–2723. doi: 10.1109/TKDE.2021.3119140. [18] YUE Guanghui, ZHANG Shaoping, ZHOU Tianwei, et al. Pyramid network with quality-aware contrastive loss for retinal image quality assessment[J]. IEEE Transactions on Medical Imaging, 2025, 44(3): 1416–1431. doi: 10.1109/TMI.2024.3501405. [19] WANG Zhenyu, LIAN Jie, SONG Chunfeng, et al. CSRS: A Chinese seal recognition system with multi-task learning and automatic background generation[J]. IEEE Access, 2019, 7: 96628–96638. doi: 10.1109/ACCESS.2019.2927396. [20] 林超群, 王大寒, 肖顺鑫, 等. 基于孪生网络与多重通道融合的脱机笔迹鉴别[J]. 自动化学报, 2024, 50(8): 1660–1670. doi: 10.16383/j.aas.c230777.LIN Chaoqun, WANG Dahan, XIAO Shunxin, et al. Offline handwriting verification based on Siamese network and multi-channel fusion[J]. Acta Automatica Sinica, 2024, 50(8): 1660–1670. doi: 10.16383/j.aas.c230777. [21] SIRAJUDEEN M and ANITHA R. Forgery document detection in information management system using cognitive techniques[J]. Journal of Intelligent & Fuzzy Systems, 2020, 39(6): 8057–8068. doi: 10.3233/JIFS-189128. [22] LI Chi’an, CHEN T Y, CHOU H S, et al. An improved image feature detection algorithm based on oriented FAST and rotated BRIEF for nighttime images[C]. 2022 IEEE International Conference on Consumer Electronics, Taipei, China, 2022: 289–290. doi: 10.1109/ICCE-Taiwan55306.2022.9869224. [23] 蔡旖旎, 陈正鸣, 倪佳佳. 一种可供识别和溯源的印章图像核验系统[J]. 计算机与现代化, 2022(5): 102–107. doi: 10.3969/j.issn.1006-2475.2022.05.016.CAI Yini, CHEN Zhengming, and NI Jiajia. A seal image verification system for identification and traceability[J]. Computer and Modernization, 2022(5): 102–107. doi: 10.3969/j.issn.1006-2475.2022.05.016. [24] TAN Mingxing and LE Q V. EfficientNet: Rethinking model scaling for convolutional neural networks[C]. The 36th International Conference on Machine Learning, Long Beach, USA, 2019: 6105–6114. [25] 赵凤, 耿苗苗, 刘汉强, 等. 卷积神经网络与视觉Transformer联合驱动的跨层多尺度融合网络高光谱图像分类方法[J]. 电子与信息学报, 2024, 46(5): 2237–2248. doi: 10.11999/JEIT231209.ZHAO Feng, GENG Miaomiao, LIU Hanqiang, et al. Convolutional neural network and vision transformer-driven cross-layer multi-scale fusion network for hyperspectral image classification[J]. Journal of Electronics & Information Technology, 2024, 46(5): 2237–2248. doi: 10.11999/JEIT231209. [26] YUE Guanghui, ZHANG Lixin, DU Jingfeng, et al. Subjective and objective quality assessment of colonoscopy videos[J]. IEEE Transactions on Medical Imaging, 2025, 44(2): 841–854. doi: 10.1109/TMI.2024.3461737. [27] WANG Ao, CHEN Hui, LIN Zijia, et al. Rep ViT: Revisiting mobile CNN from ViT perspective[C]. 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, USA, 2024: 15909–15920. doi: 10.1109/CVPR52733.2024.01506. [28] FAN Qihang, HUANG Huaibo, CHEN Mingrui, et al. RMT: Retentive networks meet vision transformers[C]. 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, USA, 2024: 5641–5651. doi: 10.1109/CVPR52733.2024.00539. [29] GAO Shanghua, CHENG Mingming, ZHAO Kai, et al. Res2Net: A new multi-scale backbone architecture[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021, 43(2): 652–662. doi: 10.1109/TPAMI.2019.2938758. [30] HAN Kai, WANG Yunhe, CHEN Hanting, et al. A survey on vision transformer[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2023, 45(1): 87–110. doi: 10.1109/TPAMI.2022.3152247. [31] LIU Ze, LIN Yutong, CAO Yue, et al. Swin transformer: Hierarchical vision transformer using shifted windows[C]. 2021 IEEE/CVF International Conference on Computer Vision, Montreal, Canada, 2021: 10012–10022. doi: 10.1109/ICCV48922.2021.00986. -