A method for training a banknote magnetic spectrum viT analysis recognition model
By collecting magnetic feature signals of banknotes, calculating key parameters for drawing magnetic spectrum diagrams, performing Fourier transforms, and constructing a dataset to train a model, the problem of misjudgment in adaptive drawing of magnetic spectrum diagrams was solved, and the accuracy and sensitivity of banknote counterfeit detection were improved.
Patent Information
- Application Number
- CN202411960417.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-12-30
AI Technical Summary
In existing technologies, the misjudgment caused by changes in the y-axis and intensity axis in adaptive magnetic spectrum plotting affects the accuracy of banknote authentication.
By collecting magnetic feature signals from banknotes, calculating key parameters for magnetic spectrum transformation and plotting, performing Fourier transform, constructing a magnetic spectrum classification dataset, and training a magnetic spectrum ViT analysis and recognition model, the ADAM optimizer and linear learning rate are used to ensure the consistency of magnetic spectrum and avoid misjudgment.
The sensitivity of the banknote authentication model has been improved, enabling it to accurately identify minute changes in magnetic signature signals, reduce false positives, and improve authentication accuracy.
Smart Images

Figure CN119903374B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of banknote authentication, and in particular to a method for training a banknote magnetic spectrum ViT analysis and recognition model. Background Technology
[0002] With the continuous development of magnetic sensor technology, magnetic image sensors have been successfully developed and are beginning to be applied in the field of banknote authentication. Magnetic image sensors, in conjunction with a uniform-speed paper feed device, can detect the complex magnetic distribution on banknotes and convert it into a magnetic image, thus enabling quantitative authentication of banknotes based on their magnetic characteristics. Therefore, quantitative analysis and authentication of the magnetic distribution on banknotes using magnetic images has significant research value and great application potential in the field of counterfeit detection. Summary of the Invention
[0003] To address the aforementioned technical problems, the present invention aims to provide a method for training a magnetic spectrum ViT analysis and recognition model for banknotes. This method solves the misjudgment problem caused by changes in the y-axis and intensity axis in adaptive magnetic spectrum plotting.
[0004] The objective of this invention is achieved through the following technical solution:
[0005] A method for training a magnetic spectrum ViT analysis and recognition model for banknotes, comprising:
[0006] A collects the magnetic signature signals of banknotes and classifies them according to their location;
[0007] B calculates key parameters for magnetic spectrum transformation and magnetic spectrum plotting, including the upper limit of intensity, lower limit of intensity, upper limit of frequency, and velocity-frequency ratio of the magnetic sensing signal;
[0008] C performs a Fourier transform on the magnetic characteristic signal and plots the magnetic spectrum according to the upper limit of intensity, the lower limit of intensity, and the upper limit of frequency.
[0009] D constructs a magnetic spectrum classification dataset and trains a magnetic spectrum ViT analysis and recognition model.
[0010] Compared with the prior art, one or more embodiments of the present invention may have the following advantages:
[0011] This method combines the plotting of magnetic spectra according to the upper limit of intensity, the lower limit of intensity, and the upper limit of frequency, in order to ensure the magnetic spectrum can be used in subsequent applications. Figure 1 It improves consistency and solves the misjudgment problem caused by changes in the y-axis and intensity axis in adaptive magnetic spectrum plotting; it also reduces model overfitting, thereby improving model sensitivity and enabling the detection of minute changes in magnetic feature signals and magnetic spectrum. Attached Figure Description
[0012] Figure 1This is a flowchart of the ViT analysis and recognition model training method for banknote magnetic spectrum.
[0013] Figure 2 It is a magnetic spectrum generated by the magnetic signal curve of the safety line and the short-time Fourier transform;
[0014] Figure 3 It is a magnetic spectrum generated by the magnetic signal curve of the two-color irregular horizontal serial number and the short-time Fourier transform;
[0015] Figure 4 It is a magnetic spectrum generated by the magnetic signal curve of the main background pattern and the short-time Fourier transform;
[0016] Figure 5 This is a graph showing the actual learning rate over 100 rounds;
[0017] Figure 6 It contains data from the training process of the convnext model;
[0018] Figure 7 This refers to the training process of the Vision Transformers model. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be described in further detail below with reference to the embodiments and accompanying drawings.
[0020] like Figure 1 The image shows the training method for the ViT analysis and recognition model of banknote magnetic spectra, including...
[0021] A collects the magnetic signature signals of banknotes and classifies them according to their location;
[0022] Along the short side of the banknote, the key features include the security thread, the two-color irregular horizontal serial number, and the main background pattern.
[0023] B calculates key parameters for magnetic spectrum transformation and magnetic spectrum plotting, including the upper limit of intensity, lower limit of intensity, upper limit of frequency, and velocity-frequency ratio of the magnetic sensing signal;
[0024] Let the relative scanning speed between the magnetic sensor and the banknote be v. signal The magnetic sensor sampling frequency is f signal The banknote is L long. cash The velocity sampling ratio r of the magnetic sensing signal signal Signal length l signal The calculation method is as follows:
[0025] r signal =f signal / v signal
[0026] l signal =Lcash ×v signal / f signal
[0027] Suppose that among all the magnetic sensing signals collected, the maximum intensity value is p. max The maximum frequency value is f max .
[0028] The upper limit of the intensity p of the magnetic sensing signal upper upper limit of frequency value f upper .
[0029] p upper =σ p ×p max
[0030] f upper =σ f ×f max
[0031] In the formula, σ p σ is the upper limit coefficient of the magnetic sensing signal intensity, with a value ranging from 1.0 to 2.0; f It is the upper limit coefficient of the frequency value of the magnetic sensing signal, with a value range of 1.0 to 1.5;
[0032] The lower limit of the magnetic sensing signal intensity is 0.
[0033] C performs a Fourier transform on the magnetic characteristic signal and plots the magnetic spectrum according to the upper limit of intensity, the lower limit of intensity, and the upper limit of frequency.
[0034] Performing a short-time Fourier transform on the magnetic feature signal requires considering that the scanning process for acquiring magnetic feature signals at key locations on the banknote is related to the sensor sampling frequency, scanning speed, and banknote length. Therefore, the short-time Fourier transform typically requires parameters including signal length and frequency, which can be replaced by the magnetic sensing signal's speed sampling ratio r. signal Signal length l signal .
[0035] Plotting a magnetic spectrum according to the upper and lower limits of intensity and the upper limit of frequency means setting the starting point of the horizontal axis of the magnetic spectrum to 0 and the ending point to the signal length l. signal ;
[0036] The vertical axis of the magnetic spectrum starts at 0, and the horizontal axis ends at the upper limit of the frequency value f. upper ;
[0037] The starting point of the intensity color axis of the magnetic spectrum is: the lower limit p of the magnetic sensing signal intensity. down The endpoint of the intensity color axis is the upper limit p of the magnetic sensing signal intensity. upper ;
[0038] Magnetic spectra plotted using this method exhibit the same characteristics for the same signal. This ensures that the magnetic spectrum will hold true in subsequent use. Figure 1 Consistency is achieved, resolving misjudgment issues caused by changes in the horizontal, vertical, and intensity / color axes during adaptive plotting of magnetic spectra.
[0039] The magnetic signal curves and short-time Fourier transform-generated magnetic spectra of the security thread, two-color irregular horizontal serial number, and main background pattern are shown below. Figure 2 , Figure 3 , Figure 4 .
[0040] D constructs a magnetic spectrum classification dataset and trains a magnetic spectrum ViT analysis and recognition model.
[0041] Construct a magnetic spectrum classification dataset, labeling magnetic spectra according to security lines, bicolor irregular horizontal numbers, main background patterns, suspicious, and no signal. Figure 4 .
[0042] The annotation method for magnetic spectrum classification datasets follows the same approach as image classification datasets, primarily by placing magnetic spectrum images in folders named after their respective categories, such as "Security Line," "Two-Color Irregular Horizontal Number," "Main Background Pattern," "Suspicious," and "No Signal."
[0043] The magnetic spectrum ViT analysis and identification model was trained using the ADAM (Adaptive Moment Estimation) optimizer. The optimizer's first moment estimate (momentum term) coefficient β1 = 0.9; the second moment estimate (squared gradient) coefficient β2 = 0.999; and the bias correction ε = 1 × 10⁻⁶. -8 .
[0044] The optimizer's learning rate l r =2×10 -5 Linear LR with a linear learning rate was used. The initial scaling factor was 1 and the final scaling factor was 0.1; the scaling factor was 80% of the total number of rounds.
[0045] The unique aspect is that the number of learning rounds is maximized, choosing 50, 100, or 150 rounds to induce overfitting in the model. This improves the model's sensitivity, enabling it to detect even minute changes in magnetic characteristic signals and magnetic spectra.
[0046] Taking 100 rounds as an example, the actual change in learning rate can be seen in the following figure. Figure 5 .
[0047]
Training Example 1
[0048] The dataset was constructed as described above, and a small convnext model was trained for 50 epochs. The final loss was 0.2452, and the accuracy was 1.0. This demonstrates relatively accurate discrimination (as shown in Table 1). Figure 6 (As shown).
[0049] Table 1. Training process data of the convnext model
[0050]
[0051]
[0052]
[0053]
Example 2
[0054] The dataset was constructed as described above, and the Vision Transformers model with Patch 16 was trained for 50 epochs. The final loss was 0.3024, and the accuracy was 1.0. This demonstrates relatively accurate differentiation (as shown in Table 2). Figure 7 (As shown).
[0055] Table 2. Training process data for the Vision Transformers model.
[0056]
[0057]
[0058]
[0059] Based on the two examples, it can be seen that this invention can effectively distinguish between known forgery and alteration methods. Because it employs deep learning, newly emerging methods can also be labeled and then trained and upgraded to address them. However, the ability of different models to identify new methods still needs to be continuously discovered and improved in practice.
[0060] While the embodiments disclosed in this invention are as described above, the content is merely for the purpose of facilitating understanding of the invention and is not intended to limit the invention. Any person skilled in the art to which this invention pertains may make any modifications and variations in form and detail of the implementation without departing from the spirit and scope disclosed herein; however, the scope of patent protection for this invention shall still be determined by the scope defined in the appended claims.
Claims
1. A method for training a magnetic spectrum ViT analysis and recognition model for banknotes, characterized in that, The method includes: A collects the magnetic signature signals of banknotes and classifies them according to their location; B calculates key parameters for magnetic spectrum transformation and magnetic spectrum plotting, including the upper limit of intensity, lower limit of intensity, upper limit of frequency, and velocity-frequency ratio of the magnetic sensing signal; C performs a Fourier transform on the magnetic characteristic signal and plots the magnetic spectrum according to the upper limit of intensity, the lower limit of intensity, and the upper limit of frequency. D. Construct a magnetic spectrum classification dataset and train a magnetic spectrum ViT analysis and recognition model. Let the relative scanning speed between the magnetic sensor and the banknote be v. signal The magnetic sensor sampling frequency is f signal The banknote is L long. cash The velocity sampling ratio r of the magnetic sensing signal signal Signal length l signal The calculation method is as follows: The velocity sampling ratio r signal With signal length l signal Used for signal preprocessing before magnetic spectrum transformation; In B, let the maximum intensity value among all the acquired magnetic sensing signals be p. max The maximum frequency value is f max Then the upper limit of the intensity p of the magnetic sensing signal upper upper limit of frequency value f upper The calculation formula is: In the formula, σ p σ is the upper limit coefficient of the magnetic sensing signal intensity, with a value ranging from 1.0 to 2.0; f It is the upper limit coefficient of the frequency value of the magnetic sensing signal, with a value range of 1.0 to 1.5; The lower limit p of the magnetic sensing signal intensity down =0; A short-time Fourier transform (SFT) is performed on the magnetic characteristic signal. The parameters included in the SFT are the signal length and the signal frequency. The signal length and signal frequency are then replaced with the signal length l of the magnetic sensing signal, respectively. signal Speed sampling ratio r signal .
2. The method for training a magnetic spectrum ViT analysis and recognition model for banknotes according to claim 1, characterized in that, The magnetic feature signal of the banknote in section A is collected along the short side of the banknote at key locations; these key locations include the security thread, the two-color irregular horizontal serial number, and the main background pattern.
3. The method for training a magnetic spectrum ViT analysis and recognition model for banknotes according to claim 1, characterized in that, In step C, the magnetic spectrum is plotted according to the upper limit of intensity, the lower limit of intensity, and the upper limit of frequency. Set the starting point of the horizontal axis of the magnetic spectrum to 0, and the ending point of the horizontal axis to the signal length l. signal ; The vertical axis of the magnetic spectrum starts at 0, and the horizontal axis ends at the upper limit of the frequency value f. upper ; The starting point of the intensity color axis of the magnetic spectrum is the lower limit p of the magnetic sensing signal intensity. down The endpoint of the intensity color axis is the upper limit p of the magnetic sensing signal intensity. upper ; The magnetic spectrum plotted shows the same characteristics for the same signal.
4. The method for training a magnetic spectrum ViT analysis and recognition model for banknotes according to claim 1, characterized in that, The D includes: Construct a magnetic spectrum classification dataset and label magnetic spectrum images according to security lines, two-color irregular horizontal numbers, main background patterns, suspicious, and no signal. The annotation method for the magnetic spectrum classification dataset follows the same procedure as for image classification datasets, placing the magnetic spectrum images in folders named after their respective categories; these include "security lines", "two-color irregular horizontal numbers", "main background patterns", "suspicious", and "no signal". The magnetic spectrum ViT analysis and identification model was trained using the ADAM optimizer. The optimizer's first-order moment estimate (momentum term coefficient) β1 = 0.9; the second-order moment estimate (squared gradient coefficient) β2 = 0.999; and the bias correction ε = 1 × 10⁻⁶. -8 ; The optimizer's learning rate l r =2×10 -5 Linear LR with a linear learning rate was used; the initial scaling factor was 1 and the final scaling factor was 0.1; the scaling factor was 80% of the total number of rounds.
5. The method for training a magnetic spectrum ViT analysis and recognition model for banknotes according to claim 3, characterized in that, The model can be trained in 50, 100, or 150 rounds.
Citation Information
Patent Citations
Artificial intelligence-based method for detecting lane using spectrogram pattern, and apparatus for same
WO2023132436A1