Bank flow document identification method, apparatus and device, and storage medium
By using regional detection model and adaptive threshold adjustment processing in bank statement recognition technology, the identification problem of bank statement documents without templates or form lines is solved, and the recognition effect of high accuracy and low error rate is achieved.
Patent Information
- Application Number
- CN202510024466.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-05-09
AI Technical Summary
When existing bank statement recognition technology faces bank statement documents without templates or table lines, it is difficult to accurately locate and analyze data, resulting in low recognition rate and high error rate.
The area detection model is used to detect the text information area in the bank statement image, and the target area is optimized through adaptive threshold adjustment processing, and finally the recognition processing is performed using ORC image recognition technology.
When facing bank statement images without forms, the bank statement data in the image can be accurately positioned and parsed, which improves the recognition rate and reduces the error rate.
Smart Images

Figure CN119964179A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and in particular to a bank statement identification method, device, equipment and storage medium. Background Art
[0002] Bank statement recognition technology refers to the technology that uses optical character recognition (OCR) technology and related artificial intelligence algorithms to automatically recognize and extract text, numbers, tables and other information in bank statement documents.
[0003] Most of the existing bank statement recognition technologies rely on a preset table structure. For example, a template is pre-established to complete the data recognition of the bank statement by identifying the fixed format information at a specific location in the bank statement document.
[0004] However, when faced with bank statements without templates or table lines, the above methods often have difficulty in accurately locating and parsing data due to the lack of clear segmentation basis, resulting in low recognition rate and high error rate. Summary of the invention
[0005] The present application provides a bank statement recognition method, device, equipment and storage medium to solve the problem in the prior art that when faced with bank statement documents without templates or table lines, it is often difficult to accurately locate and parse data due to the lack of clear segmentation basis, resulting in low recognition rate and high error rate.
[0006] In a first aspect, the present application provides a method for identifying a bank statement, the method comprising:
[0007] Acquire a bank flow image, and pre-process the bank flow image;
[0008] Inputting the preprocessed bank flow image into a region detection model to obtain a detection result output by the region detection model, wherein the detection result is used to indicate a plurality of target regions containing text information in the bank flow image;
[0009] Performing adaptive threshold adjustment processing on the plurality of target areas to obtain the plurality of optimized target areas;
[0010] Based on the ORC image recognition technology, bank statements within the multiple target areas are identified and processed.
[0011] In a possible implementation, the performing adaptive threshold adjustment processing on the multiple target areas to obtain the multiple optimized target areas includes:
[0012] Performing grayscale processing on the plurality of target areas, and determining a grayscale value corresponding to each target area;
[0013] For any one target area among the multiple target areas, determine multiple neighborhoods corresponding to the target area, and use an average grayscale value of grayscale values corresponding to the multiple neighborhoods as an adjustment threshold of the target area;
[0014] Based on the adjustment threshold, an adaptive threshold adjustment process is performed on the target area to obtain the optimized target area.
[0015] In a possible implementation, before acquiring the bank statement image, the method further includes:
[0016] Acquire multiple historical images of bank statements and annotation data corresponding to each historical image, wherein the multiple historical images include images of multiple styles and formats, and the annotation data is used to indicate data information in the corresponding historical image;
[0017] The detection model is trained using a plurality of the historical images and the corresponding annotation data to obtain the trained regional detection model.
[0018] In a possible implementation, a plurality of the historical images and the corresponding annotation data are used to train a detection model to obtain the trained regional detection model, including:
[0019] Taking the plurality of historical images as input data and the plurality of annotated data as output data, the detection model is trained and processed according to the input data and the output data until the loss function of the detection model reaches a preset value or the number of training iterations reaches an upper limit of the iteration, wherein the annotated data includes: the bounding box coordinates and the pixel-level mask of the historical image.
[0020] In a possible implementation, after the bank statements in the target area are identified based on the ORC image recognition technology, the method further includes:
[0021] The identified data is verified by a data verification component to obtain a verification result, wherein the data verification component is a pluggable structure;
[0022] According to the verification result, the identified data is filtered to obtain text data corresponding to the bank statement image.
[0023] In a possible implementation, the data verification component includes at least one of the following: a date verification unit, an amount range verification unit, an account information consistency unit, and a context logic verification unit; the identified data includes: identification data, a data type of the identification data, and a timestamp; the data verification component verifies the identified data to obtain a verification result, including:
[0024] In the case where the data verification component includes a date verification unit, the date verification unit is used to perform date rationality verification on the identification data whose data type is date, to obtain a first verification result;
[0025] In the case where the data verification component includes an amount range verification unit, the amount range verification unit is used to perform verification processing on the identification data whose data type is the amount according to the preset amount range to obtain a second verification result;
[0026] In the case where the data verification component includes an account information consistency unit, the account information consistency unit is used to perform consistency verification on the identification data in the same flow to obtain a third verification result;
[0027] In the case where the data verification component includes a context logic verification unit, the context logic verification unit is used to perform logic verification on the corresponding identification data based on the data type and timestamp of the identification data to obtain a fourth verification result, and the verification logic includes at least one of the following: data type logic, balance verification logic, account status verification logic, time series logic, and time verification logic.
[0028] In a possible implementation, the preprocessing of the bank statement image includes:
[0029] Performing image enhancement processing on the bank flow image;
[0030] The image enhancement processing includes at least one of the following: denoising processing, histogram equalization processing, brightness adjustment and contrast adjustment.
[0031] In a second aspect, the present application provides a bank statement recognition device, the device comprising:
[0032] An acquisition module is used to acquire bank flow images;
[0033] A processing module, used for preprocessing the bank flow image;
[0034] A detection module, used for inputting the preprocessed bank flow image into the region detection model to obtain the detection result output by the region detection model, wherein the detection result is used for indicating a plurality of target regions containing important information in the bank flow image;
[0035] The processing module is further used to perform adaptive threshold adjustment processing on the multiple target areas to obtain the multiple optimized target areas;
[0036] The processing module is also used to identify and process bank statements within the multiple target areas based on ORC image recognition technology.
[0037] In one possible implementation, the processing module is used to perform grayscale processing on the multiple target areas and determine the grayscale value corresponding to each target area; for any target area among the multiple target areas, determine the multiple neighborhoods corresponding to the target area, and use the average grayscale value of the grayscale values corresponding to the multiple neighborhoods as the adjustment threshold of the target area; based on the adjustment threshold, perform adaptive threshold adjustment processing on the target area to obtain the optimized target area.
[0038] In a possible implementation, the acquisition module is further used to acquire multiple historical images of bank statements and annotation data corresponding to each historical image, wherein the multiple historical images include images of multiple styles and formats, and the annotation data is used to indicate data information in the corresponding historical image;
[0039] The processing module is also used to use the multiple historical images and corresponding annotation data to train the detection model to obtain the trained regional detection model.
[0040] In a possible implementation, the processing module is also used to take the multiple historical images as input data and the multiple annotated data as output data, and train the detection model according to the input data and the output data until the loss function of the detection model reaches a preset value or the number of training iterations reaches an upper limit of the iteration, wherein the annotated data includes: bounding box coordinates and pixel-level masks of the historical images.
[0041] In a possible implementation, the processing module is also used to verify the identified data through a data verification component to obtain a verification result, wherein the data verification component is a pluggable structure; based on the verification result, the identified data is filtered to obtain text data corresponding to the bank flow image.
[0042] In a possible implementation, the data verification component includes at least one of the following: a date verification unit, an amount range verification unit, an account information consistency unit, and a context logic verification unit; the identified data includes: identification data, a data type of the identification data, and a timestamp;
[0043] The processing module is used for, when the data verification component includes a date verification unit, using the date verification unit to perform date rationality verification on the identification data whose data type is date, to obtain a first verification result;
[0044] In the case where the data verification component includes an amount range verification unit, the amount range verification unit is used to perform verification processing on the identification data whose data type is the amount according to the preset amount range to obtain a second verification result;
[0045] In the case where the data verification component includes an account information consistency unit, the account information consistency unit is used to perform consistency verification on the identification data in the same flow to obtain a third verification result;
[0046] In the case where the data verification component includes a context logic verification unit, the context logic verification unit is used to perform logic verification on the corresponding identification data based on the data type and timestamp of the identification data to obtain a fourth verification result, and the verification logic includes at least one of the following: data type logic, balance verification logic, account status verification logic, time series logic, and time verification logic.
[0047] In a possible implementation, the processing module is used to perform image enhancement processing on the bank flow image; wherein the image enhancement processing includes at least one of the following: denoising processing, histogram equalization processing, brightness adjustment, and contrast adjustment.
[0048] In a third aspect, the present application provides an electronic device, characterized in that it includes: a processor, and a memory communicatively connected to the processor;
[0049] The memory stores computer-executable instructions;
[0050] The processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect and various possible implementation methods of the first aspect.
[0051] In a fourth aspect, the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the method described in the first aspect and various possible implementation methods of the first aspect.
[0052] In a fifth aspect, the present application provides a computer program product, characterized in that it includes a computer program, which, when executed by a processor, implements the method described in the first aspect and various possible implementation methods of the first aspect.
[0053] The bank statement recognition method, device, equipment and storage medium provided in the present application obtain a bank statement image and pre-process the bank statement image; input the pre-processed bank statement image into a region detection model to obtain a detection result output by the region detection model; perform adaptive threshold adjustment processing on multiple target areas to obtain multiple optimized target areas; based on ORC image recognition technology, recognize and process the bank statements in multiple target areas, which solves the defects of low recognition rate and high error rate in the prior art, and achieves the effect of being able to accurately locate and parse the bank statement data in the image when facing a bank statement image without a table. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] 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.
[0055] Figure 1 A schematic diagram of a bank statement identification method provided in an embodiment of the present application Figure 1 ;
[0056] Figure 2 A schematic diagram of a bank statement identification method provided in an embodiment of the present application Figure 2 ;
[0057] Figure 3 A schematic diagram of the structure of a bank statement recognition device provided in an embodiment of the present application;
[0058] Figure 4 A schematic diagram of the structure of a bank statement recognition device provided in an embodiment of the present application.
[0059] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0060] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0061] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0062] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, products or devices.
[0063] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0064] In addition, this application involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and the use of artificial intelligence technology for automated decision-making, and a technical solution for making decisions that have a significant impact on personal rights and interests based on the results of automated decision-making. The application provides users with corresponding operation entrances for them to choose to agree or reject the results of automated decision-making; if the user chooses to reject, the expert decision-making process will be entered.
[0065] It should be noted that the bank statement identification method, device, equipment and storage medium provided in this application can be used in the field of financial technology, and can also be used in any field other than financial technology. The application field of the bank statement identification method, device, equipment and storage medium in this application is not limited.
[0066] Bank statement recognition technology refers to the technology that uses optical character recognition technology and related artificial intelligence algorithms to automatically identify and extract text, numbers, tables and other information in bank statement documents.
[0067] Most of the existing bank statement recognition technologies rely on a preset table structure. For example, a template is pre-established to complete the data recognition of the bank statement by identifying the fixed format information at a specific location in the bank statement document.
[0068] However, when faced with bank statements without templates or table lines, the above methods often have difficulty in accurately locating and parsing data due to the lack of clear segmentation basis, resulting in low recognition rate and high error rate.
[0069] In response to the above-mentioned problems, the present application provides a bank statement recognition method, device, equipment and storage medium, which adopts a regional detection model to determine multiple areas containing important text information in a bank statement image, and then adopts CRC image recognition technology to identify the bank statement data in each area; when faced with a bank statement image without a table, this method can accurately locate and parse the bank statement data in the image, solving the defects of low recognition rate and high error rate in the prior art.
[0070] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. 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.
[0071] Figure 1 A schematic diagram of a bank statement identification method provided in an embodiment of the present application Figure 1 .like Figure 1 As shown, the bank statement identification method provided in the embodiment of the present application includes:
[0072] S101: Acquire a bank statement image, and pre-process the bank statement image.
[0073] Among them, the bank flow image usually contains text data. In the present embodiment, it can be, for example, an ORC (Optical Character Recognition) image. It can be understood that the text in the ORC image shown in the present embodiment can include, for example, multiple languages, fonts, font sizes and writing styles. For example: it may contain different languages and texts such as Chinese, English, Arabic, etc. The fonts can be Songti, Heiti, etc., and the font sizes are also different. The writing styles can include, for example, printed text, handwritten text, etc., and this application does not impose any restrictions on this. At the same time, the bank flow image can be an image containing a specific format, or it can be an image without a table.
[0074] After the bank statement image is obtained, it is necessary to pre-process the bank statement image to make the text data in the image clearer and more accurate.
[0075] In a possible implementation, the preprocessing may be, for example, image enhancement processing, and specifically, may be at least one of denoising processing, histogram equalization processing, brightness adjustment, and contrast adjustment.
[0076] The above processing method is described in detail below.
[0077] Histogram equalization: By redistributing the pixel intensity values of the image, the grayscale distribution of the image is made more uniform, thereby improving the contrast and visual effect of the image. In the process of processing the bank flow image, histogram equalization can increase the global contrast of the image, making the difference between the text and the background more obvious.
[0078] Denoising: used to reduce random noise in bank statement images, such as salt and pepper noise or Gaussian noise. In the process of processing bank statement images, denoising can remove the noise introduced during scanning or shooting and improve the clarity of the text.
[0079] Brightness adjustment: used to change the overall brightness of the image. If the bank flow image is too dark or too bright, you can improve the visibility of the image by adjusting the brightness. This pre-processing process can ensure a good contrast between the text and the background.
[0080] Contrast adjustment: used to enhance the differences between different areas in the image and make the image details more prominent. In the process of processing bank flow images, appropriate contrast adjustment can make the text clearer and facilitate subsequent character recognition.
[0081] The purpose of preprocessing the bank statement image in this step is to improve the quality of the bank statement image and provide a good foundation for subsequent character recognition and data extraction.
[0082] S102: Input the preprocessed bank flow image into the region detection model to obtain the detection result output by the region detection model.
[0083] The detection result is used to indicate multiple target areas containing text information in the bank flow image.
[0084] It is understandable that there are blank areas and target areas in the bank flow image. The blank area refers to the background area that does not contain text. The region detection model can detect and identify the target area containing text in the image and generate a fine segmentation mask.
[0085] It is understandable that when the regional detection model is performing detection processing, sensitive data can be desensitized.
[0086] S103: performing adaptive threshold adjustment processing on the plurality of target regions to obtain the plurality of optimized target regions.
[0087] Among them, since the bank flow image may have problems such as uneven lighting, shadows or texture changes, the region detection model cannot accurately determine the target area. In other words, the target area detected by the region detection model may have blank areas caused by uneven lighting, shadows or texture changes.
[0088] Therefore, after obtaining the target area output by the region detection model, it is necessary to perform adaptive threshold adjustment processing on multiple target areas to avoid the blank area caused by uneven lighting, shadow or texture changes from being mistakenly detected as the target area.
[0089] Adaptive threshold adjustment processing can be used to optimize text segmentation for images with uneven lighting or complex backgrounds to more accurately distinguish between text areas and non-text areas.
[0090] The adaptive threshold adjustment process in this embodiment may be, for example, a global adaptive threshold adjustment or a local adaptive threshold adjustment, which is not limited in this application.
[0091] S104: Based on the ORC image recognition technology, the bank statements in the target area are identified and processed.
[0092] Among them, ORC image recognition technology can be, for example, optical character recognition (OCR) technology. This technology is a technology that converts text in an image into a computer-editable text format. Its basic principle is to process images containing text and recognize characters using features such as character shape, structure, and texture.
[0093] In this step, the sub-images corresponding to the multiple target areas can be input into the OCR engine to obtain the text string, and then the text string can be parsed through regular expressions, keyword searches or natural language processing (NLP) and other technologies to identify the text data in the bank statement image.
[0094] It can be understood that the recognized text data may include, for example, date, account, transaction type, counterparty, amount, transaction bank and other data.
[0095] The bank statement recognition method provided in the embodiment of the present application obtains a bank statement image and pre-processes the bank statement image; inputs the pre-processed bank statement image into a region detection model to obtain a detection result output by the region detection model; performs adaptive threshold adjustment processing on multiple target areas to obtain multiple optimized target areas; and recognizes and processes the bank statements in the multiple target areas based on ORC image recognition technology, thereby solving the defects of low recognition rate and high error rate in the prior art and achieving the effect of accurately locating and parsing the bank statement data in the image when facing a bank statement image without a table.
[0096] Figure 2 A schematic diagram of a bank statement identification method provided in an embodiment of the present application Figure 2 This embodiment is in Figure 1 Based on the embodiment, a possible implementation of the bank statement identification method is explained. Figure 2 As shown, the method includes:
[0097] S201: Acquire multiple historical images of bank statements and the annotation data corresponding to each historical image.
[0098] The multiple historical images may be, for example, images containing multiple styles and formats; the annotation data is used to indicate data information in the corresponding historical images.
[0099] It is understandable that the multiple historical images obtained were processed as follows: Figure 1 The purpose of the preprocessing shown in the embodiment is to ensure the accuracy of subsequent model training.
[0100] The annotated data may be, for example, data that is manually annotated, or may be obtained through annotating a big data model, and the annotated content may include, for example: location information and / or attribute information of the text data. The location information may, for example, be: the coordinates of the bounding box where the text data in the historical image is located. The attribute information may, for example, include: the data type corresponding to the text data. The specific implementation of the annotation may, for example, be: annotating the amount text data as: "amount", annotating the account text data as: "account information", annotating the date text data as: "date", etc. The annotated data may also be an annotation of attributes such as "transaction type" and "counterparty", which is not limited in this application.
[0101] S202: Using the plurality of historical images and corresponding annotation data, the detection model is trained to obtain the trained regional detection model.
[0102] Among them, since there is corresponding annotation data for the text data in multiple historical images, the detection model can be trained and processed based on multiple historical images and the corresponding annotation data, so that the detection model can be capable of detecting areas containing text data in the image.
[0103] In one possible implementation, multiple historical images can be used as input data, and multiple annotated data can be used as output data. The detection model can be trained according to the input data and output data until the loss function of the detection model reaches a preset value or the number of training iterations reaches an upper limit of the iteration.
[0104] It can be understood that in this scenario, the annotation data may include: bounding box coordinates and pixel-level masks of the historical image.
[0105] The input data may be divided into, for example, a training set, a validation set, and a test set, and the ratio thereof may be, for example, 80%-10%-10%.
[0106] The detection model is trained through the training set, that is, the detection model learns features and patterns from the training set and adjusts its parameters to minimize the loss function; after the training is completed, the hyperparameters of the detection model are adjusted based on the validation set, model selection is performed, and overfitting during the training process is monitored. During the training process, the detection model will be evaluated on the validation set to adjust the learning rate, regularization parameters, etc.; the test set is an independent data set used to evaluate the final performance of the model after the model training is completed. It provides an unbiased estimate of the model's generalization ability. The partitioning strategy uses random partitioning, randomly shuffles the data, and then distributes it to the training set, validation set, and test set in proportion, which helps to ensure the representativeness of each subset.
[0107] S203: Acquire a bank statement image, and pre-process the bank statement image.
[0108] S204: Input the preprocessed bank flow image into the region detection model to obtain the detection result output by the region detection model.
[0109] Among them, step S203-step S204 are similar to the above-mentioned step S101-step S102, and will not be repeated here.
[0110] S205: Perform grayscale processing on the multiple target areas, and determine the grayscale value corresponding to each target area.
[0111] The grayscale values corresponding to different target areas may be the same or different, depending on whether the target area contains text data.
[0112] It can be understood that the text sub-region and the non-text sub-region in the target region have different grayscale values, and the grayscale value of the target region can be determined based on the proportion or position of the text sub-region and the non-text sub-region in the target region.
[0113] S206: For any one target area among the multiple target areas, determine multiple neighborhoods corresponding to the target area, and use an average grayscale value of grayscale values corresponding to the multiple neighborhoods as an adjustment threshold of the target area.
[0114] The adjustment threshold of the target area can be determined by the following formula:
[0115] T(x,y)=μ(x,y)+C
[0116] Wherein, T(x,y) is the adaptive threshold of region (x,y); μ(x,y) is the average grayscale value of multiple neighborhoods in an n×n window centered on region (x,y); C is a constant used to adjust the threshold, which can be positive or negative.
[0117] S207: Based on the adjustment threshold, perform adaptive threshold adjustment processing on the target area to obtain the optimized target area.
[0118] Among them, after obtaining the adjustment threshold of the target area, for each pixel in the target area, if its grayscale value is greater than or equal to the adjustment threshold T(x, y), the pixel is marked as foreground (for example, white), otherwise it is marked as background (for example, black), so as to obtain the optimized target area.
[0119] S208: Based on the ORC image recognition technology, the bank statements in the target areas are identified and processed.
[0120] Among them, step S208 is similar to the above-mentioned step S104 and will not be repeated here.
[0121] S209: Verify the identified data through the data verification component to obtain a verification result.
[0122] The data verification component may be a pluggable structure, for example. After obtaining the identification data, the identification data needs to be verified to ensure the accuracy of the identification data.
[0123] In a possible implementation, the data verification component includes at least one of the following: a date verification unit, an amount range verification unit, an account information consistency unit, and a context logic verification unit;
[0124] When the identified data is verified, for example, one or more of the above-mentioned units may be used to implement it.
[0125] The implementation process of each unit is described in detail below.
[0126] In the case where the data verification component includes a date verification unit, the date verification unit is used to perform date rationality verification on the identification data whose data type is date, and obtain a first verification result.
[0127] The first verification result is used to indicate whether the date of the recognized text data is reasonable, and / or unreasonable date data.
[0128] In the case where the data verification component includes an amount range verification unit, the amount range verification unit is used to perform verification processing on the identification data whose data type is amount according to a preset amount range to obtain a second verification result.
[0129] The second verification result is used to indicate whether the amount of the recognized text data is within a preset amount range, whether the amount format is correct, etc.
[0130] In the case where the data verification component includes an account information consistency unit, the account information consistency unit is used to perform consistency verification on the identification data in the same flow to obtain a third verification result.
[0131] The third verification result is used to indicate whether the recognition data in the same flow in the recognized text data meets the consistency principle.
[0132] In the case where the data verification component includes a context logic verification unit, the context logic verification unit is used to perform logic verification on the corresponding identification data based on the data type and timestamp of the identification data to obtain a fourth verification result, and the verification logic includes at least one of the following: data type logic, balance verification logic, account status verification logic, time series logic, and time verification logic.
[0133] It is understandable that the above-mentioned multiple verification processes described in this step can be used alone or in combination. In the scenario where the above-mentioned multiple verification processes are used in combination, the bank flow data identified is more accurate because multiple verification methods are used for verification.
[0134] S210: According to the verification result, the identified data is filtered to obtain text data corresponding to the bank statement image.
[0135] The bank statement recognition method provided in this embodiment determines the adjustment threshold of the target area based on the average grayscale value of multiple neighborhoods of each target area, thereby making the adaptive threshold adjustment result of the target area more accurate; at the same time, after obtaining the recognition result using ORC image recognition technology, the recognized data is verified based on a plug-in data verification component, thereby making the determined bank statement text data more accurate.
[0136] Figure 3 This is a schematic diagram of the structure of a bank statement recognition device provided in an embodiment of the present application. Figure 3 As shown, the bank statement identification device 300 includes:
[0137] An acquisition module 301 is used to acquire a bank statement image;
[0138] A processing module 302, used for pre-processing the bank flow image;
[0139] The detection module 303 is used to input the preprocessed bank flow image into the region detection model to obtain the detection result output by the region detection model, and the detection result is used to indicate multiple target areas containing important information in the bank flow image;
[0140] The processing module 302 is further used to perform adaptive threshold adjustment processing on the multiple target areas to obtain the multiple optimized target areas;
[0141] The processing module 302 is also used to identify and process bank statements within the target areas based on ORC image recognition technology.
[0142] In one possible implementation, the processing module 302 is used to perform grayscale processing on the multiple target areas and determine the grayscale value corresponding to each target area; for any target area among the multiple target areas, determine the multiple neighborhoods corresponding to the target area, and use the average grayscale value of the grayscale values corresponding to the multiple neighborhoods as the adjustment threshold of the target area; based on the adjustment threshold, perform adaptive threshold adjustment processing on the target area to obtain the optimized target area.
[0143] In a possible implementation, the acquisition module 301 is further used to acquire multiple historical images of bank statements and annotation data corresponding to each historical image, wherein the multiple historical images include images of multiple styles and formats, and the annotation data is used to indicate data information in the corresponding historical image;
[0144] The processing module 302 is further used to use the plurality of historical images and corresponding annotation data to train the detection model to obtain the trained regional detection model.
[0145] In one possible implementation, the processing module 302 is also used to use multiple historical images as input data and multiple annotated data as output data, and train the detection model according to the input data and the output data until the loss function of the detection model reaches a preset value or the number of training iterations reaches an upper limit of the iteration, wherein the annotated data includes: bounding box coordinates and pixel-level masks of the historical images.
[0146] In a possible implementation, the processing module 302 is also used to verify the identified data through a data verification component to obtain a verification result, wherein the data verification component is a pluggable structure; based on the verification result, the identified data is filtered to obtain text data corresponding to the bank flow image.
[0147] In a possible implementation, the data verification component includes at least one of the following: a date verification unit, an amount range verification unit, an account information consistency unit, and a context logic verification unit; the identified data includes: identification data, a data type of the identification data, and a timestamp;
[0148] The processing module 302 is used for, when the data verification component includes a date verification unit, using the date verification unit to perform date rationality verification on the identification data whose data type is date, to obtain a first verification result;
[0149] In the case where the data verification component includes an amount range verification unit, the amount range verification unit is used to perform verification processing on the identification data whose data type is the amount according to the preset amount range to obtain a second verification result;
[0150] In the case where the data verification component includes an account information consistency unit, the account information consistency unit is used to perform consistency verification on the identification data in the same flow to obtain a third verification result;
[0151] In the case where the data verification component includes a context logic verification unit, the context logic verification unit is used to perform logic verification on the corresponding identification data based on the data type and timestamp of the identification data to obtain a fourth verification result, and the verification logic includes at least one of the following: data type logic, balance verification logic, account status verification logic, time series logic, and time verification logic.
[0152] In a possible implementation, the processing module 302 is used to perform image enhancement processing on the bank flow image; wherein the image enhancement processing includes at least one of the following: denoising processing, histogram equalization processing, brightness adjustment, and contrast adjustment.
[0153] The present embodiment provides a bank statement recognition device that can execute the bank statement recognition 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.
[0154] Figure 4 This is a schematic diagram of the structure of a bank statement recognition device provided in an embodiment of the present application. Figure 4 As shown, the electronic device 400 may include at least one processor 401, at least one storage medium 402, and a communication interface 403. Among them, the at least one processor 401 is used to implement the method provided by the above embodiment of the present application.
[0155] At least one memory 402 is used to store program instructions and / or data. The memory 402 is coupled to the processor 401. The coupling in the embodiment of the present application is an indirect coupling or communication connection between devices, units or modules, which can be electrical, mechanical or other forms, and is used for information exchange between devices, units or modules. The processor 401 may operate in conjunction with the memory 402. The processor 401 may execute program instructions stored in the memory 402. At least one of the at least one memory may be included in the processor.
[0156] The communication interface 403 is used to communicate with other devices through a transmission medium, so that the electronic device 400 can communicate with other devices. The communication interface 403 can be, for example, a transceiver, an interface, a bus, a circuit, or a device capable of implementing a transceiver function. The processor 401 can use the communication interface 403 to send and receive data and / or information, and is used to implement the method provided in the above embodiment of the present application. Please refer to the detailed description in the previous embodiment for details, which will not be repeated here.
[0157] The specific connection medium between the processor 401, the memory 402 and the communication interface 403 is not limited in the embodiment of the present application. Figure 4In the embodiment, the processor 401, the memory 402 and the communication interface 403 are connected via a bus 404. The bus 404 is Figure 4 The connection between other components is only for illustration and is not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0158] A computer-readable storage medium is also provided in an embodiment of the present application, on which a computer program is stored. When the computer program is executed by a processor, the technical solution of the above-mentioned method embodiment is implemented. The implementation principle and technical effect are similar and will not be repeated here.
[0159] A computer program product is also provided in an embodiment of the present application, including a computer program. When the computer program is executed by a processor, the technical solution of the above-mentioned method embodiment is implemented. The implementation principle and technical effect are similar and will not be repeated here.
[0160] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0161] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0162] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0163] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0164] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0165] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0166] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0167] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0168] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A bank statement identification method, characterized in that: The method comprises: Acquire a bank flow image, and pre-process the bank flow image; Inputting the preprocessed bank flow image into a region detection model to obtain a detection result output by the region detection model, wherein the detection result is used to indicate a plurality of target regions containing text information in the bank flow image; Performing adaptive threshold adjustment processing on the plurality of target areas to obtain the plurality of optimized target areas; Based on the ORC image recognition technology, bank statements within the multiple target areas are identified and processed.
2. The method according to claim 1, characterized in that The step of performing adaptive threshold adjustment processing on the plurality of target areas to obtain the plurality of optimized target areas comprises: Performing grayscale processing on the plurality of target areas, and determining a grayscale value corresponding to each target area; For any one target area among the multiple target areas, determine multiple neighborhoods corresponding to the target area, and use an average grayscale value of grayscale values corresponding to the multiple neighborhoods as an adjustment threshold of the target area; Based on the adjustment threshold, an adaptive threshold adjustment process is performed on the target area to obtain the optimized target area.
3. The method according to claim 1, characterized in that Before obtaining the bank statement image, the method further includes: Acquire multiple historical images of bank statements and annotation data corresponding to each historical image, wherein the multiple historical images include images of multiple styles and formats, and the annotation data is used to indicate data information in the corresponding historical image; The detection model is trained using a plurality of the historical images and the corresponding annotation data to obtain the trained regional detection model.
4. The method according to claim 3, characterized in that The detection model is trained using the plurality of historical images and the corresponding annotation data to obtain the trained regional detection model, including: Taking the plurality of historical images as input data and the plurality of annotated data as output data, the detection model is trained and processed according to the input data and the output data until the loss function of the detection model reaches a preset value or the number of training iterations reaches an upper limit of the iteration, wherein the annotated data includes: the bounding box coordinates and the pixel-level mask of the historical image.
5. The method according to claim 1, characterized in that After the bank statements in the target area are identified based on the ORC image recognition technology, the method further includes: The identified data is verified by a data verification component to obtain a verification result, wherein the data verification component is a pluggable structure; According to the verification result, the identified data is filtered to obtain text data corresponding to the bank statement image.
6. The method according to claim 5, characterized in that The data verification component includes at least one of the following: a date verification unit, an amount range verification unit, an account information consistency unit, and a context logic verification unit; the identified data includes: identification data, a data type of the identification data, and a timestamp; the data verification component verifies the identified data to obtain a verification result, including: In the case where the data verification component includes a date verification unit, the date verification unit is used to perform date rationality verification on the identification data whose data type is date, to obtain a first verification result; In the case where the data verification component includes an amount range verification unit, the amount range verification unit is used to perform verification processing on the identification data whose data type is the amount according to the preset amount range to obtain a second verification result; In the case where the data verification component includes an account information consistency unit, the account information consistency unit is used to perform consistency verification on the identification data in the same flow to obtain a third verification result; In the case where the data verification component includes a context logic verification unit, the context logic verification unit is used to perform logic verification on the corresponding identification data based on the data type and timestamp of the identification data to obtain a fourth verification result, and the verification logic includes at least one of the following: data type logic, balance verification logic, account status verification logic, time series logic, and time verification logic.
7. The method according to claim 1, characterized in that The preprocessing of the bank flow image includes: Performing image enhancement processing on the bank flow image; The image enhancement processing includes at least one of the following: denoising processing, histogram equalization processing, brightness adjustment and contrast adjustment.
8. A bank statement recognition device, characterized in that: The device comprises: An acquisition module, used to acquire bank flow images; A processing module, used for preprocessing the bank flow image; A detection module, used for inputting the preprocessed bank flow image into the region detection model to obtain the detection result output by the region detection model, wherein the detection result is used for indicating a plurality of target regions containing important information in the bank flow image; The processing module is further used to perform adaptive threshold adjustment processing on the multiple target areas to obtain the multiple optimized target areas; The processing module is also used to identify and process bank statements within the multiple target areas based on ORC image recognition technology.
9. A bank statement identification device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement 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.
11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.