Skip to content

Add SSL4Eco SeCo-Eco Weights #2849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

isaaccorley
Copy link
Collaborator

@isaaccorley isaaccorley commented Jun 21, 2025

Adds the RN50 weights pretrained on the new SSL4Eco dataset using the SeCo-Eco method modified from the original SeCo method. This is from the CVPR Earthvision paper "SSL4Eco: A Global Seasonal Dataset for Geospatial Foundation Models in Ecology", Plekhanova et al. (2025).

Weights were extracted from the checkpoint and tweaked to be loadable with timm and torchvision resnet50 and rehosted to huggingface here.

cc: @PlekhanovaElena @drprojects @jdollinger-bit

@github-actions github-actions bot added the models Models and pretrained weights label Jun 21, 2025
@isaaccorley isaaccorley requested a review from Copilot June 21, 2025 01:45
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new weight configuration for ResNet50 using the SSL4Eco SeCo‐Eco method.

  • Introduces a new weight definition (SENTINEL2_ALL_SECO_ECO) in the ResNet50_Weights class.
  • Updates associated metadata (e.g., dataset, input channels, publication link, bands) for proper integration with timm and torchvision.
Comments suppressed due to low confidence (2)

torchgeo/models/resnet.py:644

  • Verify that the provided publication link is accurate and corresponds to the SeCo-Eco method, and update the documentation if necessary.
            'publication': 'https://arxiv.org/abs/2504.18256',

torchgeo/models/resnet.py:647

  • Consider adding a comment explaining why 'NDVI' is included in the bands list along with raw satellite bands, as it is typically a derived index.
            'bands': ['B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B8A', 'NDVI'],

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jun 21, 2025
_seco_eco_bands = ['B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B8A', 'NDVI']
_seco_eco_transforms = K.AugmentationSequential(
K.Resize((224, 224)),
K.Normalize(mean=torch.tensor(0.0), std=torch.tensor(10000.0)),
Copy link
Collaborator Author

@isaaccorley isaaccorley Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PlekhanovaElena can you confirm these are the recommended transforms used during pretraining if someone wants to process a raw sentinel-2 uint16 patch?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely don't want to divide by 10K for NDVI, may need a vector of length 9

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In their code when they create NDVI in their dataset they actually multiply it by 10k so it can be normalized later by 10k

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamjstewart adamjstewart added this to the 0.8.0 milestone Jun 24, 2025
@@ -6,6 +6,7 @@ ResNet50_Weights.SENTINEL2_ALL_DECUR,13,`link <https://github.com/zhu-xlab/DeCUR
ResNet50_Weights.SENTINEL2_ALL_DINO,13,`link <https://github.com/zhu-xlab/SSL4EO-S12>`__,`link <https://arxiv.org/abs/2211.07044>`__,"CC-BY-4.0",90.7,99.1,63.6,
ResNet50_Weights.SENTINEL2_ALL_MOCO,13,`link <https://github.com/zhu-xlab/SSL4EO-S12>`__,`link <https://arxiv.org/abs/2211.07044>`__,"CC-BY-4.0",91.8,99.1,60.9,
ResNet50_Weights.SENTINEL2_ALL_SOFTCON, 13,`link <https://github.com/zhu-xlab/softcon>`__,`link <https://arxiv.org/abs/2405.20462>`__,"CC-BY-4.0"
ResNet50_Weights.SENTINEL2_ALL_SECO_ECO, 9,`link <https://github.com/PlekhanovaElena/ssl4eco>`__,`link <https://arxiv.org/abs/2504.18256>`__,"MIT"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PlekhanovaElena is the 12-band version without NDVI available? That may be more general and useful to us.

Also, I don't see a license on https://huggingface.co/eplekh/secoeco. What license are the weights released under?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation models Models and pretrained weights
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants