Bank card identification method, identification system, electronic device and storage medium
By using a bank card identification method combining target detection and text recognition models on the mobile terminal, the problem of low recognition accuracy caused by lengthy bank cards and complex background is solved, and a more efficient bank card number recognition is achieved.
Patent Information
- Application Number
- CN202210582858.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-26
- Publication Date
- 2024-11-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When using bank card optical character recognition (OCR) technology for bank card identification, there is a problem of low recognition accuracy. It is mainly because the bank card is long and the background image is complex, resulting in manual input that requires repeated identification.
A bank card recognition method is adopted to obtain the initial bank card image, use the pre-trained object detection model to perform object detection, obtain the card surface area and card number area, and judge and intercept the image angle, and combine the pre-trained text recognition model to perform text Identify and use the card number verification algorithm for verification to gradually improve the recognition accuracy.
It improves the accuracy of bank card identification by mobile terminals, reduces the introduction of redundant models, improves recognition efficiency, avoids interference from background information, and enhances the bank card number identification capability on mobile terminals.
Smart Images

Figure CN114898350B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a bank card recognition method, recognition system, electronic device and storage medium. Background Art
[0002] At present, when binding a bank card to a mobile terminal, the bank card is relatively long and the background image of the bank card is relatively complex. When manually inputting the bank card number, it is necessary to repeatedly identify the input of the card number. Therefore, it is an effective means of development to automatically identify the required bank card number from the bank card image through machine learning methods. At present, using the optical character recognition (OCR) technology of the bank card to identify the bank card number is an effective technical means. However, this technology is currently mostly deployed in the cloud or back-end model, and the mobile terminal has a low recognition accuracy when using OCR technology for bank card recognition due to its own hardware conditions. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose a bank card recognition method, recognition system, electronic device and storage medium, which can improve the accuracy of bank card recognition by a mobile terminal.
[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a bank card recognition method, the method comprising:
[0005] Obtaining an initial bank card image to be recognized;
[0006] Performing target detection on the initial bank card image using a pre-trained target detection model to obtain a first card surface area, wherein the first card surface area includes a first card number area and a first card organization logo area;
[0007] Performing image angle judgment on the first card surface area according to the first card number area and the first card organization logo area to obtain a target bank card image that meets a preset orientation state;
[0008] Capturing the target bank card image according to the first card number area to obtain a first target card number image;
[0009] Using a pre-trained text recognition model to perform text recognition on the first target card number image to obtain first card number information;
[0010] The first card number information is verified using a card number verification algorithm to obtain a target bank card number.
[0011] In some embodiments, the step of performing card number verification on the first card number information using a card number verification algorithm to obtain a target bank card number includes:
[0012] Performing card number verification on the first card number information using a card number verification algorithm to obtain a first card number verification result;
[0013] When the verification result of the first card number is successful, the target bank card number is obtained;
[0014] When the first card number verification result is a verification failure, performing background removal processing on the initial bank card image to obtain a candidate bank card image;
[0015] Performing target detection on the candidate bank card image using the target detection model to obtain a second card surface area, wherein the second card surface area includes a second card number area and a second card organization logo area;
[0016] Performing image angle judgment on the second card surface area according to the second card number area and the second card organization logo area, and obtaining a second target bank card image that meets the preset orientation state according to the result of the image angle judgment;
[0017] Capturing the second target bank card image according to the second card number area to obtain a second target card number image;
[0018] Using the text recognition model to perform text recognition on the second target card number image to obtain second card number information;
[0019] Performing card number verification on the second card number information using the card number verification algorithm to obtain a second card number verification result;
[0020] When the second card number verification result is correct, the target bank card number is obtained.
[0021] In some embodiments, the performing image angle judgment on the first card surface area according to the first card number area and the first card organization logo area to obtain a target bank card image that meets a preset orientation state includes:
[0022] Obtaining prior knowledge of the relative position of the card number area and the card organization logo area;
[0023] Performing image angle judgment on the first card surface area according to prior knowledge of the relative position between the card number area and the card organization logo area to obtain a first angle judgment result;
[0024] When the first angle judgment result is that the first card surface area meets the preset direction state, a target bank card image is obtained;
[0025] When the first angle judgment result is that the first card surface area does not satisfy the preset direction state, the image direction of the first card surface area is adjusted according to the preset direction state to obtain the target bank card image.
[0026] In some embodiments, performing image angle judgment on the first card surface area according to the prior knowledge of the relative position between the card number area and the card organization logo area to obtain a first angle judgment result includes:
[0027] Calculating the center point coordinates of the first card number area and the first card organization logo area respectively to obtain the first center point coordinates corresponding to the first card number area and the second center point coordinates corresponding to the first card organization logo area;
[0028] By using the prior knowledge of the relative position between the card number area and the card organization logo area, and according to the first center point coordinates and the second center point coordinates, the image angle of the first card surface area is judged to obtain a first angle judgment result.
[0029] In some embodiments, the target detection model is trained by:
[0030] Constructing a training sample set, wherein the training sample set includes a plurality of training samples, each training sample includes a sample image and a sample card surface area corresponding to the sample image;
[0031] Input each of the sample images into the initial detection model to perform target detection to obtain the target card surface area;
[0032] Determine a loss value according to the target card surface area and the sample card surface area;
[0033] The model parameters of the initial detection model are adjusted according to the loss value, and the adjusted model is continuously trained based on the training sample set until the loss value meets a preset training end condition, thereby obtaining a target detection model.
[0034] In some embodiments, the text recognition model includes a convolutional layer, a recurrent layer, and a transcription layer, and the using of the pre-trained text recognition model to perform text recognition on the first target card number image to obtain the first card number information includes:
[0035] Inputting the first target card number image into a pre-trained text recognition model;
[0036] Performing feature extraction on the first target card number image through the convolution layer to obtain a convolution feature vector;
[0037] Performing label prediction on the convolution feature vector through the circulation layer to obtain label distribution;
[0038] The tag distribution is feature integrated through the transcription layer to obtain the first card number information.
[0039] In some embodiments, the step of performing card number verification on the first card number information using a card number verification algorithm to obtain a target bank card number includes:
[0040] Obtain prior knowledge of card number verification;
[0041] The first card number information is verified based on the prior knowledge of the card number verification and a card number verification algorithm to obtain a target bank card number.
[0042] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a bank card recognition system, the system comprising:
[0043] An image acquisition module, used to acquire an initial bank card image to be identified;
[0044] An object detection module, configured to perform object detection on the initial bank card image using a pre-trained object detection model to obtain a first card surface area, wherein the first card surface area includes a first card number area and a first card organization logo area;
[0045] An image angle determination module, configured to determine the image angle of the first card surface area according to the first card number area and the first card organization logo area, to obtain a target bank card image that meets a preset orientation state;
[0046] An image capture module, configured to capture the target bank card image according to the first card number area to obtain a first target card number image;
[0047] A text recognition module, used to perform text recognition on the first target card number image using a pre-trained text recognition model to obtain first card number information;
[0048] The card number verification module is used to perform card number verification on the first card number information using a card number verification algorithm to obtain a target bank card number.
[0049] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application provides an electronic device, including:
[0050] at least one memory;
[0051] at least one processor;
[0052] at least one computer program;
[0053] The at least one computer program is stored in the at least one memory, and the at least one processor executes the at least one computer program to implement the bank card identification method described in the first aspect above.
[0054] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute a bank card recognition method described in the first aspect above.
[0055] The present application proposes a bank card recognition method, recognition system, electronic device and storage medium. The method obtains an initial bank card image to be recognized, performs target detection on the initial bank card image using a pre-trained target detection model, and obtains a first card face area, wherein the first card face area includes a first card number area and a first card organization logo area. In order to reduce the introduction of redundant models and improve the efficiency of bank card recognition, the image angle of the first card face area is judged according to the first card number area and the first card organization logo area, and a target bank card image that meets a preset direction state is obtained. In order to improve the recognition efficiency of the card number in the target bank card image, the target bank card image is intercepted according to the first card number area to obtain a first target card number image, and a pre-trained text recognition model is used to perform text recognition on the first target card number image to obtain the first card number information. The first card number information is verified using a card number verification algorithm to obtain the target bank card number. The present application can improve the accuracy of bank card recognition on the mobile terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 is a flow chart of a bank card identification method provided in an embodiment of the present application;
[0057] Figure 2 is a schematic diagram of the structure of an initial bank card image provided in an embodiment of the present application;
[0058] Figure 3 yes Figure 1 A first flow chart of step S160 in FIG. 1 ;
[0059] Figure 4 yes Figure 1 Flow chart of step S130 in FIG.
[0060] Figure 5 yes Figure 4 Flow chart of step S420 in FIG.
[0061] Figure 6 is a training flow chart of the target detection model provided in the embodiment of the present application;
[0062] Figure 7 yes Figure 1 Flow chart of step S150 in FIG.
[0063] Figure 8 yes Figure 1 A second flow chart of step S160 in FIG. 1 ;
[0064] Fig. 9 It is a structural diagram of a bank card recognition system provided by an embodiment of the present application;
[0065] Fig.10 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0067] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0069] First, some nouns involved in this application are analyzed:
[0070] Artificial Intelligence (AI): It is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science. AI attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0071] Luhn Algorithm: Also known as the "Modulo 10" algorithm, it is a simple checksum algorithm, generally used to verify identity codes. The Luhn algorithm verifies a string of numbers through a checksum, which is usually added to the end of the string to obtain a complete identity code.
[0072] Convolutional Recurrent Neural Network (CRNN): It is a network structure that is mainly used for end-to-end recognition of text sequences of indefinite length. It does not require cutting individual characters first, but converts text recognition into a time-dependent sequence learning problem, that is, image-based sequence recognition.
[0073] Long Short-Term Memory (LSTM): It is a time recurrent neural network that not only solves the problem that RNN cannot handle long-distance dependencies, but also solves common problems in neural networks such as gradient explosion or gradient disappearance. It is very effective in processing sequence data.
[0074] Bidirectional LSTM (Long Short-Term Memory, BiLSTM): The same input sequence is connected to the forward and backward LSTMs respectively, and then the hidden layers of the two networks are connected together and connected to the output layer for prediction.
[0075] Convolutional Neural Networks (CNN): It is a multi-layer supervised learning neural network. The convolution layer and pool sampling layer of the hidden layer are the core modules to realize the feature extraction function of the convolutional neural network. The network model uses the gradient descent method to minimize the loss function to reversely adjust the weight parameters in the network layer by layer, and improves the accuracy of the network through frequent iterative training.
[0076] Retry mechanism: During the development process, sometimes when executing certain specific operations, they cannot be executed or fail because the conditions at that time are not met. In the subsequent period of time, when the conditions are met, the corresponding operations need to be continued.
[0077] Single Shot MultiBox Detector (SSD): It is a type of target detection algorithm that does not require the region proposal stage and can directly generate the category probability and position coordinate values of the object. The final detection result can be obtained directly after a single detection, and it has the characteristics of fast detection speed.
[0078] At present, when binding a bank card to a mobile terminal, the bank card is relatively long and the background image of the bank card is relatively complex. When manually inputting the bank card number, it is necessary to repeatedly identify the input of the card number. Therefore, it is an effective means of development to automatically identify the required bank card number from the bank card image through machine learning methods. At present, using the optical character recognition (OCR) technology of the bank card to identify the bank card number is an effective technical means. However, this technology is currently mostly deployed in the cloud or back-end model, and the mobile terminal has a low recognition accuracy when using OCR technology for bank card recognition due to its own hardware conditions.
[0079] Based on this, the embodiments of the present application provide a bank card recognition method, a recognition system, an electronic device and a storage medium, which can improve the accuracy of bank card recognition on a mobile terminal.
[0080] A bank card recognition method, recognition system, electronic device and storage medium provided in an embodiment of the present application are specifically illustrated through the following embodiments. First, a bank card recognition method in an embodiment of the present application is described.
[0081] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0082] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0083] A bank card identification method provided in an embodiment of the present application relates to the field of artificial intelligence technology. A bank card identification method provided in an embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or can be configured as a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN) and big data and artificial intelligence platforms and other basic cloud computing services; the software can be an application that implements a bank card identification method, etc., but is not limited to the above forms.
[0084] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0085] See also Figure 1 , Figure 1 is an optional flow chart of a bank card recognition method provided in an embodiment of the present application. In some embodiments, a bank card recognition method may include but is not limited to steps S110 to S160. Figure 1 These six steps are introduced in detail.
[0086] Step S110, obtaining an initial bank card image to be identified;
[0087] Step S120, performing target detection on the initial bank card image using a pre-trained target detection model to obtain a first card surface area, where the first card surface area includes a first card number area and a first card organization logo area;
[0088] Step S130, judging the image angle of the first card surface area according to the first card number area and the first card organization logo area, and obtaining a target bank card image that meets a preset orientation state;
[0089] Step S140, capturing the target bank card image according to the first card number area to obtain a first target card number image;
[0090] Step S150, using a pre-trained text recognition model to perform text recognition on the first target card number image to obtain first card number information;
[0091] Step S160: Use a card number verification algorithm to verify the first card number information to obtain a target bank card number.
[0092] In step S110 of some embodiments, in order to realize the card number recognition in the bank card, first, the initial bank card image to be recognized is obtained. Specifically, the image of the bank card to be recognized is captured by an image acquisition device, such as a camera, an image scanner, etc., to obtain the initial bank card image.
[0093] In step S120 of some embodiments, in order to improve the accuracy of bank card recognition on the mobile terminal, the pre-trained target detection model is used to perform target detection on the initial bank card image to obtain the first card surface area, and the first card surface area includes the first card number area and the first card organization logo area. Specifically, since the card surface area and the card organization logo area in the bank card can realize the rapid positioning of the card number area in the bank card image, the initial bank card image is firstly subjected to target detection to determine the first card surface area, the first card number area and the first card organization logo area corresponding to the initial bank card image.
[0094] It should be noted that the target detection model includes a card surface target detection sub-model, a card number target detection sub-model, and a label target detection sub-model. Specifically, the pre-trained card surface target detection sub-model is used to perform target detection on the initial bank card image to obtain the first card surface area; the pre-trained card number target detection sub-model is used to perform target detection on the initial bank card image to obtain the first card number area; and the pre-trained label target detection sub-model is used to perform target detection on the initial bank card image to obtain the first card organization logo area, and the first card surface area includes the first card number area and the first card organization logo area. Among them, the first card organization logo area is used to distinguish the identification categories corresponding to different initial bank card images. For example, when the initial bank card image is a UnionPay card, the corresponding first card organization logo area is the UnionPay card organization logo area; when the initial bank card image is a VISA card, the corresponding first card organization logo area is the VISA card organization logo area. It should be noted that the bank card corresponding to the initial bank card image is not limited to UnionPay cards and VISA cards, which will not be repeated here.
[0095] In a specific embodiment, please refer to Figure 2 When the initial bank card image 200 is in a preset direction state, the initial bank card image 200 includes a first card face area 210, a first card number area 220 and a first card organization logo area 230. The initial bank card image 200 is subjected to target detection using a pre-trained target detection model to obtain the first card face area 210, and the first card number area 220 and the first card organization logo area 230 included in the first card face area 210.
[0096] In step S130 of some embodiments, since the direction of the bank card image in the collected target bank card image is uncertain and there are restrictions on the deployment of modules and models in the mobile terminal, the image angle of the first card face area is judged according to the first card number area and the first card organization logo area to obtain the target bank card image that meets the preset direction state. The embodiment of the present application judges the image angle of the first card face area according to the first card number area and the first card organization logo area, avoids the introduction of additional models, and improves the accuracy of bank card recognition on the mobile terminal.
[0097] It should be noted that the positive direction of the bank card can be set to a preset direction state, wherein the positive direction is represented by the current observation angle. When the first card number area is located at the upper left of the first card organization logo area, the current direction is recorded as the positive direction.
[0098] In step S140 of some embodiments, in order to improve the recognition efficiency of the target bank card image by the text recognition model and avoid interference of background information on the recognition of the first card number area, the target bank card image is intercepted according to the first card number area to obtain the first target card number image. Specifically, when the initial bank card image is subjected to target detection using the pre-trained target detection model to obtain the first card surface area, the positions of the first card number area and the first card organization logo area in the first card surface area are determined respectively, and the image is intercepted according to the position of the first card number area in the target bank card image to obtain the first target card number image.
[0099] In step S150 of some embodiments, in order to obtain the card number information in the target bank card image, a pre-trained text recognition model is used to perform text recognition on the first target card number image to obtain the first card number information. Specifically, due to the limitation of module and model deployment capacity in the mobile terminal, a text recognition model based on a CRNN network structure is used to perform text recognition on the first target card number image.
[0100] It should be noted that the traditional text recognition model based on the CRNN network structure includes a BiLSTM network, and the BiLSTM network is used to learn the semantic information of the input text. Therefore, since the embodiment of the present application uses the pre-trained text recognition model to perform text recognition on the first target card number image to obtain the first card number information, that is, it does not include the recognition of semantic information, in order to reduce the structure of the text recognition model, the embodiment of the present application can optimize the text recognition model, that is, it can remove the BiLSTM network part in the CRNN network structure, or replace the backbone network corresponding to the CNN part in the text recognition model with a lightweight Ghostnet network structure to obtain the text recognition model of the embodiment of the present application, which reduces the structure of the text recognition model and improves the efficiency of bank card recognition on the mobile terminal.
[0101] In step S160 of some embodiments, in order to more effectively realize the card number recognition in the bank card, the first card number information is verified by using a card number verification algorithm to obtain a target bank card number. Specifically, for example, the first card number information is verified by using a Luhn algorithm, that is, according to the obtained first card number information, starting from the last digit of the corresponding card number, the even digits are multiplied by the integer 2. If the result is a two-digit number, the ones digit and the tens digit are added and returned. All the returned digits are added to obtain a sum. If the first card number information for card number verification complies with the bank card number setting regulations, the sum obtained is divisible by the integer 10, and the target bank card number corresponding to the initial bank card image is obtained.
[0102] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0103] It should be noted that a bank card identification method of an embodiment of the present application can be applied to different business scenarios, including but not limited to bank card number binding, bank card information collection scenarios, and other business scenarios that require bank card identification.
[0104] See also Figure 3 , Figure 3is a flowchart of a specific method of step S160 in some embodiments of the present application. In some embodiments, step S160 includes but is not limited to steps S310 to S390. Figure 3 These nine steps are introduced in detail.
[0105] Step S310, using a card number verification algorithm to perform card number verification on the first card number information to obtain a first card number verification result;
[0106] Step S320, when the first card number verification result is successful, the target bank card number is obtained;
[0107] Step S330, when the first card number verification result is verification failure, background removal processing is performed on the initial bank card image to obtain a candidate bank card image;
[0108] Step S340, performing target detection on the candidate bank card image using a target detection model to obtain a second card surface area, where the second card surface area includes a second card number area and a second card organization logo area;
[0109] Step S350, performing image angle determination on the second card surface area according to the second card number area and the second card organization logo area, and obtaining a second target bank card image that meets a preset orientation state according to the result of the image angle determination;
[0110] Step S360, capturing the second target bank card image according to the second card number area to obtain a second target card number image;
[0111] Step S370, performing text recognition on the second target card number image using a text recognition model to obtain second card number information;
[0112] Step S380, using a card number verification algorithm to perform card number verification on the second card number information to obtain a second card number verification result;
[0113] Step S390: When the second card number verification result is correct, the target bank card number is obtained.
[0114] In step S310 and step S320 of some embodiments, in order to more effectively realize the card number recognition in the bank card, the first card number information is verified by using the card number verification algorithm to obtain the target bank card number. Specifically, for example, the first card number information is verified by using the Luhn algorithm to obtain the first card number verification result. When the first card number verification result is successful, that is, the first card number information obtained by using the text recognition model meets the bank card number setting regulations, the target bank card number is obtained. This application can improve the accuracy of bank card recognition by the mobile terminal.
[0115] In steps S330 to S390 of some embodiments, when the first card number verification result is a verification failure, a mobile terminal bank card recognition method with a Retry mechanism is introduced to improve the accuracy of bank card recognition on the mobile terminal. Specifically, in order to avoid the influence of the background area in the initial bank card image on the bank card recognition efficiency, the initial bank card image is subjected to background removal processing to obtain a candidate bank card image. The target detection model is then used to perform target detection on the candidate bank card image to obtain a second card face area, which includes a second card number area and a second card organization logo area. In order to avoid the introduction of an additional model on the mobile terminal, the image angle of the second card face area is judged according to the second card number area and the second card organization logo area, and the second target bank card image that meets the preset direction state is obtained according to the result of the image angle judgment. And the second target bank card image is image-intercepted according to the second card number area to obtain a second target card number image. In order to improve the accuracy of bank card recognition on the mobile terminal, the text recognition model is used to perform text recognition on the second target card number image to obtain the second card number information, and the card number verification algorithm is used to perform card number verification on the second card number information to obtain the second card number verification result. When the second card number verification result is that the verification is correct, the target bank card number is obtained. This application introduces a Retry mechanism to perform bank card recognition again on the initial bank card image whose first card number verification result is verification failure, thereby improving the accuracy of bank card recognition on the mobile terminal.
[0116] See also Figure 4 , Figure 4 is a flowchart of a specific method of step S130 in some embodiments of the present application. In some embodiments, step S130 specifically includes but is not limited to steps S410 to S440. Figure 4 These four steps are introduced in detail.
[0117] Step S410, obtaining prior knowledge of the relative position between the card number area and the card organization logo area;
[0118] Step S420, performing image angle judgment on the first card surface area according to the prior knowledge of the relative position between the card number area and the card organization logo area, and obtaining a first angle judgment result;
[0119] Step S430, when the first angle judgment result is that the first card surface area meets the preset direction state, a target bank card image is obtained;
[0120] Step S440: When the first angle judgment result is that the first card surface area does not satisfy the preset direction state, the image direction of the first card surface area is adjusted according to the preset direction state to obtain a target bank card image.
[0121] In steps S410 to S440 of some embodiments, in order to improve the accuracy of bank card recognition on the mobile terminal, by obtaining the prior knowledge of the relative position of the card number area and the card organization logo area, the image angle judgment is performed on the first card surface area according to the prior knowledge of the relative position of the card number area and the card organization logo area, and the first angle judgment result is obtained. Specifically, since the first card surface area includes the first card number area and the first card organization logo area, the first angle judgment result is obtained by detecting the aspect ratio in the first card number area. When the first angle judgment result is that the initial bank card image meets the preset direction state, the target bank card image is obtained. When the first angle judgment result is that the first card surface area does not meet the preset direction state, the image direction of the first card surface area is adjusted according to the preset direction state, for example, the image direction of the first card surface area corresponding to the initial bank card image is adjusted using a rotation correction algorithm to obtain the target bank card image. The present application realizes the image direction judgment function of the first card surface area by using the prior knowledge of the relative position of the card number area and the card organization logo area, reduces the introduction of additional models, and improves the accuracy of bank card recognition on the mobile terminal.
[0122] It should be noted that the positive direction of the bank card can be set to a preset direction state, wherein the positive direction is represented by the current observation angle. When the first card number area is located at the upper left of the first card organization logo area, the current direction is recorded as the positive direction.
[0123] It should be noted that the prior knowledge of the relative position of the card number area and the card organization logo area is used to indicate that the card number area in the bank card image can be quickly located according to the card surface area and the card organization logo area in the bank card, that is, it specifically includes the prior knowledge of the card number area and the card organization logo area in the horizontal direction and the prior knowledge of the vertical direction. Specifically, the image angle of the first card surface area is judged according to the prior knowledge of the relative position of the card number area and the card organization logo area to obtain a first angle judgment result. Among them, the first angle judgment result includes different direction degrees, and the direction degrees are used to indicate the direction of the image in the first card surface area to be processed. For example, the direction degrees may include 0 degrees, 90 degrees, 180 degrees, and 270 degrees. When 0 degrees is represented as the positive direction of the bank card, 90 degrees can be represented as the angle obtained by rotating 90 degrees counterclockwise from 0 degrees.
[0124] It should be noted that the first angle judgment result is obtained by detecting the aspect ratio of the first card number area. Specifically, according to the prior knowledge about the card number area and the card organization logo area in the horizontal direction, when it is detected that the aspect ratio corresponding to the first card number area is that the width of the card number frame is greater than or equal to the height of the card number frame, the corresponding first card face area is 0 degrees or 180 degrees; according to the prior knowledge about the card number area and the card organization logo area in the vertical direction, when it is detected that the aspect ratio corresponding to the first card number area is that the width of the card number frame is less than the height of the card number frame, the corresponding first card face area is 90 degrees or 270 degrees, and the image direction of the first card face area is adjusted according to the preset direction state to obtain the target bank card image.
[0125] It should be noted that when the first card number verification result is a verification failure, a mobile bank card identification method with a Retry mechanism is introduced. The method for performing image angle judgment on the second card surface area based on the second card number area and the second card organization logo area is the same as the image angle judgment method for the first card surface area and the corresponding image direction adjustment method in the above-mentioned embodiment, and will not be repeated here.
[0126] It should be noted that, in practice, there are no specific limitations on the settings of different directional degrees and the directions of rotation, which will not be elaborated here.
[0127] See also Figure 5 , Figure 5 is a flowchart of a specific method of step S420 in some embodiments of the present application. In some embodiments of the present application, step S420 includes but is not limited to step S510 and step S520. Figure 5 These two steps are introduced in detail.
[0128] Step S510, calculating the center point coordinates of the first card number area and the first card organization logo area respectively, to obtain the first center point coordinates corresponding to the first card number area and the second center point coordinates corresponding to the first card organization logo area;
[0129] Step S520, using the prior knowledge of the relative position of the card number area and the card organization logo area, and according to the first center point coordinates and the second center point coordinates, image angle judgment is performed on the first card surface area to obtain a first angle judgment result.
[0130] In step S510 and step S520 of some embodiments, in order to realize the image angle judgment of the first card surface area, the point at the upper left corner of the first card surface area is set as the coordinate origin, the right direction along the border of the first card surface area is set as the positive direction of the coordinate x axis, and the downward direction along the border of the first card surface area is set as the positive direction of the coordinate y axis. The center point coordinates of the first card number area and the first card organization logo area are calculated respectively according to the currently established two-dimensional coordinate axis to obtain the first center point coordinates corresponding to the first card number area and the second center point coordinates corresponding to the first card organization logo area. The image angle of the first card surface area is judged by using the prior knowledge of the relative position of the card number area and the card organization logo area, and the first center point coordinates and the second center point coordinates are used to obtain the first angle judgment result. Specifically, the first center point coordinates (x1, y1) corresponding to the first card number area and the second center point coordinates (x2, y2) corresponding to the first card organization logo area are obtained respectively. When the x2 of the second center point coordinates is greater than or equal to the x1 of the first center point coordinates, it indicates that the current first card surface area is 0 degrees; when the x2 of the second center point coordinates is less than the x1 of the first center point coordinates, it indicates that the current first card surface area is 180 degrees. This application realizes the image direction judgment function of the first card surface area by adopting the prior knowledge of the relative position of the card number area and the card organization logo area, reduces the introduction of additional models, and improves the accuracy of bank card recognition on the mobile terminal.
[0131] See also Figure 6 , Figure 6 is a training flow chart of the target detection model in some embodiments of the present application. In some embodiments of the present application, step S140 includes but is not limited to steps S610 to S640. Figure 6 These four steps are introduced in detail.
[0132] Step S610, constructing a training sample set, the training sample set including a plurality of training samples, each training sample including a sample image and a sample card surface area corresponding to the sample image;
[0133] Step S620, input each sample image into the initial detection model to perform target detection to obtain the target card surface area;
[0134] Step S630, determining a loss value according to the target card surface area and the sample card surface area;
[0135] Step S640, adjust the model parameters of the initial detection model according to the loss value, and continue to train the adjusted model based on the training sample set until the loss value meets the preset training end condition, thereby obtaining the target detection model.
[0136] In steps S610 to S640 of some embodiments, in order to improve the accuracy of target detection of the initial bank card image, a training sample set is constructed, and the training sample set includes multiple training samples, each training sample includes a sample image and a sample card surface area corresponding to the sample image. Each sample image is input into the initial detection model for target detection to obtain the target card surface area. In order to improve the detection accuracy of the model, a loss value is determined according to the target card surface area and the sample card surface area, and the model parameters of the initial detection model are adjusted according to the loss value, and the adjusted model is continuously trained based on the training sample set until the loss value meets the preset training end condition to obtain the target detection model.
[0137] It should be noted that the sample image is a collected image containing a bank card surface area, and the sample card surface area is the card surface area of the bank card corresponding to the sample image.
[0138] It should be noted that due to the restrictions on module and model deployment in the mobile terminal, in order to improve the detection accuracy of the model, the target detection model used in the embodiment of the present application can be constructed based on the network structure of SSD, and the lightweight network structure of Mobilenet_v3 can be used as the backbone network of SSD to improve the recognition efficiency of the target detection model. It should be noted that the embodiment of the present application can use the tflite framework to identify and deploy the mobile terminal to meet the restrictions on the deployment of the mobile terminal model.
[0139] See also Figure 7 , Figure 7 is a flowchart of a specific method of step S150 in some embodiments of the present application. In some embodiments, the text recognition model includes a convolutional layer, a recurrent layer, and a transcription layer. Step S150 specifically includes but is not limited to steps S710 to S740. Figure 7 These four steps are introduced in detail.
[0140] Step S710, inputting the first target card number image into a pre-trained text recognition model;
[0141] Step S720, extracting features of the first target card number image through a convolution layer to obtain a convolution feature vector;
[0142] Step S730, performing label prediction on the convolution feature vector through a recurrent layer to obtain label distribution;
[0143] Step S740: Perform feature integration on the tag distribution through the transcription layer to obtain the first card number information.
[0144] In some embodiments, the text recognition model CRNN includes a convolution layer, a circulation layer and a transcription layer, which improves the efficiency of bank card recognition on the mobile terminal, and inputs the first target card number image into the pre-trained text recognition model. Specifically, the first target card number image is feature extracted by the convolution layer to obtain a convolution feature vector, thereby achieving feature dimension reduction and reduction of the amount of calculation for the first target card number image. The convolution feature vector is label predicted by the circulation layer to obtain a label distribution. And the label distribution is feature integrated by the transcription layer to obtain the first card number information. The text recognition model of the embodiment of the present application reduces the structure of the text recognition model and improves the efficiency of bank card recognition on the mobile terminal.
[0145] See also Figure 8 , Figure 8 is another flowchart of a specific method of step S160 in some embodiments of the present application. In some embodiments, step S160 specifically includes but is not limited to step S810 and step S820. Figure 8 These two steps are introduced in detail.
[0146] Step S810, obtaining prior knowledge of card number verification;
[0147] Step S820: Perform card number verification on the first card number information according to prior knowledge of card number verification and a card number verification algorithm to obtain a target bank card number.
[0148] In step S810 and step S820 of some embodiments, in order to improve the accuracy of bank card recognition, prior knowledge of card number verification is obtained, and the prior knowledge of card number verification is summarized according to the rules set for bank card numbers. The first card number information is verified according to the prior knowledge of card number verification and the card number verification algorithm to obtain the target bank card number.
[0149] A bank card recognition method according to an embodiment of the present application is provided. By acquiring an initial bank card image to be recognized, the initial bank card image is subjected to target detection using a pre-trained target detection model to obtain a first card face area, wherein the first card face area includes a first card number area and a first card organization logo area. In order to reduce the introduction of redundant models and improve the efficiency of bank card recognition, the image angle of the first card face area is judged according to the first card number area and the first card organization logo area to obtain a target bank card image that meets a preset direction state. In order to improve the recognition efficiency of the card number in the target bank card image, the target bank card image is intercepted according to the first card number area to obtain a first target card number image, and the first target card number image is subjected to text recognition using a pre-trained text recognition model to obtain the first card number information. The first card number information is subjected to card number verification using a card number verification algorithm to obtain a target bank card number. The present application can improve the accuracy of bank card recognition by the mobile terminal. When the second card number verification result is that the verification is correct, the target bank card number is obtained. This application introduces a Retry mechanism to re-recognize the bank card for the initial bank card image whose first card number verification result is a failed verification, thereby improving the accuracy of bank card recognition on the mobile terminal. This application combines the prior knowledge of the relative position of the card number area and the card organization logo area with the prior knowledge of card number verification to achieve the image direction judgment function of the first card surface area, reduce the introduction of additional models, and achieve the recognition of bank cards on the mobile terminal and improve the recognition efficiency.
[0150] See also Fig. 9 The embodiment of the present application also provides a bank card recognition system, which can implement the above-mentioned bank card recognition method. The system includes an image acquisition module 910, a target detection module 920, an image angle judgment module 930, an image capture module 940, a text recognition module 950 and a card number verification module 960.
[0151] An image acquisition module 910 is used to acquire an initial bank card image to be identified;
[0152] The target detection module 920 is used to perform target detection on the initial bank card image using a pre-trained target detection model to obtain a first card surface area, where the first card surface area includes a first card number area and a first card organization logo area;
[0153] An image angle determination module 930 is used to determine the image angle of the first card surface area according to the first card number area and the first card organization logo area, so as to obtain a target bank card image that meets a preset orientation state;
[0154] An image capture module 940 is used to capture the target bank card image according to the first card number area to obtain a first target card number image;
[0155] A text recognition module 950 is used to perform text recognition on the first target card number image using a pre-trained text recognition model to obtain first card number information;
[0156] The card number verification module 960 is used to perform card number verification on the first card number information using a card number verification algorithm to obtain a target bank card number.
[0157] It should be noted that a bank card recognition system in an embodiment of the present application is used to implement the above-mentioned bank card recognition method. A bank card recognition system in an embodiment of the present application corresponds to the aforementioned bank card recognition method. For the specific processing process, please refer to the aforementioned bank card recognition method, which will not be repeated here.
[0158] The embodiment of the present application also provides an electronic device, which includes: at least one memory, at least one processor, and at least one computer program, wherein the at least one computer program is stored in the at least one memory, and the at least one processor executes the at least one computer program to implement any of the bank card recognition methods in the above embodiments. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0159] See also Fig.10 , Fig.10 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0160] The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0161] The memory 1020 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1020 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1020, and the processor 1010 calls and executes a bank card recognition method in the embodiment of this application;
[0162] Input / output interface 1030, used to implement information input and output;
[0163] The communication interface 1040 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0164] Bus 1050 , which transmits information between various components of the device (e.g., processor 1010 , memory 1020 , input / output interface 1030 , and communication interface 1040 );
[0165] The processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 are connected to each other in communication within the device via a bus 1050 .
[0166] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute a bank card identification method of any one of the above embodiments.
[0167] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0168] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0169] It can be understood by those skilled in the art that Figures 1 to 7 The technical solutions shown in the figure do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figure, or a combination of certain steps, or different steps.
[0170] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0171] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0172] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application 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 interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0173] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0174] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0175] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0176] In addition, each functional unit in each embodiment of the present application 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0177] If the integrated unit 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 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, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0178] The preferred embodiments of the present invention are described with reference to the accompanying drawings, but the scope of the present invention is not limited by the above. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A bank card recognition method, It is characterized in that The method comprises: Obtaining an initial bank card image to be recognized; Performing target detection on the initial bank card image using a pre-trained target detection model to obtain a first card surface area, wherein the first card surface area includes a first card number area and a first card organization logo area; the target detection model includes a card surface target detection sub-model, a card number target detection sub-model, and a label target detection sub-model, and performing target detection on the initial bank card image using the pre-trained target detection model to obtain the first card surface area includes: performing target detection on the initial bank card image using the card surface target detection sub-model to obtain the first card surface area; performing target detection on the initial bank card image using the card number target detection sub-model to obtain a first card number area in the first card surface area; performing target detection on the initial bank card image using the label target detection sub-model to obtain a first card organization logo area in the first card surface area; Performing image angle judgment on the first card face area according to the first card number area and the first card organization logo area to obtain a target bank card image that meets a preset orientation state; wherein, performing image angle judgment on the first card face area according to the first card number area and the first card organization logo area to obtain a target bank card image that meets a preset orientation state includes: acquiring prior knowledge of the relative position of the card number area and the card organization logo area; performing center point coordinate calculation on the first card number area and the first card organization logo area respectively to obtain first center point coordinates corresponding to the first card number area and second center point coordinates corresponding to the first card organization logo area; utilizing the prior knowledge of the relative position of the card number area and the card organization logo area, performing image angle judgment on the first card face area according to a comparison result of the corresponding coordinates of the first center point coordinates and the second center point coordinates to obtain a first angle judgment result; and determining the target bank card image that meets the preset orientation state according to the first angle judgment result; Capturing the target bank card image according to the first card number area to obtain a first target card number image; Using a pre-trained text recognition model to perform text recognition on the first target card number image to obtain first card number information; The first card number information is verified using a card number verification algorithm to obtain a target bank card number.
2. The bank card recognition method according to claim 1, It is characterized in that The step of performing card number verification on the first card number information using a card number verification algorithm to obtain a target bank card number includes: Performing card number verification on the first card number information using a card number verification algorithm to obtain a first card number verification result; When the verification result of the first card number is successful, the target bank card number is obtained; When the first card number verification result is a verification failure, performing background removal processing on the initial bank card image to obtain a candidate bank card image; Performing target detection on the candidate bank card image using the target detection model to obtain a second card surface area, wherein the second card surface area includes a second card number area and a second card organization logo area; Performing image angle judgment on the second card surface area according to the second card number area and the second card organization logo area, and obtaining a second target bank card image that meets the preset orientation state according to the result of the image angle judgment; Capturing the second target bank card image according to the second card number area to obtain a second target card number image; Using the text recognition model to perform text recognition on the second target card number image to obtain second card number information; Performing card number verification on the second card number information using the card number verification algorithm to obtain a second card number verification result; When the second card number verification result is correct, the target bank card number is obtained.
3. The bank card recognition method according to claim 1, It is characterized in that The step of determining the target bank card image that satisfies a preset direction state according to the first angle judgment result includes: When the first angle judgment result is that the first card surface area meets the preset direction state, a target bank card image is obtained; When the first angle judgment result is that the first card surface area does not satisfy the preset direction state, the image direction of the first card surface area is adjusted according to the preset direction state to obtain the target bank card image.
4. The bank card recognition method according to any one of claims 1 to 3, It is characterized in that The target detection model is trained by the following method: Constructing a training sample set, wherein the training sample set includes a plurality of training samples, each training sample includes a sample image and a sample card surface area corresponding to the sample image; Input each of the sample images into the initial detection model to perform target detection to obtain the target card surface area; Determine a loss value according to the target card surface area and the sample card surface area; The model parameters of the initial detection model are adjusted according to the loss value, and the adjusted model is continuously trained based on the training sample set until the loss value meets a preset training end condition, thereby obtaining a target detection model.
5. The bank card recognition method according to any one of claims 1 to 3, It is characterized in that The text recognition model includes a convolution layer, a recurrent layer, and a transcription layer. The pre-trained text recognition model is used to perform text recognition on the first target card number image to obtain the first card number information, including: Inputting the first target card number image into a pre-trained text recognition model; Performing feature extraction on the first target card number image through the convolution layer to obtain a convolution feature vector; Performing label prediction on the convolution feature vector through the circulation layer to obtain label distribution; The tag distribution is feature integrated through the transcription layer to obtain the first card number information.
6. The bank card recognition method according to any one of claims 1 to 3, It is characterized in that The step of performing card number verification on the first card number information using a card number verification algorithm to obtain a target bank card number includes: Obtain prior knowledge of card number verification; The first card number information is verified based on the prior knowledge of the card number verification and a card number verification algorithm to obtain a target bank card number.
7. A bank card recognition system, It is characterized in that The system comprises: An image acquisition module, used to acquire an initial bank card image to be identified; The target detection module is used to perform target detection on the initial bank card image using a pre-trained target detection model to obtain a first card surface area, wherein the first card surface area includes a first card number area and a first card organization logo area; the target detection model includes a card surface target detection sub-model, a card number target detection sub-model, and a label target detection sub-model, and the method of performing target detection on the initial bank card image using the pre-trained target detection model to obtain the first card surface area includes: performing target detection on the initial bank card image using the card surface target detection sub-model to obtain the first card surface area; performing target detection on the initial bank card image using the card number target detection sub-model to obtain the first card number area; performing target detection on the initial bank card image using the label target detection sub-model to obtain the first card organization logo area; An image angle judgment module is used to perform image angle judgment on the first card surface area according to the first card number area and the first card organization logo area to obtain a target bank card image that meets a preset direction state; wherein, performing image angle judgment on the first card surface area according to the first card number area and the first card organization logo area to obtain a target bank card image that meets a preset direction state includes: acquiring prior knowledge of the relative position of the card number area and the card organization logo area; performing center point coordinate calculation on the first card number area and the first card organization logo area respectively to obtain a first center point coordinate corresponding to the first card number area and a second center point coordinate corresponding to the first card organization logo area; using the prior knowledge of the relative position of the card number area and the card organization logo area, performing image angle judgment on the first card surface area according to a comparison result of the corresponding coordinates of the first center point coordinate and the second center point coordinate to obtain a first angle judgment result; determining the target bank card image that meets the preset direction state according to the first angle judgment result; An image capture module, configured to capture the target bank card image according to the first card number area to obtain a first target card number image; A text recognition module, used to perform text recognition on the first target card number image using a pre-trained text recognition model to obtain first card number information; The card number verification module is used to perform card number verification on the first card number information using a card number verification algorithm to obtain a target bank card number.
8. An electronic device, It is characterized in that include: at least one memory; at least one processor; at least one computer program; The at least one computer program is stored in the at least one memory, and the at least one processor executes the at least one computer program to implement: A bank card recognition method as claimed in any one of claims 1 to 6.
9. A storage medium, wherein the storage medium is a computer-readable storage medium, It is characterized in that The computer readable storage medium stores a computer program, and the computer program is used to cause a computer to execute: A bank card recognition method as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Certificate image automatic forward method, image processing apparatus, and readable storage medium
CN109101963A
Certificate scanning method and device for mobile terminal
CN110138999A
Bank card number positioning method and device
CN110807456A
Card picture sign detection method and device, computer equipment and storage medium
CN111027545A
Bank card identification method and device, computer equipment and storage medium
CN114049646A
