“When I go to a Broadway show, I’m not very happy that scalpers have bought up all the tickets,” says Andrew Ng, chief scientist of Baidu Research, the Silicon Valley branch of the tech company often described as the Google of China. Baidu has proposed a new artificial intelligence solution not only to thwart scalpers but to speed up the wait at any place where checking tickets or IDs leads to long lines. Today the tech giant announced new face recognition technology that it says is up to 99.77% accurate—able to distinguish people even better than a human can.

Baidu published two peer-reviewed research papers and tested the technology using popular methodologies, so it’s making more than empty claims. But beyond questions over how and how well these technologies work are questions of how they will be used. What are the implications of an extremely accurate face recognition database, owned by a massive tech and advertising company, that could be subpoenaed by a government?

Of course, Baidu is not alone in evangelizing the benefits of new face-recognition technologies. In recent months, both HSBC Bank and MasterCard have introduced selfie ID verification on their mobile apps (at least in pilot programs) as an alternative to passwords.

But Baidu’s program is potentially more ambitious. It aims not just to match one photo with the image already associated with the card. Instead it will scan everyone in long lines to get into venues, trying to match each scan against potentially huge facial databases—all in one second, vs. 10 seconds for fingerprint scanners that are currently being used in China (which is still faster than manually checking paper or on-screen tickets, says Ng). And that can cut backups. “The difference between one second and 10 seconds is not nine seconds,” says Ng. “It’s the difference between a five-minute wait and a half-hour wait.”

Baidu is starting with a program at the Wuzhen hotel along the waterways of the Xizha Scenic Area near Shanghai. The resort gets 8 million visitors per year, according to Baidu; and tickets are required to enter certain parts of the resort. (Face recognition won’t be used for access to guest rooms.) Baidu intends to market the cloud-based service widely. Ng says that its already working with a company (that he couldn’t name) to make face-recognition door locks for houses. And Ng would love to see it used to thwart scalpers: Someone buying a ticket would have to look into a webcam or smartphone camera so the system could match a face to a ticket (or a limited number of tickets). That would prevent bots from buying up huge blocks of tickets as soon as they go on sale, he believes. Ng also sees the tech being used in security settings like passport checks at airports.

Baidu is using a few tricks to improve accuracy and speed. For starters, it shoots video, not photos, so the system can pick the frame with the best focus and lighting, and without obstructions like another person or a raised hand, to do the analysis on. Ng’s team developed a technique called DenseBox, which he says can use a single neural network to identify a bunch of “bounding boxes” that mark parts of a scene, such as faces (like the yellow boxes that appear around someone’s face when you take a cellphone photo).

The next step, called Face Recognition via Deep Embedding, uses a pair of AI tools called convolutional neural networks (CNNs). CNNs are a staple of image recognition: They mimic the multi-step process in the brain that identifies ever-finer details—from lines, to shapes, to textures, etc. The innovation here, according to Baidu, is the two stages of recognition. The first CNN recognizes the details of a face in high resolution. The second extracts just the key features that are enough to make a comparison. “It takes as input the raw image and distills it down to a vector that captures the essence, the essential shape,” says Ng.