A method, system, and storage medium for rapid recognition of banknote images from multiple countries.

By employing a two-step identification method, which utilizes wavelet transform and Naive Bayes model for initial screening and K-means algorithm for fine classification, the problem of long recognition time for multiple currencies is solved, and efficient recognition of multiple banknotes from different countries is achieved.

CN118116121BActive Publication Date: 2026-05-26SHENZHEN DOUBLE POWER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN DOUBLE POWER TECH CO LTD
Filing Date
2023-12-01
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing multi-currency recognition technologies have long recognition times in automatic banknote counting mode, and the number of currencies loaded in the software package is limited, resulting in low efficiency when recognizing multiple currencies simultaneously.

Method used

A two-step identification method is adopted: first, coarse classification features are extracted by wavelet transform and preliminary screening is performed using a Naive Bayes model; then, the K-means algorithm is used for fine classification to reduce the number of template matches.

Benefits of technology

It significantly reduces software computation time, can process more currencies in the same amount of time, improves the efficiency of multi-country banknote recognition, and supports a simultaneous banknote circulation volume up to 10 times that of existing software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118116121B_ABST
    Figure CN118116121B_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, and computer-readable storage medium for rapid recognition of banknote images from multiple countries. To address the limitation on the number of banknote denominations that can be simultaneously counted, the recognition process is divided into two steps: First, a coarse classification template is generated for all currencies. The currency to be recognized is compared with this template to obtain the Z denominations with the highest similarity. Second, the templates for the N denominations with the highest similarity are loaded and compared with the image to be recognized to obtain the final accurate recognition result. Since the banknote image to be recognized first undergoes coarse classification, template matching does not require loading all banknote denominations for matching; only the denominations identified through coarse classification are matched, thus significantly reducing the software's computation time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of currency recognition and sorting technology, specifically to a method, system, and computer-readable storage medium for rapid recognition of images of banknotes from multiple countries. Background Technology

[0002] With increasingly frequent international trade and tourism activities, the identification of various national currencies has become increasingly important. Different countries have different printing methods and anti-counterfeiting measures for their currencies. Each country's currency has its own unique markings and characteristics; correctly identifying these characteristics is essential for determining the authenticity of a currency.

[0003] Existing multi-currency recognition methods rely on automated banknote counting, where recognition software identifies various characteristics of the currency. However, due to software computation time limitations and the finite number of currencies that can be loaded into a single software package, simultaneous recognition of multiple currencies is time-consuming, and the number of banknotes that can be processed within a given timeframe is limited.

[0004] Meanwhile, in existing software recognition solutions, currency identification and face value identification are done in only one step. If face value templates for all currencies are loaded for calculation, face value identification takes a long time. When a large number of currencies are loaded, the calculation time is very long. Summary of the Invention

[0005] In view of this, it is necessary to provide a method, system, and computer-readable storage medium for rapid recognition of banknote images from multiple countries that supports diverse currencies and offers fast recognition speed.

[0006] A method for rapid image recognition of banknotes from multiple countries, comprising the following steps:

[0007] Step 1: Perform image preprocessing on the banknote image to be recognized to obtain a preprocessed banknote image corresponding to a preset size range;

[0008] Step 2: Extract coarse classification features from the preprocessed banknote images using wavelet transform, and simultaneously obtain coarse classification feature templates for all currency types.

[0009] Step 3, coarse classification identification: The extracted coarse classification features are compared with the coarse classification feature template, and the most similar currency results in group Z are output according to the classification algorithm based on the Naive Bayes model.

[0010] Step 4: Extract feature values ​​from the image to be classified based on the region features, and train a fine classification template using the existing classified dataset;

[0011] Step 5: Fine-grained identification. Based on the results of the coarse-grained identification, load the fine-grained identification feature template. Use the template value as the center point of the K-means algorithm and perform clustering operation using the K-means algorithm. Select the currency with the highest and second highest scores. When the score difference meets the predetermined requirements, output the currency with the highest score; otherwise, output identification failure.

[0012] Preferably, step one, which involves preprocessing the banknote image to be recognized to obtain a preprocessed banknote image corresponding to a preset size range, specifically includes:

[0013] Step 1-1: Locate the set of edge points determined in the image of the banknote to be identified;

[0014] Steps 1-2: Perform quadruple fitting on the edge point set to accurately locate the vertex and center point positions of the banknote image to be identified;

[0015] Steps 1-3 involve normalizing the banknote image to be recognized, which has had its vertex and center point positions located, so that the banknote image is horizontal and scaled to a size that matches the preset size range.

[0016] Preferably, step two, which involves extracting coarse classification features from the preprocessed banknote image using wavelet transform and simultaneously obtaining coarse classification feature templates for all denominations, specifically includes:

[0017] Step 2-1, Image Loading; Load the image of the banknote to be recognized;

[0018] Step 2-2, Image segmentation; the image of the banknote to be recognized is divided into several non-overlapping image blocks;

[0019] Steps 2-3: Perform wavelet transform on each image block to obtain the low-frequency coefficients of each image block;

[0020] Steps 2-4: Coefficient processing; Encode the low-frequency coefficients of each image block according to the coding rules, and concatenate them into the overall features of the image by binary bits.

[0021] Preferably, steps 2-3, which involve performing wavelet transform on each image block, specifically include:

[0022] Step 2-3-1: Determine the wavelet basis functions;

[0023] Step 2-3-2: Apply the wavelet basis function to the current image block to generate wavelet coefficients, which include low-frequency coefficients and high-frequency coefficients;

[0024] Specifically, the frequency coefficients after wavelet transform are the gray values ​​of the processed image.

[0025] Step 2-3-3: Retain the low-frequency coefficients and discard the high-frequency coefficients.

[0026] Preferably, step three, coarse classification identification, which involves comparing the extracted coarse classification features with the coarse classification feature template and outputting the Z groups of most similar currency results according to the classification algorithm based on the Naive Bayes model, specifically includes:

[0027] Step 3-1, assuming the number of currencies is n, use respectively express, Indicates the i-th currency. ; Existing items to be classified , The feature values ​​of the m regions selected by the wavelet transform are represented; wavelet transform is performed on the m regions of the image to be classified, and the low-frequency coefficients in the m image blocks are retained to represent the contour features of the current currency image.

[0028] Step 3-2: Obtain the matching results of the existing classified currency set with m image patches as templates, and obtain the likelihood probability of Bayes' theorem, as shown in equation (1):

[0029] .....................................(1)

[0030] in, P ( a m | y n ) indicates in the event y n The premise of the event a m The probability of occurrence;

[0031] Step 3-3: Perform mathematical calculations based on the Naive Bayes formula to obtain the formula for the maximum likelihood probability, as shown in equation (2):

[0032] .............(2)

[0033] Steps 3-4: Substitute the template (1) for each currency into formula (2) to select the top Z currencies as the selected currency set, where, ;

[0034] Preferably, step four, which involves extracting feature values ​​from the image to be classified based on regional features and training a fine-grained classification template using an existing classified dataset, specifically includes:

[0035] Step 4-1: Based on the existing set of selected currencies, determine the characteristic regions of each currency.

[0036] Step 4-2: Perform wavelet transform on the feature region. The frequency coefficients after wavelet transform are the gray values ​​of the processed image. Low frequency coefficients are retained to obtain the approximate outline of the region.

[0037] Step 4-3: Extract the feature portion and save it to the template folder for this currency to train the fine classification template;

[0038] Step 4-4: Subdivide all the extracted feature regions into k a*a smaller regions, and calculate the average coefficient of each region as the feature value of that region; the total feature of each currency consists of the feature values ​​of the k regions of that currency. Calculate the average of the feature values ​​of each region in all training sets of that currency to obtain the fine classification template, which is the K value.

[0039] Specifically, the values ​​of k and a vary depending on the currency. Typically, the value of a is 2, 4, 6, or 8, while the value of k is determined based on the value of a and the size of the image.

[0040] Preferably, step five, fine identification, which uses the template value as the center point of the K-means algorithm, performs clustering using the K-means algorithm, and selects the currency with the highest and second highest scores, outputting the currency with the highest score when the score difference meets a predetermined requirement, and outputting the identification failure step specifically includes:

[0041] Step 5-1: Load the fine classification feature templates for each currency in the currency set selected by coarse classification;

[0042] Step 5-2, Template matching: Using the K value of the fine classification template as the center value of the K-means algorithm, all banknotes to be classified are clustered. The absolute value of the difference between the feature value and the template value is used as the distance from the current center. The banknotes to be classified are matched with the two banknotes with the smallest and second smallest center distances, and the distance is used as the score.

[0043] Step 5-3: Select the currency with the highest and second highest scores. When the score difference meets the predetermined requirements, determine the currency with the highest score as the current currency for output; otherwise, output recognition failure.

[0044] Preferably, the specific steps in step 5-2 of clustering all banknotes to be classified using the K value of the fine classification template as the center value of the K-means algorithm include:

[0045] Step 5-2-1: Extract the feature values ​​of the current item to be classified in the same way as extracting the fine classification feature template;

[0046] Step 5-2-2: Subtract the feature value of each small region from the fine classification feature template, and sum the absolute values ​​to get the distance from the current center.

[0047] Step 5-2-3: Select the nearest center point for matching, and use the distance as the score.

[0048] Furthermore, a multi-country banknote image rapid recognition system is provided for implementing the multi-country banknote image rapid recognition method described above, the apparatus comprising:

[0049] The image acquisition module is used to acquire images of banknotes with recognition capabilities;

[0050] The four-point positioning module is used to locate the edge points of the image and find the four corners of the image by fitting straight lines through these points, and then normalize the image size to a specified size;

[0051] The feature extraction module is used to extract corresponding coarse and fine classification features from the size-normalized image.

[0052] The coarse classification module is used to substitute the coarse classification features extracted by the feature extraction module and the coarse classification feature template into the Naive Bayes formula for judgment, and select the Z closest recognition results.

[0053] The fine-classification module is used to further compare the coarse-classification results and find the closest recognition result through K-means clustering;

[0054] The result output module is used to output the current recognition result;

[0055] in,

[0056] The four-point positioning module includes:

[0057] Edge point set lookup unit, used to find edge points;

[0058] A line fitting unit, used to fit four sides with a set of edge points;

[0059] Image size normalization unit, used for minor horizontal rotation and size scaling of the image;

[0060] The feature extraction module includes:

[0061] Wavelet transform unit, used to perform wavelet transform process;

[0062] The image pixel extraction unit is used to extract feature values ​​from a series of character blocks in the image.

[0063] Feature coding unit is used to merge the low-frequency coefficient codes of each region;

[0064] The coarse classification module includes:

[0065] The Bayesian classification computation unit is used to classify data using a Bayesian model.

[0066] The category result filtering unit is used to filter the desired currencies;

[0067] The detailed classification module includes:

[0068] Load coarse classification result unit, used to load the Z most similar currency templates selected by coarse classification;

[0069] K-means clustering units are used to perform K-means clustering on the filtered results to find the desired results.

[0070] And a computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the multi-country banknote image rapid recognition method as described above.

[0071] In the aforementioned method, system, and computer-readable storage medium for rapid recognition of multi-currency banknote images, to address the current limitation on the number of currency types that can be simultaneously counted, the recognition process is divided into two steps: First, a coarse classification template is generated for all currencies. The currency to be recognized is compared with this template to obtain the Z denominations with the highest similarity. Second, the templates for the N denominations with the highest similarity are loaded and compared with the image to be recognized to obtain the final accurate recognition result. Since the banknote image to be recognized first undergoes coarse classification, template matching does not require loading all denominations for matching; only the denominations identified through coarse classification are matched, thus significantly reducing software computation time. The method of this invention is simple, easy to implement, low-cost, and readily applicable. Attached Figure Description

[0072] Figure 1 This is a flowchart of a method for rapid recognition of banknote images from multiple countries according to an embodiment of the present invention.

[0073] Figure 2 This is a schematic diagram of the structure of the multi-country banknote image rapid recognition system according to an embodiment of the present invention. Detailed Implementation

[0074] This embodiment uses a method, system, and computer-readable storage medium for rapid recognition of banknote images from multiple countries as an example. The invention will be described in detail below with reference to specific embodiments and accompanying drawings.

[0075] Please see Figure 1This invention illustrates a method for rapid recognition of banknote images from multiple countries. The method involves preprocessing the banknote image to obtain a preprocessed banknote image corresponding to a preset size range; extracting coarse classification features from the preprocessed banknote image using wavelet transform, and simultaneously obtaining coarse classification feature templates for all currencies; performing coarse classification recognition by comparing the extracted coarse classification features with the coarse classification feature templates, and outputting the Z groups of most similar currencies using a classification algorithm based on a Naive Bayes model; extracting feature values ​​from the image to be classified based on regional features, and training a fine classification template using an existing classified dataset; and performing fine recognition by loading the fine classification feature template based on the coarse classification recognition results, using the template values ​​as the center points of a K-means algorithm, performing clustering operations using the K-means algorithm, and selecting the currencies with the highest and second-highest scores. If the score difference meets a predetermined requirement, the currency with the highest score is output; otherwise, recognition failure is output.

[0076] The specific steps are as follows:

[0077] Step S10: Acquire an image of the banknote to be identified.

[0078] Specifically, an image sensor is used to capture images of the banknotes to be identified.

[0079] Step S21: Locate the set of edge points determined in the image of the banknote to be identified;

[0080] Step S22: Perform quadruple fitting on the edge point set to accurately locate the vertex and center point positions of the banknote image to be identified;

[0081] Step S23: Normalize the banknote image to be recognized with the vertex and center point positions already located, so that the banknote image to be recognized with the vertex and center point positions already located is in the horizontal direction and scaled to a size that matches the preset size range.

[0082] Step S31, Image loading; Load the image of the banknote to be recognized;

[0083] Specifically, the loaded image of the banknote to be recognized is typically a two-dimensional digital matrix, where each element represents a pixel value in the image.

[0084] Step S32, image segmentation; the image of the banknote to be recognized is divided into several non-overlapping image blocks;

[0085] Specifically, each image block is typically a square or rectangular area. Image segmentation can be achieved by sliding a fixed-size window, the size of which depends on the application's requirements.

[0086] Step S33: Perform wavelet transform on each image block to obtain the low-frequency coefficients of each image block;

[0087] Step S34, coefficient processing: Encode the low-frequency coefficients of each image block according to the coding rules, and concatenate them into the overall features of the image by binary bits.

[0088] Preferably, step S33, which involves performing wavelet transform on each image block, specifically includes:

[0089] Step S331: Determine the wavelet basis functions;

[0090] Step S332: Apply the wavelet basis function to the current image block to generate wavelet coefficients, which include low-frequency coefficients and high-frequency coefficients;

[0091] Specifically, the frequency coefficients after wavelet transform are the gray values ​​of the processed image.

[0092] Step S333: Retain the low-frequency coefficients and discard the high-frequency coefficients.

[0093] Specifically, since the frequency of an image represents the degree of drastic change in its grayscale values, low-frequency coefficients indicate slow changes in grayscale values, representing the image's contour information, while high-frequency coefficients indicate drastic changes in grayscale values, representing details and noise in the image. For multi-country banknote classification operations, using low-frequency coefficients to perform an overall measurement of the image to determine the denomination is more accurate.

[0094] Step S41, assuming the number of currencies is n, use respectively express, Indicates the i-th currency. ; Existing items to be classified , The feature values ​​of the m regions selected by the wavelet transform are represented; wavelet transform is performed on the m regions of the image to be classified, and the low-frequency coefficients in the m image blocks are retained to represent the contour features of the current currency image.

[0095] Step S42: Obtain the matching results of the existing classified currency set with m image patches as templates, and obtain the likelihood probability of Bayes' theorem, as shown in equation (1):

[0096] ...................................(1);

[0097] in, P ( a m | y n ) indicates in the event y n The premise of the event a m The probability of occurrence;

[0098] Step S43: Perform mathematical calculations based on the Naive Bayes formula to obtain the formula for the maximum likelihood probability, as shown in equation (2):

[0099] .............(2)

[0100] Step S44: Substitute the template (1) of each currency into the formula (2) to select the top Z currencies as the selected currency set, where, ;

[0101] Specifically, the calculation process of the classification algorithm based on the Naive Bayes model in step 3-3 is as follows:

[0102] Assuming there are n types of currencies, use respectively express, Indicates the i-th currency. There are currently items to be classified. , Let represent the eigenvalues ​​of the m regions selected by the wavelet transform. The goal of coarse classification is to find the best match between the eigenvalues ​​and the eigenvalues. There are several currencies, and it is necessary to ensure that the correct currencies exist in this database. Among the various currencies, The general value is [1, 8].

[0103] To achieve this goal, we first need to use the existing classified dataset to obtain templates (i.e., the likelihood set) through training, as shown in equation (3):

[0104] .......................................(3)

[0105] To illustrate how to find the currency type with the best matching degree, we select the top [currency type] that best matches the feature. The method for each currency is as follows: Let... The currency with the best current matching degree.

[0106] It is easy to know that

[0107] ........................................(4)

[0108] Bayes' theorem is also known.

[0109] ....................................(5)

[0110] From equations (4) and (5) above, we can obtain that

[0111] ............................(6)

[0112] It is easy to obtain from the previous conditions. It is a constant. Therefore, only needs Based on the given conditions, Now assume Since the conditions are independent, we can obtain the following formula:

[0113] ....................(7)

[0114] By combining the existing template (3), the currency that best matches in the Naive Bayes model can be obtained. Similarly, by combining the above steps, the remaining currencies can be derived. Each currency.

[0115] The advantages of classification algorithms based on the Naive Bayes model are as follows:

[0116] 1. The Naive Bayes model originated from classical mathematical theory, has a solid mathematical foundation, and stable classification efficiency.

[0117] 2. The Naive Bayes model requires very few parameters to be estimated, is not very sensitive to missing data, and has a relatively simple algorithm.

[0118] 3. While assuming conditional independence reduces the classification performance of the algorithm to some extent, it greatly simplifies the complexity of the Bayesian model in practical applications.

[0119] 4. It can handle multi-classification tasks and is suitable for incremental training, meaning it can train on newly added samples in real time.

[0120] Step S51: Determine the characteristic regions of each currency based on the existing set of selected currencies.

[0121] Specifically, the characteristic area of ​​each currency represents the unique characteristic area that distinguishes it from all other currencies, and it should be different from all other currencies in some way.

[0122] Step S52: Perform wavelet transform on the feature region. The frequency coefficients after wavelet transform are the gray values ​​of the processed image. Retain the low frequency coefficients to obtain the approximate outline of the region.

[0123] Step S53: Extract the feature portion and save it to the template folder for this currency to train a fine classification template;

[0124] Step S54: Subdivide all the extracted feature regions into k a*a smaller regions, and calculate the average coefficient of each region as the feature value of that region; The total feature of each currency is composed of the feature values ​​of the k regions of that currency. Calculate the average of the feature values ​​of each region in all training sets of that currency to obtain the fine classification template, which is the K value.

[0125] Specifically, the values ​​of k and a vary depending on the currency. Typically, the value of a is 2, 4, 6, or 8, while the value of k is determined based on the value of a and the size of the image.

[0126] Step S61: Load the fine classification feature templates for each currency in the currency set selected by coarse classification;

[0127] Specifically, the refined classification feature template consists of unique features at specific locations for a particular currency. The training process involves manually defining the feature region, performing wavelet transform, and preserving low-frequency coefficients. This region is then subdivided into k a*a smaller regions, where k and a are fixed values ​​for the same currency but may differ for different currencies. The average low-frequency coefficients of these smaller regions are extracted as the current feature value. The average of the feature values ​​from a large amount of known data for the same currency is then used to obtain the refined classification feature template.

[0128] Step S62, template matching: using the K value of the fine classification template as the center value of the K-means algorithm, cluster all banknotes to be classified, and use the absolute value of the difference between the feature value and the template value as the distance from the current center. The banknotes to be classified are matched with the two banknotes with the smallest and second smallest center distances, and the distance is used as the score.

[0129] Step S63: Select the currency with the highest and second highest scores. When the score difference meets the predetermined requirements, determine the currency with the highest score as the current currency for output; otherwise, output recognition failure.

[0130] Specifically, the default difference standard value is 9, meaning that a difference less than 9 does not meet the requirements, while a difference greater than 9 meets the requirements. In special circumstances where the requirements are more stringent or more lenient, the difference standard can be adjusted up or down accordingly.

[0131] Preferably, the specific steps in step S62 of clustering all banknotes to be classified using the K value of the fine classification template as the center value of the K-means algorithm include:

[0132] Step S621: Extract the feature values ​​of the current item to be classified in the same way as extracting the fine classification feature template;

[0133] Step S622: The feature values ​​of each small region are subtracted from the fine classification feature template, and the sum of the absolute values ​​is the distance from the current center.

[0134] Step S623: Select the nearest center point for matching, and use the distance as the score.

[0135] In summary, to address the current limitation on the number of currency denominations that can be simultaneously counted, the identification process is divided into two steps: First, a coarse classification template is generated for multiple currencies. The currency to be identified is compared with this template to obtain the Z denominations with the highest similarity. Second, a template of the N most similar denominations is loaded and compared with the image to be identified to obtain the final accurate identification result. In this embodiment, the first step, the coarse classification algorithm, finds the Z most similar denominations. Fine identification only requires selecting the two most similar and second most similar denominations from these. Since the software's coarse classification is faster and the number of fine-grained denominations to be identified is fixed, the new algorithm can process more currency denominations within the same timeframe.

[0136] In this embodiment, the banknote images to be identified are first subjected to coarse classification. During template matching, it is not necessary to load all banknotes of all denominations for matching; only the denominations identified in the coarse classification are matched, thereby greatly reducing the software's computation time. With the hardware channel unchanged, existing software typically only supports counting 1 to 8 currencies simultaneously when multiple currencies are being processed. The software in this solution supports up to 10 times the number of currencies that can be processed simultaneously. Of course, when the number of currencies to be classified is small (e.g., <8), the improved algorithm is less efficient than the original algorithm. However, in practical production, the time required for classifying a small number of currencies is very short, so this drawback can be completely ignored.

[0137] And, please see Figure 2 This paper illustrates a multi-country banknote image rapid recognition system for implementing the multi-country banknote image rapid recognition method described above. The device includes:

[0138] Image acquisition module 10 is used to acquire images of banknotes with recognition capabilities;

[0139] The four-point positioning module 20 is used to locate the edge points of the image and find the four corners of the image by fitting straight lines through these points, and then normalize the image size to a specified size;

[0140] The feature extraction module 30 is used to extract corresponding coarse and fine classification features from the size-normalized image;

[0141] The coarse classification module 40 is used to substitute the coarse classification features extracted by the feature extraction module and the coarse classification feature template into the Naive Bayes formula for judgment, and select the Z closest recognition results.

[0142] The fine classification module 50 is used to further compare the coarse classification results and find the closest recognition result through K-means clustering;

[0143] The result output module 60 is used to output the current recognition result;

[0144] in,

[0145] The four-point positioning module 20 includes:

[0146] Edge point set lookup unit 201 is used to find edge points;

[0147] Line fitting unit 202 is used to fit four sides with a set of edge points;

[0148] Image size normalization unit 203 is used for minor rotation of the image to the horizontal plane and size scaling;

[0149] The feature extraction module 30 includes:

[0150] Wavelet transform unit 301 is used to perform the wavelet transform process;

[0151] Image pixel extraction unit 302 is used to extract feature values ​​of a series of character blocks in an image; for example, for a 32*64 image, it can be used to extract 32 8*8 feature values.

[0152] Feature coding unit 303 is used to merge the low-frequency coefficient codes of each region;

[0153] The coarse classification module 40 includes:

[0154] Bayesian classification computation unit 401 is used for classification using a Bayesian model;

[0155] The classification result filtering unit 402 is used to filter the desired currencies;

[0156] The fine classification module 50 includes:

[0157] Load coarse classification result unit 501, which is used to load the Z most similar currency templates selected by coarse classification;

[0158] K-means clustering unit 502 is used to perform K-means clustering on the filtered results to find the desired results.

[0159] And a computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the multi-country banknote image rapid recognition method as described above.

[0160] In the aforementioned method, system, and computer-readable storage medium for rapid recognition of multi-currency banknote images, to address the current limitation on the number of currency types that can be simultaneously counted, the recognition process is divided into two steps: First, a coarse classification template is generated for all currencies. The currency to be recognized is compared with this template to obtain the Z denominations with the highest similarity. Second, the templates for the N denominations with the highest similarity are loaded and compared with the image to be recognized to obtain the final accurate recognition result. Since the banknote image to be recognized first undergoes coarse classification, template matching does not require loading all denominations for matching; only the denominations identified through coarse classification are matched, thus significantly reducing software computation time. The method of this invention is simple, easy to implement, low-cost, and readily applicable.

[0161] It should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention can be modified and varied in various ways. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for rapid image recognition of banknotes from multiple countries, characterized in that, The method includes the following steps: Step 1: Perform image preprocessing on the banknote image to be recognized to obtain a preprocessed banknote image corresponding to a preset size range; Step 2: Extract coarse classification features from the preprocessed banknote images using wavelet transform, and simultaneously obtain coarse classification feature templates for all currency types. Step 3, coarse classification identification: The extracted coarse classification features are compared with the coarse classification feature template, and the most similar currency results in group Z are output according to the classification algorithm based on the Naive Bayes model. Step 4: Extract feature values ​​from the image to be classified based on the region features, and train a fine classification template using the existing classified dataset; Step 5, fine-grained identification: Load fine-grained classification feature templates based on the results of coarse-grained identification, use the template values ​​as the center points of the K-means algorithm, perform clustering operations using the K-means algorithm, and select the currencies with the highest and second highest scores. When the score difference meets the predetermined requirements, output the currency with the highest score; otherwise, output identification failure. Step two, which involves extracting coarse classification features from the preprocessed banknote image using wavelet transform and simultaneously obtaining coarse classification feature templates for all denominations, specifically includes: Step 2-1, Image Loading; Load the image of the banknote to be recognized; Step 2-2, Image segmentation; the image of the banknote to be recognized is divided into several non-overlapping image blocks; Steps 2-3: Perform wavelet transform on each image block to obtain the low-frequency coefficients of each image block; Steps 2-4: Coefficient processing; Encode the low-frequency coefficients of each image block according to the coding rules, and concatenate them into the overall features of the image by binary bits; Step four, which involves extracting feature values ​​from the image to be classified based on region features and training a refined classification template using an existing classified dataset, specifically includes: Step 4-1: Based on the existing set of selected currencies, determine the characteristic regions of each currency. Step 4-2: Perform wavelet transform on the feature region. The frequency coefficients after wavelet transform are the gray values ​​of the processed image. Low frequency coefficients are retained to obtain the approximate outline of the region. Step 4-3: Extract the feature portion and save it to the template folder for this currency to train the fine classification template; Step 4-4: Subdivide all the extracted feature regions into k a*a smaller regions, and calculate the average coefficient of each region as the feature value of that region; the total feature of each currency consists of the feature values ​​of the k regions of that currency. Calculate the average of the feature values ​​of each region in all training sets of that currency to obtain the fine classification template, which is the K value.

2. The method of claim 1, wherein the step of identifying the plurality of banknote images is performed by using a neural network. Step one, which involves preprocessing the banknote image to be recognized to obtain a preprocessed banknote image corresponding to a preset size range, specifically includes: Step 1-1: Locate the set of edge points determined in the image of the banknote to be identified; Steps 1-2: Perform quadruple fitting on the edge point set to accurately locate the vertex and center point positions of the banknote image to be identified; Steps 1-3 involve normalizing the banknote image to be recognized, which has had its vertex and center point positions located, so that the banknote image is horizontal and scaled to a size that matches the preset size range.

3. The method for rapid recognition of multi-country banknote images as described in claim 2, characterized in that, Steps 2-3, which involve performing wavelet transform on each image block, specifically include: Step 2-3-1: Determine the wavelet basis functions; Step 2-3-2: Apply the wavelet basis function to the current image block to generate wavelet coefficients, which include low-frequency coefficients and high-frequency coefficients; Specifically, the frequency coefficients after wavelet transform are the gray values ​​of the processed image; Step 2-3-3: Retain the low-frequency coefficients and discard the high-frequency coefficients.

4. The method for rapid recognition of multi-country banknote images as described in claim 2, characterized in that, Step three, coarse classification identification, involves comparing the extracted coarse classification features with the coarse classification feature template, and outputting the Z groups of most similar currency results according to the classification algorithm based on the Naive Bayes model. The specific steps include: Step 3-1, assuming the number of currencies is n, use respectively express, Indicates the i-th currency. ; Existing items to be classified , The feature values ​​of the m regions selected by the wavelet transform are represented; wavelet transform is performed on the m regions of the image to be classified, and the low-frequency coefficients in the m image blocks are retained to represent the contour features of the current currency image. Step 3-2: Obtain the matching results of the existing classified currency set with m image patches as templates, and obtain the likelihood probability of Bayes' theorem, as shown in equation (1): .......................................(1); in, P ( a m | y n ) indicates in the event y n The premise of the event a m The probability of occurrence; Step 3-3: Perform mathematical calculations based on the Naive Bayes formula to obtain the formula for the maximum likelihood probability, as shown in equation (2): .............(2); Steps 3-4: Substitute the template (1) for each currency into formula (2) to select the top Z currencies as the selected currency set, where, .

5. The method for rapid recognition of multi-country banknote images as described in claim 4, characterized in that, Step five, fine-grained identification, uses the template value as the center point of the K-means algorithm, performs clustering using the K-means algorithm, and selects the currency with the highest and second-highest scores. If the score difference meets a predetermined requirement, the currency with the highest score is output; otherwise, the identification failure is output. This step specifically includes: Step 5-1: Load the fine classification feature templates for each currency in the currency set selected by coarse classification; Step 5-2, Template matching: Using the K value of the fine classification template as the center value of the K-means algorithm, all banknotes to be classified are clustered. The absolute value of the difference between the feature value and the template value is used as the distance from the current center. The banknotes to be classified are matched with the two banknotes with the smallest and second smallest center distances, and the distance is used as the score. Step 5-3: Select the currency with the highest and second highest scores. When the score difference meets the predetermined requirements, determine the currency with the highest score as the current currency for output; otherwise, output recognition failure.

6. The method for rapid recognition of multi-country banknote images as described in claim 5, characterized in that, The specific steps in step 5-2, which use the K value of the fine classification template as the center value of the K-means algorithm to cluster all banknotes to be classified, include: Step 5-2-1: Extract the feature values ​​of the current item to be classified in the same way as extracting the fine classification feature template; Step 5-2-2: Subtract the feature value of each small region from the fine classification feature template, and sum the absolute values ​​to get the distance from the current center. Step 5-2-3: Select the nearest center point for matching, and use the distance as the score.

7. A multi-country banknote image rapid recognition system, used to implement the multi-country banknote image rapid recognition method as described in any one of claims 1-6, characterized in that, The system includes: The image acquisition module is used to acquire images of banknotes with recognition capabilities; The four-point positioning module is used to locate the edge points of the image and find the four corners of the image by fitting straight lines through these points, and then normalize the image size to a specified size; The feature extraction module is used to extract corresponding coarse and fine classification features from the size-normalized image. The coarse classification module is used to substitute the coarse classification features extracted by the feature extraction module and the coarse classification feature template into the Naive Bayes formula for judgment, and select the Z closest recognition results. The fine-classification module is used to further compare the coarse-classification results and find the closest recognition result through K-means clustering; The result output module is used to output the current recognition result; in, The four-point positioning module includes: Edge point set lookup unit, used to find edge points; A line fitting unit, used to fit four sides with a set of edge points; Image size normalization unit, used for minor horizontal rotation and size scaling of the image; The feature extraction module includes: Wavelet transform unit, used to perform wavelet transform process; The image pixel extraction unit is used to extract feature values ​​from a series of character blocks in the image. Feature coding unit is used to merge the low-frequency coefficient codes of each region; The coarse classification module includes: The Bayesian classification computation unit is used to classify data using a Bayesian model. The category result filtering unit is used to filter the desired currencies; The detailed classification module includes: Load coarse classification result unit, used to load the Z most similar currency templates selected by coarse classification; K-means clustering units are used to perform K-means clustering on the filtered results to find the desired results.

8. A computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the method for rapid recognition of images of banknotes from multiple countries as described in any one of claims 1-6.