Tuesday, January 31, 2017

3 Methods to Read/Scan Photo ID

In the sign-up, enrolment or on-boarding process of any product or service, the one aspect that is definitely required is ID (identity document) information. Examples of ID are national ID card, passport, visa, and driver's license.

As part of the process to digitally enable customer on-boarding, ID reading or scanning is a need, not just a good-to-have. When correctly implemented, automated ID reading can lead to positive outcomes such as:

  • Eliminate, or at least, minimise data entry error
  • Prevent ID fraud
  • Speed-up process (from minutes to just seconds)

Some ID cards contain a chip, while some have machine readable code printed onto the card, and some are simply a card printed with readable characters. In general, following are 3 methods to read/scan a ID card as part of digital customer experience.

1. Contact Smart Card Reading

It's easy to identify if an ID card is a smart card. It has a visible chip, such as the Swedish national ID card shown below.

Specimen Obtained from Wikipedia

Other countries and regions adopting contact chip for ID card are EEA (European Economic Area), Malaysia (MyKad), Thailand, Hong Kong, UAE, Mongolia, and Pakistan (SNIC).

Reading of contact smart card/chip requires a smart card reader connected to the operating system platform of your choice - e.g. Windows, Android, iOS. The smart card reader, on its own, is not able to decipher information stored in any ID chip. You will need a software programmed to support the specific ID chip reading, in order to correctly retrieve the required data from a smart card-enabled ID. Typically, what's going on within the ID chip reader software is a set of APDU command messages. Every ID may store data in a different structure.

The chip will usually contain a lot more information than what's printed on the physical card surface. Besides additional biography details, an ID chip will also contain the ID bearer's photo, and even biometrics data such as fingerprint minutiae.

2. Contactless Smart Card Reading

Same concept as applied to contact chip, but the contactless smart card doesn't have a gold-plated chip visible on the card surface. Instead, the smart card contains embedded IC connectable through radio waves. Visa payWave and MasterCard PayPass are the 2 common examples of contactless smart card.

As of ID card, the Second-generation Resident Identity Card in People's Republic of China contains a contactless smart card. Indonesia's e-KTP is another example.

To check whether an ID card contains an contactless chip, you can:
  1. install NFC reader app into your NFC-supported smartphone,
  2. turn-on NFC, and
  3. try tapping the card to the back of your smartphone. 
  4. If your smartphone beeps, it indicates that a contactless chip is detected.
To read a contactless smart card, a contactless reader (sometimes also referred to as NFC reader) will be required, along with a software that supports deciphering of the specific ID card chip data.

3. OCR (Optical Character Recognition)

When an ID card has neither a contact nor contactless smart card, your best bet is OCR. The OCR process involves:
  1. Image capturing of an ID, either through the traditional flatbed scanner, or a camera photo.
  2. Computerised processing of the ID image file, to extract any machine readable data or printed text into machine-encoded text that can be understood by human, e.g. ID number, full name, address.
Following are some factors that determine the feasibility and accuracy rate of ID card OCR.
  1. Quality of the input image. The best and most consistent quality, is undeniably the scanned image from flatbed scanner. However, it is less portable, and hardly a convenient complement for today's mobile-oriented channel. Smartphone camera photos are not created equal. It is susceptible to motion blur and lighting reflection.
  2. Presence of MRZ (machine readable zone). Data encoded and printed into MRZ format is optimised for OCR, and thus, ensures a very high OCR accuracy. Most passports worldwide have MRZ printed on the identity page.
  3. Sample Obtained from Wikipedia
  4. Presence of 2D barcode. California's driver's license has a 2D barcode printed on the back of the card, which contains the bearer's identification details. When the barcode is properly decoded, the scanning result is almost always-accurate. 
  5. Quality of printed text, or the font type used. If there is a rubber stamp or signature on top of printed text, it will deteriorate OCR accuracy. Not all font types are created equal. Some font types - such as OCR_A and OCR_B are specifically optimised for OCR, and thus, speeds-up the OCR speed and accuracy. Some font types do not present vast distinction between O and 0, I and 1, and will impact the accuracy rate. Font size matters too - text with larger font size is easier to be recognised at higher accuracy rate. 
  6. Consistency of the content layout. It's obvious that, the more consistent a card layout is, the better it is for OCR. Some IDs created in the pre-digital computerisation era are not printed with 100% consistent layout.
  7. Presence of marker. In some cases, the word "Address:" always precedes street address. This serves as a consistent marker for OCR engine to recognise and interpret street address. 
  8. Language. English content comprises Latin/Roman alphabets, and it's one of the easier finite set of alphabets or symbols to be recognised by OCR. Chinese characters on the other hand, are far more complex.
Singapore National Identity Card (IC) doesn't have an embedded chip. However, the card's printed layout is of high quality, and consistent. Besides the ID number, there are only full name, race, date of birth, gender (M or F), and country of birth clearly printed on the front side. Singapore IC OCR can be performed at very high accuracy rate

When considering OCR, there are 2 types of processor available:
  1. Server side:
    • The traditional processing method in OCR technology. If server-side OCR is applied to ID input from mobile channel, it is done at the expense of user experience. Each time a photo is captured and submitted from mobile channel to server-side OCR engine, the user has to wait for upload to be completed. Once server-side responded with OCR result, and if the result isn't satisfying, the image capture and upload process has to be reiterated again.
  2. Client side:
    • If OCR is fully rendered in client-side, such as within the iOS/Android platform, user experience is more seamless.
While smart card reading promises retrieval of always-accurate data, OCR may not - especially when the OCR scanning is relying on recognition of printed text instead of MRZ/2D barcode, and when scanning is performed from today's modern channel - i.e. mobile device camera.

Besides, it is also easier to forge an ID card on the printed surface, than the smart card or chip. Smart card may contain security features, and even PKI. However, when speed of data entry and minimising human errors are the primary objectives, OCR is definitely a very good option when smart card reading isn't possible. At the same time, you may experience failure in reading a smart card, if there is manufacturing defect or the chip is simply damaged over time due to negligence.