This is the implementation of the paper Color Invariant Skin Segmentation using FCN [1] and U-Net [2].
Images will be augmentated in HSV color space. We change the HSV values of images and enlarge the training set. We used the parameters shown in the image below.
Here is the pipeline using color space augmentation for skin segmentation.
Here is one example on how to change the HSV value.
Color space augmentation can help skin segmentation models deal with complex illuminatlion conditions. Below is some examples. Label A means model was trained after (or with) color space augmentation while label B means before (or without) color space augmentation.
git clone https://github.com/HanXuMartin/Color-Invariant-Skin-Segmentation.git
cd Color-Invariant-Skin-Segmentation
cd U-Net
python test.py
cd FCN
python prediction.py
We trained our models using ECU [3] dataset. Following the steps if you want to train your own models. We suggest the groundtruth to be in the image format (like jpg, png)
Origanize your dataset as follows:
dataset
|-----train
|-----image
|-----mask
|-----validation
|-----image
|-----mask
python train.py
Checkpoints will be saved in the U-Net/checkpoints as default.
imgB = cv2.imread('your mask')
python FCN.py
Checkpoints will be saved in the FCN/checkpoints as default.
[1]. https://github.com/yunlongdong/FCN-pytorch
[2]. https://github.com/zhixuhao/unet
[3]. S. L. Phung, A. Bouzerdoum and D. Chai, "Skin segmentation using color pixel classification: analysis and comparison," in IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 27, no. 1, pp. 148-154, Jan. 2005, doi: 10.1109/TPAMI.2005.17.
[4]. M. Wang, W. Deng, J. Hu, X. Tao and Y. Huang, "Racial Faces in the Wild: Reducing Racial Bias by Information Maximization Adaptation Network," 2019 IEEE/CVF International Conference on Computer Vision (ICCV), 2019, pp. 692-702, doi: 10.1109/ICCV.2019.00078.
If you find this repo useful, please consider citing it as following:
@InProceedings{Xu_2022_CVPR,
author = {Xu, Han and Sarkar, Abhijit and Abbott, A. Lynn},
title = {Color Invariant Skin Segmentation},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
month = {June},
year = {2022},
pages = {2906-2915}
}