{"id":21088148,"url":"https://github.com/gomezzz/msmatch","last_synced_at":"2025-05-16T11:32:31.557Z","repository":{"id":48311396,"uuid":"310303733","full_name":"gomezzz/MSMatch","owner":"gomezzz","description":"Code for the paper \"MSMatch: Semi-Supervised Multispectral Scene Classification with Few Labels\"","archived":false,"fork":false,"pushed_at":"2025-03-05T08:32:59.000Z","size":2552,"stargazers_count":25,"open_issues_count":3,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T01:01:39.250Z","etag":null,"topics":["deep-learning","machine-learning","neural-network","paper","pytorch","semi-supervised-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gomezzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-05T13:13:43.000Z","updated_at":"2025-03-05T08:33:02.000Z","dependencies_parsed_at":"2022-09-21T10:52:23.904Z","dependency_job_id":null,"html_url":"https://github.com/gomezzz/MSMatch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomezzz%2FMSMatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomezzz%2FMSMatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomezzz%2FMSMatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomezzz%2FMSMatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gomezzz","download_url":"https://codeload.github.com/gomezzz/MSMatch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254522235,"owners_count":22085075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","machine-learning","neural-network","paper","pytorch","semi-supervised-learning"],"created_at":"2024-11-19T21:15:47.451Z","updated_at":"2025-05-16T11:32:26.508Z","avatar_url":"https://github.com/gomezzz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/msmatch-semi-supervised-multispectral-scene/image-classification-on-eurosat)](https://paperswithcode.com/sota/image-classification-on-eurosat?p=msmatch-semi-supervised-multispectral-scene) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/msmatch-semi-supervised-multispectral-scene/scene-classification-on-uc-merced-land-use)](https://paperswithcode.com/sota/scene-classification-on-uc-merced-land-use?p=msmatch-semi-supervised-multispectral-scene)\n\n# MSMatch\nSemi-Supervised Multispectral Scene Classification with Few Labels\n\n\u003c!--\n*** Based on https://github.com/othneildrew/Best-README-Template\n--\u003e\n\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#set-up-datasets\"\u003eSet-up datasets\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#content-of-repository\"\u003eContent of Repository\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\n    \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#train-a-model\"\u003eTrain a model\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#evaluate-a-model\"\u003eEvaluate a model\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#set-up-datasets\"\u003eSet-up datasets\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#roadmap\"\u003eRoadmap\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#FAQ\"\u003eFAQ\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\nThis is the code for the paper *\"MSMatch: Semi-Supervised Multispectral Scene Classification with Few Labels\"* by Pablo Gómez and Gabriele Meoni, which aims to apply the state of the art of semi-supervised learning techniques to land-use and land-cover classification problems. \nCurrently, the repository includes an implementation of [FixMatch](https://arxiv.org/abs/2001.07685) for the training of [EfficientNet](https://arxiv.org/abs/1905.11946) Convolutional Neural Networks. The code builds on and extends the [FixMatch-pytorch](https://github.com/LeeDoYup/FixMatch-pytorch) implementation based on [PyTorch](https://pytorch.org/). Compared to the original repository, this repository includes code to work with both the RGB and the multispectral (MS) versions of [EuroSAT](https://arxiv.org/abs/1709.00029) dataset and the [UC Merced Land Use ](http://weegee.vision.ucmerced.edu/datasets/landuse.html) (UCM) dataset.\n\n### Built With\n\n* [PyTorch](https://pytorch.org/)\n* [conda](https://docs.conda.io/en/latest/)\n* [EfficientNet PyTorch](https://github.com/lukemelas/EfficientNet-PyTorch)\n* [albumentations](https://github.com/albumentations-team/albumentations)\n* imageio, numpy, pandas\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\nThis is a brief example of setting up MSMatch.\n\n### Prerequisites\n\nWe recommend using [conda](https://docs.conda.io/en/latest/) 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.\n\n\n* [conda](https://docs.conda.io/en/latest/), which will take care of all requirements for you. For a detailed list of required packages, please refer to the [conda environment file](https://github.com/gomezzz/MSMatch/blob/main/environment.yml).\n\n### Installation\n\n1. Get [miniconda](https://docs.conda.io/en/latest/miniconda.html) or similar\n2. Clone the repo\n   ```sh\n   git clone https://github.com/gomezzz/MSMatch.git\n   ```\n3. Setup the environment. This will create a conda environment called `torchmatch`\n   ```sh\n   conda env create -f environment.yml\n   ```\n\n### Set up datasets\nTo launch the training on EuroSAT (rgb or MS), it is necessary to download the corresponding datasets. The `root_dir` variable in the corresponding `datasets/eurosat_dataset.py` and `datasets/eurosat_rgb_dataset.py` files shall be adjusted according to the dataset path. \n  \n\u003c!-- Content of Repo --\u003e\n## Content of Repository\n\nThe repository is structured as follows: \n\n- **datasets**: contains the semi-supervised learning datasets usable for training, and augmentation code. To add a new dataset, a new class similar to, e.g., `eurosat_rgb.py`needs to be added.\n- **external/visualizations**: contains tools to create visualizations of trained models. We utilized the code from the `src` directory of [pytorch-cnn-visualizations](https://github.com/utkuozbulak/pytorch-cnn-visualizations) repository and slightly adapted it.\n- **models**: contains the neural networks models used for training.\n- **notebooks**: contains some jupyter notebooks used to create paper figures, collect training results, showing augmentation effects on images and provide additional functionalities. To be able to use the notebooks, it is necessary to additionally install [Jupyter](https://jupyter.org/).\n- **runscripts**: includes bash scripts used to train the networks.\n- **`utils.py`**: some utility functions.\n- **`train_utils.py`**: providing utils for training.\n- **`train.py`**: main train script.\n- **`eval.py`**: main script for evaluating a trained network.\n- **`environment.yml`**: conda environment file describing dependencies. \n\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\n### Train a model\n\nTo train a model on EuroSAT RGB by using EfficientNet B0 from scratch,  you can use: \n```\npython train.py --dataset eurosat_rgb --net efficientnet-b0\n```\n\n`--net ` can be used to specify the EfficientNet model, whilst `--dataset` can be used to specify the dataset. Use `eurosat_rgb` for EuroSAT RGB, `eurosat_ms` for EuroSAT MS, and `ucm` for UCM dataset.\n\nInstead of starting the training from scratch, it is possible exploit a model pretrained on ImageNet. To do it,  you can use: \n```\npython train.py --dataset eurosat_rgb --net efficientnet-b0 --pretrained\n```\n\nInformation on additional flags can be obtained by typing:\n```\npython train.py --help\n```\n\nFor additional information on training, including the use of single/multiple GPUs, please refer to [FixMatch-pytorch](https://github.com/LeeDoYup/FixMatch-pytorch).\n\n### Evaluate a model\n\nTo evaluate a trained model on a target dataset, you can use:\n\n```\npython eval.py --load_path [LOAD_PATH] --dataset [DATASET] --net [NET]\n```\n\nwhere `LOAD_PATH` is the path of the trained model (`.pth` file), `DATASET` is the target dataset, `NET` is the network model used during the training.\n\n\n## Roadmap\n\nSee the [open issues](https://github.com/gomezzz/MSMatch/issues) for a list of proposed features (and known issues).\n\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nThe project is open to community contributions. Feel free to open an [issue](https://github.com/gomezzz/MSMatch/issues) or write us an email if you would like to discuss a problem or idea first.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the GPL-3.0 License. See [LICENSE](https://github.com/gomezzz/MSMatch/blob/main/LICENSE) for more information.\n\n\u003c!-- CONTACT --\u003e\n## Contact \n\nCreated by ESA's [Advanced Concepts Team](https://www.esa.int/gsp/ACT/index.html)\n\n- Pablo Gómez - `pablo.gomez at esa.int`\n- Gabriele Meoni - `gabriele.meoni at esa.int`\n\nProject Link: [https://www.esa.int/gsp/ACT/projects/semisupervised/](https://www.esa.int/gsp/ACT/projects/semisupervised/)\n\n\n\n\u003c!-- ACKNOWLEDGEMENTS \nThis README was based on https://github.com/othneildrew/Best-README-Template\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgomezzz%2Fmsmatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgomezzz%2Fmsmatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgomezzz%2Fmsmatch/lists"}