CHONGQING, China (WASHINGTON POST) - For 40-year-old Mao Ya, the facial recognition camera that allows access to her apartment house is simply a useful convenience.
"If I am carrying shopping bags in both hands, I just have to look ahead and the door swings open," she said. "And my five-year-old daughter can just look up at the camera and get in. It's good for kids because they often lose their keys."
But for the police, the cameras that replaced the residents' old entry cards serve quite a different purpose.
Now they can see who's coming and going, and by combining artificial intelligence with a huge national bank of photos, the system in this pilot project should enable police to identify what one police report, shared with The Washington Post, called the "bad guys" who once might have slipped by.
Facial recognition is the new hot tech topic in China. Banks, airports, hotels and even public toilets are all trying to verify people's identities by analysing their faces.
But the police and security state have been the most enthusiastic about embracing this new technology.
The pilot in Chongqing forms one tiny part of an ambitious plan, known as "Xue Liang," which can be translated as "Sharp Eyes".
The intent is to connect the security cameras that already scan roads, shopping malls and transport hubs with private cameras on compounds and buildings, and integrate them into one nationwide surveillance and data-sharing platform.
It will use facial recognition and artificial intelligence to analyse and understand the mountain of incoming video evidence; to track suspects, spot suspicious behaviour and even predict crime; to coordinate the work of emergency services; and to monitor the comings and goings of the country's 1.4 billion people, official documents and security industry reports show.
At the back end, these efforts merge with a vast database of information on every citizen, a "Police Cloud" that aims to scoop up such data as criminal and medical records, travel bookings, online purchase and even social media comments - and link it to everyone's identity card and face.
A goal of all of these interlocking efforts: to track where people are, what they are up to, what they believe and who they associate with - and ultimately even to assign them a single "social credit" score based on whether the government and their fellow citizens consider them trustworthy.
At this housing complex in Chongqing, "90 per cent of the crime is caused by the 10 per cent of people who are not registered residents", the police report said. "With facial recognition we can recognise strangers, analyse their entry and exit times, see who spends the night here, and how many times. We can identify suspicious people from among the population."
Adrian Zenz, a German academic who has researched ethnic policy and the security state in China's western province of Xinjiang, said the government craves omnipotence over a vast, complex and restive population.
"Surveillance technologies are giving the government a sense that it can finally achieve the level of control over people's lives that it aspires to," he said.
In this effort, the Chinese government is working hand in glove with the country's tech industry, from established giants to plucky start-ups staffed by graduates from top American universities and former employees of companies like Google and Microsoft, who seem cheerfully oblivious to concerns they might be empowering a modern surveillance state.
The name of the video project is taken from the communist slogan "the masses have sharp eyes", and is a throwback to Mao Zedong's attempt to get every citizen spying on one another.
The goal, according to tech industry executives working on the project, is to shine a light into every dark corner of China, to eliminate the shadows where crime thrives.
The Sharp Eyes project also aims to mobilise the neighbourhood committees and snoopy residents who have long been key informers: now, state media reports, some can turn on their televisions or mobile phones to see security camera footage, and report any suspicious activity - a car without a licence plate, an argument turning violent - directly to the police.
To the eyes of the masses, in other words, add the brains of the country's fast-growing tech industry.
By 2020, China's government aims to make the video surveillance network "omnipresent, fully networked, always working and fully controllable", combining data mining with sophisticated video and image analysis, official documents show.
TECHNOLOGY FOR FIGHTING CRIME
China is not alone in experimenting with these new technologies.
The US Federal Bureau of Investigation's Next Generation Identification System uses facial recognition to compare images from crime scenes with a national database of mugshots.
Police forces across the United States have been using algorithm-based techniques for several years to predict where crimes are likely to occur.
Chicago police identified and a court convicted a thief using facial-recognition technology in 2014, and Britain used a Japanese program called NeoFace Watch to spot a wanted man in a crowd in May.
The US, with around 62 million surveillance cameras in 2016, actually has a higher per capita penetration rate than China, with around 172 million, according to Monica Wang, a senior analyst in video surveillance and security at research consultants IHS Markit in Shanghai.
Yet it is China's ambition that sets it apart.
Western law enforcement agencies tend to use facial recognition to identify criminal suspects, not to track social activists and dissidents, or to monitor entire ethnic groups.
China seeks to achieve several interlocking goals: to dominate the global artificial-intelligence industry, to apply big data to tighten its grip on every aspect of society, and to maintain surveillance of its population more effectively than ever before.
"Deep learning is poised to revolutionise the video surveillance industry," Wang wrote in a recent report. "Demand in China will grow quickly, providing the engine for future market growth."
In the showrooms of three facial-recognition start-ups in Chongqing and Beijing, video feeds roll past on big screens, with faces picked out from crowds and matched to images of wanted men and women.
Street cameras automatically classify passers-by according to gender, clothes and even hair length, and software allows people to be tracked from one surveillance camera to the next, by their faces alone.
"The bigger picture is to track routine movement, and after you get this information, to investigate problematic behaviour," said Li Xiafeng, director of research and development at Cloudwalk, a Chongqing-based firm. "If you know gambling takes place in a location, and someone goes there frequently, they become suspicious."
Gradually, a model of people's behaviour takes shape. "Once you identify a criminal or a suspect, then you look at their connections with other people," he said. "If another person has multiple connections, they also become suspicious."
The start-ups also showcase more consumer-friendly applications of their technology. Companies like SenseTime, Megvii and Cloudwalk provide the software that powers mobile apps allowing people to alter, "beautify" or transform their faces for fun.
Much of their business also comes from banks and financial companies that are using facial recognition to check identities, at ATMs or on phones.
Some airports in China already employ facial recognition in security checks, and hotels are doing the same at check-in; a Chinese version of Airbnb promises to use it to verify guests' identities, while China's version of Uber, Didi Chuxing, is using it to verify those of its drivers.
Some of the applications have a slightly gimmicky feel. A lecturer at a Beijing university was said to be using a face scanner to check if his students were bored; a toilet roll dispenser at a public facility outside the Temple of Heaven in Beijing reportedly scans faces to keep people from stealing too much paper, while a Kentucky Fried Chicken restaurant in Hangzhou allows customers to simply "smile to pay".
Other ideas are struggling to move beyond the pilot stage: A plan to identify jaywalkers in Chongqing has already been abandoned, while residents have responded to facial-recognition gates on some apartment buildings in Chongqing and Beijing by propping the doors open.
Yet facial recognition is not going away, and it promises to become a potent tool for maintaining control of Chinese society.
So far, the technology doesn't quite match the ambition: It is not foolproof.
"There will be false positives for the foreseeable future," said Jim Dempsey, executive director of UC Berkeley's Centre for Law and Technology.
This raises two critical questions, he said. Does a country's due process system protect people from being falsely convicted on the basis of facial-recognition technology? And are the false positives disproportionately skewed towards certain minority groups, such as Chinese Muslims?
In China, the tech companies claim many times greater accuracy rates than, for instance, the FBI, and probably justifiably so, experts say: after all, they have been able to draw on a huge pool of photos from government records to improve their algorithms, without any pesky concerns about privacy.
More than anything else, experts say, deep learning technologies need huge amounts of data to come up with accurate algorithms. China has more data than anywhere else in the world and fewer constraints about mining it from its citizens.
"Now we are purely data driven," said Xu Li, CEO of SenseTime. "It's easier in China to collect sufficient training data. If we want to do new innovations, China will have advantages in data collection in a legal way."
Smart technology backed by artificial intelligence will be a tool to assist the police forces of the future. Chinese IT and telecoms giant Huawei says its Safe Cities technology has already helped Kenya bring down urban crime rates.
But who's a criminal? In China, documents for the Police Cloud project unearthed by Human Rights Watch list "petitioners" - people who complain to the government about perceived injustices - as potential targets of surveillance, along with anyone who "undermines stability" or has "extreme thoughts".
Other documents cite members of ethnic minorities, specifically Muslim Uighurs from Xinjiang, as subjects of scrutiny.
Maya Wang, a researcher at Human Rights Watch, said what sets China apart is "a complete lack of effective privacy protections", combined with a system that is explicitly designed to target individuals seen as "politically threatening".
"In other countries, we are often concerned about the use of big data for deepening existing policing bias - for example, for targeting historically disadvantaged groups like African Americans in the US context - but for the Chinese systems, the targeting of people of certain ethnicity is a fundamental function of the system," she added.