Giter VIP home page Giter VIP logo

physiologicailab / sam-cl Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 2.0 179.88 MB

Self-adversarial Multi-scale Contrastive Learning for Semantic Segmentation of Thermal Facial Images [BMVC 2022]

Home Page: https://bmvc2022.mpi-inf.mpg.de/864/

License: MIT License

Python 65.68% Shell 25.82% Cuda 4.54% C 2.45% C++ 1.42% Cython 0.08%
augmented-images contrastive-learning semantic-segmentation thermal-imaging

sam-cl's Introduction

Self-adversarial Multi-scale Contrastive Learning for Semantic Segmentation of Thermal Facial Images

Abstract

Reliable segmentation of thermal facial images in unconstrained settings such as thermal ambience and occlusions is challenging as facial features lack salience. Limited availability of datasets from such settings further makes it difficult to train segmentation networks. To address the challenge, we propose Self-Adversarial Multi-scale Contrastive Learning (SAM-CL) as a generic learning framework to train segmentation networks. SAM-CL framework constitutes SAM-CL loss function and a thermal image augmentation (TiAug) as a domain-specific augmentation technique to simulate unconstrained settings based upon existing datasets collected from controlled settings. We use the Thermal-Face-Database to demonstrate effectiveness of our approach. Experiments conducted on the existing segmentation networks- UNET, Attention-UNET, DeepLabV3 and HRNetv2 evidence the consistent performance gain from the SAM-CL framework. Further, we present a qualitative analysis with UBComfort and DeepBreath datasets to discuss how our proposed methods perform in handling unconstrained situations.

This work was published at British Machine Vision Conference, 2022.

Demo

Demo of SAM-CL Framework

Inference

While this repository provides the main SAM-CL code for training and validation of thermal datasets, the inference only code along with pre-trained model is available on this repo.

Installation

Requirements

  • Linux (Ubuntu ≥ 18.04) with Python ≥ 3.6
  • PyTorch ≥ 0.4.1
  • torchvision that matches the PyTorch installation. You can install them together at pytorch.org to make sure of this.
  • You may use pip install -r requirements.txt to install the dependencies.

Training Data Preparation

We thank the authors of the Thermal Face Project for providing the data. Thermal Face Database can be requested from the authors of Thermal Face Project. From the data that is obtained, please note the path of "FaceDB_Snapshot_complete" directory.

We arrange images and labels in a specific way. You could preprocess the files by running following command with the paths in square-bracket, specified as per the paths on your local PC:

python lib/datasets/preprocess/thermalFaceDB/thermalFaceDB_generator.py --save_dir [~/dev/data/ThermalFaceDB_LM/Processed] --ori_root_dir [~/dev/data/ThermalFaceDB_Org/FaceDB_Snapshot_complete]

and finally, the dataset directory should look like below under the DATA_ROOT directory:

$ThermalFaceDBx320
├── Processed
│   ├── train
│   │   ├── image
│   │   └── label
│   ├── val
│   │   ├── image
│   │   └── label

Note: This implementation is built on openseg.pytorch as well as ContrastiveSeg. We would like to thank the developers of both these repositories for providing the source code.

Training

Illustrative command for training segmentation network:

Replace all the fields within square brackets with actual path and appropriate experiment name (e.g. --config [~/dev/data/ThermalFaceDB])

bash [scripts/thermalFaceDB/deeplab/run_x_8_deeplabv3_train_samcl_occ.sh] train [x_8_samcl_occ] [~/dev/data/ThermalFaceDB] [~/dev/data/ThermalFaceDB]

Validation

Illustrative command for running validation:

Replace all the fields within square brackets with actual path and appropriate experiment name (e.g. --config [~/dev/data/ThermalFaceDB])

bash [scripts/thermalFaceDB/deeplab/run_x_8_deeplabv3_train_samcl_occ.sh] val [x_8_samcl_occ] [~/dev/data/ThermalFaceDB] [~/dev/data/ThermalFaceDB]

Performance Evaluation:

Performance Evaluation of SAM-CL Framework

Ablation Study:

Ablation Study for TiAug and SAM-CL Loss

Qualitative Analysis on Different Datasets:

Qualitative Analysis on Different Datasets

SAM-CL Framework:

SAM-CL Framework

Thermal Image Augmentation:

Thermal Image Augmentation Module

Citation:

@inproceedings{Joshi_2022_BMVC,
author    = {Jitesh N Joshi and Nadia Berthouze and Youngjun Cho},
title     = {Self-adversarial Multi-scale Contrastive Learning for Semantic Segmentation of Thermal Facial Images},
booktitle = {33rd British Machine Vision Conference 2022, {BMVC} 2022, London, UK, November 21-24, 2022},
publisher = {{BMVA} Press},
year      = {2022},
url       = {https://bmvc2022.mpi-inf.mpg.de/0864.pdf}
}

sam-cl's People

Contributors

deepneuroscience avatar jnj256 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sam-cl's Issues

The data set

Hello, could you please provide the data set? Go to the link provided to sign up to download the data set but there was no response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.