9

I have fingerprint reader secugen and I have been able to get my application to control the fingerprint device by scanning fingerprints and I have been able to save them to mysql database!

After saving the fingerprints to the db, I now want to search for the user using fingerprint, and I can't search using new fingerprint because the fingerprint saved as blob/img. so I need to convert fingerprint to unique id to use it for searching in database?

I have mysql database with 9,000,000 user. Now I can get any user information by using user's (username)

SELECT USERS FROM members WHERE username=username_var

But now I can't use WHERE in my query because I have fingerprint template which is instead of (username) and the fingerprint will be changed every time, so i can't use the fingerprint in my query like (username) when i use WHERE in my query.

All fingerprint SDK have functions can help me with this but they are not so fast and take 7 minutes to search and that's a very long time.

I do not know what to do and how. I hope that you you understand my problem

ss.5
  • 157
  • 1
  • 1
  • 9
  • We don't know what fingerprint template is, what fingerprint you're talking about and what the heck the device you're using is doing. You've got an incomplete question there, please make it clearer and explain what it is you're doing. You want to find a person after . What is that? – N.B. May 14 '16 at 20:27
  • @N.B. done :) thank you – ss.5 May 14 '16 at 20:39
  • So all the data you have is actually an image? I'd create another column and I'd save the hash of the image (`SHA1` would suffice). Your table would have columns `(id, unique_id, fingerprint_image)`. To connect with `members`, use a junction table `members2fingerprints (member_id, fingerprint_id)`. Then, when you scan a fingerprint, hash the result and query your database. This should get you going, if you have more questions - shoot. – N.B. May 14 '16 at 20:46
  • @N.B. thank you so much, I have problem with that the the fingerprints images are never going to be exactly the same,so the SELECT WHERE will never work here. – ss.5 May 14 '16 at 20:54
  • Well, this is why you need to research this fingerprint SDK more. I've no idea what it does, nor how it matches fingerprints. It must do something more than just spit out an image, because if it only gives you an image - it's a bad device, smartphones can give you fingerprint images using their camera. I'm sorry but I can't help you further, there's information missing from this scanner of yours that I'm unaware of. – N.B. May 14 '16 at 20:57
  • @N.B. thank you, if you can check this maybe you can help me http://www.dreamincode.net/forums/topic/390173-can-save-fingerprint-but-cant-search-match/ – ss.5 May 14 '16 at 21:00
  • 1
    @N.B. There are only a few fingerprint scanners that will actually perform matching on the device. Most fingerprint scanners just capture images and it is up to the host computer and an algorithm to do the matching. While it is true that a cellphone camera can take a picture of a fingerprint, actually being able to use that picture for matching is very difficult. Most fingerprint sensors have sophisticated optics in order to clearly and accurately capture just the ridges and valleys of a fingerprint. – mageos May 25 '16 at 15:53
  • @mageos - I believe you, I really haven't used those scanners so I was simply making assumptions. It's indeed true that some things should be left to experts and not people who have no clue what they're talking about, such as me in this case :) thanks for the comment, will keep it in mind. – N.B. May 25 '16 at 18:40
  • @ss.5 Did you find any solution for this ? can you help me this i have same issue to match finger print from database. Thanks – Gautam Vasoya Sep 08 '17 at 04:02

4 Answers4

13

Summary

Either your SDK provides a way of transforming a fingerprint taken from its sensor into a string suitable for relaxed/approximate pattern matching using regular expressions, or into a binary bit vector of fixed size suitable for binary matching; or you need to find a library to do this conversion yourself. All other cases, while feasible in theory, simply aren't practical.

You cannot do anything with just the images.

And in this case, the Secugen SDK only allows access to image (for diagnostic purposes, I imagine) and it needs to run the check itself (and you want the 1:N kit for that; the 1:1 kit won't do). If you still want to pursue this, I'll include a suggestion at the bottom. Not really suggested, mind you.


Boring details

Fingerprints look too much alike one another to be amenable to standard image search. Even worse, the same fingerprint from the same person will never look the same in any two readings. Different pressure, speed, direction, environment temperature, sensor and skin moisture level, will lead to different images. Basically, you can do nothing until and unless you convert your fingerprint to a "feature vector".

There are instead functions (and your SDK should have them) to convert a fingerprint image to a list of special feature points (intersections, whorls and so on, called minutiae), along with their relative positioning and other parameters. The level up to which this happens depends on the SDK and library in use: there is more than one method. Being targeted for a very specific sensor helps, but then the methods differ in what they offer (e.g. robustness, invariance to slight fingerprints rotations, and so on). See this paper for an example as well as references to other methods.

Some kits do not allow this (do not supply the feature vector to the user) and only provide the means of comparing two fingerprint images, usually aligning them using PCA and then running a direct minutia matching. This works very well for a few images, but run time for finding an image in a database can be ruinous, so much that specialized hardware exists for the task (google 'Automatic Fingerprint Identification Systems').

Once you do have the feature vector, you need to convert it to a SQL storable object, which can be a string or a series of columns in a tuple. How to do this depends on how the vector is constructed. The nature of this object will dictate what kind of search you'll be able to run. This translation can be done in a number of ways and it definitely isn't something you should try on your own.

This also because even after vectorizing the fingerprints, you will still have no exact match. Not even between two fingerprints from the same person taken within the same minute. You will have instead a number of positive matches and a number of negative matches, and will need to establish a confidence threshold for both ("it's him", "it's not him", "can't say"). As well as deciding whether and to what extend tolerate false positives ("Yes, it's him!" - but it's not) and false negatives ("Nay, it's not him" - and it was). On a door lock you want no false positives, but can tolerate a false negative (you just slide your finger again). In a criminal investigation you can't allow a false negative to let the culprit slip, and you can accept a dozen false positives (you'll check their alibis later...) but not a hundred (you can't check out one hundred persons, and some of them won't have an alibi - no way you can arrest them all).

And for large databases you will always have to run a first pass whereby you restrict the search to those fingerprints that do have a reasonable invariant feature match (for instance, "absolute number of whorls between 75% and 125% of the sample). This is necessary to reduce the number of tuples you will then subject to further non-invariant analysis, which is much more expensive and definitely cannot be done with standard MySQL functions.

A different approach is to transform a fingerprint in a coded string representation, such that search may be done using a reasonable lexicographical approach available in a mainstream database (e.g. regular expression plus Levenshtein distance). Your SDK either supports this string conversion, or it doesn't; it involves one, possibly several transforms in feature and spectral domain. The trustworthiness of the method depends on how many features can be crammed into the string (the more signatures you have, the more precise the match needs to be, the more features you need, the longer the string).

You may be able to use some external library that does the encoding and checking for you using a suitable algorithm.

Even a simple thing such as "returning the closest match or define whether there is a match at all?" heavily depends on how the fingerprint is manipulated before storing. That's why usually SDKs will supply a high-level interface to match a fingerprint, and they'll do the heavy lifting themselves. Sometimes this heavy lifting is not translatable to a database at all (or not without tremendous difficulties); for example if the "enrollment" is actually the training of a neural network, and not the insertion of a feature vector into a database.

Dirty hack

You have nine million users (who are you, the FBI?) and permission to get nine million fingerprints. And you have this one SDK. And matching nine million images is out of the question. But for the reasons stated above, you can only ask the SDK the question, "is this image in your database?" and receive a list of, say, three names with "Yes at 99%, yes at 92%, yes at 90%".

You can perhaps do this: run a very high level, very rough binning on the image, based on something really macroscopic. I don't know, maybe the number of ridge minutiae. You will have to do this by examinining the image; possibly OpenCV might help you. You will get a number ranging from 1 to N, and this number will be unreliable, with an error of say 2%.

The key here is that you must be sure that the SDK will never say that a fingerprint that should go into block X will ever match with one that you binned into block Y.

Then you can build fifty databases with one fiftieth of the users each, supposing (rather: hoping) that your parameter distribution is reasonably flat, and not a steep Gaussian. When analyzing a fingerprint, you can copy in the SDK database directory one of the fifty databases, the one corresponding to the X value from the fingerprint you have, and in which you will have stored only those users with the same X value. Due to uncertainty, some users will be in two databases, but this way you reduce the problem by a factor of fifty (or maybe forty-five).

You still need to call the SDK matching function, since you have no other way of classifying the incoming fingerprint; but you can perhaps reduce the run time to manageable proportions.

LSerni
  • 49,775
  • 9
  • 56
  • 97
  • thank you sooo much, there are a lot of good information but i'm new in this, can you give me an example . Know I can save fingerprints minutiae as template using my sdk and I can save it in DB, what the next I should do – ss.5 May 14 '16 at 21:27
  • check this for better understanding http://www.dreamincode.net/forums/topic/392974-how-to-search-for-the-user-using-herhis-fingerprint/ – ss.5 May 14 '16 at 21:28
  • I see. Your SDK allows to "compile" an image into a template. Try this: get a template for two different scans of your index finger (call these A and B) and one for your ring finger (C). Can you access the templates? What do they look like? If you can spot similarities between A and B, that aren't between A and C or B and C, then you can try and develop a MySQL "filter" that will find likely candidates only. Then you can run `m_FPM.MatchTemplate()` only on those images. Without the SDK documentation I'm afraid there's little more that we can tell you. – LSerni May 14 '16 at 21:46
  • SDK documentation , https://www.scribd.com/doc/312618062/FDx-SDK-Pro-NET-Programming-Manual-Windows – ss.5 May 15 '16 at 01:32
  • 2.14. Template Format The FDx SDK Pro supports three types of fingerprint template formats: • SecuGen’s proprietary template format (”SG400”) • ANSI-INCITS 378-2004 "Finger Minutiae Format for Data Exchange" (“ANSI378”) • ISO/IEC 19794-2:2005 "Biometric Data Interchange Formats-- Finger Minutiae Data" (“ISO19794-2”) SG400 templates are encrypted for high security and have a size of 400 bytes. ANSI378 and ISO19794-2 templates are not encrypted, and their size is variable depending on how many fingers are in the structure and how many minutiae points are found. – ss.5 May 15 '16 at 02:27
  • I'm waiting for your help :) – ss.5 May 15 '16 at 17:16
5

There is a common misconception that there is a way to convert a fingerprint image into a unique ID that can be compared against the same way a password or a hash of a password can be compared. In reality, all fingerprint algorithms that I know of operate on some basic principles.

Extraction
The first step in processing a fingerprint image is extraction. This typically involves a number of image processing algorithms to create a clean, binarized version of the image. This is then processed for minutia points and other data points that are useful when comparing images. These points are stored in a data struct called a template. Because no two impressions of a finger will ever be exactly the same, even these templates cannot be hashed and compared for equality. The only way to compare fingerprints is with a matching algorithm.

Matching
Matching takes two templates and compares them. Most of the time this involves taking the relative locations of similar minutia points in each image. Sometimes the templates need to be rotated to accommodate variations in the users placement of their finger. The algorithm then takes the results of all these comparisons and generates a score that represents how confident the algorithm is that the two templates match.

Once a score is generated the application can check to see if is high enough to consider as a match.

No biometric algorithm is perfect. Algorithms have their accuracy measured by two metrics, the False Accept Rate (FAR) and the False Reject Rate (FRR). As you work to lower the FAR, you inevitably will increase the FRR as the threshold for matching will increase.

mageos
  • 1,176
  • 6
  • 14
0

I do not know if this will be of much help to you but basing my answer on what I have done on other SDKs while converting extracted templates to either ANSI or ISO format for saving of fingerprint templates to database, in your case you could e.g. use either of the following based on if you want ANSI or ISO template formats.

m_FPM.SetTemplateFormat(SGFPMTemplateFormat.ANSI378); to set your template to ANSI378 then save it to database

or

m_FPM.SetTemplateFormat(SGFPMTemplateFormat.ISO19794); to set your template to ISO19794-2 then save it to database

then when you are matching your captured fingerprint template to those saved in the database you then capture a fingerprint image then convert it to either ANSI or ISO template depending on the template format type you chose to save your templates then do the matching with either MatchAnsiTemplate or MatchIsoTemplate functions in your SDK according to the template format you chose for your archived fingerprint templates in your database.

I also noted that Secugen has it own proprietor Template format SG400 which you could also choose to use as well. The main concern here is that if you saved your fingerprint templates in ANSI format then for your captured fingerpint image convert it to ANSI template then loop through your fingerprint templates in database and use MatchAnsiTemplate function to find the correct match. If you saved your fingerprint templates in ISO format then for your captured fingerpint image convert it to ISO template then loop through your fingerprint templates in database and use MatchIsoTemplate function to find the correct match.

Joseph
  • 559
  • 1
  • 6
  • 19
  • Thank you , but if I save template in my database how to search in database using a new fingerprint template? So I can't search using "WHERE" if you understand me – ss.5 May 16 '16 at 14:25