How I Automated Tinder using Artificial Intelligence
↳ Machine Learning
17 Jun 2017 | 7 minute read
Table of Contents
Update (2017-12-27): I was interviewed by Nvidias The AI Podcast about this project.
Update (2019-07-01): This project, amongst others, inspired me to dive deeper into computer vision when writing my master's thesis.
Even though I am on Tinder, I'm not a big fan of it. As most people have limited information on their profiles, all you know about them is what they look like.
To get to know someone better, and evaluate if you and them could be potential lovebirds in the future, you will have to swipe on appearances and evaluate how good of a match you are in the chat or on a date at a later stage.
But for now, all you know about them is what they look like. But as we all know, there are a lot of people on Tinder. After swiping for a few minutes, you've swiped through tens of people.
But what if you could automate the process of evaluating physical attraction, and spend more time chatting with people you're already physically attracted to?
Introducing Computer Vision
At university, I've studied machine learning. Some of the courses I've taken have been on the topic of computer vision, which is a scientific field where computers are utilised to process and analyse videos or images.
That sparked a thought in my mind. What if computer vision could be used to evaluate if I find someone attractive or not? Would that be possible?
I got overly excited about this particular challenge (translation: no sleep that night), and started to explore how convolutional neural networks could be used to analyse Tinder profiles. My intuition was that these networks could be trained to learn abstract facial features of people that I found physically attractive.
Gathering images
One challenge when utilising deep learning is the large amounts of data required to train your networks. As of this, I had to gather a lot of images of people that I was physically attracted, and not physically attracted to.
Update (2019-07-01): If I would explore this problem again, I would utilise transfer learning, to explore if better results could be achieved by finetuning
a pre-trained network (which would require fewer images to be gathered).
Somehow, I had to gather thousands of images from Tinder, saving the images of yes
swipes in one folder, and the no
swipes in another folder. How could I do that?
I started to investigate the Tinder API calls using Charles which looked promising, but then stumbled upon a Python library called Pynder.
Using Pynder I was able to swipe via my computer and save the images of the people I swiped on locally. This allowed me to gather thousands of labelled
images, that could be used to train the network.
Image processing
When processing the images, I identified two challenges.
The first challenge being that images were very different. Some images were close-up selfies, and some images had five people kite-surfing on them. As of this, I chose to identify and extract only close-up images of faces, omitting every image with more than one person in the image, as to be sure that the person on the image was the person I was swiping on.
To identify faces and extract the faces from the images, I used the OpenCV Haarcascades library, having a script processing every image.
The second challenge was that the datasets of yes
and no
labelled images were imbalanced. To improve the training of my network, I used re-sampling techniques from the imbalanced-learn library.
Swiping
Having gathered and processed the images, and connected to Tinder using Pynder, I created a cron job on my server to swipe at a certain time every day using the trained network.
How did it work out?
It turned out that spending more time chatting with people, and meeting people, instead of swiping and not taking action was a great idea. The mundane and boring part of Tinder was no longer an issue, and I could focus on connecting with people.
As I was able to focus all of my "Tinder time" on making real connections, I made a connection so real it blew me away.
And today, I don't need Tinder any longer.
Update (2020-06-14): Still going strong, I love her. Also, picture 👇
Update (2021-04-14): We're now engaged. Thanks, algorithms.
Update (2021-09-15): We just got married. What a time to be alive!