Deep Politics - Deep Learning nets to predict political affinity using face images

in #convolutional6 years ago

Prediction of Spanish Political Affinity with Deep Neural Nets: Socialist vs People's Party (PSOE vs PP)

Source: https://github.com/muntisa/Deep-Politics

Note: This project is just an academic attempt to understand the human face features for future social studies. This is NOT an attempt to encroach on personal privacy! There is no public database, saved model or mobile app to be used for predictions. The model is based on a very small number of cases and, therefore, it is not good enough to be used in very accurate applications.

Question

Do you think that the political affinity could be read on our face, just using a portrait photo? Could you guess the political party by only looking at someone’s photo/face?

Solution

I am no expert in Spanish politics, but while watching Spanish TV channels, I started to guess the political party of people participating in political talk shows. After the course series on Coursera about Deep Learning (https://www.coursera.org/learn/convolutional-neural-networks), I’ve become obsessed with applications of this amassing artificial brain. Thus, I had an idea: if my brain can predict with enough accuracy the political party by looking at people’s portraits, let’s check whether an artificial mini-brain (Deep Neural Network - DNN) can do the same with more or less neurons and connections.
The project can be accessed as Deep Politics open repository: https://github.com/muntisa/Deep-Politics.

Method

Remember the aim of this project is only to test whether the DNN could associate some portrait patterns with the political affinity for only two Spanish parties: PSOE and PP. So, I searched on Internet for politician photos and I cropped only the portraits. Therefore, I obtained a very small dataset of 100 random photos: 50 for PSOE and 50 for PP.

CNN4Politics.png

Calculation details:

  • Network topology: small Convolutional Neural Networks (CNNs) or pre-trained VGG16 for transfer learning or fine tuning.
  • Data augmentation for small CNNs
  • Tools: Keras, Tensorflow, jupyter notebooks.
  • Hardware: desktop Win 10, Intel i7, 16 G RAM, GPU Nvidia Titan Xp.
  • Input image dimensions: 150 x 150 pixels.
  • Sets: 80 phoos for training, 20 photos for testing
  • Output: PSOE or PP classes.

Results

I think that is very interesting that using only few images, data augmentation and a small CNN (Conv-Conv-Conv-FC; Conv = Convolutional block, FC = Fully-Connected layer), a prediction model with an affinity over 80% can be obtained in only a few minutes (with GPU).
If we are using a pre-trained network such as VGG16 with Imagenet weights, without data augmentation, an accuracy of 85% with fine tuning methodology (training of 2 last Conv block of VGG16 + FC) may be obtained.

Conclusion

An extended hyperparameter search should be performed, with increased datasets in order to obtain a better model. Even with this short project, the results are suggesting that some portrait patterns could be linked to our political affinity, at least in Spain :-).
I hope this project will generate more interest in Deep Learning applications and less controversies than the Sexual Orientation Model from Stanford (https://www.gsb.stanford.edu/faculty-research/publications/deep-neural-networks-are-more-accurate-humans-detecting-sexual).

Acknowledgements

I gratefully acknowledge the support of NVIDIA Corporation with the donation of the Titan Xp GPU used for this research (https://developer.nvidia.com/academic_gpu_seeding).

Sort:  

Congratulations @muntisa! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @muntisa! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.31
TRX 0.11
JST 0.034
BTC 64852.72
ETH 3178.07
USDT 1.00
SBD 4.20