A hairstyle recommender system using machine learning.
Teamwork with Sark Xing, Ward de Groot, and Lara Leijtens.
Course: Designing Intelligence in Interaction. Dec 2018 – Feb 2019. TU/e
Choosing a new hairstyle can be a difficult, impactful decision. Especially envisioning if a haircut would suit the individual is hard. With the basic artificial intelligence knowledge that we learned in this course, we believed that with the analysis responses from facial recognition APIs and supervised machine learning, a relation between facial features and hairstyle is ought to be found. Therefore, we created a hairstyle recommender system called “hAIr”. The system recommends hairstyles that suit the individual’s facial characteristics
HAIr was developed based on a supervised learning algorithm of neural networks. Firstly, we collected over 12000 images with 64 different labels gathered from the Hairstyle30k dataset. Then, we analyzed these images using two market-available API’s named Microsoft Azure and Betaface. These APIs returned 26 facial features, including features such as your chin size, the size of your nose, and whether you’re wearing glasses or not. We saved some data of the dataset for validation while using the rest to train Multi-layered perceptron Neural networks, in which the generated facial features were used as input, and the hairstyle labels were used as the desired output. We had compared the validated accuracy of several neural networks that differ in the number of nodes, and we finally found that having 50 nodes in the hidden layer while using backpropagation as a learning rule gave the lowest error rate (0.157). We applied this neural network in our Hairstyle recommender system to find a relationship between hairstyle and facial features. Every time the system received a selfie from the user, it would provide the top three recommendations and show the accuracy.
Technical explanation of the hAIr system
The hAIr system in use
However, in this project, because of lacking professional skills to modify the neural networks, the trained network only reached an accuracy of 28.10% when validated with images that were not used for training. From the feedback we got from the final presentation, we learned that it could be improved by trying different combinations of input variables or using a different conversion for the values that were gained from the APIs. It is also possible that the APIs are not completely accurate. A third possibility for improvement would be to use a different learning algorithm, such as k-Nearest Neighbors or naive Bayes.
Because I had some coding experience, in this course assignment, I was able to learn related technologies quickly. Therefore, I played the role of a pioneer, trying the APIs, testing the neural network, and using Processing to achieve a hairstyle recommender system. Through this course, I got the chance to learn some basic methods of AI. I had always been interested in it but didn’t know where to start. The experience in this course showed me the possibility of getting involved in an AI project in my future work. Also, because I did more than half of the coding work, it trained my coding skills, too. I learned Python two years ago just for fun and had not used it in any design projects. The project taught me how to build my work on others’ wheels, which I thought is valuable for design students to make quick iterations in prototyping.
As for the missed opportunities, we got the feedback in the final presentation that it would be better if we used KNN rather than a neural network algorithm. Actually, we had listed KNN as a plan-b solution, but we didn’t manage enough time to go deep into that direction. Also, when we were trying various neural network structures, due to the lack of background knowledge, there was a lack of logic in the selection of nodes and layers. If I’m going to do an AI-related project in the future, I should take more courses to supplement my knowledge.