|
Download master_prompt.md from unknownBrain/BioHCL-SSSM-Complete-Workspace: direct link, hf CLI and curl.
- Browser
- Download file 9.73 kB
-
https://huggingface.co/unknownBrain/BioHCL-SSSM-Complete-Workspace/resolve/main/master_prompt.md
- Command line
-
hf download hf://unknownBrain/BioHCL-SSSM-Complete-Workspace/master_prompt.md
-
curl -L -o master_prompt.md https://huggingface.co/unknownBrain/BioHCL-SSSM-Complete-Workspace/resolve/main/master_prompt.md
9.73 kB
| # 🩺 MASTER PROMPT: BioHCL-SSSM Pediatric Pneumonia Research & Ablations | |
| > **To Antigravity (AGY):** You are acting as the Lead Medical Deep Learning Research Engineer on the **BioHCL-SSSM** project for pediatric pneumonia diagnosis. Read this entire document and all referenced `.md` files in this workspace before taking action. | |
| --- | |
| ## 1. Executive Context & Mission | |
| * **Project Name:** BioHCL-SSSM (Hierarchical Convolutional State-Space Hybrid Architecture for Pediatric Pneumonia Diagnosis). | |
| * **Internship Supervisor:** **Tathagat Sir**. | |
| * **Clinical Dataset:** Guangzhou Women and Children’s Medical Center Pediatric Chest X-Ray Cohort (5,856 images; Kermany et al., *Cell* 2018; official held-out test split of 624 images). | |
| * **Local Hardware:** Intel Core i9 (12th Gen) + NVIDIA GeForce RTX 3080 Ti Laptop GPU (16 GB VRAM) with CUDA acceleration. | |
| * **Hugging Face Repository:** `unknownBrain/BioHCL-SSSM-Complete-Workspace` (Public). | |
| --- | |
| ## 2. 🚨 Tathagat Sir's Exact Feedback & Directives | |
| Internship supervisor Tathagat Sir provided detailed, unambiguous instructions on how the ablations, benchmarks, and deliverables must be structured. | |
| ### A. The Golden Rule: Zero Fabrication / Zero Hallucination | |
| * **Under NO circumstances should any number, metric, standard deviation, or curve be fabricated, simulated, hallucinated, or borrowed from outside papers (e.g., brain tumor or chest CT papers).** | |
| * Every single reported metric must be an **100% genuine empirical measurement** produced by training and evaluating models directly on the Guangzhou pediatric chest X-ray cohort. | |
| * Every experiment must report exact empirical counts: True Positives (TP), True Negatives (TN), False Positives (FP), False Negatives (FN), along with Accuracy, Precision, Recall (Sensitivity), Specificity, F1-Score, and ROC-AUC. | |
| ### B. Tathagat Sir's Literal Directives (Voice Notes & WhatsApp): | |
| 1. **On Cross-Validation:** | |
| > *"CV is correct."* | |
| *(The 10-fold CV is 100% approved by Sir: 99.37% ± 0.33% mean accuracy, 0.9957 F1, with all 10 checkpoints verified).* | |
| 2. **On SOTA Benchmarking:** | |
| > *"Benchmark - wrong. I need benchmark as in state of the art techniques accuracy as a vanilla model Like Resnet, vit, deit etc around 10 to 15 latest models and ofc ours best model in the sheet."* | |
| *(Addressed: 15 models benchmarked in `1_sota_benchmarks_master.csv`).* | |
| 3. **On Table 1 (Component-Wise Ablation):** | |
| > *"Table 1 - for component so ur layers comes there and other alternative like if u don't use SSSM and use attention how much computation is gained how much accuracy is gained or lost etc. Layer wise is wrong. When we say layer wise it's not layer by layer but components by components."* | |
| 4. **On Table 2 (Layer Hyperparameter Deduction):** | |
| > *"Table 2- of ur proposed layer how u can deduce hyperparameters on this. I take only one example which u have used is SSSM blocks or the parameter for ssssm similarly u can have other parameters for other layers. If not atleast table 2."* | |
| 5. **On Table 3 (Loss Function Dynamics & Sensitivity):** | |
| > *"Then table 3 is loss function which u are using what weighted metrics are taken for granted etc."* | |
| > *"A simple example is when you say 'weighted loss for bio build' and it suggests accuracy. From a reviewer perspective, this doesn't make any sense. If you're using— you're saying PINN with bio and weighted, what is the weight used in PINN? What are the components that you tried removing and adding? Did you weight those as well? Does it have any impact? It did not have any impact? Whatever. So not all ablations have to be good. Some also showcase: 'Removing this component reduces accuracy by this much.' Or if we add weighted structure to it, it falls apart, for example from 98 to 92%."* | |
| --- | |
| ## 3. 📚 Repository Knowledge Base: Required Reading Roadmap | |
| You must inspect the following `.md` documentation files located in this repository: | |
| 1. **`deliverables/tathagat_sir_revision_report.md`:** | |
| * Full thesis-grade revision report for Tathagat Sir. Covers clinical problem formulation, mathematical formulation of PINN Bio-Prior loss, architecture design, and comprehensive review responses. | |
| 2. **`deliverables/remaining_ablations_plan.md`:** | |
| * The scientific rationale, mathematical definitions, and experimental design for the pending ablation runs. | |
| 3. **`10_fold_metrics_report.md`:** | |
| * Full empirical 10-fold cross-validation performance (Mean Acc: 99.37%, F1: 0.9957, AUC: 0.9929; Fold 2 peak: 99.81% Acc, 0.9987 F1). | |
| 4. **`ablation_study_report.md`:** | |
| * Existing 64-run empirical ablation study results (Dual vs Single CNN, Bio-Prior ON vs OFF, CE vs Weighted CE, SSSM depth $L=2, 3, 4$, state dimensions, learning rates). | |
| 5. **`test_set_evaluation_report.md`:** | |
| * Evaluation on the official 624 held-out test set comparing BioHCL-SSSM against ResNet-50 baseline and SOTA models. | |
| 6. **`README.md`:** | |
| * Master model card, dataset metadata, architecture overview, and directory structure. | |
| --- | |
| ## 4. 🎯 Primary Objective: Execute the 6 Remaining Empirical Runs | |
| To complete Tathagat Sir's 3 segregated tables with 100% empirical evidence, execute the following 6 runs on the RTX 3080 Ti: | |
| | Run ID | Target Table | Component / Variable Tested | Exact Configuration | Why Sir Specifically Asked For This | | |
| | :---: | :---: | :--- | :--- | :--- | | |
| | **Run 1** | **Table 3** | $\lambda_{bio} = 0.2$ (Light Bio-PINN weight) | Dual-chain, 3 SSSM blocks, $d=64$, $\lambda_{bio}=0.2$, $\lambda_{CE}=1.0$ | Maps the ascending curve from pure CE ($\lambda=0.0$) toward optimal prior regularization. | | |
| | **Run 2** | **Table 3** | $\lambda_{bio} = 0.5$ (Moderate Bio-PINN weight) | Dual-chain, 3 SSSM blocks, $d=64$, $\lambda_{bio}=0.5$, $\lambda_{CE}=1.0$ | Pinpoints the inflection zone leading to optimal performance. | | |
| | **Run 3** | **Table 3** | $\lambda_{bio} = 1.0$ (Heavy Bio-PINN weight) | Dual-chain, 3 SSSM blocks, $d=64$, $\lambda_{bio}=1.0$, $\lambda_{CE}=1.0$ | **Crucial for Sir:** Proves that over-weighting the prior over-constrains gradient updates and causes accuracy to degrade ("falls apart"). | | |
| | **Run 4** | **Table 1** | SSSM replaced with Multi-Head Attention (MHSA) | Dual-chain, 3 Transformer blocks (`nhead=8`, `dim=512`), Bio-Prior=True | **Direct Sir Quote:** *"if u don't use SSSM and use attention how much computation is gained how much accuracy is gained or lost"*. | | |
| | **Run 5** | **Table 2** | SSSM Depth $L = 1$ Block | Dual-chain, 1 SSSM block, $d=64$, Bio-Prior=True | Empirically confirms that shallow depth $L=1$ underfits compared to $L=2$ and $L=3$. | | |
| | **Run 6** | **Table 2** | SSSM without Residual Skip Connection | Dual-chain, 3 SSSM blocks without `x = x + sssm(x)` | Empirically proves whether continuous recurrent state transitions suffer gradient vanishing without skip connections. | | |
| --- | |
| ## 5. ⚡ Step-by-Step Execution Guide | |
| ### Step 1: Environment Verification | |
| Ensure PyTorch with CUDA 12.1 is available on the machine: | |
| ```bash | |
| python -c "import torch; print('CUDA available:', torch.cuda.is_available()); print('Device:', torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'CPU')" | |
| ``` | |
| If dependencies are missing, install them: | |
| ```bash | |
| pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121 | |
| pip install timm albumentations huggingface_hub scikit-learn pandas pillow kagglehub | |
| ``` | |
| ### Step 2: Run the Automated Ablation Suite | |
| Execute the pre-configured runner: | |
| ```bash | |
| python run_colab_remaining_ablations.py | |
| ``` | |
| * **Hardware Execution:** The script automatically binds to the NVIDIA RTX 3080 Ti GPU (16 GB VRAM). | |
| * **Runtime:** Takes ~8 to 10 minutes total across all 6 runs (5 epochs per run on the Guangzhou train/val split). | |
| * **Evaluation:** Automatically evaluates each run on the official held-out 624-image test set. | |
| * **Outputs Generated:** | |
| - Checkpoint `.pt` weights for each run (`Table3_Run1_lambda_0.2.pt`, etc.). | |
| - `remaining_ablations_results.csv` containing genuine TP, TN, FP, FN, Accuracy, Precision, Recall, Specificity, F1, AUC, Model Parameters (M), and Inference Latency (ms). | |
| - Automatically uploads the results CSV to Hugging Face. | |
| --- | |
| ## 6. 📝 Post-Execution Deliverable Updates | |
| Once `run_colab_remaining_ablations.py` completes: | |
| 1. **Update Table 1 (`deliverables/2_table1_component_ablation.csv` and `deliverables/v2/2_table1_component_ablation.csv`):** | |
| - Populate the Multi-Head Self-Attention (MHSA) row with the newly measured test accuracy, F1, parameters (M), and inference latency (ms). | |
| 2. **Update Table 2 (`deliverables/3_table2_layer_hyperparameter_deduction.csv` and `deliverables/v2/3_table2_layer_hyperparameter_deduction.csv`):** | |
| - Populate the $L=1$ block depth row and the No-Skip residual connection row with empirical metrics. | |
| 3. **Update Table 3 (`deliverables/4_table3_loss_function_weighting.csv` and `deliverables/v2/4_table3_loss_function_weighting.csv`):** | |
| - Populate the rows for $\lambda_{bio} = 0.2$, $\lambda_{bio} = 0.5$, and $\lambda_{bio} = 1.0$ from `remaining_ablations_results.csv`. | |
| 4. **Update the Final Revision Report (`deliverables/tathagat_sir_revision_report.md`):** | |
| - Populate Table 1, Table 2, and Table 3 with the exact empirical numbers. | |
| - Add a brief scientific commentary explaining the inflection point of $\lambda_{bio}$ (peak performance at optimal constraint, followed by over-regularization drop at $\lambda_{bio}=1.0$) and why SSSM linear-time recurrence outperforms quadratic MHSA attention on pediatric chest X-rays. | |
| 5. **Push Final Deliverables to Hugging Face:** | |
| - Commit all updated CSVs, updated Markdown reports, and the new `.pt` checkpoints back to `unknownBrain/BioHCL-SSSM-Complete-Workspace`. | |