Metadata-Version: 2.4
Name: edns
Version: 1.0.0
Summary: EDN-S: Enhanced Deep Network for Satellite Super-Resolution
Home-page: https://github.com/aimenachraff-jpg/MASTER2-A1
Author: Aimen Achraff
Author-email: Aimen Achraff <aimenachraff@example.com>
Maintainer-email: Aimen Achraff <aimenachraff@example.com>
License: MIT
Project-URL: Homepage, https://github.com/aimenachraff-jpg/EDN-S
Project-URL: Repository, https://github.com/aimenachraff-jpg/EDN-S
Project-URL: Issues, https://github.com/aimenachraff-jpg/EDN-S/issues
Project-URL: Documentation, https://github.com/aimenachraff-jpg/EDN-S/wiki
Keywords: super-resolution,satellite,sentinel-2,edsr,deep-learning,remote-sensing,pytorch
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.0.0
Requires-Dist: torchvision>=0.15.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: omegaconf>=2.3.0
Requires-Dist: scipy>=1.10.0
Requires-Dist: scikit-image>=0.21.0
Requires-Dist: rasterio>=1.3.0
Requires-Dist: pillow>=9.0.0
Requires-Dist: matplotlib>=3.7.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: flake8>=6.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: pre-commit>=3.0; extra == "dev"
Provides-Extra: gui
Requires-Dist: tkinter; extra == "gui"
Provides-Extra: cloud
Requires-Dist: kagglehub>=0.3.0; extra == "cloud"
Requires-Dist: kaggle>=1.7.0; extra == "cloud"
Provides-Extra: full
Requires-Dist: edns[cloud,dev,gui]; extra == "full"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# EDN-S: Enhanced Deep Network for Satellite Super-Resolution

## Overview
EDN-S (Enhanced Deep Network for Satellite Super-Resolution) is a lightweight PyTorch implementation of EDSR-small for satellite image super-resolution, deployable as a pip-installable package with CLI and Python API.

**Author:** Chekalil Aimene Charef Eddine
**Project type:** Independent research startup (self-directed, completed without institutional affiliation)
**Thesis:** "Hallucination-Aware and Task-Driven Evaluation of Super-Resolution Methods for ALSAT-2B Satellite Imagery"

---

## All Phases Complete ✅

| # | Phase | Status | Date | Result |
|---|-------|--------|------|--------|
| 0 | Infrastructure & Environment | ✅ | 2026-11-12 | CPU-only PyTorch, FreeLLMAPI |
| 1 | Literature Review | ✅ | 2026-11-13 | 47 papers, research gap identified |
| 2 | Research Questions & Methodology | ✅ | 2026-11-12/13 | 6 RQs (H1–H6), protocol finalized |
| 3 | Dataset Acquisition & Preparation | ✅ | 2026-11-15 | PROBA-V (1,450 imgsets), Sentinel-2 (87 scenes, 14,748 tiles) |
| 4 | Baseline Implementation | ✅ | 2026-11-15 | 149 Sim-ALSAT-2B pairs, bicubic baseline, EDSR-tiny smoke test |
| 5 | Super-Resolution Experiments | ✅ | 2026-11-18 | **EDSR-small: 24.86 dB vs bicubic 21.83 dB (+3.03 dB)** on Kaggle 2×T4 |
| 6 | Hallucination-Aware Evaluation | ✅ | 2026-11-18 | 1,742 test tiles; **EDSR hallucination 6.89% vs bicubic 13.03%** |
| 7 | Downstream Task Evaluation | ⏳ Optional | — | Framework implemented (`src/downstream/tasks.py`), deferred |
| 8 | Statistical Analysis & Discussion | ✅ | 2026-11-18 | Cohen's d 6.19, McNemar p<0.001 (textural/spectral) |
| 9 | Thesis Writing & Final Validation | ✅ | 2026-11-19 | 24-page LaTeX thesis compiled |

---

## Installation

```bash
pip install edns
```

Or from source:
```bash
git clone https://github.com/aimenachraff-jpg/MASTER2-A1.git
cd MASTER2-A1
pip install -e .
```

---

## Quick Start

### Python API
```python
from edns.inference import run_sr

result_path = run_sr(
    input_path="data/raw/sentinel2/test.tif",
    output_path="output_sr.tif",
    model_path="experiments/checkpoints/edsr_small_phase5_best.pt"
)
```

### CLI
```bash
edns-sr input.tif [output.tif]
```

Environment variables: `EDNS_CKPT`, `EDNS_CONFIG`

---

## Key Features
- 🚀 **Lightweight**: 1.52M parameters, fast on CPU (~50s for 1024→4096 tile on Intel Iris Xe)
- 🌍 **Satellite-optimized**: 4-channel input (B2, B3, B4, B8) for Sentinel-2 imagery
- 📊 **Comprehensive metrics**: PSNR, SSIM, SAM, ERGAS, SCI, TUS
- 🧪 **Hallucination detection**: Spectral, Structural, Textural, Semantic categories
- 🛠️ **Deployable**: CLI + Python API, pip-installable package (`edns`)

---

## Verified Results

| Metric | EDSR-small | Bicubic | Δ |
|--------|-----------|---------|---|
| PSNR (dB) | **24.86** | 21.83 | **+3.03** |
| SSIM | 0.72 | 0.61 | +0.11 |
| SAM (rad) | 0.058 | 0.082 | −0.024 |
| ERGAS | 2.14 | 4.31 | −2.17 |
| Hallucination rate | **6.89%** | 13.03% | **−6.14%** |

Statistical significance: Cohen's d = 6.19 (very large), McNemar p < 0.001 for textural and spectral hallucination categories.

---

## Model Architecture
- **Base**: EDSR-small (16 residual blocks, 64 features)
- **Scale**: ×4 super-resolution
- **Input**: 4 channels (B2, B3, B4, B8) — Sentinel-2 surface reflectance
- **Output**: 4 channels at 4× higher resolution

---

## Package Structure (`edns`)
```
src/edns/
├── models/          EDSR implementation
├── inference/       SRInference class + CLI entry point (edns-sr)
├── data/            GeoTIFF I/O, z-score normalization using training stats
├── evaluation/      Metrics: PSNR, SSIM, SAM, ERGAS, SCI, TUS
├── hallucination/   Hallucination detector (Spectral/Structural/Textural/Semantic)
└── utils/           Logging, helpers, timers
```

---

## License
MIT License — see [LICENSE](LICENSE) file

## Acknowledgments
Special thanks to the Kaggle community for dataset access and the OpenCode framework for enabling this independent research.

## Author
Chekalil Aimene Charef Eddine — independent researcher
