It'd be interesting to think about what kind of "stereotyping" we're OK with and what kinds we aren't—and I mean stereotype just in the inductive, pattern-forming sense.
We can imagine a camera + ML system set up around an elementary school that is in charge of sending the school into lockdown in the case of emergencies. The actual details of this thought experiment are probably iffy, but I don't think they matter in painting the contours of the problem at hand.
Now, e.g. statistically black Americans commit violent felonies at higher rates, and a perfectly well-tuned, sensitive facial threat-level indicator might tic up a little coming from a statistical place. That seems pretty scummy and gross. But realistically, if you were trying to profile school shooters, you'd probably actually start profiling white teenagers with greasy hair, acne, and military jackets, because non-white school shooters are pretty damn rare. Would this be OK?
Then there's the next level—let's say there are certain colors that especially violent subcultures wear, like white long-sleeve Ts. And there've been a couple prominent school shooters with white long-sleeve Ts, lots of people on 4chan are wearing white long-sleeves and talking about shooting up schools, so if a teen in a white long-sleeve is walking around campus with a giant dufflebag, maybe that threat level indicator should go up.
Then there's really explicit symbolism—what about a kid with Nazi tattoos on his knuckles, that the camera system picked up getting into a fight last week with a bullying jock. At that point, you're working off strong statistical precedent, and more precise correlations than phenotypic descriptors. And yet, this is still the same premise—statistical correlations between appearance and behaviors, or between life histories and actions.
And of course, everything I just described can be, and is, a "threat indicator" to administrators who run these schools already.
So where do you draw the line, between prejudice and statistical correlations? You can't, they're the exact same thing mathematically.