GithubHelp home page GithubHelp logo

sinc-rppg's Introduction

SiNC-rPPG

Non-Contrastive Unsupervised Learning of Physiological Signals from Video

Highlight paper in Conference on Computer Vision and Pattern Recognition (CVPR) 2023

Figure 1: Overview of the SiNC framework for rPPG compared with traditional supervised and unsupervised learning. Supervised and contrastive losses use distance metrics to the ground truth or other samples. Our framework applies the loss directly to the prediction by shaping the frequency spectrum, and encouraging variance over a batch of inputs. Power outside of the bandlimits is penalized to learn invariances to irrelevant frequencies. Power within the bandlimits is encouraged to be sparsely distributed near the peak frequency.

Contents

  • Preprocessing code for the PURE dataset is in src/preprocessing/PURE
  • Training code is in src/train.py
  • Testing code is in src/test.py
  • Experiment config file is in src/args.py
  • Loss functions are in src/utils/losses.py
  • Model architectures are in src/models/
  • Dataloaders are in src/datasets/
  • TODO: preprocessing code for UBFC-rPPG, DDPM, and HKBU-MARs.

Installation

Install dependencies with python3:

pip install -r requirements.txt

To Run

1.) To prepare the data for training, download PURE and follow the steps in src/preprocessing/PURE

2.) Train several models with:

./scripts/train_PURE.sh

3.) Test the models with:

./scripts/test_PURE.sh

Notes

When new dataloaders are added, make sure to add them to src/datasets/utils.py so they can be selected from a corresponding command-line argument. You can run cross-dataset experiments by adding new datasets to line 30 in src/test.py.

Citation

If you use any part of our code or data, please cite our paper.

@inproceedings{speth2023sinc,
  title={Non-Contrastive Unsupervised Learning of Physiological Signals from Video},
  author={Speth, Jeremy and Vance, Nathan and Flynn, Patrick and Czajka, Adam},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2023},
}

sinc-rppg's People

Contributors

jemspeth avatar aczajka avatar

Stargazers

greatgol avatar  avatar  avatar S.Wei avatar Matthieu S. avatar leewonseok avatar Jeff Carpenter avatar  avatar Li zhipeng avatar xu zhanyu avatar Juan C Martinez avatar Wang Xu avatar Akshay Paruchuri avatar  avatar 汪汪 avatar hutao avatar Chaoqi avatar  avatar Ökkeş Uğur Ulaş avatar Toy avatar Zhaodong Sun avatar  avatar Yihang avatar Naixin Zhai avatar Kunyoung Lee avatar Alireza Moazeni avatar Victor avatar ssssafe avatar  avatar

Watchers

Walter Scheirer avatar Joel Brogan avatar Patrick Flynn avatar  avatar  avatar

sinc-rppg's Issues

Where is the SiNC model

Thank you very much for your work. I would like to ask where the SiNC model is, as I only found PhysNet and RPNet in the downloaded code. Additionally, I would like to inquire about the approximate FLOPs of this model.

The results of the PURE test are different from those in the paper

After training and testing on PURE, the test results are significantly different from those in the paper,The results I got are shown below,I got the result step by step according to the readme, but I don't know where I made a mistake. Could you explain why?

pure_testing
ME, MAE, RMSE, r
-1.00 $\pm$ 1.26 & 1.75 $\pm$ 1.48 & 5.82 $\pm$ 3.01 & 0.96 $\pm$ 0.03

Is this really non-contrastive learning?

Hi,

Impressive work, it looks so simple.

In my view, the core of the work consists of three types of loss: Bandwidth, Sparsity, and Variance, which are referred to as IPR, SNR, and EMD in the code. Both IPR and SNR are weakly supervised terms based on prior knowledge. To prevent model collapse into trivial solutions, an EMD term is introduced.

EMD essentially constructs negative pairs by forcing the model to output a uniformly distributed psd within a batch. This effectively compares samples within a batch to ensure their distances are maximized as much as possible. Consider this scenario: if the batch size is 1, then EMD cannot function because it's impossible to construct negative pairs.

EMD does not completely solve the problem of model collapse into trivial solutions; it cannot guarantee that psd distributions produced by models positively correlate with ground truth labels—sometimes models may just randomly distribute outputs within bandwidth.

Based on my replication results, convergence is not very stable; sometimes good outcomes can be achieved while other times they're quite poor.

Looking forward to more code releases from the author!

Experiment on UBFC cannot work

The UBFC.py is not finished.

def __getitem__(self, idx):
    raise NotImplementedError

After preprocessing the UBFC-rPPG Dataset, run train.py with UBFC, there come errors as below:

File "../SiNC/src/datasets/UBFC.py", line 95, in set_augmentations
raise NotImplementedError
NotImplementedError

Could you mind to share the pretrained model weight on PURE?

Thanks for sharing the code of this work, its really amazing! I want to test it on the real world including head movement, but I dont have the permition to access PURE Dataset now. Would you mind to share the model weight on PURE dataset?

Thanks for sharing

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.