A banknote quality detection method, system and medium based on multispectral image
Through the multi-spectral image detection method, the support vector regression model and regional voting strategy are used to solve the problem of banknote quality detection in complex backgrounds, and fast and accurate graffiti and dirty detection are achieved, improving the accuracy of banknote quality evaluation.
Patent Information
- Application Number
- CN202110528860.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-14
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-05-14
AI Technical Summary
The prior art is difficult to accurately detect the quality of banknotes in complex backgrounds, especially graffiti and dirty situations, and the surface textures of banknotes in different countries are different, resulting in increased detection difficulty.
Using a detection method based on multispectral images, the red, green and blue three-band images were collected, preprocessed and feature extraction were performed, and the support vector regression model was used to combine regional voting strategies to judge the quality of the banknotes, so as to achieve graffiti and dirty under complex backgrounds. Pollution detection.
It improves the accuracy and speed of banknote quality detection, can quickly identify the authenticity and abnormality of banknotes in complex backgrounds, and reduces the rate of misjudgment.
Smart Images

Figure CN113240643B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of banknote quality detection, and in particular to a banknote quality detection method, system and storage medium based on multispectral images. Background Art
[0002] At present, paper currency is the mainstream form of currency circulation. When paper currency circulates in the market, it is easy to be stained, or someone will write on the paper currency intentionally or unintentionally, resulting in graffiti and dirt on the surface of the paper currency. These graffiti and dirty paper currencies are not suitable for circulation in the market. In addition, different countries have their own paper currencies, and the surface textures of paper currencies in different countries are not the same. It is difficult to accurately detect the quality of paper currencies with complex backgrounds. In this situation, there is an urgent need for a banknote quality evaluation technology to achieve quality rating of banknotes. Summary of the invention
[0003] In order to overcome the deficiencies of the prior art, one of the objectives of the present invention is to provide a banknote quality detection method based on multispectral images, which can perform quality detection on banknotes and improve detection accuracy.
[0004] A second objective of the present invention is to provide a detection system for executing the above-mentioned banknote quality detection method based on multi-spectral images.
[0005] A third object of the present invention is to provide a storage medium for executing the above-mentioned banknote quality detection method based on multi-spectral images.
[0006] One of the purposes of the present invention is achieved by the following technical solution:
[0007] A banknote quality detection method based on multispectral images, comprising:
[0008] Step S1: collecting a multispectral image of the banknote to be tested, and preprocessing the image to obtain multiple sub-areas;
[0009] Step S2: extracting feature parameters of each sub-region, performing feature fusion on the feature parameters of the sub-region and importing them into the trained regression model to obtain confidence;
[0010] Step S3: Combining the confidence level and the regional voting strategy to determine the quality of the banknote to be tested.
[0011] Furthermore, the multispectral image is a three-band image of red, green and blue.
[0012] Furthermore, the pretreatment method is:
[0013] Divide the banknote multispectral image into N*N sub-regions on average, where N is a non-zero natural number;
[0014] Assign corresponding attention weights to each sub-region according to the image texture features.
[0015] Furthermore, the feature parameters include Hog features, Gabor filter local energy, texture statistical histogram features and image wavelet transform coefficient variance.
[0016] Furthermore, the feature fusion method is:
[0017] The characteristic parameters of the sub-regions are concatenated into a 26-dimensional initial feature vector;
[0018] The final regional feature vector is obtained by multiplying the initial feature vector by the attention weight corresponding to the region.
[0019] Furthermore, the training method of the regression model is:
[0020] The support vector regression model is trained using the final region feature vectors of a plurality of banknote images that do not contain abnormal features to obtain a trained regression model.
[0021] Furthermore, the regional voting strategy is:
[0022]
[0023] Among them, the sub-region with a confidence level greater than or equal to 2 is set as RS, N f is the number of RS; N c It is the number of block connected domains of RS in the texture image, and the area of each connected domain is larger than the area of a single sub-region.
[0024] Furthermore, the confidence is divided into three levels:
[0025]
[0026] Among them, the three levels from low to high represent genuine banknotes, suspected abnormal banknotes and abnormal banknotes.
[0027] The second object of the present invention is achieved by adopting the following technical solution:
[0028] A banknote quality detection system based on multispectral images, comprising:
[0029] An acquisition module, used for acquiring multispectral images of the banknote to be tested;
[0030] A preprocessing module for dividing the multispectral image into multiple sub-regions;
[0031] A feature extraction module is used to extract feature parameters of each sub-region and perform feature fusion on the feature parameters of the sub-region to obtain a final regional feature vector;
[0032] The model analysis module is used to import the final regional feature vector after feature fusion into the trained regression model to obtain confidence;
[0033] The post-processing module is used to judge the quality of the banknotes to be tested by combining the confidence level and the regional voting strategy.
[0034] The third object of the present invention is achieved by adopting the following technical solution:
[0035] A storage medium stores a program, wherein the program, when executed by a processor, implements the above-mentioned banknote quality detection method based on multispectral images.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] The present invention uses a regression model to pre-train the features of banknotes that do not contain abnormal features. When the banknotes to be tested need to be tested, the feature vectors of the banknotes to be tested are imported into the trained regression model, thereby completing graffiti and dirt detection under any complex background, thereby achieving the purpose of quickly detecting the quality of the banknotes. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic diagram of a banknote quality detection method based on multi-spectral images of the present invention;
[0039] Figure 2 It is a specific flow chart of the banknote quality detection method based on multi-spectral images of the present invention;
[0040] Figure 3 It is a structural block diagram of the banknote quality detection system based on multi-spectral images of the present invention. DETAILED DESCRIPTION
[0041] The present invention is further described below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that, under the premise of no conflict, the various embodiments or technical features described below can be arbitrarily combined to form a new embodiment.
[0042] Embodiment 1
[0043] This embodiment discloses a banknote quality detection method based on multispectral images, which can detect graffiti, dirt, etc. on the surface of banknotes under any complex background, thereby improving the accuracy of banknote quality evaluation.
[0044] like Figure 1 , Figure 2 As shown, the banknote quality detection method of this embodiment includes the following steps:
[0045] Step S1: collecting a multispectral image of the banknote to be tested, and preprocessing the image to obtain multiple sub-areas;
[0046] Step S2: extracting feature parameters of each sub-region, performing feature fusion on the feature parameters of the sub-region and importing them into the trained regression model to obtain confidence;
[0047] Step S3: Perform regional voting strategy processing in combination with the confidence level to determine the quality of the banknote to be tested.
[0048] In this embodiment, before quality inspection is performed on the banknotes to be inspected, a regression model needs to be pre-built. The training method of the regression model is:
[0049] Step a: Collect a multispectral image of a banknote image without abnormal features, wherein the banknote image without abnormal features specifically refers to an original banknote image without dirt, graffiti, etc., and obtain image information of different bands of the same target at the same time by camera photography or scanning. In this embodiment, the multispectral image specifically refers to image information of the three bands of red, green and blue. The method for obtaining the multispectral image is a prior art and will not be described in detail here.
[0050] Step b: Divide the multispectral image into N*N sub-regions on average. In the N*N sub-regions, assign different attention weights α according to the depth and density of the texture in the original banknote image. j , where j = 1, 2, ..., N * N. This embodiment can be used to emphasize or select important information of the target processing object by allocating different attention weights, suppress irrelevant detail information, reduce interference in subsequent feature extraction, and improve feature extraction accuracy.
[0051] Step c: extracting feature parameters from each sub-region, wherein the feature parameters include but are not limited to Hog features, Gabor filter local energy, texture statistical histogram features and image wavelet transform coefficient variance.
[0052] Among them, the Hog feature is a directional gradient distribution histogram, which is constructed by calculating and counting the gradient direction histogram of the local area of the image; in this method, 8 gradient directions are used, and the calculated gradient distribution histogram is normalized. After this normalization, better effects can be obtained for lighting changes and shadows, and finally an 8-dimensional Hog feature vector is obtained.
[0053] The Gabor filter bank is in four directions There are two wavelengths to choose from. The local energy here is represented by the global grayscale of the sub-region after Gabor filtering. Due to the complexity of the texture, the direction and wavelength can be set according to the specific texture, and finally an 8-dimensional feature vector is obtained.
[0054] Among them, the texture statistical histogram features can be represented by the following 6 metrics:
[0055] (1) The variance of the histogram is as follows:
[0056]
[0057] (2) The square sum of probabilities is shown in the following formula:
[0058]
[0059] (3) Average entropy, as shown below:
[0060]
[0061] (4) Relative smoothness, as shown in the following formula:
[0062]
[0063] (5) Skewness, as shown in the following formula:
[0064]
[0065] (6) Kurtosis, as shown below:
[0066]
[0067] Among them, μ is the mean grayscale value in the region, Z i Refers to the value corresponding to the i-th gray level, L means that the sub-region has L gray levels, p(Z i ) represents the frequency of the value at the i-th grayscale level, σ represents the standard deviation of the grayscale in the area, and the final generated texture statistical histogram feature is (s1, s2, s3, s4, s5, s6), which is a 6-dimensional feature vector.
[0068] The image wavelet transform coefficient variance in the feature parameter is a four-dimensional vector, which represents the variance of the coefficients calculated from the low-pass decomposition filter. The four coefficients are approximate, horizontal, vertical, and diagonal coefficients.
[0069] Step d: Concatenate the above feature parameters into a 26-dimensional initial feature vector V i , and then multiply the initial feature vector by the regional attention weight α i Get the final regional feature vector V f The final regional feature vector V f By adding different weights, the ability to detect graffiti and dirty banknotes in weak texture areas is improved, the probability of genuine banknotes in strong texture areas being mistaken for graffiti and dirty banknotes is reduced, and the accuracy of banknote quality detection is further improved.
[0070] Step e: Use the final region feature vector V f To train the support vector regression model M1, to complete the training steps of the regression model.
[0071] The specific method for training the support vector regression model is as follows:
[0072] (1) Set the training sample set:
[0073] The final regional feature vector V f Set the training sample set T = {(x1,y1),(x2,y2),...,(x k ,y k ),...,(x N ,y N )},x k ∈R n , R n is the input space, n represents the dimension of the input space. The value y in the output space k ∈R, R is the output space. (x k ,y k ) represents the kth sample point, N represents the number of sample points in the training set, and the insensitive loss factor ε and the penalty factor C are set.
[0074] (2) Calculate the kernel function matrix K and initialize it:
[0075] Calculate the kernel function matrix K, k pq =K(x p ,x q )=<φ(x p ),φ(x q )>, where k pq represents the kernel function product of the p-th sample point and the q-th sample point, φ(x) is the kernel function; initialize the Lagrange multiplier constant λ=(λ1,λ2,...,λ k ,...,λ N )=0, the decision function bias b is equal to 0. Among them, λ k Represents the kth sample x in the decision function k The corresponding Lagrange multiplier, b represents the bias of the decision function.
[0076] (3) Use the SMO algorithm to optimize the objective function until all samples in the training set meet the KKT condition. The objective function to be optimized is as follows:
[0077]
[0078]
[0079] Among them, λ irepresents the Lagrange multiplier corresponding to the i-th sample point, k ij represents the kernel function product of the i-th sample point and the j-th sample point. ε is the insensitive loss factor.
[0080] (4) Calculate the final regression decision function:
[0081] After the training is completed, the final Lagrangian vector λ is calculated to be (λ1,λ2,...,λ k ,...,λ N ), the final decision bias is b, and the calculated regression decision function is: Among them, λ i represents the i-th Lagrangian multiplier in the final Lagrangian vector, x i is the i-th sample in the training sample set, x is a new sample, K(x i ,x) is the kernel function product of the i-th sample in the training sample set and the new sample x, y x Represents the output of the regression decision function corresponding to the new sample x.
[0082] After the regression model is trained, the multispectral image of the banknote to be tested can be collected, and the banknote image to be tested can be processed by partitioning according to the method of steps a to d above to obtain the final regional feature vector V of each sub-region of the banknote to be tested. f , the final regional feature vector V f As a test sample set, it is input into the trained regression model for operation, and the output value of the regression model M1 is used as the confidence Conf that the sub-region contains abnormal features; in this embodiment, Conf is divided into three grades, as shown in the following formula:
[0083]
[0084] The three levels from low to high represent genuine banknotes, suspected abnormal banknotes, and abnormal banknotes.
[0085] In this embodiment, considering that the abnormal features of banknotes often appear in clusters, the regional voting strategy processing needs to be performed in the last two classifications, and finally the quality of the banknotes is judged based on the regional voting strategy processing results; when performing the regional voting strategy processing in this embodiment, the relative position of each region and their respective confidence levels need to be considered at the same time. The regional voting strategy is shown in the following formula:
[0086]
[0087] Among them, the sub-region with a confidence level greater than or equal to 2 is set as RS, N f is the number of RS. i Represents N fThe confidence level of the ith sub-region in N. According to whether RS is connected in space, the concept of block connected domain is introduced. c is the number of block connected domains of RS in the texture image, and the minimum value is 1. The area of each connected domain must be larger than the area of a single sub-region. i When N c The larger the value, the more discrete the distribution of abnormal banknotes. In this case, the score of regional voting will be lower. c Unchanged, Grade i When it is smaller, it means that the degree of abnormality of the banknote is relatively low, and the score of the regional vote will also be lower.
[0088] When Y<3, there is no anomaly in the banknote;
[0089] When 3<=Y<=5, the banknote is slightly abnormal;
[0090] When 6<=Y<=9, the banknote is seriously abnormal;
[0091] When Y>10, the banknote is seriously abnormal.
[0092] This embodiment uses a regression model to pre-train the features of banknotes that do not contain abnormal features. When the banknotes need to be tested, the feature vectors of the banknotes are imported into the trained regression model, so that graffiti and dirt detection under any complex background can be completed, thereby achieving the purpose of quickly detecting the quality of banknotes.
[0093] Embodiment 2
[0094] This embodiment provides a banknote quality detection system based on multispectral images, which executes the banknote quality detection method based on multispectral images described in the first embodiment. Figure 3 As shown, the detection system of this embodiment specifically includes the following modules:
[0095] An acquisition module is used to acquire a multispectral image of the banknote to be tested, wherein the multispectral image is image information of three bands: red, green and blue;
[0096] The preprocessing module is used to divide the multispectral image into multiple sub-regions. The division rule is to divide the multispectral image into N*N sub-regions on average. In the N*N sub-regions, different attention weights α are assigned according to the depth and density of the texture in the original banknote image. j ;
[0097] The feature extraction module is used to extract the feature parameters of each sub-region and perform feature fusion on the feature parameters of the sub-region to obtain the initial feature vector V i , and then multiply the initial feature vector by the regional attention weight α i Get the final regional feature vector Vf ; Among them, the feature parameters include but are not limited to Hog features, Gabor filter local energy, texture statistical histogram features and image wavelet transform coefficient variance;
[0098] Model analysis module, used to convert the final regional feature vector V f Import the trained regression model to obtain confidence;
[0099] The post-processing module is used to judge the quality of the banknotes to be tested by combining the confidence level and the regional voting strategy.
[0100] Embodiment 3
[0101] This embodiment provides a banknote quality detection device, comprising:
[0102] program;
[0103] A memory, used for storing the program;
[0104] A processor is used to load the program to execute the banknote quality detection method based on multispectral images described in the first embodiment.
[0105] In addition, this embodiment also provides a storage medium storing a program, characterized in that when the program is executed by a processor, the banknote quality detection method based on multispectral images as described above is implemented.
[0106] The device and storage medium in this embodiment and the method in the above embodiment are two aspects based on the same inventive concept. The method implementation process has been described in detail above, so those skilled in the art can clearly understand the structure and implementation process of the device in this implementation based on the above description. For the sake of brevity of the specification, they will not be repeated here. The above implementation is only a preferred implementation of the present invention, and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and replacements made by those skilled in the art on the basis of the present invention belong to the scope of protection claimed by the present invention.
[0107] The above-mentioned embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and substitutions made by technicians in this field on the basis of the present invention shall fall within the scope of protection required by the present invention.
Claims
1. A banknote quality detection method based on multispectral images, characterized in that: include: Step S1: collecting a multispectral image of the banknote to be tested, and preprocessing the image to obtain multiple sub-areas; The preprocessing method is to divide the banknote multispectral image into N*N sub-regions on average, where N is a non-zero natural number; And assign corresponding attention weights to each sub-region according to the image texture features; Step S2: extracting characteristic parameters of each sub-region, wherein the characteristic parameters include Hog features, Gabor filter local energy, texture statistical histogram features and image wavelet transform coefficient variance; splicing the characteristic parameters of the sub-region into a 26-dimensional initial feature vector; multiplying the initial feature vector by the attention weight corresponding to the region to obtain a final regional feature vector; performing feature fusion on the characteristic parameters of the sub-region and importing the final regional feature vector into a trained regression model to obtain confidence; wherein the training method of the regression model is: using the final regional feature vectors of multiple banknote images without abnormal features to train a support vector regression model to obtain a trained regression model; Step S3: The quality of the banknotes to be tested is judged by combining the confidence and the regional voting strategy. The confidence is divided into three levels, which represent genuine banknotes, suspected abnormal banknotes and abnormal banknotes from low to high respectively; the regional voting strategy is: Among them, the sub-region with a confidence level greater than or equal to 2 is set as RS, N f is the number of RS; N c It is the number of block connected domains of RS in the texture image, and the area of each connected domain is larger than the area of a single sub-region.
2. The banknote quality detection method based on multispectral images according to claim 1 is characterized in that: The multispectral image is a three-band image of red, green and blue.
3. A banknote quality detection system based on multispectral images, characterized in that: include: An acquisition module, used for acquiring multispectral images of the banknote to be tested; A preprocessing module for dividing the multispectral image into multiple sub-regions; That is, the multispectral image of the banknote is evenly divided into N*N sub-areas, where N is a non-zero natural number; And assign corresponding attention weights to each sub-region according to the image texture features; A feature extraction module is used to extract feature parameters of each sub-region, perform feature fusion on the feature parameters of the sub-region to obtain a final regional feature vector; wherein the feature parameters include Hog features, Gabor filter local energy, texture statistical histogram features and image wavelet transform coefficient variance; the feature parameters of the sub-region are spliced into a 26-dimensional initial feature vector; the initial feature vector is multiplied by the attention weight corresponding to the region to obtain a final regional feature vector; A model analysis module, used for importing the final regional feature vector after feature fusion into a trained regression model to obtain confidence; wherein the training method of the regression model is: using the final regional feature vectors of a plurality of banknote images without abnormal features to train a support vector regression model to obtain a trained regression model; The post-processing module is used to judge the quality of the banknotes to be tested by combining the confidence and the regional voting strategy. The confidence is divided into three levels, which represent genuine banknotes, suspected abnormal banknotes and abnormal banknotes from low to high respectively; the regional voting strategy is: Among them, the sub-region with a confidence level greater than or equal to 2 is set as RS, N f is the number of RS; N c It is the number of block connected domains of RS in the texture image, and the area of each connected domain is larger than the area of a single sub-region.
4. A storage medium storing a program, characterized in that: When the program is executed by a processor, the banknote quality detection method based on multispectral images as described in any one of claims 1-2 is implemented.
