reefnet-pytorch-models
This repository provides modular, split-aware PyTorch Dataset classes used in the ReefNet project for coral reef image classification. Designed to integrate with timm, it supports large-scale genus-level training and evaluation on Red Sea-specific benchmarks.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.5%) to scientific vocabulary
Repository
This repository provides modular, split-aware PyTorch Dataset classes used in the ReefNet project for coral reef image classification. Designed to integrate with timm, it supports large-scale genus-level training and evaluation on Red Sea-specific benchmarks.
Basic Info
- Host: GitHub
- Owner: ReefNet-Project
- License: other
- Language: Python
- Default Branch: main
- Size: 0 Bytes
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
ReefNet Training Code
This repository contains data loading utilities used in the ReefNet project for training coral reef classification models using timm, a PyTorch-based image modeling library. The provided dataset classes enable flexible, split-aware loading of coral patch images annotated with genus-level labels.
For model details, benchmarks, and data, visit the project page: https://reefnet-project.github.io/reefnet-2025/
Directory Structure
bash
pytroch-models/
reefnet_dataset.py # General-purpose loader
dataset_reefnet_v2.py # main data loader for classification tasks used in ReefNet code
dataset_rsg.py # Al-wajh dataset loader
... # rest of the files like the original repo
README.md
... (integration with timm)
Overview of Data Loaders
ReefNetDataset
- General-purpose dataset class supporting arbitrary label, path, and split column names.
- Outputs:
(image_tensor, label_index) - CSV must contain columns like
patch_path,split, and your chosen label column (e.g.,genusorExperimental_label).
CoralPatchCSVLoader
- Simplified loader for standard
train/val/testsplits usinggenusas the label column. - Prints summary statistics on load: class counts, unique labels, etc.
RSGPatchCSVLoader
- Specialized loader for Al-wajh testing dataset.
- Filters samples based on a predefined list of genera (e.g., Porites, Acropora, Pocillopora).
- Use this for domain-specific generalization or Red Sea evaluation tasks.
Usage
Example (Standalone PyTorch Training)
```python from loaders.reefnet_dataset import ReefNetDataSet from torchvision import transforms
transform = transforms.Compose([ transforms.Resize((224, 224)), transforms.ToTensor() ])
dataset = ReefNetDataSet( csvfile='reefnetmetadata.csv', split='train', labelcolumn='genus', pathcolumn='patch_path', transform=transform )
image, label = dataset[0] print(image.shape, label) ```
CSV Format
All loaders expect a CSV with at least these columns:
- patch_path: path to the coral patch image
- genus or Experimental_label: genus-level coral label
- split: one of train, val, or test
For RSGPatchCSVLoader, an additional column Our_Labels is used to filter classes.
Citing ReefNet
If you use these loaders or any ReefNet data or models in your research, please cite:
bibtex
@article{battach2025reefnet,
title={ReefNet: A Large-scale, Taxonomically Enriched Dataset and Benchmark for Coral Reef Classification},
author={Battach, Yahia and Felemban, Abdulwahab and Khan, Faizan Farooq and Radwan, Yousef A. and Li, Xiang and Silva, Luis and Suka, Rhonda and Gonzalez, Karla and Marchese, Fabio and Williams, Ivor D. and Jones, Burton H. and Beery, Sara and Benzoni, Francesca and Elhoseiny, Mohamed},
journal={arXiv preprint arXiv:XXXX.XXXXX},
year={2025}
}
Maintainer
- Yahia Battach Creator and Maintainer
License
This code is licensed under the CC BY 4.0 License.
Questions?
Feel free to open an issue or visit our project homepage for more resources.
Owner
- Name: ReefNet-Project
- Login: ReefNet-Project
- Kind: organization
- Repositories: 1
- Profile: https://github.com/ReefNet-Project
Citation (CITATION.cff)
message: "If you use this software, please cite it as below."
title: "PyTorch Image Models"
version: "1.2.2"
doi: "10.5281/zenodo.4414861"
authors:
- family-names: Wightman
given-names: Ross
version: 1.0.11
year: "2019"
url: "https://github.com/huggingface/pytorch-image-models"
license: "Apache 2.0"
GitHub Events
Total
Last Year
Dependencies
- actions/checkout v2 composite
- actions/setup-python v1 composite
- actions/checkout v4 composite
- trufflesecurity/trufflehog main composite
- huggingface_hub *
- pyyaml *
- safetensors *
- torch *
- torchvision *
- expecttest * development
- pytest * development
- pytest-forked * development
- pytest-timeout * development
- pytest-xdist * development
- huggingface_hub *
- numpy *
- pyyaml *
- safetensors >=0.2
- torch >=1.7
- torchvision *