Files changed (1) hide show
  1. README.md +255 -17
README.md CHANGED
@@ -1,22 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
- language: en
3
- license: apache-2.0
4
- tags:
5
- - semantic-segmentation
6
- - mask2former
7
- - autonomous-vehicles
8
- - off-road
9
- metrics:
10
- - mIoU
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ---
12
 
13
- # GOOSE-M2F (Swin-Large)
14
- This model is a task-specific adaptation of Mask2Former (Swin-Large) for the **ICRA 2026 GOOSE 2D Semantic Segmentation Challenge** in Vienna, Austria.
15
 
16
- ### Performance
17
- - **Official Composite mIoU: 70.08%** (Ranked at the top of the leaderboard)
 
 
18
 
19
- ### Architecture Modifications
20
- 1. **200 Object Queries** (expanded from 100) for high-density 64-class terrain parsing.
21
- 2. **Feature Refinement Module (FRM):** ASPP-lite + CBAM dual attention to resolve Vegetation and Terrain over-segmentation.
22
- 3. **Auxiliary Supervision Head:** Direct H/4 resolution supervision to bypass query bottlenecks for thin/rare objects.
 
1
+ ## GOOSE-M2F: Adapting Mask2Former for High-Fidelity, Long-Tailed Fine-Grained Semantic Segmentation in Unstructured Outdoor Terrain
2
+
3
+ **Jyothiraditya Lingam, Nikhileswara Rao Sulake, Sai Manikanta Eswar Machara**
4
+
5
+ *Department of Computer Science and Engineering*
6
+ *Rajiv Gandhi University of Knowledge Technologies (RGUKT), Nuzvid, Andhra Pradesh, India*
7
+
8
+ <p align="center">
9
+ <a href="https://arxiv.org/abs/XXXX.XXXXX"><b>πŸ“„ Paper</b></a> β€’
10
+ <a href="https://github.com/Aditya-Lingam-9000/GOOSE-M2F"><b>πŸ’» Code</b></a> β€’
11
+ <a href="https://huggingface.co/XYZ9843/GOOSE-M2F"><b>πŸ€— Hugging Face</b></a> β€’
12
+ <a href="https://www.codabench.org/competitions/14257"><b>πŸ† Challenge</b></a>
13
+ </p>
14
+
15
+ > **GOOSE-M2F** is a task-specific adaptation of Mask2Former for the **GOOSE 2D Fine-Grained Semantic Segmentation Challenge (ICRA 2026)**. The proposed framework addresses long-tailed semantic segmentation in unstructured outdoor environments through enhanced object query capacity, feature refinement, auxiliary supervision, class-balanced optimization, and robust multi-scale inference.
16
+
17
+ > **Official Challenge Performance:** **70.08% Composite mIoU** (63.55% Fine mIoU, 76.61% Coarse mIoU), achieving **3rd Place** on the GOOSE 2D FGSS Challenge Leaderboard.
18
+
19
+ ---
20
+
21
+ ### πŸ“’ News
22
+
23
+ * **[ICRA 2026]** GOOSE-M2F achieved **3rd Place** in the GOOSE 2D Fine-Grained Semantic Segmentation Challenge.
24
+ * **[2026]** Source code and trained models released.
25
+ * **[2026]** Technical report available on arXiv.
26
+
27
+ ---
28
+
29
+
30
+ ## What is GOOSE-M2F?
31
+
32
+ The GOOSE dataset presents one of the most challenging real-world segmentation benchmarks: 64 fine-grained classes across diverse unstructured outdoor environments including forests, gravel paths, construction zones, and agricultural terrain β€” with a severely long-tailed class distribution.
33
+
34
+ GOOSE-M2F extends the baseline Mask2Former (Swin-Large backbone) with three key modifications engineered specifically for this challenge:
35
+
36
+ | Modification | Problem Solved | Impact |
37
+ |---|---|---|
38
+ | **200 Object Queries** (vs 100) | Query saturation in 64-class scenes | +2-3% composite mIoU |
39
+ | **Feature Refinement Module (FRM)** β€” ASPP-lite + CBAM | Over-segmentation of amorphous terrain classes | +3-4% on Vegetation/Terrain |
40
+ | **Auxiliary Supervision Head** at H/4 resolution | Vanishing gradients for tiny/thin classes | +5-8% on rare classes |
41
+
42
  ---
43
+
44
+ ## Architecture
45
+
46
+ ```
47
+ Input Image [B, 3, H, W]
48
+ β”‚
49
+ β–Ό
50
+ Swin-Large Backbone (Hierarchical, 4 stages)
51
+ Stage 1-4: channels {192, 384, 768, 1536}, resolutions {H/4 β†’ H/32}
52
+ β”‚
53
+ β–Ό
54
+ MSDeformAttn Pixel Decoder (6-layer FPN)
55
+ Output: mask_features [B, 256, H/4, W/4]
56
+ β”‚
57
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
58
+ β–Ό β–Ό
59
+ [NEW] Feature Refinement Module [NEW] Auxiliary Head
60
+ ASPP-lite: dilations {1, 3, 6, 12} Conv(256β†’256β†’64)
61
+ + Global Average Pooling DB-weighted CE loss
62
+ + CBAM Dual-Attention (Ch + Sp) Supervised at H/4
63
+ β”‚
64
+ β–Ό
65
+ Transformer Decoder (9 layers)
66
+ [MOD] 200 Object Queries (was 100)
67
+ Masked Cross-Attention
68
+ β”‚
69
+ β–Ό
70
+ Class Head [B, 200, 65] Γ— Mask Head [B, 200, H/4, W/4]
71
+ β”‚
72
+ β–Ό
73
+ Hungarian Matching β†’ Semantic Prediction
74
+ ```
75
+
76
+ ---
77
+
78
+ ## Training Strategy
79
+
80
+ | Technique | Description |
81
+ |---|---|
82
+ | **Distribution-Balanced (DB) Loss** | `w_c = (1-Ξ²)/(1-Ξ²^n_c)`, Ξ²=0.9999. Amplifies gradients for rare classes. |
83
+ | **Rare-Class Copy-Paste (RCCP)** | Pre-extracted rare-class cutouts pasted onto training images at 85% probability. |
84
+ | **Dynamic IoU-Aware Weights** | Per-class loss weights updated every epoch from validation IoU (0%β†’4x, 80%+β†’1x). |
85
+ | **10x LR Jump (V4)** | Backbone 1e-5, Decoder 5e-5 β€” broke the model out of a local minimum at ~55%. |
86
+ | **EMA (decay=0.9995)** | Shadow weights consistently +1.0–1.5% over raw model on validation. |
87
+ | **Class-Aware Repeat Sampling** | Oversamples images containing rare classes proportional to their rarity. |
88
+ | **Polynomial LR Decay** | Gradual decay after warmup, with annealing in final sessions. |
89
+
90
+ ### Training Progression (V1 β†’ V8)
91
+
92
+ | Session | Base LR | Backbone LR | Official Score |
93
+ |---------|---------|-------------|----------------|
94
+ | V1 (S3) | 5e-6 | 1e-6 | 50.68% |
95
+ | V2 (S4) | 5e-6 | 1e-6 | 54.62% |
96
+ | V3 (S5) | 5e-6 | 1e-6 | 55.64% |
97
+ | V4 (S6) | **5e-5** | **1e-5** | 56.38% ← **10x LR Jump** |
98
+ | V5 (S7) | 5e-5 | 1e-5 | 57.59% |
99
+ | V6 (S8) | 5e-5 | 1e-5 | 58.58% |
100
+ | V7 (S9) | 5e-5 | 1e-5 | 59.23% |
101
+ | V8 (S10) | **2.5e-5** | **5e-6** | 59.51% ← Annealing |
102
+ | **Inference** | β€” | β€” | **70.08%** ← +10.57% from TTA |
103
+
104
+ ---
105
+
106
+ ## Inference Engine
107
+
108
+ The final performance leap from 59.51% (training) to 70.08% (submission) came entirely from the inference pipeline:
109
+
110
+ | Technique | Gain | Description |
111
+ |---|---|---|
112
+ | **Dense Sliding Window** | +4-5% | 896Γ—896 crops, stride=384px (57% overlap) |
113
+ | **2D Gaussian Kernel Blending** | Eliminates artifacts | Center pixels weighted higher, edges down-weighted |
114
+ | **4-Scale TTA** | +3-4% | Scales: 0.5Γ—, 0.75Γ—, 1.0Γ—, 1.5Γ— |
115
+ | **H-Flip TTA** | +1-2% | 8 total views per image (4 scales Γ— 2 flips) |
116
+ | **EMA Weights** | +1-1.5% | Shadow weights used instead of raw training weights |
117
+ | **AuxHead Stripping** | VRAM savings | Removed before inference β€” not needed for prediction |
118
+
119
+ ---
120
+
121
+ ## Project Structure
122
+
123
+ ```
124
+ goose-m2f/
125
+ β”œβ”€β”€ src/
126
+ β”‚ β”œβ”€β”€ model.py ← GOOSEMask2Former (FRM + AuxHead + 200 queries)
127
+ β”‚ β”œβ”€β”€ features.py ← Dataset, augmentations, EMA, metrics
128
+ β”‚ β”œβ”€β”€ train.py ← Training engine (Trainer class)
129
+ β”‚ └── inference.py ← Dense Gaussian patch-blending inference
130
+ β”œβ”€β”€ configs/
131
+ β”‚ β”œβ”€β”€ train_config.yaml ← All training hyperparameters
132
+ β”‚ └── infer_config.yaml ← TTA and inference settings
133
+ β”œβ”€β”€ data/raw/ ← Dataset (symlink or copy)
134
+ β”œβ”€β”€ models/ ← Manually placed checkpoints
135
+ β”œβ”€β”€ outputs/
136
+ β”‚ β”œβ”€β”€ checkpoints/ ← best_model.pth, latest.pth, charts
137
+ β”‚ └── predictions/ ← Output PNG predictions
138
+ β”œβ”€β”€ tests/
139
+ β”‚ └── test_model.py ← pytest unit tests
140
+ β”œβ”€β”€ instructions/
141
+ β”‚ └── instructions.md ← Full setup + usage guide
142
+ └── requirements.txt
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Quick Start
148
+
149
+ ### 1. Setup
150
+
151
+ ```bash
152
+ git clone https://github.com/Aditya-Lingam-9000/GOOSE-2D-FGSS-Challenge
153
+ cd GOOSE-2D-FGSS-Challenge
154
+
155
+ conda create -n goose python=3.11 -y && conda activate goose
156
+ pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
157
+ pip install -r requirements.txt
158
+ accelerate config # Configure for your GPU setup
159
+ ```
160
+
161
+ ### 2. Configure Paths
162
+
163
+ Edit `configs/train_config.yaml`:
164
+ ```yaml
165
+ data_dir: "/path/to/goose_dataset"
166
+ csv_path: "/path/to/goose_label_mapping.csv"
167
+ output_dir: "outputs/checkpoints/session_01"
168
+ ```
169
+
170
+ ### 3. Train
171
+
172
+ ```bash
173
+ # Single GPU
174
+ python -m src.train --config configs/train_config.yaml
175
+
176
+ # Multi-GPU
177
+ accelerate launch --num_processes 2 -m src.train --config configs/train_config.yaml
178
+ ```
179
+
180
+ ### 4. Inference
181
+
182
+ Edit `configs/infer_config.yaml` with the checkpoint path and image directory, then:
183
+ ```bash
184
+ python -m src.inference --config configs/infer_config.yaml
185
+ ```
186
+
187
+ ### 5. Tests
188
+
189
+ ```bash
190
+ pytest tests/ -v
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Results
196
+
197
+ ### Official Leaderboard Performance (Final Submission)
198
+
199
+ | Metric | Score |
200
+ |---|---|
201
+ | Fine mIoU | ~68.5% |
202
+ | Coarse mIoU | ~71.6% |
203
+ | **Official Composite** | **70.08%** |
204
+
205
+ ### Coarse Category Breakdown
206
+
207
+ | Category | mIoU |
208
+ |---|---|
209
+ | Sky | 94.6% |
210
+ | Road | 91.0% |
211
+ | Vehicle | 89.8% |
212
+ | Vegetation | 89.8% |
213
+ | Construction | 75.5% |
214
+ | Terrain | 78.9% |
215
+ | Human | 62.8% |
216
+ | Sign | 62.4% |
217
+ | Water | 33.9% |
218
+ | Object | 51.3% |
219
+ | Animal | 0.0% |
220
+
221
+ ---
222
+
223
+ ## Requirements
224
+
225
+ | Package | Version |
226
+ |---|---|
227
+ | torch | β‰₯ 2.1.0 |
228
+ | transformers | β‰₯ 4.38.0 |
229
+ | accelerate | β‰₯ 0.27.0 |
230
+ | albumentations | β‰₯ 1.3.1 |
231
+ | opencv-python | β‰₯ 4.9.0 |
232
+ | numpy | β‰₯ 1.24.0 |
233
+
234
+ See `requirements.txt` for the complete list.
235
+
236
+ ---
237
+
238
+ ## Citation
239
+
240
+ If you use this work, please cite:
241
+
242
+ ```bibtex
243
+ @techreport{---,
244
+ title = {GOOSE-M2F: Adapting Mask2Former for High-Fidelity, Long-Tailed Fine-Grained Semantic Segmentation in Unstructured Outdoor Terrain},
245
+ author = {---},
246
+ year = {2026},
247
+ institution = {---}
248
+ }
249
+ ```
250
+
251
  ---
252
 
253
+ ## References
 
254
 
255
+ - **Mask2Former**: Cheng et al., *Masked-Attention Mask Transformer for Universal Image Segmentation*, CVPR 2022
256
+ - **Swin Transformer**: Liu et al., ICCV 2021
257
+ - **CBAM**: Woo et al., *Convolutional Block Attention Module*, ECCV 2018
258
+ - **DeepLab**: Chen et al., *Rethinking Atrous Convolution*, TPAMI 2017
259
 
260
+ ---