Spaces:
Configuration error
Download agent.md from DaneshSelwal/Classification-DIAS-65Bands-Workspace: direct link, hf CLI and curl.
- Browser
- Download file 7 kB
-
https://huggingface.co/spaces/DaneshSelwal/Classification-DIAS-65Bands-Workspace/resolve/main/agent.md
- Command line
-
hf download hf://spaces/DaneshSelwal/Classification-DIAS-65Bands-Workspace/agent.md
-
curl -L -o agent.md https://huggingface.co/spaces/DaneshSelwal/Classification-DIAS-65Bands-Workspace/resolve/main/agent.md
MASTER CONTEXT & WORKFLOW: Hyperspectral Image Classification & UQ (DIAS 65-Bands)
Last Updated: 2026-09-16 Role: This is the single authoritative "Master File" for any agent, developer, or automated system working in this workspace. It dictates the architectural setup, pipeline execution process, storage strategy, and historical context of the DIAS 65-bands Uncertainty Quantification (UQ) project.
1. Project Domain & Objective
This project implements a generalized framework for Hyperspectral Remote Sensing Image Classification and Uncertainty Quantification. Specifically, this repository is dedicated to processing the DIAS agricultural dataset (65 spectral bands). The goal is to train deep learning models (AlexNet, GFNet, ViT-UNet) and apply various UQ methodologies (Conformal Prediction, Ensembles, Distillation) to measure epistemic and aleatoric uncertainty, yielding reliable spatial maps and metrics.
2. Workspace Architecture & Storage Strategy
The environment is split across three primary locations to balance local Mac memory limitations with the need for persistent cloud backups.
Active Local Workspace (
/Users/danesh/Documents/AGY/agy/classification/)- The primary staging and development ground.
- Git Tracking: Tracks the remote GitHub repository
DaneshSelwal/classification_dias.git. - Constraint: Do not store redundant
.zipor unzipped caches here. Clean updl_temp/folders after processing.
Google Drive Cold Storage (
/Users/danesh/Documents/AGY/classification_65bands/)- The ultimate local mirror to the Google Drive cloud backup.
- Syncing Rule: This folder must strictly mirror the finalized artifacts from the Local Workspace using
rsync. It is never to be used as a working directory.
GitHub Repository (
classification_dias)- Git LFS: All heavy
.kerasand.h5model weights MUST be tracked via Git Large File Storage (LFS). - Before pushing, always run
git lfs track "folder/models/*.keras".
- Git LFS: All heavy
3. The Orchestration Pipeline (How Work Gets Done)
Due to computational constraints on the local Mac, all model training is orchestrated autonomously on Kaggle GPUs. Any new pipeline must follow this strict 9-step execution workflow:
Step 1: Notebook Adaptation
The local Jupyter notebook must be adapted for Kaggle. File paths must point to /kaggle/input/... and outputs must be written to /kaggle/working/....
Step 2: Obfuscation Strategy (Crucial)
To prevent Kaggle automated bans/flags when uploading datasets:
- Every dataset file and model weight must be renamed to a generic alias (e.g.,
k001.mat,k016.keras). - The mapping must be registered in
/Users/danesh/Documents/AGY/agy/classification/kaggle_name_mapping.json.
Step 3: Kaggle Upload
- Data/Models: Large files must be uploaded as a Kaggle Dataset (
kaggle datasets create). - Code: The notebook is pushed as a Kaggle Kernel (
kaggle kernels push).
Step 4: Execution & Monitoring
Run kaggle kernels status <slug> and poll until the status is COMPLETE.
Step 5: Download Outputs
Use kaggle kernels output <slug> -p <local_temp_folder> -o to pull down the generated .keras weights and evaluation CSV/Excel files.
Step 6: Local Organization
Move downloaded artifacts from the temp folder to their permanent homes (e.g., baseline/models/ and baseline/results/).
Step 7: Local Cache Cleanup
Immediately delete the local dl_temp/ caches to free up Mac storage memory.
Step 8: Git Commit & Push
Commit the models and results. Agents must use BypassSandbox: true when executing git push to GitHub.
Step 9: Google Drive Sync
Run rsync -av /Users/danesh/Documents/AGY/agy/classification/ /Users/danesh/Documents/AGY/classification_65bands/ --exclude '.git' to update the cold storage.
4. Completed Pipelines & Methodologies
All items listed here have been fully trained, evaluated, pushed to GitHub (via Git LFS), and synced to Google Drive.
- Baseline (
baseline/)- Method: Softmax, MC Dropout, Temperature Scaling.
- Models: AlexNet, GFNet, ViT-UNet (both
_bestand_final).
- Self-Adaptive Conformal Prediction (
sacp/)- Method: Post-hoc calibration evaluated across spatial windows (3, 5, 7, 9).
- Multi-Head CP (
multicp/)- Method: Architectural modification outputting multi-head predictions.
- Models: 6 multi-head
.kerasvariants.
- Deep Ensembles & CreDE (
ensemble/)- Method: 15 distinct teacher models trained (5 seeds per architecture).
- Evaluation: CreDE spatial uncertainty maps generated.
- Kaggle Dependency: These 15 models were uploaded as a dedicated Kaggle Dataset (
daneshselwal/dias-ensemble-models, obfuscated ask016-k030) so other kernels could access them.
5. Active / Pending Pipelines
All pipelines are now COMPLETE as of 2026-09-16. No active Kaggle kernels running.
✅ CREDIT Distillation (credit/) — COMPLETED 2026-09-16
- Method: Conformalized Regularized Distillation Training (Student learning from the 15 Ensembles).
- Models: AlexNet_CNN_CREDIT_best.keras (260MB), GFNet_CREDIT_best.keras (125MB), ViT_UNet_CREDIT_best.keras (187MB)
- Results: CREDIT_Results.xlsx, credit_evaluation_summary.csv, credit_train_uncertainty_summary.csv, 3 spatial maps PNGs, confusion matrices PNG
- GitHub: Pushed via Git LFS (commit dcb2cfc)
- Drive: Synced to classification_65bands/credit/results/
- Note for future agents: Kaggle kernels cannot read large
.kerasfiles from other kernels viakernel_sources. Fix: mount ensemble teachers explicitly asdataset_sources(dias-ensemble-models dataset, k016-k030).
6. Future Skeletons (To Be Implemented)
The original research repository contains several advanced methodologies that currently exist only as empty "skeleton" directories in this workspace. Future iterations of this project will port and execute these:
dapm/(Deep Adaptive Predictive Modeling)dofa/(Dynamic Wavelength Tokenization)georsclip/(Vision-Language Model)mambahsi/(State Space Models)spatialgcn/(Graph Convolutional Networks)multicp_sacp/(Spatial Multi-Head CP)
7. Hard Rules for Autonomous Agents
- Never delete
.kerasfiles from Git-tracked folders unless you are intentionally removing them from the GitHub repository usinggit rm. - Always use
BypassSandbox: truewhen communicating with network interfaces (Git push, Kaggle CLI commands, Rsync). - Protect the Google Drive: Only write to
/Users/danesh/Documents/AGY/classification_65bands/usingrsyncfrom the local workspace. Do not treat it as a scratch pad. - Update this Document: If a new pipeline is executed, a new Kaggle dataset is created, or a core architectural rule changes, this
agent.mdfile MUST be updated to reflect the new state.