Sam-Roblex commited on
Commit
a24b840
·
verified ·
1 Parent(s): 096fba2

Upload 4 files

Browse files
README.md CHANGED
@@ -1,3 +1,106 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ base_model: stabilityai/stable-diffusion-xl-base-1.0
4
+ tags:
5
+ - controlnet
6
+ - lora
7
+ - stable-diffusion-xl
8
+ - text-to-image
9
+ - image-to-image
10
+ - remote-sensing
11
+ - satellite-imagery
12
+ - synthetic-data
13
+ - geospatial
14
+ pipeline_tag: text-to-image
15
+ language:
16
+ - en
17
  ---
18
+
19
+ # ConLoRA-Sat
20
+
21
+ **Parameter-Efficient Synthetic Satellite Imagery Generation for Data-Scarce Humanitarian Contexts**
22
+
23
+ ConLoRA-Sat combines **LoRA** (domain-style adaptation) with **ControlNet** (spatial structure) on a **Stable Diffusion XL 1.0** backbone: one text prompt plus a 5-class land-cover segmentation map generates a realistic 0.5 m satellite image. It targets data-scarce humanitarian use, e.g. UN peacekeeping training, producing fictitious yet geographically plausible terrain rather than identifiable real locations.
24
+
25
+ ```
26
+ Sam-Roblex/ConLoRA-Sat/
27
+ ├── lora/
28
+ │ └── satellite_lora.safetensors ← one file: the LoRA weights
29
+ └── controlnet/
30
+ ├── config.json ← SDXL ControlNet architecture (required by diffusers)
31
+ └── diffusion_pytorch_model.safetensors ← the ControlNet weights
32
+ ```
33
+
34
+ - Trained on **322 curated images** (LoRA) and **4,333 image/segmentation pairs** (ControlNet) from Mogadishu (Somalia) and Addis Ababa (Ethiopia). About **24 A6000-equivalent GPU-hours** total. Runs in 16-20 GB inference VRAM.
35
+
36
+ ## Usage
37
+
38
+ Both components load from this repo via subfolders:
39
+
40
+ ```python
41
+ from diffusers import StableDiffusionXLControlNetPipeline, ControlNetModel
42
+ import torch
43
+
44
+ pipe = StableDiffusionXLControlNetPipeline.from_pretrained(
45
+ "stabilityai/stable-diffusion-xl-base-1.0",
46
+ controlnet=ControlNetModel.from_pretrained(
47
+ "Sam-Roblex/ConLoRA-Sat", subfolder="controlnet", torch_dtype=torch.float16),
48
+ torch_dtype=torch.float16, variant="fp16", use_safetensors=True).to("cuda")
49
+
50
+ pipe.load_lora_weights("Sam-Roblex/ConLoRA-Sat",
51
+ weight_name="lora/satellite_lora.safetensors")
52
+
53
+ image = pipe(
54
+ "satellite imagery, aerial view, Mixed-use urban settlement with moderate building density",
55
+ image="seg_map.png", # 5-class map, 1024×1024
56
+ num_inference_steps=50,
57
+ guidance_scale=7.5,
58
+ controlnet_conditioning_scale=1.0,
59
+ ).images[0]
60
+ ```
61
+
62
+ Notes:
63
+ - LoRA trigger phrase is **"satellite imagery, aerial view"**, prepended to a descriptive caption.
64
+ - On water-dominated maps lower `controlnet_conditioning_scale` toward **0.8** for smoother coastlines.
65
+ - The two components are trained separately and composed at inference, so either can be reused independently.
66
+
67
+ ## Land-cover class legend
68
+
69
+ | Class | RGB |
70
+ |------------|----------|
71
+ | Bareland | `#D2B48C` |
72
+ | Vegetation | `#228B22` |
73
+ | Roads | `#404040` |
74
+ | Buildings | `#B22222` |
75
+ | Water | `#1E90FF` |
76
+
77
+ ## Model details
78
+
79
+ - **Backbone**: SDXL 1.0 Base, frozen throughout.
80
+ - **LoRA** (`lora/`): cross-attention query/value projections, rank 32, α 16. Prodigy optimizer, Min-SNR weighting (γ 5). ~4,000 steps, ~2 GPU-hours.
81
+ - **ControlNet** (`controlnet/`): trainable copy of SDXL's U-Net encoder path, injected via zero-initialised 1×1 convolutions. AdamW (lr 5e-6, 500-step warm-up), DDPM schedule. All 4,333 pairs, ~22 GPU-hours.
82
+
83
+ ## Results
84
+
85
+ | Config | FID | LPIPS | CMMD | CLIPScore |
86
+ |--------|-----|-------|------|-----------|
87
+ | LoRA only | 110.98 | 0.640 | 0.034 | 0.249 |
88
+ | ControlNet only | 106.44 | 0.490 | 0.063 | 0.246 |
89
+ | **ConLoRA-Sat** | **100.88** | **0.474** | 0.061 | 0.248 |
90
+
91
+ Downstream (DeepLabV3+/ResNet-50): a segmenter trained only on synthetic imagery retains **90.1 %** of a real-data baseline; 200 real + 600 synthetic recovers **92.5 %**. In a 53-expert perceptual study, synthetic images were misclassified as real in **20.8 %** of trials.
92
+
93
+ ## Train / evaluate / cite
94
+ Training scripts, evaluation code, and dataset documentation live in the companion GitHub repository. Dataset: [Zenodo: 10.5281/zenodo.22747581](https://doi.org/10.5281/zenodo.22747581) (CC BY-NC 4.0). Paper: *ConLoRA-Sat: Parameter-Efficient Synthetic Satellite Imagery Generation for Data-Scarce Humanitarian Contexts*, EarthArXiv preprint (under review).
95
+
96
+ ```bibtex
97
+ @misc{qureshi2026conlorasat,
98
+ title = {ConLoRA-Sat: Parameter-Efficient Synthetic Satellite Imagery
99
+ Generation for Data-Scarce Humanitarian Contexts},
100
+ author = {Qureshi, Seyed Amir Muhammad and Granell, Carlos and Casteleyn, Sven},
101
+ year = {2026},
102
+ note = {EarthArXiv preprint; under review}
103
+ }
104
+ ```
105
+
106
+ **License**: weights Apache-2.0; base model CreativeML OpenRAIL++-M. Training dataset CC BY-NC 4.0. Generates fictitious terrain, not identifiable real locations.
controlnet/config.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "ControlNetModel",
3
+ "_diffusers_version": "0.27.0",
4
+ "act_fn": "silu",
5
+ "addition_embed_type": "text_time",
6
+ "addition_embed_type_num_heads": 64,
7
+ "addition_time_embed_dim": 256,
8
+ "attention_head_dim": [
9
+ 5,
10
+ 10,
11
+ 20
12
+ ],
13
+ "block_out_channels": [
14
+ 320,
15
+ 640,
16
+ 1280
17
+ ],
18
+ "class_embed_type": null,
19
+ "conditioning_channels": 3,
20
+ "conditioning_embedding_out_channels": [
21
+ 16,
22
+ 32,
23
+ 96,
24
+ 256
25
+ ],
26
+ "controlnet_conditioning_channel_order": "rgb",
27
+ "cross_attention_dim": 2048,
28
+ "down_block_types": [
29
+ "DownBlock2D",
30
+ "CrossAttnDownBlock2D",
31
+ "CrossAttnDownBlock2D"
32
+ ],
33
+ "downsample_padding": 1,
34
+ "encoder_hid_dim": null,
35
+ "encoder_hid_dim_type": null,
36
+ "flip_sin_to_cos": true,
37
+ "freq_shift": 0,
38
+ "global_pool_conditions": false,
39
+ "in_channels": 4,
40
+ "layers_per_block": 2,
41
+ "mid_block_scale_factor": 1,
42
+ "mid_block_type": "UNetMidBlock2DCrossAttn",
43
+ "norm_eps": 1e-05,
44
+ "norm_num_groups": 32,
45
+ "num_attention_heads": null,
46
+ "num_class_embeds": null,
47
+ "only_cross_attention": false,
48
+ "projection_class_embeddings_input_dim": 2816,
49
+ "resnet_time_scale_shift": "default",
50
+ "transformer_layers_per_block": [
51
+ 1,
52
+ 2,
53
+ 10
54
+ ],
55
+ "upcast_attention": null,
56
+ "use_linear_projection": true
57
+ }
controlnet/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:728d6b7bd956fdd0927ea9508621afe52a5022c8f3c23959e82a5ed9f91e2584
3
+ size 5004167864
lora/satellite_lora.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d03dcceee4b74a0940bbc73dae4e1dec7b10df139c7265befaa600925070d6e
3
+ size 228537092