gomezzz / DistMSMatch

A MPI-distributed version of MSMatch integrating the PASEOS framework for physical modelling
GNU General Public License v3.0
0 stars 0 forks source link

DistMsMatch

Distributed Semi-Supervised Multispectral Scene Classification with Few Labels

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributing
  4. FAQ
  5. Contact

About The Project

This is the code to realize DistMSMatch, a distributed version of MSMatch. The repository includes an implementation of FixMatch for the semi-supervised training of different convolutional neural networks, including a U-Net Encoder, EfficientNet and EfficientNet Lite to perform scene classification on the EuroSAT dataset. The code builds on and extends the FixMatch-pytorch implementation based on PyTorch.

Built With

Getting Started

This is a brief example of setting up DistMSMatch.

Prerequisites

We recommend using conda to set-up your environment. This will also automatically set up CUDA and the cudatoolkit for you, enabling the use of GPUs for training, which is recommended.

Installation

  1. Get miniconda or similar
  2. Clone the repo
    git clone https://github.com/gomezzz/DistMSMatch
  3. Setup the environment. This will create a conda environment called distmsmatch
    conda env create -f environment.yml

Set up datasets

To launch the training on EuroSAT (rgb), it is necessary to download the corresponding datasets. Please place the dataset in /data/EuroSAT_RGB. Alternatively, you can change the root_dir variable in the datasets/EurosatRGBDataset.py to point to the dataset. The dataset can be download here.

Run training

The training is performed using the mpi4py package and utilizes multiple processes to control the different spacecraft. Different configurations files in .toml format can be used to set-up DistMsMatch in swarm or federated mode. The federated mode may be performed using a ground station or a geostationary satellite as parameter server.

To run the training using 8 spacecraft, you can proceed as follows:

mpiexec -n 8 python main.py --cfg_path path_to_cfg_file 

If path_to_cfg_file is not specified, the default swarm learning scenario will be run using eight spacecraft.

Contributing

The project is open to community contributions. Feel free to open an issue or write us an email if you would like to discuss a problem or idea first.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

Created by ESA's Advanced Concepts Team, $\Phi$-lab, and AI Sweden.

Project Link: https://www.esa.int/gsp/ACT/projects/semisupervised/

Reference

If you have used DistMSMatch, please cite the following paper DistMSMatch:

@article{ostman2023distmsmatch,
  author = {Östman, Johan and Gómez, Pablo and Shreenath, Vinutha Magal and Meoni, Gabriele},
  title = {Decentralised Semi-supervised Onboard Learning for Scene Classification in Low-Earth Orbit},
  journal = {arXiv:2305.04059 [cs.LG]},
  year = {2023},
}