This project consist of two parts:
- Acne detection
- Recognition of dark circles under the eyes
First part of project is focused on detecting acne in facial images using the YOLOv7 object detection model. We used this YOLOv7 implementation.
# clone project
git clone https://github.com/lqrhy3/skin-disease-recognition.git
cd skin-disease-recognition/src/models/yolov7
# [OPTIONAL] create conda environment
conda create -n yolov7
conda activate yolov7
# install requirements
pip install -r requirements.txt
We used the acne04 dataset for this project, which can be downloaded from the following page: link. The dataset consists of facial images with corresponding bounding boxes for acne.
# converting raw Acne04 dataset to VOC format
python3 src/data/convert_acne04_to_voc.py --raw_data_dir <path to raw Acne04 dataset> --baked_data_dir <destination folder>
# converting voc to yolo format
python3 src/data/convert_acne04_voc_to_yolo.py --voc_data_dir <path to acne dataset in voc format> --baked_data_dir <destination folder>
# splitting on train and validation part. this script creates train.txt and val.txt
python3 src/data/split_yolo.py --yolo_data_dir <path to yolo format dataset>
# visualizing acne dataset in VOC format
python3 src/visualization/fiftyone_acne04_voc.py --data_dir <path to data>
# visualizing acne dataset in yolo format
python3 src/visualization/fiftyone_acne04_yolo.py --data_dir <path to data>
# visualizing yolo predictions
python3 src/visualization/fiftyone_acne04_yolo_preds.py --source <path to data> --weights <path to yolo weights> --device <cpu or cuda> --img-size <img size (int)> --conf_thres <object confidence thr> --iou_thres <IoU thr for NMS>
Instructions for training and evaluating YOLOv7 can be found in original repository.
This part focused on developing a solution for recognizing dark circles under the eyes on face images. Due to data privacy concerns, we are unable to share the dataset we used in this project.
Initially, we tried using the UNet-like architecture for this task, but we did not achieve good results, cause of low quality of ground truth masks. Therefore, we decided to use a unsupervised no-ML approach from this paper, and it performed well for our dataset.
# clone project
git clone https://github.com/lqrhy3/skin-disease-recognition.git
cd skin-disease-recognition
# [OPTIONAL] create conda environment
conda create -n skin-disease-project
conda activate skin-disease-project
# install requirements
pip install -r requirements.txt
python3 src/eval_noml_classification.py --data_dir <data_dir> --path_to_landmarks_predictor <landmarks_predictor>
Link to dlib landmarks predictor
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Dataset contains a folder with facial images and a corresponding folder with segmentation masks for dark circles under the eyes. In order to process the dataset, we used morphological opening and closing techniques to remove noise from the masks.
python3 src/data_process_data_circles.py --raw_data_dir <raw dataset folder> --processed_dir <destination folder>
python3 src/train.py experiment=unet_baseline.yaml
python3 src/eval_segmentation.py ckpt_path=<path to cktp> output_dir=<path to save predictions>
# visualize dataset dark_circles, data_dir should contain 'data/' and 'labels/' folders
python3 src/visualization/fiftyone_dark_circles.py --data_dir <path to data folder>
# visualize dataset with predicted masks
python3 src/visualization/fiftyone_dark_circles_pred.py --data_dir <path to data folder> --preds_dir <path to predictions folder>
This project was completed by Stanislav Mikhaylevskiy, Victor Pavlishen and Vladimir Chernyavskiy. If you have any questions or suggestions regarding this project, please feel free to contact us.