Dahua Racist Uyghur Tracking Revealed

By IPVM Team, Published Nov 04, 2020, 10:13am EST

Dahua's software, published on its website, was revealed to track Uyghurs, a persecuted minority in China. The 1-minute video below explains the situation:

This confirms Dahua developed discriminatory software like its rival Hikvision, which promoted a Uyghur-detecting AI camera last year.

Dahua deleted the source minutes after IPVM contacted them and would not comment. In this post, we examine this incident.

What Happened

The news first began spreading on Twitter after engineer Serge Bazanski (@q3k) posted lines of code from Dahua's SDK showing "EM_NATION_TYPE_UYGUR" next to "维族(新疆)" which means "Uyghur (Xinjiang)":

IPVM Image

After @q3k's tweet, the news was widely shared on social media, including by Hong Kong activist Joshua Wong:

IPVM Image

Internet users criticized the Dahua code as "dismaying" and "sickening", noting "you have to be quite inhumane to write code that massively discriminates against a group of people like this."

Get Notified of Video Surveillance Breaking News
Get Notified of Video Surveillance Breaking News

Note: Dahua is not partially state-owned, to the contrary of the tweet above, unlike its crosstown rival Hikvision.

What Does The Code Mean?

"EM_NATION_TYPE_UYGUR" is a face attribute analytic that is widely deployed across Chinese police security camera networks to automatically determine whether a person is Uyghur (or not). The goal is to allow PRC police to covertly track Uyghurs as they move throughout a city/town.

Many Chinese surveillance companies such as Megvii, SenseTime, and Yitu offer this analytic as reported by The New York Times. "NATION" is short for nationality (民族), the term used in the PRC for ethnic groups.

IPVM previously found over a dozen PRC police departments deploying Uyghur analytics, which China's top law enforcement agency even included in facial recognition guidelines:

IPVM Image

The PRC government has been criticized by activists and (mostly) Western governments for human rights abuses against Uyghurs, chiefly by building a sprawling surveillance state in their home region of Xinjiang and sending millions to 're-education' camps.

Dahua Sanctions Over Uyghur Abuses

Dahua was sanctioned by the US government in October 2019 over complicity in human rights abuses against Uyghurs; in response, Dahua bragged this showcased its “strong technology”. Dahua is deeply involved in surveillance against Uyghurs, having won almost $1 billion in massive Xinjiang police surveillance deals.

Code Is On Dahua's Own Website

The SDK which mentions Uyghur recognition was available on Dahua's own Downloads page on its website which showed the SDK was current with the last update on April 21, 2020:

IPVM Image

Dahua Deletes SDK Minutes After IPVM Requests Comment

Minutes after IPVM contacted Dahua to request comment on this story, Dahua deleted that SDK. The Dahua downloads page now has a new SDK dated November 4 which does not include Uyghur recognition, IPVM verified.

Other Analytics Being Used

The Dahua SDK shows other analytics, including whether or not someone has a beard:

IPVM Image

Beard analytics are notable since the PRC government has cracked down on beards in Xinjiang for being a sign of religious piety (unlike in the US, in China men rarely have beards).

As noted online, the Dahua SDK also rates "attractiveness" on a 1-100 scale and has "race" detection ("black", "yellow", "white" are the only three 'races').

Dahua No Response

Although Dahua deleted the SDK less than 30 minutes after our request for comment, it did not respond to our questions about this code for more than a day. If Dahua later chooses to comment, we will update.


This incident highlights how pervasive anti-Uyghur discrimination is for PRC video surveillance companies, who profit from huge PRC police spending.

Dahua continues to avoid answering legitimate questions about its direct deals with the Xinjiang government, including selling software and services that discriminate against the persecuted Uyghur minority.

4 reports cite this report:

Patenting Uyghur Tracking - Huawei, Megvii, More on Jan 12, 2021
A patent application authored by Huawei and the PRC government includes...
Huawei / Megvii Uyghur Alarms on Dec 08, 2020
Huawei and Megvii worked together to test and validate Uyghur alarms,...
Uniview Racist Uyghur Recognition Revealed on Nov 16, 2020
Uniview, the PRC's third-largest video surveillance manufacturer and a major...
Milestone Denies Dahua "Joint Value Proposition" on Nov 11, 2020
Just days after Dahua's racist Uyghur tracking was revealed, Dahua ran...

Comments (16)

Only IPVM Members may comment. Login or Join.

It's almost like installing gas chambers for the Nazi Germany concentration camps. I have heard they even practice forceful sterilization of Uyghur women there in China. I wouldn't buy equipment by such a manufacturer.

This is in NO WAY even close to being equivalent to installing gas chambers. Is it complicity in human rights abuses, yes. Is it bad, yes. But for anyone to suggest that offering discriminatory surveillance code even remotely approaches the depravity and evil of a place like Mauthausen-Gusen, you are minimizing and downplaying the true horror of the Holocaust.

My grandfather was imprisoned in Mauthausen-Gusen and I've heard the stories, like him sleeping in the crematorium amongst piles of dead bodies. Don't even start with these ridiculous comparisons.

When the NDAA bans aren’t enough, or the worst happens and Biden bends us back over for China, at least there’s horrific crimes against humanity to keep Hikvision and Dahua at bay.

There had to be one didn't there......? So let me guess who you voted for........

Update: SCMP has now covered this: Chinese surveillance giant expanding in the US attracts scrutiny over possible targeting of Uygurs | South China Morning Post

They include a response from Dahua:

“Dahua Technology does not sell products that feature [an] ethnicity-focused recognition function,” the company responded by email.

While making that denial, the SCMP simultaneously said that Dahua did not provide any other information:

With the new controversy, Dahua responded quickly by replacing the SDK files. The company, however, did not respond to additional inquiries about its code.

The Dahua SDK certainly was tracking Uyghurs specifically (and no other ethnicity/nationality) in that nation_type field. They still have offered no explanation for that so it is not clear if Dahua is telling the truth, lying, or omitting material information on why their SDK was tracking Uyghurs.

Warning: I recently switched from de-caffeinated beverages, and I guess it shows.

As a coder it's pretty weird to see a base class called "MyStructure" - it's the kind of name you might use if you're just doing random stuff for fun. It suggests to me that not a lot of thought went into the naming of things in this SDK.

That said, I want to point out that what we're looking at are NOT functions, they're just a bunch of definition of identifiers that can be used in functions, and the twitter posts are not actually showing the functions that supposedly use/return these values.

It's not uncommon to add these sorts of things to SDK/APIs even before the capability is there (Apple fanboys enthusiasts often dig through the iOS SDKs to look for hints on future devices and capabilities). So, while I agree that this whole thing is ethically corrupt, I think it worth mentioning that we're looking at intent, and perverse as it is, it is not evidence of actual capability.

But does it really matter if Dahua or HikVision actually has this capability?

There's no question that building a robust classifier that can detect Uyghurs with good accuracy is - sick as it is - good marketing. There are plenty of people who are salivating at the idea of such a thing. Obviously not to detect Uyghurs, but maybe detect other kinds of people that you don't like (but obviously justified). Even if you have no intent to track any ethnic minority, you might walk away with the conclusion that these companies have magical and superior technology compared to their peers.

Dahua and the PRC clearly has an interest in having people believe they have this capability. Lots of people think they do, and often they'll point to a propaganda piece on YouTube that shows how China can detect if someone is slightly constipated from a 32x40px ROI. Shortly thereafter, YouTube with all their Google intelligence and accurate knowledge of my unsavory internet activity will suggest that I watch a 5 y/o review of some laptop I bought a long time ago.

What scares me is that a lot of people think that these systems are super accurate. Yes, it's surprising and fun when my Anki robot says "Hi Morten". It's fun that we can have algorithms that can recognize a bike, a car and a bag, but when you run these things, you'll see that quite often they fail and make mistakes a human never would. People tend to develop a blindness to the errors, and instead they make excuses "the sun was blinding the camera", "it was foggy", and instead latch on to the magical moments when it did work.

When the general perception is that tech is neutral, objective and accurate (it is neither), people may start to think that if the computer says you did it, then you did it. What possible motive could a computer have to lie? Despots usually love this sort of thing.

Sadly, I think banning Dahua/HikVision is to get PRC to stop the incarceration of Uyghurs, is a fools errand. If the campaign is successful, and Dahua and HikVision goes bankrupt, then four new companies will pop up like the heads of Medusa. If we ban all trade with China, then chances are the iron grip will just tighten as everyday citizens are hurt by the boycott - ultimately leading to more suffering.

As a professed misanthrope with no faith in humanity, its really hard for me to see a solution to this. Let's speak up when we see injustice, but you kinda get numb after a while. The media seems to be a constant barrage of things I should be upset about, so apathy has set in a looooong time ago. And then people don't buy Dahua, but instead order a ton of cheap Chinese junk from Bezos' mail-order company.

I'd like to see us waking up to the new reality of commerce. You can get all the parts needed to build a capable IP camera in China by just walking around Shenzhen, as a private person. This ability to create products with little friction is simply amazing. Contrast to the west where you have to go through NDAs, negotiations, people who won't talk to you because you're not ordering 20.000 units etc. That - combined with the "money for nothing" mentality that is being praised in the west will be our undoing.

NOTICE: This comment has been moved to its own discussion: Sadly, I Think Banning Dahua/Hikvision Is To Get PRC To Stop The Incarceration Of Uyghurs, Is A Fools Errand.

intent, and perverse as it is, it is not evidence of actual capability

Ahhh yes the age old Dahua business model we intend to be secure, identify you but we aren't actually capable of it.

Update, US Senator criticizes Dahua on this:

Sen. Blackburn, There has been "New evidence"...

Could this be a Hikvision ploy? 'Whomever did this, take 1 step forward [Hikvision takes 1 step back]

(just a little humor here folks)

... Paragraph #2 in the Daily Beast article is hilarious and likely 100% correct. Thanks for posting John.

For context, this is the start of paragraph #2:

In what can only be described as a massive fuck-up

While I don't know how Dahua came to do this, we have now talked to enough people 'close' to China tech companies that the most common reason we hearing was that they thought this was no big deal, i.e., inside of China, tracking ethnic minorities is not terribly controversial and surely a significant number think it is important for protecting safety and a 'harmonious society' as the China Foreign Ministry says.

For context, this is the start of paragraph #2:

In what can only be described as a massive fuck-up

While I don't know how Dahua came to do this, we have now talked to enough people 'close' to China tech companies that the most common reason we hearing was that they thought this was no big deal, i.e., inside of China, tracking ethnic minorities is not terribly controversial and surely a significant number think it is important for protecting safety and a 'harmonious society' as the China Foreign Ministry says.

IPVM has been on this for a long time now, why the recent coverage? I’ve been begging for it and I’m thankful for it but represents a fairly staunch about face....

about face...

but represents a fairly staunch about face....

what about face?

"staunch face" recognition?

Loading Related Reports