Identifying trannies with AI -

hundredpercent

kiwifarms.net
Sometimes it happens that even the best of us are fooled. It doesn't happen often, but some of them either pass, or are just taken to be extremely weird-looking women.

A few years ago, I thought using AI to out them would be a fun project, so I scraped a dataset of comparatively credible trannies, as photographed in good lighting with makeup and (presumably) facial feminization surgery by professional photographers. I also scraped a comparable dataset of girls. Ages are ~20-30, around 40% pass if we're being real generous. Faces were about 50-100px across. n=250 for the traps, 2000+ for the girls. Trannies are not common, passing trannies are even rarer, and the life expectancy is low.

I ran some random facial feature vectorization library I found on the Internet (SeetaFace, https://github.com/seetaface/SeetaFaceEngine/tree/master/FaceIdentification) that was purportedly "trained with 1.4M face images of 16K subjects including both Mongolians and Caucasians". I then fed its outputs to a simple SVM classifier (SVC from scikit-learn), and set it so that it would take class imbalances into account.

The accuracy was a dismal 70%, which is really not what I had expected.

What went wrong here? How can I improve on this? Has facial recognition meaningfully improved since late 2018?

I'm attaching the datasets for reference. They are extremely NSFW. I think "btrps" is short for "better traps," since it's the top ranking so they should logically pass better.
 

Attachments

The Mass Shooter Ron Soye

🖩🍸🔫 :) :) :) 😷
kiwifarms.net
Did you use SeetaFaceEngine2 or the older one? The new one should be more accurate and run over twice as fast.

Even if you can't make a 100% accurate pass or fail transdar, you could use it to score how well they pass.

Good timing for a facial recognition topic: IBM CEO’s Letter to Congress on Racial Justice Reform

IBM no longer offers general purpose IBM facial recognition or analysis software. IBM firmly opposes and will not condone uses of any technology, including facial recognition technology offered by other vendors, for mass surveillance, racial profiling, violations of basic human rights and freedoms, or any purpose which is not consistent with our values and Principles of Trust and Transparency. We believe now is the time to begin a national dialogue on whether and how facial recognition technology should be employed by domestic law enforcement agencies.
 
Last edited:

hundredpercent

kiwifarms.net
Did you use adversarial networks?
Aren't those for generating content? I want a machine that takes an image of a "woman" and tells me if it's a tranny or not.
Did you use SeetaFaceEngine2 or the older one? The new one should be more accurate and run over twice as fast.

Even if you can't make a 100% accurate pass or fail transdar, you could use it to score how well they pass.

Good timing for a facial recognition topic: IBM CEO’s Letter to Congress on Racial Justice Reform
The older one, first version. There's also many other ones, like FaceNet. I don't know which one is best.
Do you think the feature vectorization is even the bottleneck here, or something else? Someone claimed I shouldn't use SVM for a classifier, so I'm thinking that might be the problem.
 

Ben Garrison

Got a life sentence, when I shot a Jew
kiwifarms.net
Now what you could do would be to connect this to twitter's firehose and scan for antifa traps
 
  • Feels
Reactions: Yotsubaaa

Arminius

Now with glow in the dark action!
kiwifarms.net
I'm thinking this Terminator prequel might be based. Origins of Skynet
 

PowerWomon

Kiwi Farm's Most Hated Feminist
kiwifarms.net
Greetings!

That is an interesting project. I don't know what you wish to do with this exactly, but I believe that the more knowledge there is among the public the better one can also respond to applications of AI on part of the state. I will try my best to help you along.

I do not know how good your dataset is or the library you are using. I also do not know at this point what accuracy you should be able to expect. It sounds like those were your questions, too, and here is some basic information you could collect that might be a bit like a smoke test to see if your setup and baseline is solid:

1.) To gauge expectations, it might make sense to get an idea what state of the art approaches achieve in terms of accuracy for discriminating gender between male and female.

The following study gets an accuracy in the high 90s. It is a random study from India and I do not know where the cutting edge on that task is currently, but that might not matter. I am citing this here to get an idea, a ballpark number what can be achieved with current methods in terms of gender discrimination.

Screen Shot 2020-06-09 at 1.00.00 PM.png

Dhomne, Amit, Ranjit Kumar, and Vijay Bhan. "Gender recognition through face using deep learning." Procedia Computer Science 132 (2018): 2-10.

What I understand they do is comparatively straightforward: they use an already trained AlexNet neural network and do some transfer learning on the widely used celebrity face database to teach it to discriminate gender. They only seem to be using a very small training and test set, with few epochs, so it does not sound as if this procedure involved a lot of compute time.

From that it might be safe enough to assume, for now, that the ability of current approaches to discriminate gender in itself is not the limiting factor for the accuracy your approach could be able to achieve.

2.) I have no idea how good the library in combination with the dataset you are using is. As most common current libraries for facial recognition, it seems that the API returns to you two sets of information, one being the regions where it detects a face and the other being the landmarks it extracted. From what I understand, you are then using a support vector machine on these landmarks to see if you can distinguish women from transgender.

The documentation states how many faces it has been trained on, which sounds impressive, but it does not tell me how reliable it should be. I am sure I can find some numbers, but it might make sense to do some sanity checks on your data in addition. For example, if you extract landmarks from the same person in several images, how reliable is it in recoginizing the person? That might provide you with some information about the quality of the extracted landmarks for your dataset. The primary purpose of the library is to recognize faces, for which it uses a cosine-distance metric to compute a similarity score, from what I undrestand. This test might not tell you how well suited this library is for what you set out to do, but it should be a good sanity test to tell you if there is something fundamentally flawed with your dataset, your approach, or your use of the library. If it cannot even match the same person reliably with the landmarks provided, the features being extracted might also be too poor to reliably identify sex or transgender status.

3.) Once you have the above squared away, it might be a useful to see how well your approach distinguishes sex of the person in the pictures. It will give you a ballpark estimate and again something akin to a smoke test to see if your approach is basically sane or missing something big. Include some men and women in your dataset and see how accurate the support vector machine is in discriminating them. If you cannot even reliably tell men apart from women, it might very well be expected that your performance on transgender people would be even poorer.

The celebrity face dataset is already annotated with a variety of binary features, among them being gender, from what I recall. You are probably aware of this already, but just to remind you, there are also built-in datasets in scikit-learn that could be useful to you:

SciKit Learn: Real World Datasets

4.) Whether or not you have multiple images of the same person, using a data agumentation process might be useful. Using shifts, tilts, cropping, flipping, brightness variation and such of images might be a good way to test and improve your approach. See if basic changes ruin the accuracy of the library you are using.

5.) I do not want to resort to the knee jerk response you get for so many questions on AI and machine learning and tell you "Just use a neural network, bro!" But if all fails you might want to consider changing the algorithmic approach you use. I had checked but I forgot again, and it's not so important, but I do not know what the facial recognition library you are using uses to extrac the landmarks. Probably a neural network, too, and it would not surprise me if they used the same approach as thousand others and have simply used transfer learning on the last few layers of some big pre-trained network like AlexNet or similar. Still, you might want to see if using a neural network instead of a support vector machine gives you better accuracy. The accuracy of SVMs is really not so bad so falling prey to the hype of using neural networks for everything is not always the correct response. See if an ANN, probably with about two fully connected layers, in order to be able to better learn non-linear separations, gives you a better accuracy. From what I understand about the features, a CNN would probably not be as good as a fully connected layer, probably with simple sigmoid activation or something. Normalize the features before you feed them in, just in case, and use softmax as the last layer. Each layer should probably have about at least as many as nodes as the square root of the number of landmark features (that is the rule of thumb I use in such cases). Use simple stochastic gradient descent or ADAM, but this will probably give you a little bit more feedback about the learning progression it is able to achieve. If it really does not budge at all and you get no meaningful convergence at all, then I am not sure if the landmark features it extracts are sufficient to recognize transgender status of a person.
 

PowerWomon

Kiwi Farm's Most Hated Feminist
kiwifarms.net
I am currently unable to edit my posts, so I will have to append this.

6.) Both for your current approach and for the softmax layer, it might be helpful to see which images or persons it gets wrong exactly. It is still a major outstanding problem to improve the interpretability of neural networks, but you might be able to get some information that way. The above mentioned softmax layer, for example, might tell you which images it has trouble with, so you might be able to structure your learning schedule around this and prioritize images it gets wrong. Generate a confusion matrix or something similar.

7.) If you do end up going the route of a neural network, see if using a dropout layer is helpful. I had a similar machine learning task once where that seemed helpful. There might be features in the data, especially given the comparatively small number of images you have, that the classification algorithm you use over-focuses on. A dropout layer can help in those situations because it teaches the neural network to use as sparse a selection of features as possible and to not be overly reliant on features that bias your dataset. This happens paricularly frequently on such hand-collected datasets, as building a proper machine learning dataset can be very hard to build. For example, if you were to classify ducks and cats, and all cats were photographed indoors, while all ducks were photographed in water or on grass, it might instead learn that everything indoors is a cat and everything outdoors is a duck. That specifically is very likely not to be the case, as you are already extracting facial features, that might be facial features it focuses on that are in the end not indicative of a person's transgender status.

8.) If you do use a training approach, through a neural network or otherwise, make sure you have a decent training/test/validation split in your data. I do not know how you assigned the images to your training and test set, but if your choice of assignment is bad, that can also severely hurt your performance. Look out for overfitting. If you are doing this in Keras, for example, it is very easy in the learning scheduler to configure getting both test and validation accuracy, which you can then easily plot with matplotlib, for example.

VIeBL.png

It doesn't really matter so much what you use, though. All major frameworks should be fine, such at PyTorch, or whatever else you wish to use.
 

PowerWomon

Kiwi Farm's Most Hated Feminist
kiwifarms.net
God damn, it. One last thing. Again, I cannot edit my posts right now. I upset Null's tranny love interest, fitting to the topic of the thread, and it seems they passive-aggressively revoked my edit-abilities, too, together with my revoked chat permissions. Such as life.

9.) The gold standard might be doing something similar to what this facial recognition library is doing, as well as the study I cited above, as well as many other machine learning research that is going on. You will find these applications of transfer learning ad nauseam. If you want to go through the trouble, grab an AlexNet neural net, in whatever format you prefer, and use the same transfer learning approach, i.e.:

a.) Shave the last few layers off, freeze the other layers.
b.) Add a fully connected layer, plus a new softmax layer, and train it with your dataset.
c.) You might get very valuable data by having a softmax layer with not just two but at least three classes: male, famale, transgender.
d.) The probabilities of the softmax layer can give you additional information, such as how "certain" it is someone is male/female/transgender.
softmax.png


By the way, Null, I do not think Rio will ever touch your penis.
 

XYZpdq

fbi most wanted sskealeaton
True & Honest Fan
kiwifarms.net
this is sorta like when they invent a Mysteron detector in Captain Scarlet
 

Kosher Dill

Potato Chips
True & Honest Fan
kiwifarms.net
It seems to me that you should try an easier version of the problem first rather than going right to identifying 40-pixel-wide faces from porn stills. Why not use a dataset of higher-res images cropped to just the face looking directly at the camera? Get a proof of concept done first before moving on to the harder tasks.
The test images provided with the library you're using are much higher-res than yours, they may not even have tested it on low-res images.

EDIT: and if you do get something working, then you can progressively lower the input images' resolution and see how strong "beer goggles" you have to apply to your algorithm to fool it :lol:
 

hundredpercent

kiwifarms.net
Now what you could do would be to connect this to twitter's firehose and scan for antifa traps
I don't need an AI for that.
Greetings!

That is an interesting project. I don't know what you wish to do with this exactly, but I believe that the more knowledge there is among the public the better one can also respond to applications of AI on part of the state. I will try my best to help you along.

I do not know how good your dataset is or the library you are using. I also do not know at this point what accuracy you should be able to expect. It sounds like those were your questions, too, and here is some basic information you could collect that might be a bit like a smoke test to see if your setup and baseline is solid:

1.) To gauge expectations, it might make sense to get an idea what state of the art approaches achieve in terms of accuracy for discriminating gender between male and female.

The following study gets an accuracy in the high 90s. It is a random study from India and I do not know where the cutting edge on that task is currently, but that might not matter. I am citing this here to get an idea, a ballpark number what can be achieved with current methods in terms of gender discrimination.

View attachment 1362912
Dhomne, Amit, Ranjit Kumar, and Vijay Bhan. "Gender recognition through face using deep learning." Procedia Computer Science 132 (2018): 2-10.

What I understand they do is comparatively straightforward: they use an already trained AlexNet neural network and do some transfer learning on the widely used celebrity face database to teach it to discriminate gender. They only seem to be using a very small training and test set, with few epochs, so it does not sound as if this procedure involved a lot of compute time.

From that it might be safe enough to assume, for now, that the ability of current approaches to discriminate gender in itself is not the limiting factor for the accuracy your approach could be able to achieve.

2.) I have no idea how good the library in combination with the dataset you are using is. As most common current libraries for facial recognition, it seems that the API returns to you two sets of information, one being the regions where it detects a face and the other being the landmarks it extracted. From what I understand, you are then using a support vector machine on these landmarks to see if you can distinguish women from transgender.

The documentation states how many faces it has been trained on, which sounds impressive, but it does not tell me how reliable it should be. I am sure I can find some numbers, but it might make sense to do some sanity checks on your data in addition. For example, if you extract landmarks from the same person in several images, how reliable is it in recoginizing the person? That might provide you with some information about the quality of the extracted landmarks for your dataset. The primary purpose of the library is to recognize faces, for which it uses a cosine-distance metric to compute a similarity score, from what I undrestand. This test might not tell you how well suited this library is for what you set out to do, but it should be a good sanity test to tell you if there is something fundamentally flawed with your dataset, your approach, or your use of the library. If it cannot even match the same person reliably with the landmarks provided, the features being extracted might also be too poor to reliably identify sex or transgender status.

3.) Once you have the above squared away, it might be a useful to see how well your approach distinguishes sex of the person in the pictures. It will give you a ballpark estimate and again something akin to a smoke test to see if your approach is basically sane or missing something big. Include some men and women in your dataset and see how accurate the support vector machine is in discriminating them. If you cannot even reliably tell men apart from women, it might very well be expected that your performance on transgender people would be even poorer.

The celebrity face dataset is already annotated with a variety of binary features, among them being gender, from what I recall. You are probably aware of this already, but just to remind you, there are also built-in datasets in scikit-learn that could be useful to you:

SciKit Learn: Real World Datasets

4.) Whether or not you have multiple images of the same person, using a data agumentation process might be useful. Using shifts, tilts, cropping, flipping, brightness variation and such of images might be a good way to test and improve your approach. See if basic changes ruin the accuracy of the library you are using.

5.) I do not want to resort to the knee jerk response you get for so many questions on AI and machine learning and tell you "Just use a neural network, bro!" But if all fails you might want to consider changing the algorithmic approach you use. I had checked but I forgot again, and it's not so important, but I do not know what the facial recognition library you are using uses to extrac the landmarks. Probably a neural network, too, and it would not surprise me if they used the same approach as thousand others and have simply used transfer learning on the last few layers of some big pre-trained network like AlexNet or similar. Still, you might want to see if using a neural network instead of a support vector machine gives you better accuracy. The accuracy of SVMs is really not so bad so falling prey to the hype of using neural networks for everything is not always the correct response. See if an ANN, probably with about two fully connected layers, in order to be able to better learn non-linear separations, gives you a better accuracy. From what I understand about the features, a CNN would probably not be as good as a fully connected layer, probably with simple sigmoid activation or something. Normalize the features before you feed them in, just in case, and use softmax as the last layer. Each layer should probably have about at least as many as nodes as the square root of the number of landmark features (that is the rule of thumb I use in such cases). Use simple stochastic gradient descent or ADAM, but this will probably give you a little bit more feedback about the learning progression it is able to achieve. If it really does not budge at all and you get no meaningful convergence at all, then I am not sure if the landmark features it extracts are sufficient to recognize transgender status of a person.

6.) Both for your current approach and for the softmax layer, it might be helpful to see which images or persons it gets wrong exactly. It is still a major outstanding problem to improve the interpretability of neural networks, but you might be able to get some information that way. The above mentioned softmax layer, for example, might tell you which images it has trouble with, so you might be able to structure your learning schedule around this and prioritize images it gets wrong. Generate a confusion matrix or something similar.

7.) If you do end up going the route of a neural network, see if using a dropout layer is helpful. I had a similar machine learning task once where that seemed helpful. There might be features in the data, especially given the comparatively small number of images you have, that the classification algorithm you use over-focuses on. A dropout layer can help in those situations because it teaches the neural network to use as sparse a selection of features as possible and to not be overly reliant on features that bias your dataset. This happens paricularly frequently on such hand-collected datasets, as building a proper machine learning dataset can be very hard to build. For example, if you were to classify ducks and cats, and all cats were photographed indoors, while all ducks were photographed in water or on grass, it might instead learn that everything indoors is a cat and everything outdoors is a duck. That specifically is very likely not to be the case, as you are already extracting facial features, that might be facial features it focuses on that are in the end not indicative of a person's transgender status.

8.) If you do use a training approach, through a neural network or otherwise, make sure you have a decent training/test/validation split in your data. I do not know how you assigned the images to your training and test set, but if your choice of assignment is bad, that can also severely hurt your performance. Look out for overfitting. If you are doing this in Keras, for example, it is very easy in the learning scheduler to configure getting both test and validation accuracy, which you can then easily plot with matplotlib, for example.

View attachment 1362957
It doesn't really matter so much what you use, though. All major frameworks should be fine, such at PyTorch, or whatever else you wish to use.

9.) The gold standard might be doing something similar to what this facial recognition library is doing, as well as the study I cited above, as well as many other machine learning research that is going on. You will find these applications of transfer learning ad nauseam. If you want to go through the trouble, grab an AlexNet neural net, in whatever format you prefer, and use the same transfer learning approach, i.e.:

a.) Shave the last few layers off, freeze the other layers.
b.) Add a fully connected layer, plus a new softmax layer, and train it with your dataset.
c.) You might get very valuable data by having a softmax layer with not just two but at least three classes: male, famale, transgender.
d.) The probabilities of the softmax layer can give you additional information, such as how "certain" it is someone is male/female/transgender.
View attachment 1362974

By the way, Null, I do not think Rio will ever touch your penis.
These are excellent posts, thank you!

2: That's right. SeetaFace has extremely high dimensionality and is quite sparse. Since FaceNet has better accuracy, it seems like it would be strictly better to use. It also has nicer tools for cleaning the data.

1, 3: Good idea. I don't have a dataset of male faces, but I'll try to find a comparable one. I would think that above 90% is possible, intuitively.

4: FaceNet states explicitly in the whitepaper that this is not a problem. Human faces are not symmetrical, but the included test suite tests for tilting up to 10deg etc.

5: Even when explicitly set to balance the classes, there's horrible class imbalance problems. The confusion matrix looks like this:
Code:
[[0.90261628 0.09738372]
[0.47468354 0.52531646]]
What's happening? When I print the raw decisions, they're pretty much all either -1 or 1. This doesn't change with probability=True either.

8: I'm using scikit, that has the same feature.

I'm going to try a neural network next, but please tell if there's anything wrong in this code that might cause a class imbalance problem:
Code:
import numpy as np
from sklearn.svm import SVC
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
from sklearn.decomposition import PCA
from sklearn.utils import shuffle

X = np.load('embeddings.npy')
ls = np.load('label_strings.npy')
y = []
for el in ls:
    y.append(0 if el == 'girls' else 1)

X, y = shuffle(X, y)

classifiers = [SVC(gamma=2, C=1, class_weight='balanced')]
names = ["RBF SVM"]

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.4, random_state=42)

for name, clf in zip(names, classifiers):
    clf.fit(X_train, y_train)
    score = clf.score(X_test, y_test)
    print(score)
    y_pred = clf.predict(X_test)
    print(confusion_matrix(y_test, y_pred, normalize='true'))
It seems to me that you should try an easier version of the problem first rather than going right to identifying 40-pixel-wide faces from porn stills. Why not use a dataset of higher-res images cropped to just the face looking directly at the camera? Get a proof of concept done first before moving on to the harder tasks.
The test images provided with the library you're using are much higher-res than yours, they may not even have tested it on low-res images.

EDIT: and if you do get something working, then you can progressively lower the input images' resolution and see how strong "beer goggles" you have to apply to your algorithm to fool it :lol:
Where are you suggesting I find a dataset of high-res traps cropped perfectly?
If you have a big collection, please post it. This is just what I was able to scrape from PornHub.
 
Tags
None