Template format

SourceAFIS » Algorithm » Template format

This page describes the format of serialized fingerprint templates produced by SourceAFIS. You probably don't need to know this unless you want to access data stored in the template.

This page describes native SourceAFIS templates. SourceAFIS also supports a few foreign template formats, but their use is discouraged.

Why templates?

When SourceAFIS compares fingerprints, it really compares their high-level biometric features, specifically minutiae (ridge endings and bifurcations). Every minutia is characterized by its position, type (ending or bifurcation), and by the direction of the corresponding ending or bifurcation.

Feature extraction is the process of deriving biometric features from fingerprint image. Feature extraction produces fingerprint template, essentially a data structure encoding biometric features. Template is then fed to matcher for the actual matching. The reason for this separation is that feature extraction is several orders of magnitude costlier than matching a single pair of templates. Applications should cache the expensive templates whenever they are likely to be used more than once.

Serialization

Templates are an in-memory data structure. In order to encourage more effective caching, especially when searching large databases of fingerprints, fingerprint template can be serialized and stored persistently. Reloading the template from persistent storage is usually much faster than reconstructing it from fingerprint image. This page describes the format of serialized templates below.

Compatibility

SourceAFIS templates can be used only with the particular version of SourceAFIS that generated them. Attempting to use older templates in newer SourceAFIS may result in exceptions during deserialization or matching or in loss of accuracy during matching.

Applications should always store and transmit original fingerprint images. Serialized templates should be used only as a local cache and only with SourceAFIS library pinned to a particular version. When SourceAFIS needs to be upgraded, all templates must be re-extracted from fingerprint images.

SourceAFIS supports some foreign template formats, which can be used instead of native SourceAFIS templates, but this is discouraged. For compatibility and long-term storage, fingerprint images are better than any template format. For temporary template caches, native templates privide best performance and accuracy.

Visualization

The following visualization can be created from data stored in the serialized template. Original fingerprint image is in the background of the visualization, but it is not part of the template.

Endings are shown in blue, bifurcations in green. Sticks attached to minutiae point in the direction of that minutia. Image size corresponds to size stored in the serialized template.

Format

Serialized SourceAFIS template is a data structure serialized in JSON and compressed with gzip. Fields width and height describe the size of the input image after it was rescaled to 500dpi. The rest of JSON data is a list of minutiae. Every minutia is described by the following fields:

{
  "version": "3.8.1",
  "width": 388,
  "height": 374,
  "minutiae": [
    {
      "x": 74,
      "y": 136,
      "direction": 1.9513027039072617,
      "type": "ending"
    },
    {
      "x": 80,
      "y": 156,
      "direction": 1.9936502529278375,
      "type": "ending"
    },
    {
      "x": 174,
      "y": 16,
      "direction": 6.134295359570089,
      "type": "bifurcation"
    },
    {
      "x": 142,
      "y": 304,
      "direction": 5.780342096251726,
      "type": "ending"
    },
    {

... skipped 229 lines ...

      "y": 282,
      "direction": 5.412281850103933,
      "type": "ending"
    },
    {
      "x": 302,
      "y": 242,
      "direction": 5.244113047643495,
      "type": "ending"
    },
    {
      "x": 201,
      "y": 23,
      "direction": 3.0419240010986313,
      "type": "ending"
    },
    {
      "x": 194,
      "y": 93,
      "direction": 0.6000502134017536,
      "type": "ending"
    },
    {
      "x": 265,
      "y": 207,
      "direction": 1.6704649792860586,
      "type": "bifurcation"
    }
  ]
}