amini-ai commited on
Commit
e4f10e7
·
verified ·
1 Parent(s): 870d71b

Update model card with architecture, usage, and research context

Browse files
Files changed (1) hide show
  1. README.md +144 -3
README.md CHANGED
@@ -1,3 +1,144 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: transformers
4
+ tags:
5
+ - patchtst
6
+ - time-series
7
+ - remote-sensing
8
+ - earth-observation
9
+ - self-supervised-learning
10
+ - masked-pretraining
11
+ inference: false
12
+ ---
13
+
14
+ # AminiTech/amini-600k-v1
15
+
16
+ Amini 600K V1 is a compact transformer checkpoint for learning representations of satellite pixel time series. It accepts 48 time positions and 10 numerical channels per pixel, with shared encoder weights across channels.
17
+
18
+ The model is part of Amini's work on self-supervised representation learning for Earth observation. It adapts PatchTST to numerical spectral-band and index sequences, learning through reconstruction of randomly masked temporal patches. The released checkpoint contains an encoder and a patch reconstruction head.
19
+
20
+ ## Model details
21
+
22
+ | Property | Value |
23
+ | --- | --- |
24
+ | Developer | AminiTech / Amini.ai |
25
+ | Architecture | `PatchTSTForPretraining` |
26
+ | Model size | Approximately 0.6M |
27
+ | Input shape | `[batch_size, 48, 10]` |
28
+ | Encoder layers | 3 |
29
+ | Hidden width | 128 |
30
+ | Attention heads | 4 |
31
+ | Feed-forward width | 512 |
32
+ | Patch length / stride | 12 / 12 |
33
+ | Cross-channel attention | Disabled |
34
+ | Normalization | `batchnorm` |
35
+ | Internal scaling | `std` |
36
+ | Masking | Random patches; configured ratio 0.4 |
37
+ | Reconstruction objective | Mean squared error |
38
+ | CLS token | Enabled |
39
+ | Weight format / precision | Safetensors / float32 |
40
+ | Exported Transformers version | `4.51.3` |
41
+
42
+ Architecture details refer to [this checkpoint configuration](https://huggingface.co/AminiTech/amini-600k-v1/blob/870d71be731c46e97916f8f63f7c164a305cff9e/config.json). Context length counts positions after preprocessing; it does not specify a calendar duration.
43
+
44
+ ## Uses
45
+
46
+ - Generate pixel time-series embeddings for similarity search and clustering.
47
+ - Train downstream land-use/land-cover classifiers with labeled data.
48
+ - Explore temporal patterns in agricultural and environmental data.
49
+
50
+ Classification, regression, and forecasting require an appropriate downstream model and task-specific evaluation. The reconstruction head does not produce land-cover labels or future forecasts. The `prediction_length` field in the configuration does not establish a trained forecasting capability.
51
+
52
+ ## Input and preprocessing
53
+
54
+ Provide finite float32 values with shape `[batch_size, 48, 10]`, preserving chronological order and consistent channel definitions.
55
+
56
+ The exported model specifies a 48-position context and 10 channels. A release-specific channel schema, normalization statistics, and temporal preprocessing manifest are not distributed with the checkpoint.
57
+
58
+ Use the channel order, feature definitions, normalization, and missing-data handling associated with the training pipeline for your application. The model applies internal standard-deviation scaling.
59
+
60
+ ## Training and related research
61
+
62
+ The exported configuration records self-supervised random patch masking and MSE reconstruction. The mask ratio is a configuration value; the realized fraction depends on the discrete number of patches. The released artifacts do not include a dataset manifest linking this revision to a particular corpus and split.
63
+
64
+ Related research describes Sentinel-2 median biweekly composites from 2020-2024 and 50,000 chips across Africa. The companion study describes the compact model family. It does not specify the exact Hub revision used in its experiments. [ICLR 2025 ML4RS paper](https://ml-for-rs.github.io/iclr2025/camera_ready/papers/52.pdf)
65
+
66
+ ## Usage
67
+
68
+ Install PyTorch, Transformers with PatchTST support, and Safetensors. The example below uses synthetic input to demonstrate the API. Real inputs require the preprocessing described above.
69
+
70
+ ### Extract embeddings
71
+
72
+ ```python
73
+ import torch
74
+ from transformers import PatchTSTModel
75
+
76
+ MODEL_ID = "AminiTech/amini-600k-v1"
77
+ REVISION = "870d71be731c46e97916f8f63f7c164a305cff9e"
78
+
79
+ encoder = PatchTSTModel.from_pretrained(
80
+ MODEL_ID,
81
+ revision=REVISION,
82
+ use_safetensors=True,
83
+ do_mask_input=False,
84
+ ).eval()
85
+
86
+ past_values = torch.randn(
87
+ 1, encoder.config.context_length, encoder.config.num_input_channels,
88
+ dtype=torch.float32,
89
+ )
90
+ observed_mask = torch.ones_like(past_values, dtype=torch.bool)
91
+
92
+ with torch.inference_mode():
93
+ hidden = encoder(
94
+ past_values=past_values,
95
+ past_observed_mask=observed_mask,
96
+ ).last_hidden_state
97
+
98
+ # Shape: [batch, channels, patch_tokens_including_cls, hidden_width]
99
+ patch_hidden = hidden[:, :, 1:, :] # Exclude the prepended CLS token.
100
+ per_channel_embeddings = patch_hidden.mean(dim=2)
101
+ pixel_embeddings = per_channel_embeddings.mean(dim=1)
102
+
103
+ print(pixel_embeddings.shape) # torch.Size([1, 128])
104
+ ```
105
+
106
+ Loading the bare encoder omits the reconstruction head and may produce an unused-weight warning. This example averages patch embeddings and then channels; pooling should match the downstream training protocol. Channel-level or CLS-token embeddings can also be used.
107
+
108
+ ### Run masked reconstruction
109
+
110
+ ```python
111
+ from transformers import PatchTSTForPretraining
112
+
113
+ model = PatchTSTForPretraining.from_pretrained(
114
+ MODEL_ID, revision=REVISION, use_safetensors=True,
115
+ ).eval()
116
+
117
+ with torch.inference_mode():
118
+ outputs = model(
119
+ past_values=past_values,
120
+ past_observed_mask=observed_mask,
121
+ )
122
+ reconstruction_loss = outputs.loss
123
+ ```
124
+
125
+ The pretraining class applies random input masking even in evaluation mode. The encoder example explicitly disables masking for repeatable embeddings. Missing values must be represented consistently with the applicable preprocessing; the all-ones mask above is for fully populated synthetic input.
126
+
127
+ ## Evaluation and limitations
128
+
129
+ Release-specific numerical benchmarks are not reported in this card. The usage examples have been checked with the released weights on CPU using PyTorch 2.6.0 and Transformers 4.48.3; this checks loading and forward-pass behavior, not downstream accuracy.
130
+
131
+ - Clouds, missing observations, interpolation, sensor differences, and feature scaling can affect embeddings.
132
+ - Transfer across regions, seasons, sensors, and acquisition conditions requires evaluation on representative data.
133
+ - Random pixel splits can contain spatially related examples; geographic and temporal holdouts are useful when assessing generalization.
134
+ - Reconstruction loss alone does not establish downstream classification, crop-yield prediction, calibrated change detection, or causal relationships.
135
+ - Exact training data provenance and preprocessing are incompletely documented for this revision.
136
+
137
+ ## License
138
+
139
+ This checkpoint is released under the Apache License 2.0, as declared in its repository metadata.
140
+
141
+ ## References
142
+
143
+ - [Self-Supervised Representation Learning on Remote Sensing Pixel Time Series with Patch-Based Masking](https://ml-for-rs.github.io/iclr2025/camera_ready/papers/52.pdf), ICLR 2025 ML4RS Workshop.
144
+ - [Hugging Face PatchTST documentation](https://huggingface.co/docs/transformers/model_doc/patchtst).