Cash amount determination method and device, electronic equipment and storage medium

Through the cash counting model based on the BlendMask model, the currency and denomination of banknotes and coins are automatically identified, which solves the problem of low efficiency in cash amount determination in the existing technology and realizes efficient and accurate cash amount calculation.

CN120708322APending Publication Date: 2025-09-26AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510977399.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-15
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In the prior art, a currency counter only supports banknotes of a single currency, resulting in low efficiency in determining the cash amount and requiring manual counting of foreign currency or coins.

Method used

A cash counting model trained based on the BlendMask model is used to identify the currency and denomination information of banknotes and coins through image processing and calculate the total amount.

Benefits of technology

It realizes the automatic identification of multi-currency and multi-form cash without manual counting, improving the efficiency and accuracy of cash amount determination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120708322A_ABST
    Figure CN120708322A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a cash amount determination method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a target image including cash; wherein the cash is paper money and / or coins; processing the target image based on a preset cash counting model to obtain currency information and face value information of each cash in the target image; calculating the total amount of all cash in the target image according to the currency information and the face value information; wherein the cash counting model is obtained by training based on a BlendMask model. The method is used for achieving the effect of improving the cash amount determination efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a method, device, electronic device, and storage medium for determining a cash amount. Background Art

[0002] Banks face a large amount of cash storage business every day, and can use special machines (such as banknote counting machines) to count cash to determine the cash amount.

[0003] Currently, cash storage may include foreign currencies or coins, and cash counting machines usually only support banknotes of a single currency, so the cash amount needs to be manually counted, resulting in low efficiency in determining the cash amount. Summary of the Invention

[0004] The embodiments of the present application provide a method, device, electronic device, and storage medium for determining a cash amount, so as to improve the efficiency of determining a cash amount.

[0005] In a first aspect, an embodiment of the present application provides a method for determining a cash amount, comprising:

[0006] Acquiring a target image including cash; wherein the cash is banknotes and / or coins;

[0007] Based on a preset cash counting model, the target image is processed to obtain the currency information and denomination information of each cash in the target image; and the total amount of all cash in the target image is calculated based on the currency information and denomination information; wherein, the cash counting model is obtained based on the BlendMask model training.

[0008] In a second aspect, an embodiment of the present application provides a device for determining a cash amount, comprising:

[0009] An acquisition module, configured to acquire a target image including cash; wherein the cash is banknotes and / or coins;

[0010] A processing module is used to process the target image based on a preset cash counting model to obtain the currency information and denomination information of each cash in the target image; and calculate the total amount of all cash in the target image based on the currency information and denomination information; wherein, the cash counting model is obtained by training based on the BlendMask model.

[0011] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor;

[0012] The memory stores computer-executable instructions;

[0013] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementation methods of the first aspect.

[0015] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0017] Figure 1 Schematic diagram of the process for determining the cash amount provided for this application Figure 1 ;

[0018] Figure 2 Schematic diagram of the process for determining the cash amount provided for this application Figure 2 ;

[0019] Figure 3 A schematic diagram of the structure of a device for determining a cash amount provided in this application;

[0020] Figure 4 This is a schematic diagram of the structure of the electronic device provided in this application.

[0021] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0022] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0023] The method for determining the cash amount provided in this application takes a photo of the cash, processes the image through a pre-trained cash counting model, identifies the currency and denomination of the cash in the image, and then determines the total amount of cash in the image based on the currency and denomination, without the need for manual counting, thereby improving the efficiency of determining the cash amount.

[0024] The execution subject of the embodiment of the present application may be an electronic device with processing capabilities, such as a computer, a server, etc., and the embodiment of the present application is not limited here.

[0025] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0026] Figure 1 Schematic diagram of the process for determining the cash amount provided for this application Figure 1 ,like Figure 1 As shown, the method includes:

[0027] S101. Acquire a target image including cash.

[0028] Exemplarily, cash refers to banknotes and / or coins. The target image refers to an image containing at least one piece of cash (banknote or coin). It is understood that the banknotes and cash in the target image must be laid out flat on a flat surface, avoiding complete overlap. Slight edge overlap is permitted, but key features, such as the denomination and currency identifier, must be visible. Coins should be spread out as much as possible to minimize obstruction. It should be noted that this embodiment of the application does not limit the format type of the target image.

[0029] In one example, a user may use a mobile device to capture a target image and send it to an electronic device; or the electronic device may obtain a stored target image from a database.

[0030] S102: Process the target image based on a preset cash counting model to obtain currency information and denomination information of each cash in the target image.

[0031] For example, a cash counting model is an AI model used to automatically identify the currency and denomination of cash in an image and calculate the total amount. This cash counting model is trained based on the BlendMask model, an instance segmentation model that combines global and local segmentation to accurately segment targets and extract fine-grained features. Optionally, the cash counting model can include a currency recognition model and a denomination recognition model, used to identify currency information and denomination information, respectively. Currency information refers to the currency type of the cash; denomination information refers to the denomination of the cash.

[0032] In one example, an electronic device can input a target image into a preset cash counting model to obtain the currency and denomination information of each cash in the target image. Specifically, the currency recognition model in the cash counting model can process the target image to obtain the currency information in the target image; and the denomination recognition model in the cash counting model can process the target image to obtain the denomination information in the target image.

[0033] In some embodiments, an electronic device obtains a training set that includes sample images of banknotes and coins of various circulating currencies; and preprocesses the sample images in the training set, including data labeling and data enhancement. First, with the help of a data labeling tool, the target cash in the sample image is classified, identified, and labeled as the ground truth. In order to better identify various types of cash, the labeling categories are divided into two types of labeling information: currency and denomination based on the characteristics of different cash. The currency category mainly includes common currencies such as RMB, US dollars, euros, and Japanese yen, and the denomination category is the denomination of cash: 1000, 500, 100, 50, etc. The sample images are classified and labeled to obtain a currency labeling dataset labeled as currency and a denomination labeling dataset labeled as cash denomination.

[0034] In order to increase the size of the training data set and the diversity of the data, this application performs data enhancement on the sample images. The sample images in the training set are reversed, cropped, and other operations are performed. Each cropping will retain the ground truth part of the image, and then randomly spliced ​​to a picture, and expanded into the training set as new sample image data. In this way, the number of sample images in the training set is greatly increased, and the diversity of the training set is improved. In addition, in order to eliminate the influence of the shooting angle or the wear of the cash on the final recognition results, the sample images are cropped, flipped, the brightness and saturation are adjusted, and noise reduction is performed to obtain higher quality sample images. In this way, a data enhancement method based on cropping and splicing is used to pre-process the images by cropping and splicing, simulating complex cash situations, solving the problem of insufficient small sample training data, and improving the effectiveness and diversity of model training.

[0035] Based on the training set and the currency annotation dataset, the BlendMask model was trained, hyperparameters were adjusted, and the optimal hyperparameter settings were obtained through cross-validation, thereby obtaining a currency recognition model for currency identification. Similarly, based on the training set and the denomination annotation dataset, the BlendMask model was trained, hyperparameters were adjusted, and the optimal hyperparameter settings were obtained through cross-validation, thereby obtaining a denomination recognition model for denomination classification.

[0036] S103 : Based on a preset cash counting model, calculate the total amount of all cash in the target image according to the currency information and the denomination information.

[0037] For example, the total amount refers to the sum of all cash amounts in the target image, and can be classified and counted by currency to output the sub-item amounts of each currency and the total amount (the total amount after converting each currency at the exchange rate based on the preset currency).

[0038] In one example, when processing a target image based on a cash counting model, the currency information and face value information of the same cash in the target image can be associated, and then the cash in the target image can be classified based on the currency information, and then the amount can be calculated based on the face value information of each classified cash to obtain the sub-item amount of each currency, or the sub-item amount of each currency can be converted into the amount of the preset currency according to the preset exchange rate to obtain the total amount of the preset currency.

[0039] The method for determining the amount of cash provided in the embodiment of the present application is to capture a target image containing cash, identify and process the target image using a preset cash counting model, obtain the currency information and denomination information of each cash in the target image, and automatically determine the total amount of each cash in the target image based on the cash counting model. Through this method, on the one hand, automatic classification and amount calculation of cash are achieved through image recognition, eliminating the need for manual counting of each bill, thereby improving the efficiency of cash counting; on the other hand, the cash counting model pre-trained by the BlendMask model can have a more refined segmentation capability, capable of capturing the subtle features of cash and improving the accuracy of identifying the currency and denomination of cash; on the other hand, the operational process of cash counting can be simplified, and the user only needs to take a photo of the cash and upload it to automatically count the total amount of cash, thereby improving the user experience.

[0040] Figure 2 Schematic diagram of the process for determining the cash amount provided for this application Figure 2 ,like Figure 2 As shown, this embodiment Figure 2 Based on the embodiment, a method for determining the cash amount is described in detail. The method includes:

[0041] S201: Acquire a target image including cash.

[0042] It should be noted that this step is similar to the aforementioned step S101 and will not be repeated here.

[0043] Optionally, the target image may be preprocessed, for example, by adjusting the brightness and saturation of the target image and performing noise reduction processing to reduce the impact of noise on subsequent results.

[0044] S202: Based on the currency recognition model, detect and extract features from the target image to determine the boundary information and currency information of each cash in the target image.

[0045] Exemplarily, the currency recognition model refers to a sub-model in the cash counting and recognition model trained based on the BlendMask model, which is used to identify the currency type of cash in the image and locate the position of the cash in the image. The boundary information of the cash refers to the position coordinates of the cash in the target image, usually represented by a rectangular bounding box. The format can be [x1, y1, x2, y2], where (x1, y1) is the coordinate of the upper left corner of the bounding box, and (x2, y2) is the coordinate of the lower right corner of the bounding box, which is used to accurately locate a single cash. The boundary information of the cash corresponds one-to-one with the currency information. In other words, the currency recognition model can output the currency information and boundary information of each cash. After the electronic device inputs the target image into the cash counting model, it can pass the target image to the currency recognition model in the cash counting and recognition model. The currency recognition model detects and extracts the characteristic information of the currency in the target image and outputs the boundary information and currency information of each cash in the target image.

[0046] Optionally, the currency recognition model may include a detection (Detector) module, a fusion mask (BlendMask) module, and a classification module.

[0047] Specifically, the detection module based on the currency recognition model performs feature extraction processing on the target image to obtain the first multi-scale feature information; and performs detection processing on the first multi-scale feature map to determine the boundary information of each cash in the target image. Exemplarily, the detection module may include a backbone network (Backbone) and a Feature Pyramid Network (FPN), and performs feature extraction on the target image based on the ResNet-50 backbone network and FPN to generate a multi-scale feature map, i.e., the first multi-scale feature information, to adapt to cash of different sizes; and performs detection processing on the multi-scale feature map through the RetinaNet architecture to determine the boundary information of each cash. For example, the backbone network in the detection module extracts multiple layers of basic features of the target image; the FPN in the detection module fuses the multiple layers of basic features to obtain the first multi-scale feature information, wherein the first multi-scale feature information includes P2-P6 feature maps, and the number of channels of each layer of feature map is 256. Based on the RetinaNet architecture, the classification branch of the detection module predicts the probability that a preset anchor point belongs to cash, and the regression branch predicts the bounding box offset. A candidate bounding box is generated based on the probability and offset. The candidate bounding box is filtered using the non-maximum suppression algorithm to obtain the boundary information of the cash. The output cash boundary information can be in the format of [x1, y1, x2, y2, confidence], where x1 and y1 are the coordinates of the upper left corner of the bounding box, x2 and y2 are the coordinates of the lower right corner of the bounding box, and the confidence indicates the probability that the bounding box contains cash.

[0048] Then, based on the fusion mask module of the currency recognition model, the currency feature information of each cash is obtained based on the boundary information of each cash and the first multi-scale feature information; based on the classification module of the currency recognition model, the currency information of each cash is determined based on the currency feature information of each cash. For example, based on the boundary information of the cash, the feature vector of the cash area is extracted from the first multi-scale feature information through the RoIAlign operation; a low-resolution mask of the cash area is generated through the Mask Head of the fusion mask module; the low-resolution mask is refined using the Coarse-to-Fine mechanism to obtain a refined mask of the cash area; and the currency feature information is extracted from the refined mask, which includes color features, texture features, and shape features. It should be noted that color features can be calculated using the HSV color histogram, texture features can be extracted using local binary pattern (LBP) features, and shape features include aspect ratio and rectangularity. Finally, the currency feature information is input into the fully connected layer of the classification module for feature conversion. A Softmax function is used to calculate the matching probability between the currency feature information and each preset currency category. The currency category with the highest matching probability is determined as the currency information for the cash. If the matching probability falls below a first threshold, the currency information is marked as "pending." Through these steps, the currency recognition model can determine the currency information and cash boundary information for each cash in the target image.

[0049] S203 : Based on the boundary information of each banknote, the target image is cropped to obtain a partial image including a single banknote.

[0050] For example, a partial image refers to an image of a single cash note area cropped from a target image based on the cash note's boundary information. This image contains only one cash note, thus avoiding interference from other cash notes during subsequent denomination recognition. Based on the cash note's boundary information, the electronic device may expand the bounding box by a preset ratio, such as 10%, to obtain expanded boundary information. Based on the expanded boundary information, the electronic device may crop the single cash note area from the target image and adjust the resolution of the cropped image to obtain the partial image.

[0051] Specifically, based on the boundary information of the cash, an initial cropping area is determined; after the initial cropping area is expanded outward by a preset ratio, a target cropping area is obtained; and based on the target cropping area, a target image is cropped to obtain a partial image.

[0052] For example, the initial cropping area refers to the area corresponding to the bounding box determined based on the boundary information of the current image. The initial cropping area can be expanded outward by a preset proportion to obtain the target cropping area. The target image is cropped based on the target cropping area to obtain a partial image.

[0053] S204: For each partial image, based on the face value recognition model, perform detection and feature extraction processing on the partial image to determine the face value information of the cash.

[0054] For example, the denomination recognition model is a sub-model within the cash counting and recognition model trained based on the BlendMask model, used to identify the denomination of individual cash notes. The electronic device can input a partial image into the denomination recognition model within the cash counting model. The model detects and extracts the denomination's feature information from the partial image and outputs the denomination information of the cash in the partial image.

[0055] Optionally, the face value recognition model may include a detection (Detector) module, a fusion mask (BlendMask) module and a classification module.

[0056] Specifically, a detection module based on a face value recognition model performs feature extraction on a local image to obtain second multi-scale feature information of the local image; then performs detection processing on the second multi-scale feature information of the local image to determine the boundary information of the face value in the local image. Exemplarily, the detection module may include a backbone network and a feature pyramid network. Based on a ResNet-50 backbone network and FPN, the detection module performs feature extraction on the local image to generate a multi-scale feature map, i.e., the second multi-scale feature information; then, the detection module performs detection processing on the multi-scale feature map using a RetinaNet architecture to determine the digital region, i.e., the boundary information of the face value. For example, the backbone network in the detection module extracts multiple layers of basic features of the local image; then, the FPN in the detection module fuses these multiple layers of basic features to obtain the second multi-scale feature information, where the second multi-scale feature information includes feature maps P2-P5, with each layer of the feature map having 256 channels. Based on the RetinaNet architecture, the classification branch of the detection module predicts candidate bounding boxes for the digital area, and the candidate bounding boxes are filtered using the non-maximum suppression algorithm to obtain the boundary information of the face value. The output boundary information of the face value can be in the format of [x1, y1, x2, y2, confidence], where x1 and y1 are the coordinates of the upper left corner of the bounding box, x2 and y2 are the coordinates of the lower right corner of the bounding box, and the confidence level indicates the probability that the bounding box contains a number.

[0057] The fusion mask module of the denomination recognition model then obtains denomination feature information for the local image based on the boundary information of the denomination in the local image and the second multi-scale feature information of the local image. The classification module of the denomination recognition model then determines the denomination information of the cash in the local image based on the denomination feature information. For example, based on the boundary information of the denomination, a feature vector of the digit region is extracted from the second multi-scale feature information through a RoIAlign operation. A refined mask of the digit region is generated through the Mask Head of the fusion mask module. The denomination feature information is extracted from the refined mask, which includes digit features, pattern features, and size features. Numeric features may include the shape of the digits, pattern features may include watermark and security thread features, and size features may include the ratio of the digit region to the cash region. Finally, the denomination feature information is input into the classifier of the classification module, which calculates the probability of matching the denomination feature information with preset prototypes for each currency type and denomination. The denomination category with the highest matching probability is determined as the denomination information of the cash. If the matching probability falls below a second threshold, the denomination information is marked as "pending." Through the above steps, the denomination information of the cash in each partial image can be determined based on the denomination recognition model.

[0058] Optionally, based on the currency information corresponding to the partial image, a classifier corresponding to the partial image is determined; based on the classifier corresponding to the partial image in the classification module of the denomination recognition model, the matching probability between the denomination feature information of the partial image and each preset denomination category is calculated; and the denomination category with the highest matching probability is determined as the denomination information of the partial image. Exemplarily, the classification module of the denomination recognition model can preset a classifier for each currency. As mentioned above, the partial image is cropped based on the boundary information of the cash, and the boundary information of the cash corresponds one-to-one with the currency information. Therefore, the partial image corresponds one-to-one with the currency information. Based on the currency information corresponding to the partial image, the classifier corresponding to the partial image can be determined. Then, based on the classifier corresponding to the partial image, the matching probability between the denomination feature information of the partial image and each preset denomination category can be calculated; and the denomination category with the highest matching probability is determined as the denomination information of the partial image to improve the accuracy of the denomination information.

[0059] S205: Correlate the currency information and denomination information of the same cash according to the boundary information of the cash.

[0060] For example, as mentioned above, the boundary information of cash corresponds to the currency information one by one. Therefore, the currency information and denomination information of the same cash can be combined based on the boundary information of the cash.

[0061] S206 : Under the same currency information, calculate the total amount of each denomination information corresponding to the currency information in the target image.

[0062] For example, for each currency information, the number of occurrences of each denomination information may be calculated, and then the total amount corresponding to the currency information may be obtained based on the number of occurrences and the denomination amount.

[0063] Optionally, for cash marked "pending" (currency or denomination with low confidence), its boundary information and corresponding partial image can be separately listed, prompting the user to manually confirm, for example, by clicking on the image area to enter the denomination. By setting up a separate "pending" category in this way, low-confidence targets can be dynamically filtered out, reducing the false recognition rate.

[0064] The method for determining the amount of cash provided in the embodiment of the present application is that the electronic device can detect and extract features from a target image containing cash through a currency recognition model in a pre-trained cash counting model, and determine the boundary information and currency information of each cash in the target image; then, based on the boundary information of each cash, the target image can be cropped to obtain a local image including a single cash; then, based on the denomination recognition model in the pre-trained cash counting model, the local image can be recognized to obtain the denomination information of the cash in the local image; based on the boundary information of the cash, the denomination information and currency information of the same cash can be associated, and finally, the total amount of cash corresponding to each currency information can be calculated. Through this method, on the one hand, automatic cash classification and amount calculation can be achieved through image recognition, without the need for manual counting one by one, which improves the efficiency of cash amount determination; on the other hand, it supports mixed recognition of multi-currency and multi-form cash, which improves the flexibility of cash counting; on the other hand, by utilizing the refined segmentation capability of the BlendMask model, the currency and denomination recognition models are independently trained and used, and the two models perform independent recognition tasks, and then the results are fused, which can capture the subtle features of cash, and combine global detection and local segmentation to achieve pixel-level segmentation. In the face of complex cash situations, it can improve the accuracy of currency and denomination recognition.

[0065] Figure 3 A schematic diagram of the structure of the cash amount determination device provided in this application, such as Figure 3 As shown, the cash amount determination device 300 provided in this embodiment includes:

[0066] The acquisition module 301 is configured to acquire a target image including cash, wherein the cash is banknotes and / or coins;

[0067] The processing module 302 is used to process the target image based on a preset cash counting model to obtain the currency information and denomination information of each cash in the target image; and calculate the total amount of all cash in the target image based on the currency information and denomination information; wherein, the cash counting model is obtained based on the BlendMask model training.

[0068] In one possible implementation, the cash counting model includes a currency recognition model and a denomination recognition model; the processing module 302 is configured to:

[0069] Based on the currency recognition model, the target image is detected and feature extracted to determine the boundary information and currency information of each cash in the target image; wherein the boundary information of the cash corresponds to the currency information one by one;

[0070] For each banknote, the target image is cropped based on the boundary information of the banknote to obtain a partial image including the single banknote;

[0071] For each partial image, detection and feature extraction processing are performed on the partial image based on the denomination recognition model to determine the denomination information of the cash.

[0072] In a possible implementation, the processing module 302 is configured to:

[0073] Based on the detection module of the currency recognition model, feature extraction processing is performed on the target image to obtain first multi-scale feature information; and detection processing is performed on the first multi-scale feature map to determine boundary information of each currency in the target image;

[0074] A fusion mask module based on the currency recognition model obtains currency feature information of each cash according to the boundary information of each cash and the first multi-scale feature information;

[0075] The classification module based on the currency recognition model determines the currency information of each cash according to the currency feature information of each cash.

[0076] In a possible implementation, the processing module 302 is configured to:

[0077] Based on the detection module of the face value recognition model, performing feature extraction processing on the partial image to obtain second multi-scale feature information of the partial image; and performing detection processing on the second multi-scale feature information of the partial image to determine boundary information of the face value in the partial image;

[0078] Based on the fusion mask module of the face value recognition model, the face value feature information of the partial image is obtained according to the boundary information of the face value in the partial image and the second multi-scale feature information of the partial image;

[0079] The classification module based on the denomination recognition model determines the denomination information of the cash in the partial image according to the denomination feature information of the partial image.

[0080] In a possible implementation, the partial image corresponds to the currency information in a one-to-one manner; the classification module includes multiple classifiers; the processing module 302 is configured to:

[0081] Determining a classifier corresponding to the partial image according to the currency information corresponding to the partial image;

[0082] Calculating the matching probability between the face value feature information of the partial image and each preset face value category based on the classifier corresponding to the partial image in the classification module of the face value recognition model;

[0083] The denomination category with the highest matching probability is determined as the denomination information of the cash in the partial image.

[0084] In a possible implementation, the processing module 302 is configured to:

[0085] Determining an initial cropping area based on boundary information of the cash;

[0086] Expanding the initial cropping area outward by a preset ratio to obtain a target cropping area;

[0087] The target image is cropped based on the target cropping area to obtain the partial image.

[0088] In a possible implementation, the currency information of the cash corresponds to the boundary information of the cash in a one-to-one manner; the processing module 302 is configured to:

[0089] Based on the preset cash counting model, associating currency information and denomination information of the same cash according to the boundary information of the cash;

[0090] Under the same currency information, the total amount of each denomination information corresponding to the currency information in the target image is calculated.

[0091] The cash amount determination device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.

[0092] Figure 4 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 4 As shown, the electronic device 400 provided in this embodiment includes: at least one processor 401 and a memory 402. Optionally, the electronic device 400 further includes a communication component 403. The processor 401, the memory 402 and the communication component 403 are connected via a bus.

[0093] In a specific implementation process, at least one processor 401 executes the computer-executable instructions stored in the memory 402, so that the at least one processor 401 performs the above method.

[0094] The specific implementation process of the processor 401 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.

[0095] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.

[0096] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory.

[0097] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be classified into address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.

[0098] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0099] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0100] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0101] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0102] The division of units is merely a logical functional division; actual implementations may employ alternative divisions, such as combining or integrating multiple units or components into another system, or omitting or disabling certain features. Furthermore, any direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units, either through an interface, electrical, mechanical, or other means.

[0103] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0104] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0105] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.

[0106] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0107] Finally, it should be noted that those skilled in the art will readily identify other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein. The present invention is not limited to the precise structure described above and illustrated in the accompanying drawings, and various modifications and variations may be made without departing from the scope thereof. The scope of the present invention is limited solely by the appended claims.

Claims

1. A method for determining a cash amount, characterized in that: include: Acquiring a target image including cash; wherein the cash is banknotes and / or coins; Based on a preset cash counting model, the target image is processed to obtain the currency information and denomination information of each cash in the target image; and the total amount of all cash in the target image is calculated based on the currency information and denomination information; wherein, the cash counting model is obtained based on the BlendMask model training.

2. The method according to claim 1, characterized in that The cash counting model includes a currency recognition model and a denomination recognition model; the target image is processed based on the preset cash counting model to obtain the currency information and denomination information of each cash in the target image, including: Based on the currency recognition model, the target image is detected and feature extracted to determine the boundary information and currency information of each cash in the target image; wherein the boundary information of the cash corresponds to the currency information one by one; For each banknote, the target image is cropped based on the boundary information of the banknote to obtain a partial image including the single banknote; For each partial image, detection and feature extraction processing are performed on the partial image based on the denomination recognition model to determine the denomination information of the cash.

3. The method according to claim 2, characterized in that The detecting and feature extraction processing of the target image based on the currency recognition model to determine the boundary information and currency information of each cash in the target image includes: Based on the detection module of the currency recognition model, feature extraction processing is performed on the target image to obtain first multi-scale feature information; and detection processing is performed on the first multi-scale feature map to determine boundary information of each currency in the target image; A fusion mask module based on the currency recognition model obtains currency feature information of each cash according to the boundary information of each cash and the first multi-scale feature information; The classification module based on the currency recognition model determines the currency information of each cash according to the currency feature information of each cash.

4. The method according to claim 2, characterized in that The detecting and feature extraction processing of the partial image based on the denomination recognition model to determine the denomination information of the cash includes: Based on the detection module of the face value recognition model, performing feature extraction processing on the partial image to obtain second multi-scale feature information of the partial image; and performing detection processing on the second multi-scale feature information of the partial image to determine boundary information of the face value in the partial image; Based on the fusion mask module of the face value recognition model, the face value feature information of the partial image is obtained according to the boundary information of the face value in the partial image and the second multi-scale feature information of the partial image; The classification module based on the denomination recognition model determines the denomination information of the cash in the partial image according to the denomination feature information of the partial image.

5. The method according to claim 4, characterized in that The partial image corresponds to the currency information in a one-to-one manner; the classification module includes multiple classifiers; the classification module based on the denomination recognition model determines the denomination information of the cash in the partial image according to the denomination feature information of the partial image, including: Determining a classifier corresponding to the partial image according to the currency information corresponding to the partial image; Calculating the matching probability between the face value feature information of the partial image and each preset face value category based on the classifier corresponding to the partial image in the classification module of the face value recognition model; The denomination category with the highest matching probability is determined as the denomination information of the cash in the partial image.

6. The method according to claim 2, characterized in that The target image is cropped based on the boundary information of the cash to obtain a partial image including a single cash piece, including: Determining an initial cropping area based on boundary information of the cash; Expanding the initial cropping area outward by a preset ratio to obtain a target cropping area; The target image is cropped based on the target cropping area to obtain the partial image.

7. The method according to any one of claims 1 to 6, characterized in that The currency information of the cash corresponds to the boundary information of the cash in a one-to-one manner; the total amount of all cash in the target image is calculated based on the currency information and the denomination information based on the preset cash counting model, including: Based on the preset cash counting model, associating currency information and denomination information of the same cash according to the boundary information of the cash; Under the same currency information, the total amount of each denomination information corresponding to the currency information in the target image is calculated.

8. A device for determining a cash amount, characterized in that: include: An acquisition module, configured to acquire a target image including cash; wherein the cash is banknotes and / or coins; A processing module is used to process the target image based on a preset cash counting model to obtain the currency information and denomination information of each cash in the target image; and calculate the total amount of all cash in the target image based on the currency information and denomination information; wherein, the cash counting model is obtained by training based on the BlendMask model.

9. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.