The system looks at each driver’s license photograph stored in the state’s computers, mapping thousands of facial data points and generating algorithms that compare the images to others in the mathematical database, said State Police spokesman David Procopio. The software then displays licenses with similar-looking photographs - those with two or more images that have a high score for being the same person. Registry analysts review the licenses and check biographical information, criminal records, and drivers’ histories, in part to rule out cases with legitimate explanations, such as drivers who are identical twins.

At least 34 states are using such systems. They help authorities verify a person’s claimed identity and track down people who have multiple licenses under different aliases, such as underage people wanting to buy alcohol, people with previous license suspensions, and people with criminal records trying to evade the law. Lisa Cradit, a spokeswoman for L-1 Identity Solutions , the largest developer of the software, said it can reduce fraud by 80 percent.

Massachusetts began using the software after receiving a $1.5 million grant from the US Department of Homeland Security as part of an effort to prevent terrorism, reduce fraud, and improve the reliability and accuracy of personal identification documents that states issue.

“Theoretically this can happen again, depending on the whims of the computer,’’ said his lawyer, William Spallina.

Neither the Registry nor State Police keep tabs on the number of people wrongly tagged by the system. But Gass estimates in his lawsuit that hundreds might have received revocation notices in error since the system was installed.

“We send out 1,500 suspension letters every day,’’ said Registrar Rachel Kaprielian, who says the system has been a powerful weapon to fight identity fraud since it was installed in 2006 but that it is not without problems. “There are mistakes that can be made.’’

And apparently, he has company. Last year, the facial recognition system picked out more than 1,000 cases that resulted in State Police investigations, officials say. And some of those people are guilty of nothing more than looking like someone else. Not all go through the long process that Gass says he endured, but each must visit the Registry with proof of their identity.

It turned out Gass was flagged because he looks like another driver, not because his image was being used to create a fake identity. His driving privileges were returned but, he alleges in a lawsuit, only after 10 days of bureaucratic wrangling to prove he is who he says he is.

After frantic calls and a hearing with Registry officials, Gass learned the problem: An antiterrorism computerized facial recognition system that scans a database of millions of state driver’s license images had picked his as a possible fraud.

“I was shocked,’’ Gass said in a recent interview. “As far as I was concerned, I had done nothing wrong.’’

John H. Gass hadn’t had a traffic ticket in years, so the Natick resident was surprised this spring when he received a letter from the Massachusetts Registry of Motor Vehicles informing him to cease driving because his license had been revoked.

Last year, State Police obtained 100 arrest warrants for fraudulent identity, and 1,860 licenses were revoked as a result of the software, according to Procopio.

“The advantage of securing the identity of 4 1/2 million drivers is of considerable state interest, and that is what this software does,’’ Kaprielian said.

In Pennsylvania, which began using the system in 2007, officials say they have directed 1,500 cases of suspected fraud to police. New York detected roughly 3,500 instances of possible fraud, resulting in 600 arrests since a system was adopted in 2010.

“Our goal is one person, one license,’’ said Jackie McGinnis, a spokeswoman for the Department of Motor Vehicles in New York. “And this is a good way to detect people who have multiple licenses for multiple reasons.’’

Gass, 41, said his ordeal began April 5 after he retrieved his mail from a PO Box in Needham. The letter from the Registry, dated March 22, 2011, notified Gass that his license had been revoked April 1.

He said he called the Registry three times, explaining in vain that he had only recently opened his mail and that he could no longer work because he drives for a living. Registry employees told him that he was flagged because his license photo was similar in appearance to another driver, his lawsuit alleges. He was told that to clear up the problem he would have to show proof of his identity to the Registry, he said.

Gass got a hearing April 11 in the Department of Transportation offices at 10 Park Plaza. There, hearings officer Kevin M. Innes showed Gass a sheet of paper with images of Gass and Edward Perry of Rehoboth, who had also received a letter. By that time, Perry had already provided the Registry with documents confirming his identity.

Gass said in the suit that he provided his birth certificate and Social Security card as proof of his identity, but that Innes insisted that he provide documents with his current address. Gass’s lawyer Spallina said he faxed the document two days later.

On April 14, Spallina called to confirm that the Registry had received the papers and was told that Gass was cleared at the hearing to drive again.

Gass is seeking unspecified damages and an injunction blocking the Registry from revoking licenses without a hearing, arguing that his job requires driving and that he lost wages while he waited to have his license reinstated. He said he has no qualms with efforts to crack down on fraud but is miffed at how his case was handled.

“No one is angry about the work they have to do to track fraud, but once they saw the error, even the words sorry would go a long way. But I got nothing,’’ he said. “The overwhelming attitude was they couldn’t care less.’’

Kaprielian said the Registry gives drivers enough time to respond to the suspension letters and that it is the individual’s “burden’’ to clear up any confusion. She added that protecting the public far outweighs any inconvenience Gass or anyone else might experience.

“A driver’s license is not a matter of civil rights. It’s not a right. It’s a privilege,’’ she said. “Yes, it is an inconvenience [to have to clear your name], but lots of people have their identities stolen, and that’s an inconvenience, too.’’

Meghan Irons can be reached at mirons@globe.com.

© Copyright 2011 Globe Newspaper Company.