A Chinese high school in Hangzhou is using facial-recognition technology that scans students every 30 seconds.

The system is analyzing students' emotions and actions in the classroom as well as replacing ID cards and wallets at the library and canteen.

Facial-recognition technology is widespread in China, where it is being used to predict crime.

But using the systems in schools has raised privacy concerns, and last year hundreds of channels livestreaming classroom surveillance footage online was shut down.

A Chinese high school is using facial-recognition technology to monitor and analyze students' behavior.

The technology scans classrooms at Hangzhou No. 11 High School every 30 seconds and records students' facial expressions, categorizing them into happy, angry, fearful, confused, or upset. The system also records student actions such as writing, reading, raising a hand, and sleeping at a desk.

The "intelligent classroom behavior management system," according to Global Times, also records students' attendance, and students' faces are used to pay for canteen lunches and to borrow items from the library.

The school's vice principal said students' privacy was protected because the technology didn't save images from the classroom and stored data on a local server rather than on the cloud.

Last year the Chinese company Qihoo 360 shut down hundreds of its surveillance livestreaming channels after an uptick in privacy concerns. The channels streamed camera footage from several public locations including swimming pools, restaurants, and classrooms — the latter protected only by a password.

But security systems are rising in popularity after an increase in violence and questionable practices at Chinese kindergartens. In Beijing, all kindergartens are now required to have surveillance systems, some of which are even connected to local police monitoring systems.

The use of facial-recognition technology is soaring in China, where it is being used to increase efficiency and improve policing. Cameras are used to catch jaywalkers, find fugitives, track people's regular hangouts, and even predict crime.

But China isn't the only country introducing surveillance in schools. Earlier this year, India's capital territory Delhi, said it would implement surveillance cameras at all governments schools, allowing parents to stream classroom footage in real time.