Method for constructing identification model, method for identifying bank card number and related products

By building a multi-task recognition model and using data augmentation technology to process bank card data sets, the problem of low bank card number recognition accuracy in complex environments of OCR technology is solved, and efficient and accurate identification of bank card number on the C-end is achieved.

CN120299049APending Publication Date: 2025-07-11NANJING XIYIN ECOMMERCE CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510293173.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

In the case of complex and changeable C-end user environment, the existing OCR technology has low accuracy in bank card number identification, which is difficult to meet the actual application needs.

Method used

By acquiring the initial bank card data set and background data set, using the background data set to enhance the initial bank card data, a multi-task recognition model is built, including the card key point detection model, the card number detection model and the card number recognition model, and the multi-task recognition model is trained to adapt to complex environments such as uneven lighting, tilted shooting angles, complex backgrounds and blurred images.

Benefits of technology

It improves the accuracy and efficiency of bank card number identification, and can accurately identify bank card number in complex environments without the need for manual input by users, improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120299049A_ABST
    Figure CN120299049A_ABST
Patent Text Reader

Abstract

The invention discloses a method for constructing an identification model, a method for identifying a bank card number and a related product. The method for constructing the identification model comprises the following steps: acquiring an initial bank card data set and a background data set; performing data enhancement on the initial bank card data set by using the background data set to obtain a bank card data set; and constructing a multi-task identification model by using the bank card data set. According to the embodiment of the invention, the background data set is utilized to perform data enhancement on the initial bank card data set, so that the sufficient bank card data set with sample diversity is obtained. By means of the bank card data set, the model can fully learn and adapt to the characteristics and modes of the bank card under various complex environment conditions such as uneven illumination, oblique shooting angle, complex background and blurred image, so that the generalization ability and the recognition accuracy of the multi-task recognition model in practical application are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure generally relates to the field of image processing technology. More specifically, this disclosure relates to a method for constructing an identification model, a method for identifying a bank card number, and related products. Background Art

[0002] With the popularization and development of the mobile Internet and e-commerce, more and more users choose to shop online on the mobile side. After the selection is completed, they then conduct consumption settlement through mobile payment. However, before making a payment, users often need to manually enter their bank card numbers on the platform to bind the bank cards under their names to the platform. This manual card number entry binding process is extremely cumbersome and prone to input errors, thus bringing a bad user experience.

[0003] In recent years, with the development of deep learning, it has strongly promoted the progress of OCR (Optical Character Recognition) technology, making it perform excellently in text recognition. The OCR technology obtains images through optical devices such as scanners and cameras, and then processes the text in the images to identify the characters in the images, including letters, numbers, symbols, etc. Therefore, applying the OCR technology to bank card number recognition can effectively reduce the user's manual input operation and improve the bank card number recognition efficiency. However, in the C-end (Consumer End) scenario, the user's usage environment has the significant characteristics of being complex and changeable, and uncertain factors such as uneven illumination, tilted shooting angle, background interference, and image blurring widely exist. Uneven illumination will cause too large a brightness difference in the bank card number area, resulting in some characters being difficult to clearly image; a tilted shooting angle will cause the card number characters to deform, increasing the recognition difficulty; complex background interference may cause the recognition algorithm to misidentify the elements in the background as card number characters; and image blurring will make the character edges unclear and details lost. These adverse factors greatly affect the extraction and judgment of the bank card number features by the above OCR recognition algorithm, and thus lead to a significant reduction in the accuracy rate when applying this recognition method to bank card number recognition.

[0004] In view of this, there is an urgent need to provide a method for constructing an identification model, a method for identifying a bank card number, and related products to improve the recognition efficiency and accuracy of bank card numbers. Summary of the Invention

[0005] In order to solve at least one or more of the above-mentioned technical problems, this disclosure proposes a method for constructing an identification model, a method for identifying a bank card number, and related products in multiple aspects to improve the recognition accuracy of bank card numbers.

[0006] In a first aspect, the present disclosure provides a method for constructing an identification model, including: obtaining an initial bank card data set and a background data set; using the background data set to perform data augmentation on the initial bank card data set to obtain a bank card data set; and using the bank card data set to construct a multi-task identification model.

[0007] In some embodiments, the multi-task identification model includes a card key point detection model, a card number detection model, and a card number recognition model; the bank card data set includes a card key point detection data set, a card number detection data set, and a card number recognition data set respectively used for constructing the card key point detection model, the card number detection model, and the card number recognition model; the card key point detection data set is labeled with a bank card detection frame and the positions of the vertices of the bank card; the card number detection data set is labeled with the area where the bank card number is located; the card number recognition data set is labeled with the area where the bank card number is located and the bank card number displayed in the area; using the bank card data set to construct a multi-task identification model includes: using the card key point detection data set to train a first preset model to obtain the card key point detection model; using the card number detection data set to train a second preset model to obtain the card number detection model; and using the card number recognition data set to train a third preset model to obtain the card number recognition model.

[0008] In some embodiments, using the background data set to perform data augmentation on the initial bank card data to obtain a bank card data set includes: performing image segmentation on the initial bank card data set to extract bank card images; performing augmentation transformation on the bank card images, where the augmentation transformation includes at least one operation of random rotation, scaling, HSV transformation, perspective transformation, blurring, adding texture; randomly synthesizing the augmented bank card images with the background images in the background data set to obtain a simulated bank card data set; and merging the simulated bank card data set and the initial bank card data set to obtain the bank card data set.

[0009] In some embodiments, after merging the simulated bank card data set and the initial bank card data set to obtain the bank card data set, it further includes: performing annotation on the bank card data set according to the type of the bank card data set to obtain a target bank card data set corresponding to the type; wherein, if the target bank card data set is a card key point detection data set, then annotate the bank card detection frame and the positions of the vertices of the bank card on the bank card data set; if the target bank card data set is a card number detection data set, then annotate the area where the bank card number is located on the bank card data set; if the target bank card data set is a card number recognition data set, then annotate the area where the bank card number is located and the bank card number displayed in the area on the bank card data set.

[0010] In some embodiments, after constructing the multi-task recognition model using the bank card data set, the following steps are further included: converting the multi-task recognition model into an ncnn model using the ncnn framework.

[0011] In a second aspect, the present disclosure provides a method for identifying a bank card number using the recognition model constructed in the foregoing first aspect and any of its embodiments, including: obtaining an input image of a user; and using the multi-task recognition model to perform bank card number recognition on the input image to obtain an identification result of the bank card number.

[0012] In some embodiments, the multi-task recognition model includes a card key point detection model, a card number detection model, and a card number recognition model; the step of using the multi-task recognition model to perform bank card number recognition on the input image to obtain an identification result of the bank card number includes: using the card key point detection model to perform card key point detection on the input image to obtain a card key point detection result, where the card key point detection result includes a bank card detection frame; cropping the input image according to the bank card detection frame to obtain a bank card image; using the card number detection model to perform card number detection on the bank card image to obtain the area where the bank card number is located; and using the card number recognition model to perform card number recognition on the area where the bank card number is located in the bank card image to obtain the identification result of the bank card number.

[0013] In some embodiments, the card key point detection result further includes the vertex positions of the bank card; before cropping the input image according to the bank card detection frame to obtain a bank card image, the following steps are included: obtaining the reference vertex positions of the bank card in a preset standard environment; determining a perspective transformation matrix according to the positional relationship between the vertex positions of the bank card and the reference vertex positions; and using the perspective transformation matrix to perform perspective transformation on the input image to obtain a corrected input image.

[0014] In some embodiments, the card key point detection result further includes the vertex positions of the bank card. After using the card key point detection model to perform bank card target detection and bank card vertex position detection on the input image to obtain a card key point detection result, the following steps are further included: determining whether the bank card detection frame exists in the card key point detection result; if the bank card detection frame exists, determining the number of vertex positions of the bank card; if the number of vertex positions of the bank card is a preset threshold, performing the step of cropping the input image according to the bank card detection frame to obtain a bank card image; if the number of vertex positions of the bank card is not the preset threshold, jumping back to continue performing the step of obtaining the input image of the user; and if the bank card detection frame does not exist, jumping back to continue performing the step of obtaining the input image of the user.

[0015] In some embodiments, the multi-task recognition model is an ncnn model; before using the multi-task recognition model to recognize the bank card number from the input image to obtain the recognition result of the bank card number, it further includes: deploying the multi-task recognition model.

[0016] In a third aspect, the present disclosure provides a processing device, including: a processor configured to execute program instructions; and a memory configured to store program instructions, which when loaded and executed by the processor, cause the processor to execute the method for constructing a recognition model described in the first aspect of the present disclosure and any of its embodiments and the method for recognizing a bank card number described in the second aspect of the present disclosure and any of its embodiments.

[0017] In a fourth aspect, the present disclosure provides a computer-readable storage medium storing program instructions, which when loaded and executed by a processor, cause the processor to execute the method for constructing a recognition model described in the first aspect of the present disclosure and any of its embodiments and the method for recognizing a bank card number described in the second aspect of the present disclosure and any of its embodiments.

[0018] Through the method for constructing a recognition model provided above, in the embodiments of the present disclosure, data augmentation is performed on the initial bank card dataset by using the background dataset to obtain a sufficient and sample-diverse bank card dataset, and then a multi-task recognition model is constructed by using this bank card dataset. It can be understood that a sufficient and sample-diverse bank card dataset can provide rich and diverse sample instances for the construction of the multi-task model. With the help of these samples, the model can fully learn and adapt to the characteristics and patterns of bank cards in various complex environmental conditions such as uneven illumination, tilted shooting angles, complex backgrounds, and blurred images, thereby improving the generalization ability and recognition accuracy of the model in practical applications. Therefore, when this multi-task recognition model is applied to bank card number recognition, the bank card number can be accurately recognized based on the input image without the user manually inputting the bank card number, achieving the effect of improving the recognition efficiency and accuracy of the bank card number. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features, and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the drawings, several embodiments of the present disclosure are shown in an exemplary rather than restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts, where:

[0020] Figure 1 Shows an exemplary flowchart of the method for constructing a recognition model according to some embodiments of the present disclosure;

[0021] Figure 2 Shows an exemplary flowchart of the method for constructing a recognition model according to some embodiments of the present disclosure;

[0022] Figure 3 An exemplary flowchart of a method for constructing an identification model according to some embodiments of the present disclosure is shown;

[0023] Figure 4 An exemplary flowchart of a method for constructing an identification model according to some embodiments of the present disclosure is shown;

[0024] Figure 5 An exemplary flowchart of a method for identifying a bank card number according to some embodiments of the present disclosure is shown;

[0025] Figure 6 An exemplary flowchart of a method for identifying a bank card number according to some embodiments of the present disclosure is shown;

[0026] Figure 7 An exemplary flowchart of a method for identifying a bank card number according to some embodiments of the present disclosure is shown;

[0027] Figure 8 An exemplary overall flowchart of steps of a method for identifying a bank card number according to some embodiments of the present disclosure is shown;

[0028] Figure 9 Output images corresponding to each step in the exemplary overall flowchart of steps of a method for identifying a bank card number according to some embodiments of the present disclosure are shown;

[0029] Figure 10 An exemplary structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed implementation manners

[0030] Next, the technical solutions in the embodiments of the present disclosure will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.

[0031] It should be understood that the terms "including" and "comprising" used in the specification and claims of the present disclosure indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0032] It should also be understood that the terms used in this disclosure statement are only for the purpose of describing specific embodiments and are not intended to limit this disclosure. As used in this disclosure statement and the claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms. It should be further understood that the term "and / or" used in this disclosure statement and the claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0033] As used in this specification and the claims, the term "if" can be interpreted as "when", "once", "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrases "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined", "in response to determining", "once [the described condition or event] is detected" or "in response to detecting [the described condition or event]" depending on the context.

[0034] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings.

[0035] Exemplary application scenarios

[0036] When performing consumer settlement or transfer payment operations on the mobile side, users need to bind the bank cards under their names to the corresponding platforms in advance. Only after completing this binding process can subsequent payments be carried out smoothly. Currently, the bank card binding still requires users to manually enter the bank card number. This manual card number entry binding process is not only cumbersome but also prone to input errors, thus affecting the user experience.

[0037] OCR technology uses optical devices such as scanners and cameras to collect images and process the text in them, and can accurately identify various types of characters such as letters, numbers, and symbols. With the continuous progress of technology, OCR has performed more and more excellently in the field of text recognition. Applying it to bank card number recognition can effectively reduce manual input by users and significantly improve the recognition efficiency.

[0038] However, on the C side, the user's usage environment is complex and changeable, with various adverse factors such as uneven lighting, tilted shooting angles, complex background interference, and blurred images. These adverse factors will seriously interfere with the extraction and judgment of bank card number features by the recognition algorithm, making the accuracy of this recognition method in bank card number recognition greatly reduced and difficult to meet the actual application requirements.

[0039] Exemplary application solutions

[0040] In view of this, embodiments of the present disclosure provide a method for constructing an identification model. By obtaining an initial bank card data set and a background data set, the initial bank card data is enhanced using the background data set to obtain a sufficient bank card data set. This bank card data set covers a rich and diverse range of usage scenarios and includes samples collected under various adverse factors such as uneven lighting, tilted shooting angles, complex background interference, and image blurring. Furthermore, a multi-task identification model that can be used for bank card number identification and has excellent identification accuracy is constructed using this bank card data set.

[0041] Figure 1 FIG. 4 shows an exemplary flowchart of a method 100 for constructing an identification model according to some embodiments of the present disclosure. As Figure 1 shown, method 100 includes steps S101 to S103. First, in step 101, an initial bank card data set and a background data set are obtained. In embodiments of the present disclosure, the initial bank card data set consists of real bank card images of users. The background data set consists of various background images.

[0042] Furthermore, the initial bank card data set can be obtained through methods such as manual collection and web crawling. Among them, a web crawler, also known as a web spider or web robot, with the English name Web Crawler or Spider, is a program or script that automatically crawls information on the World Wide Web according to certain rules. It can be understood that the initial bank card data set can be quickly obtained through a web crawler. In addition, the background data set can be collected independently or existing background image resources on the market can be selected. As an example, rich image resources provided by open-source data sets such as imagenet (Image Network), coco (Microsoft Common Objects in Context), and place365 (Places365-CNNs for Scene Classification) can be selected as the background data set.

[0043] Since bank cards involve user privacy, it is often difficult to obtain a sufficient initial bank card data set. However, if the data set used to construct the multi-task model is insufficient and the adverse factors such as uneven lighting, tilted shooting angles, complex backgrounds, and image blurring mentioned above are not fully considered during data collection, it will directly cause a significant reduction in the identification accuracy of the model.

[0044] Therefore, in step S102, the initial bank card dataset is data-augmented using the background dataset to obtain the bank card dataset. This step aims to expand the initial bank card dataset on the one hand and to simulate and generate samples affected by adverse factors such as uneven illumination, tilted shooting angles, complex backgrounds, and image blurring on the other hand, so as to ensure that the finally obtained bank card dataset can comprehensively cover various complex situations that may be encountered in actual applications, thereby constructing a more robust multi-task recognition model and improving the recognition accuracy of the multi-task recognition model.

[0045] Finally, in step S103, a multi-task recognition model is constructed using the bank card dataset. In the embodiment of the present disclosure, a preset model is trained using a sufficient and sample-diverse bank card dataset to obtain the multi-task recognition model. The bank card dataset is pre-annotated with the true results for the training and learning of the preset model. It can be understood that the training process of the multi-task recognition model is specifically as follows: First, the bank card dataset is input into the preset model, and the preset model will make predictions on the input bank card dataset to obtain prediction results. Then, the prediction results are compared with the true results annotated in the bank card dataset, and the model parameters of the preset model are continuously and automatically updated according to the comparison results. This loop process is repeated continuously until the preset model converges. At this time, the converged preset model is the multi-task recognition model.

[0046] The above has generally described Figure 1 the method 100 for constructing a recognition model of the present disclosure. In the embodiment of the present disclosure, the initial bank card dataset is data-augmented using the background dataset to obtain a sufficient and sample-diverse bank card dataset, and then the multi-task recognition model is constructed using the bank card dataset. It can be understood that a sufficient and sample-diverse bank card dataset can provide rich and diverse sample instances for the construction of the multi-task model. With these samples, the model can fully learn and adapt to the characteristics and patterns of bank cards in various complex environmental conditions such as uneven illumination, tilted shooting angles, complex backgrounds, and image blurring, thereby improving the generalization ability and recognition accuracy of the multi-task recognition model in actual applications. Therefore, when this multi-task recognition model is applied to bank card number recognition, the bank card number can be accurately recognized based on the input image without the user manually inputting the bank card number, achieving the effect of improving the recognition efficiency and accuracy of the bank card number.

[0047] However, those skilled in the art should understand that Figure 1 the method shown is exemplary rather than restrictive, and those skilled in the art can make adjustments as needed. Next, in conjunction with Figure 2 the construction process of constructing a multi-task model using the bank card dataset will be described, Figure 2 showing an exemplary flowchart of the method 200 for constructing a recognition model according to some embodiments of the present disclosure. AsFigure 2 As shown in the figure, method 200 includes steps S201 to S205. Among them, steps S201 and S202 are the same as steps S101 and S102 of the previous method 100, and steps S203 to S205 are a specific implementation of the aforementioned step S103. Therefore, the features described in the previous context in combination with Figure 1 can be similarly applied here.

[0048] It should be noted that the multi-task recognition model in the embodiments of the present disclosure includes a card key point detection model, a card number detection model, and a card number recognition model. Among them, the card key point detection model is used to perform bank card target detection and bank card vertex position detection on bank card images. The card number detection model is used to detect the area where the bank card number is located in the bank card image. The card number recognition model is used to recognize the bank card number in the area where the bank card number is located.

[0049] Based on the different detection purposes of different models, the required training data sets also vary. Specifically, the bank card data set includes a card key point detection data set, a card number detection data set, and a card number recognition data set, which are respectively used for the construction of the card key point detection model, the card number detection model, and the card number recognition model. Each image in the card key point detection data set is labeled with a bank card detection frame and the bank card vertex position. The bank card detection frame frames the area where the bank card is located. It can be understood that the area where the bank card is located specifically refers to the area range where the entire bank card is located in the image. Each image in the card number detection data set is labeled with the area where the bank card number is located. The area where the bank card number is located refers to the specific range occupied by the bank card number digits or characters in the image. Based on the explanations of the area where the bank card is located and the area where the bank card number is located, it can be seen that the area where the bank card is located and the area where the bank card number is located respectively represent different area ranges. Each image in the card number recognition data set is labeled with the area where the bank card number is located and the bank card number displayed in this area. It can be understood that the content labeled in different data sets is the prediction target of the preset model and also the true result of the prediction. When each preset model is trained, the prediction result is compared with the labeled true result, and then the model parameters of itself are continuously updated according to the comparison result until convergence to obtain each multi-task recognition model.

[0050] Based on the above definitions, the construction process of the multi-task model is as Figure 2 shown. First, method 200 sequentially executes steps S201 and S202 to obtain a sufficient and diverse bank card data set. Since steps S201 and S202 are the same as steps S101 and S102 of the previous method 100, they will not be elaborated here, and the relevant content can be referred to the previous description.

[0051] Next, in step S203, the first preset model is trained using the card key point detection dataset to obtain the card key point detection model. The first preset model can be the yolov8-pose model (YOLOv8 Pose Estimation Model).

[0052] Specifically, the specific execution process of training the first preset model using the card key point detection dataset to obtain the card key point detection model can be as follows: The card key point detection dataset annotated with the bank card detection frame and the bank card vertex position is input into the first preset model. The first preset model performs bank card target detection and bank card vertex position detection on the images in the card key point detection dataset to obtain the bank card detection frame and the bank card vertex position. Then the first preset model compares the detected bank card detection frame and bank card vertex position with the true bank card detection frame and bank card vertex position pre-annotated in the image, and updates its own model parameters according to the comparison result. After that, it continues to jump to execute the steps of performing bank card target detection and bank card vertex position detection on the images in the card key point detection dataset until the first preset model converges to obtain the card key point detection model. It can be understood that the training processes of the card number detection model and the card number recognition model are the same as that of the card key point detection model, except for the datasets they use and the prediction purposes. Those skilled in the art can know the training processes of the card number detection model and the card number recognition model based on the training process of the card key point detection model. Therefore, the training processes of the card number detection model and the card number recognition model will not be repeated hereinafter.

[0053] In step S204, the second preset model is trained using the card number detection dataset to obtain the card number detection model. In the embodiments of the present disclosure, the second preset model detects the area where the bank card number is located in the images in the card number detection dataset, and marks the detected area where the bank card number is located in the image. For example, the detected area where the bank card number is located can be framed using a rectangular box. In some embodiments, the second preset model can adopt the DBNet (DifferentiableBinarization Network) model.

[0054] In step S205, the third preset model is trained using the card number recognition dataset to obtain the card number recognition model. In the embodiments of the present disclosure, the third preset model recognizes the bank card number in the area where the bank card number is marked in the images in the card number recognition dataset, and outputs the recognition result of the bank card number. This recognition result is the specific value of the recognized bank card number. In some embodiments, the third preset model can use the CRNN (Convolutional Recurrent Neural Network) model.

[0055] It should be noted that, in addition to the exemplary models, the first preset model, the second preset model, and the third preset model can also adopt other models. Those skilled in the art can select a suitable model as the preset model according to the actual application scenario. For example, a model based on Transformer can be used as the first preset model.

[0056] It can be understood that the above steps S203 to S205 are independent of each other and there is no dependency relationship between them. Therefore, these steps can be executed simultaneously or staggered during implementation. The embodiments of the present disclosure do not make specific limitations on this.

[0057] The above combines Figure 2 Overall, the method 200 for constructing an identification model of the present disclosure has been described. In the embodiments of the present disclosure, the first preset model is trained using a card key point detection data set to obtain a card key point detection model that can be used for bank card target detection and bank card vertex position detection of bank card images. The second preset model is trained using a card number detection data set to obtain a card number detection model that can be used for detecting the area where the bank card number is located in the bank card image. And the third preset model is trained using a card number recognition data set to obtain a card number recognition model that can be used for bank card number recognition in the area where the bank card number is located in the bank card image. Furthermore, when performing bank card number recognition on an image, the above multi-task recognition models can be sequentially used to perform step-by-step recognition on the image, and finally the specific value of the bank card number in the image can be accurately output. This recognition method does not require the user to manually input the bank card number. Only by inputting an image containing the bank card, the specific value of the bank card number can be automatically and accurately recognized, thereby improving the recognition efficiency and accuracy of the bank card number.

[0058] However, those skilled in the art should understand that Figure 2 the method shown is exemplary rather than restrictive, and those skilled in the art can make adjustments according to needs. Next, in combination with Figure 3 the specific implementation process of data augmentation on the initial bank card data set using the background data set to obtain the bank card data set will be described. Figure 3 FIG. shows an exemplary flowchart of a method 300 for constructing an identification model according to some embodiments of the present disclosure. As Figure 3 shown, the method 300 includes steps S301 to S306. Among them, step S301 and step S306 are respectively the same as step S101 and step S103 of the foregoing method 100, and steps S302 to S305 are a specific implementation manner of step S102 in the foregoing method 100. Therefore, the features described in combination with Figure 1 above can be similarly applied here.

[0059] First, in step S301, an initial bank card data set and a background data set are obtained. Based on the description above, the initial bank card data set consists of real bank card number images of users. The background data set consists of various background images. This step S301 is the same as step S101 described in the previous method 100. Therefore, for the acquisition of the initial bank card data set and the background data set, reference can be made to the description of step S101 above, and details will not be repeated here.

[0060] Next, a specific implementation method for using the background data set to perform data augmentation on the initial bank card data set to obtain a bank card data set (corresponding to step S102 above) is described.

[0061] In step S302, image segmentation is performed on the initial bank card data set to extract bank card images. In the embodiments of this disclosure, a saliency detection model such as a BiRefNet (Bidirectional Refinement Network) model can be used to perform image segmentation on each image in the initial bank card data set, thereby extracting bank card images. It can be understood that the saliency detection model can detect the area where the bank card is located in the image, and then crop the image to obtain the bank card image. Based on the description above, the area where the bank card is located specifically refers to the area range where the entire bank card is located in the image. In step S303, an enhancement transformation is performed on the bank card image. In some embodiments, the enhancement transformation may include performing at least one of the operations of randomly rotating, scaling, hsv transformation (Hue Saturation Value transformation), perspective transformation, blurring, and adding textures to the bank card image. The enhancement transformation aims to simulate samples under the influence of various complex environmental factors, covering scenarios such as uneven illumination, tilted shooting angles, cluttered backgrounds, and blurred images, so as to provide sufficient and diverse sample instances for the training of the multi-task recognition model.

[0062] Specifically, as the name implies, random rotation means randomly rotating the bank card image by an angle. Perspective transformation refers to the operation of projecting an image from one plane to another to change the perspective and shape of the image so that it conforms to the perspective law. Blurring is to perform blurring processing on the bank card image to reduce the details and clarity of the bank card image. Adding texture means adding detailed patterns or structures with certain rules, shapes, and textures to the surface of the bank card image. The specific implementation of any of the above operations in the embodiments of the present disclosure is not clearly limited. Those skilled in the art can flexibly select and implement appropriate implementation solutions based on the content and teachings disclosed in the embodiments of the present disclosure and in combination with their actual needs and professional knowledge. For example, random rotation and blurring operations can be performed on the bank card image, and the blurring operation can be achieved by performing mean filtering on the bank card image.

[0063] In step S304, the enhanced transformed bank card image is randomly synthesized with the background images in the background dataset to obtain a simulated bank card dataset. In the embodiments of the present disclosure, a background image can be randomly selected from the background dataset, and then the background image is pasted behind the enhanced transformed bank card image as the background of the bank card image, thereby obtaining a simulated bank card image. A collection of numerous simulated bank card images constitutes a simulated bank card dataset.

[0064] Through the above steps S303 and S304, the diversification processing of the bank card image is realized to simulate the complex and changeable environmental impacts in reality, so that the finally generated bank card dataset can not only achieve dataset expansion, but also widely cover various situations that may occur in various complex environments such as uneven illumination, tilted shooting angles, complex backgrounds, and blurred images. Furthermore, using this bank card dataset to construct a multi-task recognition model can effectively improve the adaptability of the multi-task recognition model to different complex environmental factors, enabling it to show more excellent recognition accuracy in practical applications.

[0065] In some embodiments, to obtain more simulated bank card datasets, steps S303 and S304 can be repeatedly executed multiple times on the same bank card image extracted in step S302. For example, steps S303 and S304 are repeatedly executed 50 times on the same bank card image extracted in step S302, so that one bank card image can be expanded to obtain 50 simulated bank card images.

[0066] In step S305, the simulated bank card dataset and the initial bank card dataset are merged to obtain a bank card dataset. In the embodiments of the present disclosure, the simulated bank card dataset and the initial bank card dataset are merged into a set, and the merged set is the bank card dataset.

[0067] In addition, it should be noted that based on the foregoing description, it can be known that the bank card dataset includes a card key point detection dataset, a bank card number detection dataset, and a bank card number recognition dataset, and different datasets are respectively labeled with different contents for constructing different multi-task models. Therefore, in some embodiments, after obtaining the bank card dataset in step S305, the bank card dataset can also be labeled according to the type of the bank card dataset to be constructed, so as to obtain the target bank card dataset corresponding to this type. Specifically, if the target bank card dataset is a card key point detection dataset, the bank card dataset is labeled with bank card detection frames and the positions of the vertices of the bank card; if the target bank card dataset is a bank card number detection dataset, the bank card dataset is labeled with the area where the bank card number is located; if the target bank card dataset is a bank card number recognition dataset, the bank card dataset is labeled with the area where the bank card number is located and the bank card number displayed in this area. For example, after step S305 is executed and the type of the obtained bank card dataset A is a card key point detection dataset, each image in the bank card dataset A is labeled with bank card detection frames and the positions of the vertices of the bank card, so as to obtain the card key point detection dataset.

[0068] In other embodiments, if the obtained bank card dataset is sufficient, the bank card dataset can also be directly divided into three categories: a card key point detection dataset, a bank card number detection dataset, and a bank card number recognition dataset, and then the corresponding contents are respectively labeled for the card key point detection dataset, the bank card number detection dataset, and the bank card number recognition dataset. For example, after step S305 is executed and the bank card dataset A is obtained, the bank card dataset A can be divided into a card key point detection dataset A1, a bank card number detection dataset A2, and a bank card number recognition dataset A3, and then the corresponding contents are respectively labeled for these three types of datasets.

[0069] In some embodiments, after step S301 is executed, the corresponding contents can also be labeled for the initial bank card dataset according to the type of the bank card dataset to be finally constructed. For example, if a card key point detection dataset is to be obtained, the initial bank card dataset is labeled with bank card detection frames and the positions of the vertices of the bank card; if a bank card number detection dataset is to be obtained, the initial bank card dataset is labeled with the area where the bank card number is located; if a bank card number recognition dataset is to be obtained, the initial bank card dataset is labeled with the area where the bank card number is located and the bank card number displayed in this area of the bank card number. And after the simulated bank card image is obtained in step S304, the labeled content of the simulated bank card image can be updated. After the above operations, a card key point detection dataset, a bank card number detection dataset, and a bank card number recognition dataset labeled with the corresponding contents can also be obtained after step S305.

[0070] It should be noted that the embodiments of this disclosure do not explicitly limit the timing of annotating the initial bank card dataset and the simulated bank card dataset. Those skilled in the art can, according to the actual situation, flexibly perform the annotation operation at any step after obtaining the initial bank card dataset and the simulated bank card dataset.

[0071] Finally, in step S306, a multi-task recognition model is constructed using the bank card dataset. The specific implementation of constructing the multi-task recognition model can refer to the description above and will not be elaborated here.

[0072] The above Figure 3 Overall, the method 300 for constructing a recognition model of this disclosure has been described. The embodiments of this disclosure perform image segmentation on the images in the initial bank card dataset to extract bank card images, and then perform at least one enhancement transformation operation such as random rotation, scaling, HSV transformation, perspective transformation, blurring, and adding textures on the bank card images, and randomly synthesize the enhanced bank card images with the background images in the background dataset, so as to obtain an extended simulated bank card dataset, and this simulated dataset covers various influences of the real complex environment. Finally, the initial bank card dataset and the extended simulated bank card dataset are combined to obtain a sufficient bank card dataset that covers the complex and changeable environmental influences in reality. Furthermore, the multi-task recognition model constructed using this bank card dataset can cope with different complex environmental factors, enabling it to show more excellent recognition accuracy in practical applications.

[0073] However, those skilled in the art should understand that Figure 3 the method shown is exemplary rather than restrictive, and those skilled in the art can make adjustments according to needs. Next, in combination with Figure 4 the method for constructing a recognition model of some embodiments of this disclosure will be further described. Figure 4 An exemplary flowchart of the method 400 for constructing a recognition model of some embodiments of this disclosure is shown. As Figure 4 shown, the method 400 includes steps S401 to S404. Among them, steps S401 to S403 are respectively the same as steps S101 to S103 of the previous method 100, and step S404 is an additional technical solution of the method 100 for constructing a recognition model. Therefore, the features described above in combination with Figure 1 can be similarly applied here.

[0074] First, at S401, an initial bank card dataset and a background dataset are obtained. Then, in step S402, the initial bank card dataset is enhanced using the background dataset to obtain a bank card dataset. Next, in step S403, a multi-task recognition model is constructed using the bank card dataset. The specific implementation of each of the above steps can refer to the corresponding descriptions above and will not be elaborated here.

[0075] Finally, at step S404, the multi-task recognition model is converted into an ncnn model by using the ncnn framework. In the embodiments of the present disclosure, the ncnn framework (Neural Compute Neural Network) can be used to convert the multi-task recognition model into an ncnn model that can be deployed for inference on any end-side (such as a mobile device, a smart wearable device, etc., which are terminal devices that directly interact with users), thereby improving the compatibility of the multi-task recognition model constructed in the embodiments of the present disclosure.

[0076] The above combination Figure 4 Overall, the method 400 for constructing a recognition model of the present disclosure has been described. By converting the multi-task recognition model into an ncnn model in the embodiments of the present disclosure, the multi-task recognition model can be deployed on mobile devices such as mobile phones and computers, improving the compatibility of the multi-task recognition model. Further, when a user performs consumption settlement or transfer payment on a mobile device, only an image of a bank card needs to be input, and the deployed multi-task recognition model can accurately recognize the bank card number in the input image, thereby improving the efficiency and accuracy of bank card number recognition. However, those skilled in the art should understand that Figure 4 the method shown is exemplary and not restrictive, and those skilled in the art can make adjustments as needed.

[0077] The present disclosure also proposes a method for recognizing a bank card number. Specifically, it obtains an input image of a user, and then uses the multi-task recognition model constructed in any of the above embodiments to recognize the bank card number in the input image to obtain a recognition result of the bank card number. Based on the bank card number recognition method of the embodiments of the present disclosure, the user does not need to manually input the bank card number, and only needs to input an input image containing the bank card to accurately recognize the bank card number, thereby improving the efficiency of bank card number recognition and the user experience.

[0078] Figure 5 shows an exemplary flowchart of a method 500 for recognizing a bank card number according to some embodiments of the present disclosure. As Figure 5 shown, the method 500 includes step S501 and step S502. First, at step S501, an input image of a user is obtained. It can be understood that, ideally, the input image should contain a bank card. As an example, the input image can be obtained by photographing a bank card with a camera provided by a mobile device. Or directly select an input image containing a bank card from the photo album of the mobile device.

[0079] Furthermore, in step S502, the multi-task recognition model is used to recognize the bank card number from the input image to obtain the recognition result of the bank card number. The recognition result of the bank card number is the specific value of the bank card number. The multi-task recognition model is the multi-task recognition model constructed in any of the above embodiments. Based on the foregoing description, it can be known that this multi-task recognition model can cope with various complex environmental influences, so as to accurately recognize the bank card number in the input image.

[0080] The above combination Figure 5 Overall, the method 500 for constructing a recognition model of the present disclosure has been described. In the embodiments of the present disclosure, by obtaining the input image of the user, the multi-task recognition model constructed in any of the foregoing embodiments is used to recognize the bank card number from the input image to obtain the recognition result of the bank card number. Through this method of recognizing the bank card number, the user does not need to manually input the bank card number, and only needs to input the input image containing the bank card to accurately recognize the bank card number, and improve the recognition efficiency of the bank card number and the user experience.

[0081] However, those skilled in the art should understand that Figure 5 The method shown is exemplary rather than restrictive, and those skilled in the art can make adjustments according to needs.

[0082] In some embodiments, before performing step S502, the multi-task recognition model can be deployed locally so that when binding a bank card, the multi-task recognition model can be used to recognize the bank card number. The specific deployment method of this multi-task recognition model can refer to the prior art and will not be clearly defined here. It should be noted that this multi-task recognition model is an ncnn model, which has high compatibility and can be deployed on any mobile device, such as mobile phones, computers, tablets, etc.

[0083] Next, in combination with Figure 6 The specific execution process of using the multi-task recognition model to recognize the bank card number from the input image to obtain the recognition result of the bank card number will be described. Figure 6 An exemplary flowchart of a method 600 for recognizing a bank card number according to some embodiments of the present disclosure is shown. As Figure 6 shown, the method 600 includes steps S601 to S605. Among them, step S601 is the same as step S501 above, and steps S602 to S605 are a specific implementation manner of the foregoing step S502. Therefore, the features described in combination with Figure 5 above can be similarly applied here.

[0084] First, in step S601, the input image of the user is obtained. This step is the same as step S501 of the above method 600 and will not be elaborated here. The relevant content can be referred to the foregoing description.

[0085] Based on the foregoing description, the multi-task recognition model includes a card key point detection model, a card number detection model, and a card number recognition model. Among them, the card key point detection model is used to perform bank card target detection and bank card vertex position detection on the image. The card number detection model is used to detect the area where the bank card number is located in the image. The card number recognition model is used to recognize the bank card number within the area where the bank card number is marked in the image.

[0086] Therefore, further in step S602, the card key point detection model is used to perform card key point detection on the input image to obtain a card key point detection result. The card key point detection result includes a bank card detection frame. In the embodiments of the present disclosure, after the input image is input into the card key point detection model, the card key point detection model first performs bank card target detection on the input image to identify the bank card in the input image and obtain the coordinates of the bank card detection frame. The coordinates of the bank card detection frame can be represented by the upper left corner coordinates and the lower right corner coordinates. Based on the coordinates of the bank card detection frame, the bank card in the input image is framed to obtain a bank card detection frame.

[0087] In some embodiments, when the input image of the user does not include a bank card, then the card key point detection model will not detect a bank card when performing bank card target detection on the input image, or when the input image of the user does not fully present the entire picture of the bank card, then when the card key point detection model performs vertex position detection on the input image, it will not be able to detect all the vertices of the bank card. If the above situations continue to perform subsequent detection on the input image, on the one hand, it may not be possible to completely identify all the card number information on the bank card; on the other hand, it will cause unnecessary memory consumption and reduce the detection efficiency. Therefore, when performing step S602, the card key point detection model can also be used to perform bank card vertex position detection on the input image to further obtain a card key point detection result of the bank card vertex position. It can be understood that based on the foregoing construction process of the card key point detection model, it can be determined that the card key point detection model can perform bank card target detection and bank card vertex position detection on the input image, so there is no need to retrain the card key point detection model here. Then, after step S602, it can be first determined whether there is a bank card detection frame in the card key point detection result. Whether there is a bank card detection frame means whether a bank card is successfully detected in the input image. If there is no bank card detection frame, it indicates that no bank card is detected in the input image, and the following step S603 is not continued, but the above step S601 is jumped to to re-obtain the user's input image and perform bank card number recognition again.

[0088] Further, if there is a bank card detection frame, indicating that a bank card is detected in the input image, then further count the number of vertex positions of the bank card. If the number of vertex positions of the bank card is a preset threshold, which can be set to 4 as an example, it indicates that the input image includes a complete bank card without any omission. At this time, the steps S603 in the following text can be continued. On the contrary, if the number of vertex positions of the bank card is not the preset threshold, it indicates that there is an omission of the bank card in the input image. At this time, the steps S603 in the following text may not be continued, but instead jump to continue executing the above step S601 to re-obtain the user's input image and perform bank card number recognition again.

[0089] In step S603, crop the input image according to the bank card detection frame to obtain a bank card image. In the embodiments of the present disclosure, to avoid the influence of the background environment other than the bank card in the image on subsequent detection, the input image can be cropped along the boundary of the bank card detection frame, or the input image can be cropped after expanding the boundary of the bank card detection frame outward by a certain distance to obtain a bank card image that only contains the bank card.

[0090] In step S604, use the card number detection model to detect the card number of the bank card image to obtain the area where the bank card number is located. In the embodiments of the present disclosure, the bank card image is input into the card number detection model, and then the card number detection model detects the card number of the bank card image to determine the area where the bank card number is located, and frames the area where the bank card number is located in the bank card image with a rectangular box. Based on the foregoing description, the area where the bank card number is located refers to the specific range occupied by the bank card number digits or characters in the input image.

[0091] Finally, in step S605, use the card number recognition model to recognize the card number in the area where the bank card number is located in the bank card image to obtain the recognition result of the bank card number. In the embodiments of the present disclosure, the bank card image marked with the area where the bank card number is located is input into the card number recognition model, and the card number recognition model recognizes the card number in the area where the bank card is marked in the bank card image to determine the recognition result of the bank card number and output it. It can be understood that this recognition result is the specific value of the bank card number.

[0092] The above combination Figure 6Generally, a method 600 for constructing an identification model according to the present disclosure is described. In the embodiments of the present disclosure, an input image of a user is obtained. Then, a card key point detection model is first used to perform card key point detection on the input image to obtain a card key point detection result including a bank card detection frame. Then, the input image is cropped according to the bank card detection frame to obtain a bank card image. This step can eliminate the background influence in the image except for the bank card, and further improve the accuracy of the recognition result. Then, a card number detection model is used to detect the card number on the bank card image to obtain the area where the bank card number is located. Finally, a card number recognition model is used to recognize the card number in the area where the bank card number is located on the bank card image to obtain the recognition result of the bank card number.

[0093] However, those skilled in the art should understand that Figure 6 the method shown is exemplary rather than restrictive, and those skilled in the art can adjust it according to needs. Next, in combination with Figure 7 some embodiments of the present disclosure will be further described for the method of bank card number recognition. Figure 7 An exemplary flowchart of a method 700 for bank card number recognition according to some embodiments of the present disclosure is shown. As Figure 7 shown, the method 700 includes steps S701 to S708. Among them, steps S701, S702, S706, S707, and S707 are respectively the same as steps S601 to S605 described in the foregoing method 600. Steps S703 to S705 are additional technical solutions for the method of bank card number recognition in some embodiments of the present disclosure. Therefore, the features described in combination with Figure 6 above can be similarly applied here.

[0094] First, in step S701, an input image of a user is obtained. Then, in step S702, a card key point detection model is used to perform card key point detection on the input image to obtain a bank card detection result. The bank card detection result includes a bank card detection frame and the bank card vertex position. Steps S701 and S702 here can refer to the descriptions of steps S601 and S602 in the foregoing method 600, and will not be elaborated here.

[0095] Next, in step S703, the reference bank card vertex position in a preset standard environment is obtained. As an example, the reference bank card vertex position can be obtained by using a card key point detection model to detect the bank card vertex position of a clear reference bank card image.

[0096] In step S704, a perspective transformation matrix is determined according to the positional relationship between the vertex positions of the bank card and the reference vertex positions of the bank card. In the embodiments of the present disclosure, the vertex positions of the bank card and the reference vertex positions of the bank card can be input into existing perspective transformation matrix calculation software provided on the market, so that the software calculates the perspective transformation matrix according to the positional relationship between the vertex positions of the bank card and the reference vertex positions of the bank card. For example, the cv2.getPerspectiveTransform() function provided by OpenCV (Open Source Computer Vision Library) can be used to calculate the perspective transformation matrix.

[0097] In step S705, the input image is subjected to perspective transformation by using the perspective transformation matrix to obtain a corrected input image. In the embodiments of the present disclosure, by performing perspective transformation on the input image, problems such as geometric distortion, perspective deviation, and projection deformation caused by factors such as the shooting angle and the camera position of the input image can be corrected, thereby providing a good basis for subsequent bank card number recognition and further improving the accuracy of bank card number recognition.

[0098] Then in step S706, the input image is cropped according to the bank card detection frame to obtain a bank card image. Further in step S707, the bank card image is subjected to bank card number detection by using a card number detection model to obtain the area where the bank card number is located. Finally, in step S708, the area where the bank card number is located in the bank card image is subjected to bank card number recognition by using a card number recognition model to obtain the recognition result of the bank card number. The relevant content of these three steps can refer to the corresponding description of method 600 in the foregoing, and will not be elaborated here.

[0099] The above has described Figure 7 Generally, the method 700 for constructing an identification model according to the present disclosure is described. In the embodiments of the present disclosure, first, a card key point detection model is used to perform card key point detection on the input image, which includes bank card target detection and bank card vertex position detection. After obtaining the card key point detection result including the bank card detection frame and the bank card vertex position, in order to correct problems such as geometric distortion, perspective deviation, and projection deformation caused by factors such as the shooting angle and the camera position of the input image, then the reference vertex positions of the bank card in a preset standard environment are obtained, and a perspective transformation matrix is determined according to the positional relationship between the vertex positions of the bank card and the reference vertex positions of the bank card, so as to perform perspective transformation on the input image by using the perspective transformation matrix to obtain a corrected input image. Then subsequent detection is performed on the corrected input image to finally obtain the recognition result of the bank card number. Through the above correction operation on the input image, the accuracy of bank card number recognition can be further improved. However, those skilled in the art should understand that Figure 7The method shown is exemplary rather than restrictive, and those skilled in the art can make adjustments as needed.

[0100] Based on the description of the method for identifying a bank card number above, next, in combination with the attached Figure 8 and Figure 9 Describe the overall exemplary process steps of the method for identifying a bank card number in some embodiments of this disclosure. As Figure 8 shown, the process starts. First, obtain the input image of the user. The obtained input image is as Figure 9 shown in Figure a. Then input the input image into the card key point detection model to obtain the card key point detection result including the bank card detection frame and the bank card vertex positions as shown in Figure 9 Figure b. Further, determine whether there is a bank card detection frame in the card key point detection result. If there is no bank card detection frame, return to execute the step of obtaining the input image of the user. If there is a bank card detection frame, further determine whether the number of bank card vertex positions is equal to 4. If the number of bank card vertex positions is not equal to 4, return to execute the step of obtaining the input image of the user. If the number of bank card vertex positions is equal to 4, further correct the input image. The specific correction operation is to determine the perspective transformation matrix according to the position relationship between the reference bank card vertex positions and the bank card vertex positions in the aforementioned card key point detection result; then use the perspective transformation matrix to perform perspective transformation on the input image to obtain the corrected input image. The corrected input image is as Figure 9 shown in Figure c. After that, further crop the corrected input image according to the bank card detection frame to obtain the bank card image as shown in Figure 9 Figure d. Then input the bank card image into the card number detection model to obtain the area where the bank card number is located in the bank card image. The area where the bank card number is located can be referred to Figure 9 Figure e. Finally, continue to input the bank card image into the card number recognition model to recognize the bank card number in the area where the bank card number is located in the bank card image to obtain the recognition result of the bank card number. The recognition result is as Figure 9 shown in the figure, which is the specific value of the bank card number.

[0101] In order to implement the method steps described in this disclosure above in combination with the drawings at the software and hardware levels, the embodiments of this disclosure also provide a processing device, and this processing device can be an electronic device as Figure 10 shown. Figure 10 Shows an exemplary structural block diagram of the electronic device 10 in the embodiments of this disclosure. As Figure 10 shown, the electronic device 10 of this disclosure may include a processor 110 and a memory 120. Among them, an executable program is stored on the memory 120, and the processor 110 can load and execute the executable program so that the electronic device 10 realizes any method step described above.

[0102] In an example scenario, the processor 110 can be used to control the memory 120. Further, the processor 110 can be a central processing unit (CPU), an application processor (AP), etc. integrated in the electronic device 10; and the memory 120, as the hardware for implementing the storage function, can be a read-only memory (ROM), a dynamic RAM (DRAM), etc.

[0103] This disclosure can also be implemented as a computer-readable storage medium storing program instructions that, when executed by a processor of an electronic device, cause the processor to perform at least part of the various steps of the above methods of this disclosure. In an embodiment of this disclosure, a computer program product is also provided, including a computer program or instructions that, when executed by a processor, implement the method of building an identification model and the method of identifying a bank card number described in the embodiments of this disclosure.

[0104] Although multiple embodiments of this disclosure have been shown and described herein, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many variations, changes, and alternative ways can be thought of by those skilled in the art without departing from the spirit and scope of this disclosure. It should be understood that various alternatives to the embodiments of this disclosure described herein can be employed in practicing this disclosure. The appended claims are intended to define the scope of protection of this disclosure and thus cover equivalents or alternatives within the scope of these claims.

[0105] The collection and acquisition of various data in this application comply with relevant laws and regulations and are authorized by the data providers. Any organization or individual that needs to obtain external data shall obtain authorization according to law and ensure data security, and shall not illegally collect, use, process, or transmit unauthorized or unprotected data, nor illegally buy, provide, or disclose unauthorized or unprotected data.

Claims

1. A method for constructing an identification model, characterized in that, Including: Obtain an initial bank card data set and a background data set; Use the background data set to perform data augmentation on the initial bank card data set to obtain a bank card data set; And Use the bank card data set to construct a multi-task recognition model.

2. The method for constructing an identification model according to claim 1, wherein The multi-task recognition model includes a card key point detection model, a bank card number detection model, and a bank card number recognition model; the bank card data set includes a card key point detection data set, a bank card number detection data set, and a bank card number recognition data set respectively used to construct the card key point detection model, the bank card number detection model, and the bank card number recognition model; the card key point detection data set is labeled with a bank card detection frame and the vertex positions of the bank card; the bank card number detection data set is labeled with the area where the bank card number is located; The bank card number recognition data set is labeled with the area where the bank card number is located and the bank card number displayed in the area; The constructing the multi-task recognition model using the bank card data set includes: Use the card key point detection data set to train a first preset model to obtain the card key point detection model; Use the bank card number detection data set to train a second preset model to obtain the bank card number detection model; and Use the bank card number recognition data set to train a third preset model to obtain the bank card number recognition model.

3. The method for constructing an identification model according to claim 1, wherein The performing data augmentation on the initial bank card data using the background data set to obtain a bank card data set includes: Perform image segmentation on the initial bank card data set to extract bank card images; Perform augmentation transformation on the bank card images, where the augmentation transformation includes at least one operation of random rotation, scaling, HSV transformation, perspective transformation, blurring, and adding textures; Randomly synthesize the augmented bank card images with the background images in the background data set to obtain a simulated bank card data set; and Merge the simulated bank card data set and the initial bank card data set to obtain the bank card data set.

4. The method for constructing an identification model according to claim 3, wherein After the merging the simulated bank card data set and the initial bank card data set to obtain the bank card data set, it further includes: According to the type of the bank card data set, label the bank card data set to obtain a target bank card data set corresponding to the type; where If the target bank card data set is a card key point detection data set, label the bank card data set with a bank card detection frame and the vertex positions of the bank card; if the target bank card data set is a bank card number detection data set, label the bank card data set with the area where the bank card number is located; if the target bank card data set is a bank card number recognition data set, label the bank card data set with the area where the bank card number is located and the bank card number displayed in the area.

5. The method for constructing an identification model according to claim 1, wherein After the constructing the multi-task recognition model using the bank card data set, it further includes: Use the ncnn framework to convert the multi-task recognition model into an ncnn model.

6. A method for identifying a bank card number using an identification model constructed by the method according to any one of claims 1-5, characterized in that, Including: Obtain the input image of the user; And Use the multi-task recognition model to perform bank card number recognition on the input image to obtain the recognition result of the bank card number.

7. The method for identifying a bank card number according to claim 6, wherein The multi-task recognition model includes a card key point detection model, a card number detection model, and a card number recognition model; the using the multi-task recognition model to perform bank card number recognition on the input image to obtain the recognition result of the bank card number includes: Using the card key point detection model to perform card key point detection on the input image to obtain a card key point detection result, where the card key point detection result includes a bank card detection frame; Cropping the input image according to the bank card detection frame to obtain a bank card image; Using the card number detection model to perform card number detection on the bank card image to obtain the area where the bank card number is located; and Using the card number recognition model to perform card number recognition on the area where the bank card number is located in the bank card image to obtain the recognition result of the bank card number.

8. The method for identifying a bank card number according to claim 7, wherein The card key point detection result further includes the bank card vertex positions; before cropping the input image according to the bank card detection frame to obtain a bank card image, it includes: Obtaining the reference bank card vertex positions in a preset standard environment; Determining a perspective transformation matrix according to the positional relationship between the bank card vertex positions and the reference bank card vertex positions; and Performing perspective transformation on the input image using the perspective transformation matrix to obtain a corrected input image.

9. The method for identifying a bank card number according to claim 7, wherein, The card key point detection result further includes the bank card vertex positions. After using the card key point detection model to perform bank card target detection and bank card vertex position detection on the input image to obtain the card key point detection result, it further includes: Judging whether the bank card detection frame exists in the card key point detection result; If the bank card detection frame exists, determining the number of the bank card vertex positions; If the number of the bank card vertex positions is a preset threshold, performing the step of cropping the input image according to the bank card detection frame to obtain a bank card image; If the number of the bank card vertex positions is not the preset threshold, jumping to continue executing the step of obtaining the input image of the user; and If the bank card detection frame does not exist, jumping to continue executing the step of obtaining the input image of the user.

10. The method for identifying a bank card number according to claim 6, wherein The multi-task recognition model is an ncnn model; before using the multi-task recognition model to perform bank card number recognition on the input image to obtain the recognition result of the bank card number, it further includes: Deploying the multi-task recognition model.