We want to build a clothing recommendation system that can use four deep learning models to obtain important characteristics of user clothing use. The dataset used for training is a huge set of MMLAB datasets, DeepFashion.

2025/05/0203:52:35 hotcomm 1302

The full text has 3095 words, and the expected learning time is 9 minutes

We want to build a clothing recommendation system that can use four deep learning models to obtain important characteristics of user clothing use. The dataset used for training is a huge set of MMLAB datasets, DeepFashion. - DayDayNews

Source: Pexels


This article will explain how to integrate deep learning models and build a clothing recommendation system.

We want to build a clothing recommendation system, which can use four deep learning models to obtain important characteristics of user clothing use.


Recommendation system can be divided into 4 categories:


  • Recommendation based on product characteristics
  • Recommendation based on other users' behavior
  • Recommendation based on general user characteristics
  • Recommendation based on the above-mentioned multiple standards


We want to build a clothing recommendation system that can use four deep learning models to obtain important characteristics of user clothing use. The dataset used for training is a huge set of MMLAB datasets, DeepFashion. - DayDayNews

Source: Pexels


In the case, we will make suggestions based on users and product characteristics. User characteristics considered are gender, age, and body mass index (BMI). The product characteristics that are taken into account are the type of clothing the user wears. Therefore, we need a photo of the user, predict all features and recommend the corresponding clothing.


will obtain clothing features from the user's full body image.


uses a human posture estimation system called AlphaPose to determine whether the user is complete. AlphaPose detects 19 points of a person. If at least 17 points are detected, it is considered to be a complete human figure.


We want to build a clothing recommendation system that can use four deep learning models to obtain important characteristics of user clothing use. The dataset used for training is a huge set of MMLAB datasets, DeepFashion. - DayDayNews

Figure 1: AlphaPose estimation system


We retrained one of the most well-known classifiers on the Internet - YOLO v3. YOLO is also one of the most accurate image classifiers. The dataset used for training is a huge set of MMLAB datasets, DeepFashion. Another model used by


is the Dlib, get_frontal_face_detector() function. This model is built with 5 HOG filters. The model detects the front and side view surfaces. The model was chosen because it was fast and accurate. When detecting age and gender, we categorized age and gender using openCV and convolutional neural networks according to the data science article.


Estimating IMC based on an article titled "Estimating Body Mass Index from face images using Keras and transfer learning".


We want to build a clothing recommendation system that can use four deep learning models to obtain important characteristics of user clothing use. The dataset used for training is a huge set of MMLAB datasets, DeepFashion. - DayDayNews

Figure 2: Architecture of the recommended system


model integration


All code is written in Python 3.5 using some computer vision libraries (such as OpenCV) and some deep learning frameworks (such as Keras).


  1. detector =dlib.get_frontal_face_detector()# Carga de modelos
  2. # CNN
  3. age_net, gender_net =load_caffe_models()
  4. # Boddy Mass Index
  5. model_bmi = get_trained_model()
  6. ### Face Detection
  7. img_h, img_w, _ = np.shape(image)
  8. detected = detector(image, 1)
  9. faces
  10. =
  11. np.empty((1,
  12. configml15.RESNET50_DEFAULT_IMG_WIDTH, 3))
  13. config.RESNET50_DEFAULT_IMG_WIDTH, detection= {}
  14. if len(detected) 0:
  15. for i,d in enumerate(detected):
  16. x1, y1, x2, y2, w, h = d.left(), d.top(), d.right() + 1, d.bottom() + 1, d.width(),
  17. d.height()
  18. xw1 = max(int(x1 - margin * w), 0)
  19. yw1 = max(int(y1 - margin * h), 0)
  20. xw2 = min(int(x2 + margin * w), img_w - 1)
  21. yw2 = min(int(y2 + margin * h), img_h - 1)
  22. cv2.rectangle(image, (xw1, yw1),(xw2, yw2), (255, 0, 0), 2)
  23. #Get Face
  24. face_img = frame[yw1:yw2,xw1:xw2].copy()
  25. # Estimación
  26. age, gender = get_age_and_gender(face_img,age_net, gender_net)
  27. # Boddy Mass Index
  28. faces[0,:,:,:]=cv2.resize(face_img,
  29. (config.RESNET50_DEFAULT_IMG_WIDTH,3 )) /255.00
  30. bmi = round(float(model_bmi.predict(faces)[0][0]),2)
  31. detection[i]={'gender':gender, 'age':age, 'bmi':bmi}


Through these codes, the model is loaded into RAM for pose estimation. To estimate age, gender, and BMI, we also cut the area where the face is located. Then, use YOLO to classify clothes to display the recommended types of clothes.


  1. def eval_cloth(img_test,categoria_test, size_test):
  2. filename = './ClothEmbedding/X_reduced2.sav'
  3. X_reduced, hasher, pca, df =joblib.load(filename)
  4. img = cv2.imread(img_test)
  5. img_c = cv2.resize(img, (80, 80), interpolation=cv2.INTER_CUBIC)
  6. img_data_test = img_c.reshape(-1).astype(np.float32)
  7. img_transformed =hasher.transform(img_data_test.reshape(1, -1))
  8. img_reduced =pca.transform(img_transformed)
  9. # Distancia entre la muestra y la basede datos
  10. dist = [np.linalg.norm(img_reduced-e) for e in X_reduced]
  11. df['distance'] = distml10
  12. df_test = df.sort_values(['distance'])
  13. # Se conserva sólo la categorygiríarequeridah
  14. df_test = df_test[df_test['categoria2'] == category_test]
  15. # Se conservan sólo las tallasrequeridas
  16. cat_ns = ['tacones', 'chanclas', 'botas', 'bolsa', 'ropa_interior']
  17. ifnot(categoria_test in cat_ns):
  18. if(len(size_test) == 2):
  19. true_table = [(size_test[0] in sizes_r or size_test[1] in sizes_r) for sizes_r in df_test['tallas']]
  20. else:
  21. true_table = [size_test[0] in sizes_r for sizes_r in df_test['tallas']]
  22. df_test = df_test[true_table]
  23. returndf_test10

The last function will receive all information about people and clothes. Compare clothing characteristics with clothing in the database. We recommend wearing similar clothes to users.


Finally, considering the user experience, I made a front-end.

We want to build a clothing recommendation system that can use four deep learning models to obtain important characteristics of user clothing use. The dataset used for training is a huge set of MMLAB datasets, DeepFashion. - DayDayNews

Figure 3: Building a Web for Recommended System Trying to


Thanks for reading! Remember to speak enthusiastically~

We want to build a clothing recommendation system that can use four deep learning models to obtain important characteristics of user clothing use. The dataset used for training is a huge set of MMLAB datasets, DeepFashion. - DayDayNews

Leave a message Like and follow

Let’s share the information on AI learning and development

If reprinted, please leave a message in the background and abide by the reprinting specifications

hotcomm Category Latest News