Amazon Web Services has added several new features to its facial-recognition technology, Rekognition.

This includes expanded age-recognition capabilities and the new ability to recognize fear.

Rekognition is a controversial technology and has been the subject of much criticism and protests — from both inside and outside Amazon.

These new features drew some flack from commenters on Twitter.

Meanwhile, the US Customers and Border Patrol is looking for quotes on a sweeping new border protection system that includes more facial-recognition tech.

Amazon Web Services has expanded the capabilities of its controversial facial-recognition technology called Rekognition.

It now better detects more age ranges and it can also detect fear, the company announced in a blog post on Monday.

The company explained (emphasis ours):

Today, we are launching accuracy and functionality improvements to our face analysis features. Face analysis generates metadata about detected faces in the form of gender, age range, emotions, attributes such as 'Smile', face pose, face image quality and face landmarks. With this release, we have further improved the accuracy of gender identification. In addition, we have improved accuracy for emotion detection (for all 7 emotions: 'Happy', 'Sad', 'Angry', 'Surprised', 'Disgusted', 'Calm' and 'Confused') and added a new emotion: 'Fear'. Lastly, we have improved age range estimation accuracy; you also get narrower age ranges across most age groups.

Earlier this month AWS also announced that Rekognition can now detect violent content such as blood, wounds, weapons, self-injury, corpses, as well as sexually explicit content.

But it was the news of more age ranges and fear detection that was met with comments on Twitter.

Just last month several protesters interrupted Amazon AWS CTO Werner Vogels during a keynote speech at an AWS conference in New York.

Read: An Amazon Web Services VP explains why it's been successful in convincing Microsoft customers to jump ship

They were protesting AWS's work with the U.S. Immigration and Customs Enforcement (ICE) and the family separation policy at the Southern Border. Amazon hasn't acknowledged whether ICE uses its Rekognition technology, but the company did meet with ICE officials to pitch its facial-recognition tech, among other AWS services, as revealed by emails between Amazon and various government officials obtained by the American Civil Liberties Union Foundations.

Amazon's Rekognition has come under fire from a wide range of groups who want the company to stop selling it to law enforcement agencies. In April, AI experts penned an open letter to Amazon about it. Civil rights group have protested it. 100 Amazon employees sent a letter to management last year asking the company to stop selling Rekognition to law enforcement. Another 500 signed a letter this year asking Amazon to stop working with ICE altogether.

Read: How this programmer landed a job on Amazon's disaster relief squad, which has delivered $15 million of goods to displaced people worldwide

"AWS comes under fire for Rekognition sales to the federal government, who in turn is building concentration camps for children, and AWS's response is to improve 'age range estimation' and 'fear detection' in the service? Are you f-- KIDDING ME?!" tweeted Corey Quinn from the Duckbill Group, a consultant that helps companies manage their AWS bill. Quinn also hosts the Screaming in the Cloud podcast.

Another developer tweeted, "In 25 years we're going to be talking about how AWS handled this situation in the same way we talk about how IBM enabled the holocaust. Every engineer and ML researcher who worked on this should be ashamed of themselves."

The CBP is looking to buy more facial-recognition tech

Meanwhile, the U.S. Customs and Border Protection (CBP), a sister agency to ICE, has put out a new request for quotes on a sweeping new border-security system that includes expanded use of facial-recognition technology.

"Integration of facial recognition technologies is intended throughout all passenger applications," the RFQ documents say.

The CBP already uses facial recognition at various airports, such as in Mexico City, where it matches passenger's faces with photos taken from their passports or other government documents, it says.

Read: Amazon CTO Werner Vogels shared a powerful response to the ongoing protests of the company's involvement with ICE

And the CBP uses other biometric information, such as taking fingerprints of people at the border if it suspects that they are entering the country illegally, it says.

"CBP's future vision for biometric exit is to build the technology nationwide using cloud computing," the agency wrote in a 2017 article about the use of facial recognition and finger-print tech.

This new contract for new border security technologies is expected to begin in early 2020 and could be worth $950 million over its lifespan, according to the RFQ documents.