Home

Awesome

Event Penguins (CVPR 2024)

This is the official repository for Low-power, Continuous Remote Behavioral Localization with Event Cameras accepted at CVPR 2024 by Friedhelm Hamann, Suman Ghosh, Ignacio Juarez Martinez, Tom Hart, Alex Kacelnik, Guillermo Gallego

<h2 align="left">

Project Page | Paper | Video | Data

</h2>

Low-power, Continuous Remote Behavioral Localization with Event Cameras

Table of Contents

  1. Citation
  2. Quickstart
  3. Details
  4. Acknowledgements
  5. In the Press
  6. Additional Resources

Citation

If you use this work in your research, please consider citing:

@InProceedings{Hamann24cvpr,
    author    = {Hamann, Friedhelm and Ghosh, Suman and Martinez, Ignacio Juarez and Hart, Tom and Kacelnik, Alex and Gallego, Guillermo},
    title     = {Low-power Continuous Remote Behavioral Localization with Event Cameras},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2024},
    pages     = {18612-18621}
}

Quickstart

Setup

You can use Miniconda to set up an environment:

conda create --name eventpenguins python=3.8
conda activate eventpenguins

Install PyTorch by choosing a command that matches your CUDA version. You can find the compatible commands on the PyTorch official website (tested with PyTorch 2.2.2), e.g.:

conda install pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia

Install other required packages:

pip install -r requirements.txt

Preprocessing the data

  1. Create a folder for the data:
cd <project-root>
mkdir data
  1. Download the data and save it in <project-root>/data.

  2. Create the pre-processed dataset with the following command:

python scripts/preprocess.py --data_root data/EventPenguins --output_dir data --recording_info_path config/annotations/recording_info.csv

This crops the events according to the pre-annotated nests and stores the recordings according to the split specified in the paper.

Inference

  1. Create a folder for models:
mkdir models
  1. Download the pre-trained model weights from here and save them in the models folder.

  2. Run inference with the following command:

python scripts/inference.py --config config/exp/inference.yaml --verbose

Details

Original Data

The EventPenguins dataset contains 24 ten-minute recordings, with 16 annotated nests. An overview of the data can be found in config/annotations/recording_info.csv. Each recording has a roi_group_id, which links to the location of the 16 pre-annotated regions of interest, which can be found in config/annotations/rois (new set of ROIs when the camera was moved). The dataset is structured as follows:

EventPenguins/
├── <yy-mm-dd>_<hh-mm-ss>/  # (these folders are referred to as "recordings")
│   ├── frames/
│   │   ├── 000000000000.png
│   │   ├── 000000000001.png
│   │   └── ...
│   ├── events.h5
│   ├── frame_timestamps.txt  # [us]
│   └── metadata.yaml       
└── ...

Please note that we do not use the grayscale frames in our method but provide them for completeness.

Pre-processed Data

Structure

The processed data is stored in a single HDF5 file named preprocessed.h5. The file structure is organized as follows:

Attributes

Each subgroup (ROI) has the following attributes:

Each main group (recording timestamp) has the following attribute:

Annotations

The annotations are in config/annotations/annotations.json. The structure is very similar to ActivityNet, with an additional layer to consider different nests.

{
  "version": "VERSION 0.0",
  "database": {
    "<yy-mm-dd>_<hh-mm-ss>": {
      "annotations": {
        "<roi_id>": [
          {
            "label": <label>,
            "segment": [
              <t_start>,
              <t_end>
            ]
          },
          ...
        ]
      }
    }
  }
}

"adult_flap" and "chick_flap" are other types of wing flapping easily confused with the ecstatic display (ed). We provide these labels for completeness, but they are not considered in our method.

Acknowledgements

The evaluation for activity detection is largely inspired by ActivityNet. We thank the authors for their excellent work.

In the Press

Additional Resources