In-depth evaluation-Android free bank card recognition SDK, which is better, Huawei HMS MLKit and Card IO?

Posted Jun 15, 202014 min read

1 Introduction

Two previous articles have introduced the bank card recognition function of Huawei HMS MLKit. The first one is how to simply integrate bank card recognition to realize the bank card binding function. The second article introduces the bank card recognition and The difference and relationship between other text recognition services, please refer to the previous link for details:

Ultra-simple integration of Huawei HMS MLKit machine learning service Bank card recognition SDK, one-click implementation of bank card binding

Https://developer.huawei.com/consumer/cn/forum/topicview?tid=0201217390745110144&fid=18

One article to understand Huawei HMS ML Kit text recognition, bank card recognition, universal card identification, ID card recognition

Https://developer.huawei.com/consumer/cn/forum/topicview?tid=0201242744680220246&fid=18

Through the above two articles, the friends must already know the usage scenarios of bank card recognition, and how to use Huawei's bank card to identify the SDK. What is the effect of the SDK provided by Huawei and how competitive? The editor of this article will give you an in-depth evaluation. How about the effect?


2 Pick a competing product-Card IO

Just like the mobile phone evaluation, in order to better reflect the evaluation effect, the editor needs to choose a competitor. For the better, we will choose a more popular github open source project Card.io for comparison. Look at the two The effect is good. The editor downloads a demo code from github, generates an APK through compilation, and installs it on the phone. Let's start our comparison.


3 Comparative analysis dimensions

As a developer, if you want to choose an easy-to-use SDK, you will mainly consider whether the SDK will charge or not, identify whether it is accurate, fast or not, etc. The editor will list the dimensions that you want to compare from the perspective of the developer. The following dimensions are expanded.

Developer focus Contrast dimension
Do you charge? Cost and expense comparison
Which devices are supported? Equipment type coverage comparison
How much space is required to integrate the SDK? SDK package size comparison
Which countries and types of cards can be identified? Comparison of supported card types
Is the recognition speed fast? Recognition speed comparison
Is the identification accurate? Identification accuracy comparison
Is the workload of integrated development large? Integration difficulty comparison

4 Is there any charge? --Comparison of use cost and expense

This comparison is simple, just list it out.

SDK Cost and Expense Comparison
Huawei HMS MLKit Bank Card Identification Service Free Huawei HMS MLkit All end-side capabilities are currently free of charge. You can see the official service introduction: https://developer.huawei.com/consumer/cn/doc/development /HMS-Guides/ml-introduction-4
Card.io Free As previously mentioned, Card.io is an open source project on github, so it is free to use

Comparison conclusion:tie, both are free


5 Which devices are supported? --Comparison of equipment type coverage

SDK Device Type Coverage Comparison
Huawei HMS MLKit Bank Card Identification Service Full Model Coverage All the capabilities of Huawei HMS MLKit are covered by all models, which means that Huawei models can be used, and non-Huawei mobile phones can also be used
Card.io Full model coverage Card.io itself is an open source project, but also full model coverage.

Comparison conclusion:tied, all models are covered


6 How much space does the integrated SDK need to occupy the APP? --SDK package size comparison

card.io provides a variety of algorithm libraries such as x86_64, arm64-v8a, X86, armeabi-v7a, armeabi, mips, etc. This is mainly used to adapt to different CPUs, because current Android phones are basically arm Architecture, and armeabi is currently obsolete, so for the sake of fairness, we only calculate algorithm libraries of arm64-v8a and armeabi-v7a. Huawei HMS ML Kit bank card recognition service also supports the provision of these two algorithm libraries. Compare the results below.

6.1 Cardio SDK package size:

Insert picture description here

This is the size of the entire sample APK. The size of the SDK part after removing the sample code is about 6.1M.

6.2 Huawei MLKit bank card recognition SDK package size:

Insert picture description here

By analyzing the size of the sample APK, you can see that the SDK contains two parts:algorithm and resources, and you can see that the total size of the SDK parts is about 3.1M.

6.3 Comparison conclusion:Obviously, Huawei HMS MLKit is better

The comparison is summarized as follows:

SDK SDK package size comparison
Huawei HMS MLKit Bank Card Identification Service About 3.1M
Card.io About 6.1M

7 Which countries and types of cards can be identified? --Comparison of recognized card types

7.1 Analysis of common card types

Common bank cards in the world are Visa, JCB, MasterCard, Express Card, China UnionPay, etc. We will select some examples for these cards and see how the two SDKs recognize the results.

7.2 Visa card identification comparison

The editor found several visa cards for identification, to see if the starting card type and card number can be correctly identified.

7.2.1 Card.io:Visa card can be recognized correctly

Insert picture description here

7.2.2 Huawei HMS MLKit:Visa cards can be correctly recognized

Insert picture description here

It seems that for Visa cards, the card type and card number can be correctly identified.

7.3 Mastercard identification comparison

7.3.1 Card.io:Can be correctly identified

Insert picture description here

7.3.2 Huawei HMS MLKit:Can be correctly identified

Insert picture description here

7.4 JCB card identification comparison

7.4.1 Card.io:Recognition test unsuccessful

Since there is no real JCB card in hand, I found some cards on the Internet and tested multiple cards, but none of them were recognized. Small partners with real cards can experience it by themselves and feedback the test results.

Test result description:In the screenshot below, all the alignment boxes on the periphery of the bank card turn green to indicate that the alignment has been completed, but the recognition result has not been returned.

Insert picture description here

7.4.2 Huawei HMS MLKit:Can be correctly identified

Insert picture description here

Note:Since there is no real card, there is no identification of the starting card organization. Small partners with real cards can experience it by themselves and feedback the test results.

7.5 Comparison of Express Cards

7.5.1 Card.io:Recognition test unsuccessful

Test result description:In the screenshot below, all the alignment boxes on the periphery of the bank card turn green to indicate that the alignment has been completed, but the recognition result has not been returned.
Insert picture description here

There is no real express card on hand, so I found some cards on the Internet and tested multiple cards, but none of them were recognized. Small partners with real cards can experience it for themselves and feedback the test results.

7.5.2 Huawei HMS MLKit:Can be correctly identified

Insert picture description here

Since there is no real card, the organization is not recognized. Small partners with real cards can experience it by themselves and feedback the test results.

7.6 UnionPay Card Comparison

7.6.1 Card.io:Can be correctly identified, but the issuing bank is incorrectly identified

Insert picture description here

The card type was mistakenly identified as a discover card.

7.6.2 Huawei HMS ML Kit:Can be correctly identified

Insert picture description here

Can correctly identify the card number and card type.

7.7 Comparison conclusion:Huawei HMS MLKit is better than Card.io from the test situation

SDK | Visa Card | Master Card | JCB Card | Express Card | UnionPay Card |
| --- | --- | --- | --- | --- | --- |
| HUAWEI HMS MLKit Bank Card Recognition Service | Recognizable correctly | Recognizable correctly | Recognizable correctly | Recognizable correctly | Recognizable correctly |
| Card.io | Recognizable correctly | Recognizable correctly | Not tested successfully | Not tested successfully | Can be correctly recognized(Card type recognition error) |

Through the above comparison, we can see that Huawei HMS MLKit bank card recognition can be recognized by international mainstream cards. Card.io can recognize common cards such as Visa and MasterCard, but JCB cards, Express cards, etc. have not passed the test.


8 Is the recognition fast? --Identification speed comparison

For fairness, here we only select cards that both SDKs can recognize for testing.

8.1 Card.io:slow calibration but fast recognition

Card.io needs a long time to calibrate in front of it. You must wait until the card is completely in the frame(the frame will become all green at this time) before starting the test. Since the calibration is very strict, the patience of the user is very tested here. Careful alignment is required. But once the alignment is complete, the recognition speed is very fast, almost no delay, and the result is returned immediately after alignment.

Insert picture description here

8.2 Huawei HMS ML Kit:Quick calibration and recognition

As you can see from the following picture, Huawei HMS MLKit bank card recognition does not need to be fully aligned. It only needs to be within the detection frame to start recognition. The overall end-to-end calculation is faster than Card.IO.

Insert picture description here

8.3 Comparison conclusion:each has its own merits, under normal circumstances the end-to-end recognition speed MLKit is better than Card.io

Although Card.io has a faster recognition speed, it needs to rely on the calibration frame to fully calibrate. It is difficult to fully calibrate the calibration frame, and it often takes a long time. Huawei HMS ML Kit does not need to be fully aligned with the calibration frame.

SDK Recognition Speed Description
Card.io The recognition speed is very fast, but it needs to rely on the calibration frame to fully calibrate It is difficult to calibrate the calibration frame completely. This operation often takes a long time, and the entire recognition process takes a very long time.
Huawei HMS MLKit Bank Card Recognition Service Usually the overall speed is faster than card.io There is no need to fully align the calibration frame. When aligning the calibration frame, recognition will start at the same time. The overall speed is usually better than Card.io

Therefore, the comparison conclusion is as follows:Under the condition of fully aligning the calibration frame, Card.io recognition speed is better than ML Kit. However, if you look at the recognition speed from end to end(from the start to the final return result), then HMS ML Kit is likely to be faster than Card.io, unless Card.io is fully aligned with the calibration frame when it is started. But this is usually difficult to achieve.


9 Is the identification accurate? --Identification accuracy comparison

Different bank cards may affect the accuracy rate. It is possible that the SDK recognizes a certain type of bank card particularly well, and a certain type of recognition is particularly poor. For the sake of fairness, we will classify the bank card in further detail, and then in a certain To test the accuracy rate within the class, it may be clear to small partners who understand machine learning. Common machine learning techniques often use a large number of sample data sets for sample training to generate a recognition model, which can be used for inference analysis of the recognized content. Bank card recognition is also used In a similar way, the font of the bank card will be an important influence factor for bank card recognition.

So we first classify bank cards according to fonts. There is no uniform standard for bank card fonts, but the common international bank card fonts are 7B-OCR, OCR-A

  1. Farrington7B font, also known as 7B-OCR font, is a font created by Canadian barcode company Barcodesoft. The font is widely used internationally, including many domestic cards.

Insert picture description here

  1. OCR-A typeface, a typeface created by American Type Founders, was later widely used in the world in check coding, bank card number and other fields. You can see that the number "8" is like a "hulu".

Insert picture description here

  1. Other fonts, common Arial fonts:

Insert picture description here

Times font:

Insert picture description here

Below we test for different font dimensions:

9.1 Farrington7B font accuracy test

Selected 10 test samples for testing

Insert picture description here

Insert picture description here

Card.io:all can be correctly recognized

However, the card organization of UnionPay cards will be recognized as discover. This problem has already been explained in the previous chapter and will not be expanded.

In addition, the editor found that while doing some extended tests, although Card.io can recognize Farrington7B font bank cards, it only supports the recognition of xxxx-xxxx-xxxx-xxxx cards with spaces for every 4 consecutive numbers, but not other cards. Bank cards with spaces and formats such as xxxxxx-xxxxxx-xxxxxx, such as the one below, are not recognized.

As shown below:The green frame of the bank card in the format of xxxx-xxxx-xxxx-xxxx is perfectly aligned, but the result cannot be returned.

Insert picture description here
Huawei HMS ML Kit:all can be correctly identified

HMS MLKit can also be fully recognized.

9.2 OCR-A font accuracy test

If the editor does not have the real hand, I searched online for 4 days and found 4 cards that meet the coding rules.

Insert picture description here

Card.io:All four cards are not recognized

Not listed one by one, choose two of them for reference

Insert picture description here

Insert picture description here

Huawei HMS ML Kit:all can be correctly identified

Not listed one by one, choose two of them for reference

Insert picture description here

Insert picture description here

9.3 Bank cards in other fonts

The editor selected the following bank cards as samples to test, and see how the two SDKs are recognized.

Insert picture description here

Card.io:All four cards are not recognized

Even if the four cards are aligned, they cannot be detected successfully. Examples are as follows:

Insert picture description here

Huawei HMS ML Kit:all can be correctly identified

All four cards can correctly identify the card number and card type, for example:

Insert picture description here

9.4 Comparison conclusion:Judging from the results of this test, the recognition rate of Huawei HMS MLKit in OCR-A and other fonts far exceeds that of Card.io


I believe that through the above comparison conclusions, everyone already knows the comparison results in their hearts, here is a table to summarize:

SDK | Farrington7B font accuracy rate | OCR-A font accuracy rate | Other font accuracy rates |
| --- | --- | --- | --- |
| Card.io | 100%(only supports xxxx-xxxx-xxxx-xxxx format bank cards) | 0%| 0%|
| Huawei HMS MLKit Bank Card Identification Service | 100%| 100%| 100%|

[Remarks]The above accuracy rate data only represents the results of the sample test collected by me, not the official accuracy rate, the data is for reference only


10 Is the integration workload small? --Comparison of integration difficulty

The editors refer to the official website development steps on both sides, and summarize it for everyone:

10.1 Card.io integration difficulty:only two steps are required to complete code development

  1. Set the identification parameters and bring up the interface

Insert picture description here

  1. Rewrite the onActivityResult() method to get the result

Insert picture description here

10.2 Ease of integration for Huawei HMS MLKit:Similarly, only two steps are required to complete code development

  1. Set the identification parameters and bring up the interface

Insert picture description here

  1. Get the recognition result through callback

Insert picture description here

Insert picture description here

10.3 Contrast conclusion:tie, both are very easy to integrate

As you can see from the comparison above, the integration of the two SDKs is very simple, and it only takes a few lines of code to complete


Final summary

The whole evaluation is basically over here. Through the above evaluation, we can now answer the questions at the beginning of the article. We directly go to the comparison table to summarize the above comparison conclusions:

Developer Focus Contrast Dimension Conclusion
Do you charge? Cost and expense comparison Tie tie
Which devices are supported? Equipment Type Coverage Comparison Flat Hand
How much space is required to integrate the SDK? SDK package size comparison Test Huawei is about 3.1M, card.io is about 6.1, Huawei is dominant
Which countries and types of cards can be identified? Comparison of supported card types Tested Huawei can recognize five types, card.io three types, Huawei dominates
Is the recognition fast? Recognition speed comparison Each has its own advantages, usually end-to-end recognition speed Huawei is better than Card.io
Is the identification accurate? Recognition accuracy comparison Huawei is better than Card.io overall, Card.io in the test sample does not recognize font bank cards except Farrington 7B well
Development? Comparison of integration difficulty

Conclusion analysis
Why there is such a comparison result, I personally think that this is because Card.io is mainly aimed at international universal cards, such as Visa and Master cards, but it does not support local cards in various countries, and only supports very mainstream banks. Card number fonts and formats, and some card number fonts and formats are not well supported. If you want to identify a variety of bank cards more widely, then I believe that Huawei HMS MLKit bank card recognition SDK is a good choice.

HMS MLKit Demo and Github address:
Demo download and github address of HMS MLKit please refer to:
[ https://developer.huawei.com/consumer/cn/doc/development/HMS-Examples/ml-samplecode-4] ( https://developer.huawei.com/consumer/cn/doc/development/HMS- Examples/ml-samplecode-4)

Https://github.com/HMS-Core/h...

Bank card identification demo code path:MLKit-Samplemodule-textsrcmainjavacommlkitsampleactivityBankCardRecognitionActivity.java


Previous link: Things you must know to access the card-like fast service

Content source:[ https://developer.huawei.com/consumer/cn/forum/topicview?tid=0201272756582550132&fid=18] ( https://developer.huawei.com/consumer/cn/forum/topicview?tid=0201272756582550132&fid =18)

Author:AI \ _talking