Gasformer: A Transformer-based Architecture for Segmenting Methane Emissions from Livestock in Optical Gas Imaging
Toqi Tahamid Sarker1,Mohamed G Embaby2,Khaled R Ahmed1, Amer AbuGhazaleh2,
1 School of Computing, 2 School of Agricultural Sciences.
Southern Illinois University
Paper: (arXiv 2404.10841)
Methane emissions from livestock, particularly cattle, significantly contribute to climate change. Effective methane emission mitigation strategies are crucial as the global population and demand for livestock products increase. We introduce Gasformer, a novel semantic segmentation architecture for detecting low-flow rate methane emissions from livestock, and controlled release experiments using optical gas imaging. We present two unique datasets captured with a FLIR GF77 OGI camera. Gasformer leverages a Mix Vision Transformer encoder and a Light-Ham decoder to generate multi-scale features and refine segmentation maps. Gasformer outperforms other state-of-the-art models on both datasets, demonstrating its effectiveness in detecting and segmenting methane plumes in controlled and real-world scenarios. On the livestock dataset, Gasformer achieves mIoU of 88.56%, surpassing other state-of-the-art models.
Step 1: Clone the Gasformer repository:
To get started, first clone the Gasformer repository and navigate to the project directory:
git clone https://github.com/toqitahamid/Gasformer.git
cd Gasformer
Step 2: Environment Setup:
Gasformer recommends setting up a conda environment and installing dependencies via pip or conda. Use the following commands to set up your environment:
Create and activate a new conda environment
conda create -n gasformer python=3.8
conda activate gasformer
Install PyTorch and CUDA
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
Install MMSegmentation dependencies
pip install -U openmim
mim install mmengine
mim install "mmcv>=2.0.0"
Install additional packages
conda install conda-forge::ftfy
conda install conda-forge::tensorboard
pip install wandb
conda install anaconda::ipykernel
Verification
Gasformer is based on MMSegmentation 1.2.1, so we need to check the versions of PyTorch, MMCV and MMSegmentation.
python -c "import torch, mmcv, mmseg; print(torch.__version__, mmcv.__version__, mmseg.__version__)"
@article{sarker2024gasformer,
title={Gasformer: A Transformer-based Architecture for Segmenting Methane Emissions from Livestock in Optical Gas Imaging},
author={Toqi Tahamid Sarker and Mohamed G Embaby and Khaled R Ahmed and Amer AbuGhazaleh},
journal={arXiv preprint arXiv:2404.10841},
year={2024},
}
This project is based on Segformer (paper, code), Light-Ham (paper, code), and MMsegmentation. Thanks for their excellent works.