Method for identifying types of atomic stamp-pad ink based on hyperspectral imaging technology and back propagation neural network
The establishment of an atomic oil printing sample library through hyperspectral imaging technology and BP neural networks has solved the time-consuming and lossy oil printing identification problem in the existing technology, and achieved rapid and accurate recognition of atomic oil printing types, which is suitable for the identification of multiple types of problems.
Patent Information
- Application Number
- CN202510567901.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-15
AI Technical Summary
In the prior art, the oil-printing identification method has the problem of long-term, high cost and damage to the sample, making it difficult to achieve fast, accurate and lossless identification of atomic oil-printing types.
Hyperspectral imaging technology is used to establish an atomic oil printing sample library, and a three-layer neural network model is established using backpropagation neural network (BP algorithm), and atomic oil printing type identification is performed through hyperspectral data to achieve fast, accurate and lossless recognition.
It realizes fast, accurate and lossless identification of atomic printing oil types, improves identification efficiency and accuracy, and is suitable for identification of multiple types of problems.
Smart Images

Figure CN120496090A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a method for identifying types of atomic ink based on hyperspectral imaging technology and back propagation neural network. Background Art
[0002] Seal impressions, as key evidence for verifying the authenticity and validity of documents, play a crucial role in forensic science. When examining documentary evidence, examiners often need to meticulously compare suspected seal impressions with sample ones to determine whether they originate from the same seal, providing evidence for clarifying the facts of the case.
[0003] Existing methods for identifying stamp ink rely primarily on chromatography and spectroscopy. Chromatography offers high accuracy but is expensive, time-consuming, and incapable of providing real-time results. Spectroscopy, on the other hand, uses chemical techniques that can damage sample integrity. Therefore, there is an urgent need for a rapid, highly accurate, and non-destructive atomic stamp ink identification method. Summary of the Invention
[0004] The present invention aims to provide an atomic ink identification method which is time-saving, highly accurate and non-destructive to samples.
[0005] The idea of the present invention is to use hyperspectral imaging technology, establish hyperspectral data of atomic ink sample library, select appropriate neural network algorithm to build model, and realize the identification of atomic ink types.
[0006] Based on the above objectives, the present invention provides a method for identifying the type of atomic ink based on hyperspectral imaging technology and back propagation neural network, the method comprising the following steps:
[0007] (1) Establish a sample database
[0008] Collect n different atomic ink samples, customize n new atomic stamps with identical inscriptions, and add a different atomic ink sample to each new atomic stamp. Use each stamp to stamp on test paper three times, collecting 3n stamp samples as a sample library. After thorough drying, use a hyperspectral imaging system to collect hyperspectral data for each stamp sample; where n is a natural number.
[0009] (2) Extracting samples
[0010] Using image visualization environment software, the regions of interest (ROIs) of the hyperspectral data of each seal sample were manually extracted. For each seal sample, m ROIs were selected, resulting in a total of 3n × m spectral data. 2n × m spectral data were set as the training set, and n × m spectral data were set as the test set. There was no overlap between the training set and the test set.
[0011] (3) Establishing an algorithm model
[0012] A three-layer neural network based on the BP algorithm was established, consisting of an input layer, a hidden layer, and an output layer. The input layer receives external signals and data, using the spectral data of the atomic ink sample as the node of the input layer. The output layer uses the BP network neural model to convert qualitative data into quantitative outputs and comprehensively evaluate the output results. The hidden layer constructs the network according to the neuron number algorithm to establish the model.
[0013] (4) Training and validating algorithm models
[0014] Set various parameters based on the neural network tool, and train and verify the neural network. Use the confusion matrix during the training and verification process to show the accuracy of the classification results.
[0015] (5) Detection of the sample to be tested
[0016] The hyperspectral data of the seal to be tested is collected by a hyperspectral imaging system, and the obtained hyperspectral data is used as the data of the input layer. The model in step (3) is used to match the seal samples in the sample library and output the results.
[0017] In this disclosure, "different atomic ink samples" specifically refer to products from different brands of atomic ink. The 10 samples selected are all from brands that are frequently used and widely representative in the current market. It should be noted that these samples only represent a subset of the sample cases described in this disclosure and should not be considered to encompass all possible sample cases.
[0018] As a preferred embodiment, n=10, m=50. That is, a total of 1500 pieces of spectral data are obtained, of which 1000 pieces of spectral data are set as a training set and 500 pieces of spectral data are set as a test set.
[0019] Preferably, in step (2), the size of each region of interest is 20x20 pixels.
[0020] In the present invention, in step (3), let X be the input layer data set, which is contained in x1, ..., xd, H be the hidden layer data set, which is contained in h1, h2, ..., hL, and Y be the output layer data set, which is contained in y1, ..., yk; the relationship between the data sets satisfies the formula:
[0021] H=ωX+b
[0022] Y = βH, where ω is the weight vector from the input layer to the hidden node, b is the bias of the hidden node, and β is the weight vector from the hidden node to the output layer;
[0023] Use the training set to adjust the network weights: In the backpropagation phase, the difference between the predicted output and the true output is calculated and backpropagated from the output layer to the hidden layer, adjusting the weights and bias values of each layer to minimize the loss function;
[0024] Use mean squared error (MSE) as the loss function:
[0025]
[0026] Among them, Y is the real output, is the predicted output.
[0027] According to a preferred embodiment, in step (4), the confusion matrix is a 2×2 matrix, including TP true positives, FN false negatives, FP false positives, and TN true negatives, wherein:
[0028] The accuracy TP is the ratio of the number of samples that are correctly classified by the classification model to the total number of samples:
[0029]
[0030] The precision rate PC is the ratio of the number of correctly classified positive samples to the actual positive class:
[0031]
[0032] The recall rate is the proportion of samples that are predicted to be positive among the samples that are actually positive:
[0033]
[0034] Specificity SP measures the accuracy of the model in identifying negative samples, that is, the proportion of samples predicted by the model to be negative that are actually negative:
[0035]
[0036] The model is evaluated by the harmonic mean TF of precision and recall:
[0037]
[0038] In the present invention, in order to improve the accuracy of the training set and the test set, the number of hidden layers is set to 2, and the number of hidden neurons in each layer is 20.
[0039] This paper utilizes hyperspectral imaging technology to establish a sample library of different atomic inks. By comparing different neural network algorithms, the present invention selects the BP algorithm, compared to traditional LSTM and RF algorithms, for precise identification of different types of atomic inks. This method can rapidly, accurately, and non-destructively identify the type of atomic ink on a sample. The detection method of this invention has broad research potential and wide application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 Schematic diagram of the neural network structure of the present invention;
[0041] Figure 2 Schematic diagram of the basic form of the confusion matrix of the present invention;
[0042] Figure 3 Schematic diagram of the accuracy of two data sets with different numbers of neurons in the present invention;
[0043] Figure 4 Schematic diagram of original spectrum data of the present invention;
[0044] Figure 5 Schematic diagram of sample and spectrum selection. (a) Schematic diagram of ROI selection for printed text, (b) is an example of ROI in (a). DETAILED DESCRIPTION
[0045] The following examples are used to illustrate the technical solutions of the present invention in a non-limiting manner.
[0046] Example 1: Model building
[0047] Customize 10 rubber stamps, each with the words "Experimental Sample Stamp" engraved on it, with a diameter of 38mm. Obtain 10 kinds of atomic inks, each corresponding to a blank circular stamp. Pour the atomic inks into the corresponding blank circular ink pad box, and use the corresponding stamp to print on the same test paper (Morning Brand A4 model 75g / cm 2 The samples were stamped on 30 sheets of copy paper, with three stamp samples for each stamp, resulting in a total of 30 seal samples. After the samples dried for a week, hyperspectral data of the seal samples were collected using a conventional hyperspectral imaging system.
[0048] Using image visualization environment software, 50 regions of interest (ROIs) were manually selected for each seal sample, each ROI was 20x20 pixels, and a total of 1500 spectral data were selected, of which 1000 spectral data were set as training sets and 500 spectral data were set as test sets, and there was no overlap between the training set and the test set.
[0049] A three-layer neural network based on the BP algorithm is established, including an input layer, a hidden layer, and an output layer. There are two hidden layers, and the number of hidden neurons in each layer is 20:
[0050] Let X be the input layer dataset, which is contained in x1,…,xd, H be the hidden layer dataset, which is contained in h1,h2,…,hL, and Y be the output layer dataset, which is contained in y1,…,yk. The relationship between the datasets satisfies the formula:
[0051] H=ωX+b
[0052] Y=βH
[0053] Among them, ω is the weight vector from the input layer to the hidden node, b is the bias of the hidden node, and β is the weight vector from the hidden node to the output layer;
[0054] Use the training set to adjust the network weights: In the backpropagation phase, the difference between the predicted output and the true output is calculated and backpropagated from the output layer to the hidden layer, adjusting the weights and bias values of each layer to minimize the loss function;
[0055] Use mean squared error (MSE) as the loss function:
[0056]
[0057] Among them, Y is the real output, is the predicted output.
[0058] Then, based on the neural network tool, various parameters are set, and the neural network is trained and verified. During the training and verification process, the confusion matrix is used to demonstrate the accuracy of the classification results.
[0059] The confusion matrix is a 2×2 matrix, including TP true positives, FN false negatives, FP false positives, and TN true negatives, where:
[0060] The accuracy TP is the ratio of the number of samples that are correctly classified by the classification model to the total number of samples:
[0061]
[0062] The precision rate PC is the ratio of the number of correctly classified positive samples to the actual positive class:
[0063]
[0064] The recall rate is the proportion of samples that are predicted to be positive among the samples that are actually positive:
[0065]
[0066] Specificity SP measures the accuracy of the model in identifying negative samples, that is, the proportion of samples predicted by the model to be negative that are actually negative:
[0067]
[0068] The model is evaluated by the harmonic mean TF of precision and recall:
[0069]
[0070] After the model is established, 10 samples from the training set and test set are used as input respectively. The model evaluation indicators include accuracy, F1, PC, SN, SP and calculation time. The calculation time refers to the time spent from the start to the end of the program calculation. The modeling accuracy and calculation time of different algorithms are compared.
[0071] For comparison, a conventional RF algorithm and LSTM algorithm were used instead of the BP algorithm of the present invention to build a model. The RF algorithm had 20 decision trees and a minimum leaf node count of 6. The LSTM algorithm used the Rule activation function, a bidirectional LSTM layer with 128 hidden units, and the BP neural network algorithm used the Tanh activation function. The algorithm had two hidden layers, each with 20 neurons. The results are shown in Table 1-2:
[0072] Table 1 Evaluation results using training set samples as input
[0073]
[0074]
[0075] Table 2 Evaluation results using test set samples as input
[0076]
[0077]
[0078] Table 3 Accuracy
[0079]
[0080] The test results show that by replacing the BP neural network algorithm with a random forest (RF) or long short-term memory (LSTM) algorithm, qualitative models for different types of atomic inks were established. The table shows that the BP model achieved accuracies of 97.238% and 93.555% on the training and test sets, respectively. The RF model's accuracy was 5.441% lower and 10.870% lower than the LSTM and BP models, respectively. The BP model's test accuracy was 7.775% higher and 21.322% higher than the LSTM and RF models, respectively.
[0081] Identifying the type of atomic seal is of great significance for technicians to judge the authenticity of documents or contracts. Therefore, in the process of quickly distinguishing the authenticity of documents, the performance evaluation of the algorithm is particularly critical. Computation time, as an important indicator to measure performance, covers the entire process of model training and prediction. In the present invention, all experiments were carried out on the same computer to ensure the comparability of the results. It can be clearly seen from the data analysis that the BP algorithm performs excellently in PC, SN, SP and F1 evaluation indicators, significantly improving the accuracy of the training model and test results. This result strongly demonstrates the excellent performance of the BP algorithm in predicting the type of atomic seal ink using hyperspectral imaging data. Especially when dealing with multi-class problems, the BP algorithm, with its powerful adaptive ability, effectively solves the problems faced by traditional LSTM and RF algorithms, such as local minimization, overfitting and improper learning rate selection. In contrast, when dealing with data outside the training set, the RF model's predictive ability is relatively limited and is easily interfered by noisy data.
[0082] In summary, the BP algorithm not only surpasses the RF and LSTM algorithms in classification capabilities but also excels in modeling efficiency, making it undoubtedly the most suitable tool for atomic ink type identification among the three algorithms. The results show that the BP algorithm is the best choice for classifying hyperspectral imaging data of different types of atomic ink.
Claims
1. A method for identifying atomic ink types based on hyperspectral imaging technology and back propagation neural network, the method comprising the following steps: (1) Establish a sample database Collect n different atomic ink samples, customize n new atomic stamps with identical inscriptions, and add a different atomic ink sample to each new atomic stamp. Use each stamp to stamp on test paper three times, collecting 3n stamp samples as a sample library. After thorough drying, use a hyperspectral imaging system to collect hyperspectral data for each stamp sample; where n is a natural number. (2) Extracting samples Using image visualization environment software, the regions of interest (ROIs) of the hyperspectral data of each seal sample were manually extracted. For each seal sample, m ROIs were selected, resulting in a total of 3n × m spectral data. 2n × m spectral data were set as the training set, and n × m spectral data were set as the test set. There was no overlap between the training set and the test set. (3) Establishing an algorithm model A three-layer neural network based on the BP algorithm was established, consisting of an input layer, a hidden layer, and an output layer. The input layer receives external signals and data, using the spectral data of the atomic ink sample as the node of the input layer. The output layer uses the BP network neural model to convert qualitative data into quantitative outputs and comprehensively evaluate the output results. The hidden layer constructs the network according to the neuron number algorithm to establish the model. (4) Training and validating algorithm models Set various parameters based on the neural network tool, and train and verify the neural network. Use the confusion matrix during the training and verification process to show the accuracy of the classification results. (5) Detection of the sample to be tested The hyperspectral data of the seal to be tested is collected by a hyperspectral imaging system, and the obtained hyperspectral data is used as the data of the input layer. The model in step (3) is used to match the seal samples in the sample library and output the results.
2. The method for identifying the type of atomic ink according to claim 1, wherein n=10, m=50.
3. The method for identifying the type of atomic ink according to claim 1, wherein In step (2), the size of each ROI is 20x20 pixels.
4. The method for identifying the type of atomic ink according to claim 1, wherein In step (3), let X be the input layer dataset, which is contained in x1, ..., xd, H be the hidden layer dataset, which is contained in h1, h2, ..., hL, and Y be the output layer dataset, which is contained in y1, ..., yk; the relationship between the datasets satisfies the formula: H=ωX+b Y=βH Among them, ω is the weight vector from the input layer to the hidden node, b is the bias of the hidden node, and β is the weight vector from the hidden node to the output layer; Use the training set to adjust the network weights: In the backpropagation phase, the difference between the predicted output and the true output is calculated and backpropagated from the output layer to the hidden layer, adjusting the weights and bias values of each layer to minimize the loss function; Use mean squared error (MSE) as the loss function: Among them, Y is the real output, is the predicted output.
5. The method for identifying the type of atomic ink according to claim 1, wherein In step (4), the confusion matrix is a 2×2 matrix, including TP true positive, FN false negative, FP false positive, TN true negative, where: The accuracy TP is the ratio of the number of samples that are correctly classified by the classification model to the total number of samples: The precision rate PC is the ratio of the number of correctly classified positive samples to the actual positive class: The recall rate is the proportion of samples that are predicted to be positive among the samples that are actually positive: Specificity SP measures the accuracy of the model in identifying negative samples, that is, the proportion of samples predicted by the model to be negative that are actually negative: The model is evaluated by the harmonic mean TF of precision and recall:
6. The method for identifying the type of atomic ink according to claim 1, wherein There are 2 hidden layers, and the number of hidden neurons in each layer is 20.
Citation Information
Patent Citations
Offset printing ink color matching method based on least square support vector machine
CN102799895A
Cited By
Seal verification method and device, electronic equipment, storage medium and program product
CN120823413A