unknownBrain commited on
Commit
09cc42e
·
verified ·
1 Parent(s): 9c629b8

Sync master_prompt.md with 6 complete empirical runs and Tathagat Sir quotes

Browse files
Files changed (1) hide show
  1. master_prompt.md +56 -40
master_prompt.md CHANGED
@@ -1,6 +1,6 @@
1
  # 🩺 MASTER PROMPT: BioHCL-SSSM Pediatric Pneumonia Research & Ablations
2
 
3
- > **To Antigravity (AGY):** You are acting as the Lead Medical Deep Learning Research Engineer for the **BioHCL-SSSM** project. Read this entire document and the referenced `.md` files in this repository before taking action.
4
 
5
  ---
6
 
@@ -8,51 +8,65 @@
8
  * **Project Name:** BioHCL-SSSM (Hierarchical Convolutional State-Space Hybrid Architecture for Pediatric Pneumonia Diagnosis).
9
  * **Internship Supervisor:** **Tathagat Sir**.
10
  * **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).
11
- * **Target Hardware:** Intel Core i9 (12th Gen) + NVIDIA GeForce RTX 3080 Ti Laptop GPU (16 GB VRAM) with CUDA acceleration.
12
  * **Hugging Face Repository:** `unknownBrain/BioHCL-SSSM-Complete-Workspace` (Public).
13
 
14
  ---
15
 
16
- ## 2. 🚨 The Golden Rule from Tathagat Sir (Zero Fabrication)
17
- 1. **ABSOLUTE BAN ON FABRICATION / BORROWING:**
18
- - Under **NO** circumstances should any metric, table value, standard deviation, or curve be fabricated, simulated, hallucinated, or borrowed from outside papers (e.g., brain tumor or chest CT papers).
19
- - 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.
20
- 2. **STATISTICAL REPORTING RIGOR:**
21
- - Every experiment must report exact empirical counts: True Positives (TP), True Negatives (TN), False Positives (FP), False Negatives (FN).
22
- - Derived metrics must include: Accuracy (%), Precision (%), Recall/Sensitivity (%), Specificity (%), F1-Score, and ROC-AUC (%).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  ---
25
 
26
  ## 3. 📚 Repository Knowledge Base: Required Reading Roadmap
27
  You must inspect the following `.md` documentation files located in this repository:
28
 
29
- 1. **`deliverables/tathagat_sir_revision_report.md` (or `tathagat_sir_revision_report.md`):**
30
- * *Contents:* Comprehensive thesis-grade revision report prepared for Tathagat Sir.
31
- * *Details:* Covers clinical problem formulation, biological motivation for the PINN Bio-Prior loss (lung field symmetry & opacity gradient penalties), architecture design, SOTA benchmark comparison against 15 architectures, and responses to previous supervisor review questions.
32
- 2. **`deliverables/remaining_ablations_plan.md` (or `remaining_ablations_plan.md`):**
33
- * *Contents:* The scientific rationale, mathematical definitions, and experimental design for the pending ablation runs.
34
- * *Details:* Details the loss sensitivity sweep for $\lambda_{bio} \in \{0.2, 0.5, 1.0\}$, and the sequence context engine replacement (SSSM vs Multi-Head Self-Attention).
35
  3. **`10_fold_metrics_report.md`:**
36
- * *Contents:* Full empirical 10-fold cross-validation performance.
37
- * *Details:* Mean Accuracy: **99.37% ± 0.33%**, Mean F1: **0.9957 ± 0.0022**, Mean AUC: **0.9929 ± 0.0039**. Peak Fold 2: **99.81% accuracy, 0.9987 F1** (Checkpoint: `medical imaging/best_student_cv.pt`).
38
  4. **`ablation_study_report.md`:**
39
- * *Contents:* Existing 64-run empirical ablation study results.
40
- * *Details:* Dual vs Single CNN stem, Bio-Prior ON vs OFF, Cross-Entropy vs Weighted CE, learning rates ($5\times 10^{-4}$ vs $1\times 10^{-3}$), state dimension ($d_{state} = 64$ vs $128$), and SSSM depth ($L=2, 3, 4$).
41
  5. **`test_set_evaluation_report.md`:**
42
- * *Contents:* Evaluation on the official 624 held-out test set comparing BioHCL-SSSM against ResNet-50 baseline and Transformer models.
43
  6. **`README.md`:**
44
- * *Contents:* Hugging Face model card, dataset metadata, architecture overview, and repository directory structure.
45
 
46
  ---
47
 
48
- ## 4. 🎯 Primary Objective: Execute the 4 Pending Core Ablations
49
- The preliminary deliverables have unfilled / pending slots for 4 specific empirical runs requested by Tathagat Sir. Run them locally using the RTX 3080 Ti GPU.
50
 
51
- ### The 4 Required Runs:
52
- 1. **Run 1: $\lambda_{bio} = 0.2$** (Light biological constraint sensitivity).
53
- 2. **Run 2: $\lambda_{bio} = 0.5$** (Moderate biological constraint sensitivity).
54
- 3. **Run 3: $\lambda_{bio} = 1.0$** (Heavy biological constraint / over-regularization penalty test).
55
- 4. **Run 4: Sequence Context Engine Ablation (MHSA)** — Replace the SSSM block with standard **Multi-Head Self-Attention (8 heads, 512 embedding dim)** to prove the selective state-space model's empirical superiority over quadratic attention in medical imaging.
 
 
 
56
 
57
  ---
58
 
@@ -69,17 +83,17 @@ pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
69
  pip install timm albumentations huggingface_hub scikit-learn pandas pillow kagglehub
70
  ```
71
 
72
- ### Step 2: Run the Automated Ablation Script
73
  Execute the pre-configured runner:
74
  ```bash
75
  python run_colab_remaining_ablations.py
76
  ```
77
- * **Hardware Execution:** The script automatically binds to the NVIDIA RTX 3080 Ti GPU.
78
- * **Runtime:** Takes ~6 to 8 minutes total across all 4 runs (5 epochs per run on the Guangzhou train/val split).
79
  * **Evaluation:** Automatically evaluates each run on the official held-out 624-image test set.
80
  * **Outputs Generated:**
81
- - `run_biopinn_lambda_0_2.pt`, `run_biopinn_lambda_0_5.pt`, `run_biopinn_lambda_1_0.pt`, `run_mhsa_attention.pt`
82
- - `remaining_ablations_results.csv` containing genuine TP, TN, FP, FN, Accuracy, Precision, Recall, Specificity, F1, and AUC.
83
  - Automatically uploads the results CSV to Hugging Face.
84
 
85
  ---
@@ -88,11 +102,13 @@ python run_colab_remaining_ablations.py
88
  Once `run_colab_remaining_ablations.py` completes:
89
 
90
  1. **Update Table 1 (`deliverables/2_table1_component_ablation.csv` and `deliverables/v2/2_table1_component_ablation.csv`):**
91
- - Fill in the genuine empirical test metrics for the Multi-Head Self-Attention (MHSA) row from `remaining_ablations_results.csv`.
92
- 2. **Update Table 3 (`deliverables/4_table3_loss_function_weighting.csv` and `deliverables/v2/4_table3_loss_function_weighting.csv`):**
93
- - Fill in the genuine empirical test metrics for $\lambda_{bio} = 0.2$, $\lambda_{bio} = 0.5$, and $\lambda_{bio} = 1.0$ from `remaining_ablations_results.csv`.
94
- 3. **Update the Final Revision Report (`deliverables/tathagat_sir_revision_report.md`):**
95
- - Populate Table 1 and Table 3 with the exact empirical numbers.
 
 
96
  - 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.
97
- 4. **Push Final Deliverables to Hugging Face:**
98
- - Commit all updated CSVs, updated Markdown reports, and the 4 new `.pt` checkpoints back to `unknownBrain/BioHCL-SSSM-Complete-Workspace`.
 
1
  # 🩺 MASTER PROMPT: BioHCL-SSSM Pediatric Pneumonia Research & Ablations
2
 
3
+ > **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.
4
 
5
  ---
6
 
 
8
  * **Project Name:** BioHCL-SSSM (Hierarchical Convolutional State-Space Hybrid Architecture for Pediatric Pneumonia Diagnosis).
9
  * **Internship Supervisor:** **Tathagat Sir**.
10
  * **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).
11
+ * **Local Hardware:** Intel Core i9 (12th Gen) + NVIDIA GeForce RTX 3080 Ti Laptop GPU (16 GB VRAM) with CUDA acceleration.
12
  * **Hugging Face Repository:** `unknownBrain/BioHCL-SSSM-Complete-Workspace` (Public).
13
 
14
  ---
15
 
16
+ ## 2. 🚨 Tathagat Sir's Exact Feedback & Directives
17
+ Internship supervisor Tathagat Sir provided detailed, unambiguous instructions on how the ablations, benchmarks, and deliverables must be structured.
18
+
19
+ ### A. The Golden Rule: Zero Fabrication / Zero Hallucination
20
+ * **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).**
21
+ * 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.
22
+ * 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.
23
+
24
+ ### B. Tathagat Sir's Literal Directives (Voice Notes & WhatsApp):
25
+ 1. **On Cross-Validation:**
26
+ > *"CV is correct."*
27
+ *(The 10-fold CV is 100% approved by Sir: 99.37% ± 0.33% mean accuracy, 0.9957 F1, with all 10 checkpoints verified).*
28
+ 2. **On SOTA Benchmarking:**
29
+ > *"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."*
30
+ *(Addressed: 15 models benchmarked in `1_sota_benchmarks_master.csv`).*
31
+ 3. **On Table 1 (Component-Wise Ablation):**
32
+ > *"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."*
33
+ 4. **On Table 2 (Layer Hyperparameter Deduction):**
34
+ > *"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."*
35
+ 5. **On Table 3 (Loss Function Dynamics & Sensitivity):**
36
+ > *"Then table 3 is loss function which u are using what weighted metrics are taken for granted etc."*
37
+ > *"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%."*
38
 
39
  ---
40
 
41
  ## 3. 📚 Repository Knowledge Base: Required Reading Roadmap
42
  You must inspect the following `.md` documentation files located in this repository:
43
 
44
+ 1. **`deliverables/tathagat_sir_revision_report.md`:**
45
+ * 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.
46
+ 2. **`deliverables/remaining_ablations_plan.md`:**
47
+ * The scientific rationale, mathematical definitions, and experimental design for the pending ablation runs.
 
 
48
  3. **`10_fold_metrics_report.md`:**
49
+ * 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).
 
50
  4. **`ablation_study_report.md`:**
51
+ * 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).
 
52
  5. **`test_set_evaluation_report.md`:**
53
+ * Evaluation on the official 624 held-out test set comparing BioHCL-SSSM against ResNet-50 baseline and SOTA models.
54
  6. **`README.md`:**
55
+ * Master model card, dataset metadata, architecture overview, and directory structure.
56
 
57
  ---
58
 
59
+ ## 4. 🎯 Primary Objective: Execute the 6 Remaining Empirical Runs
60
+ To complete Tathagat Sir's 3 segregated tables with 100% empirical evidence, execute the following 6 runs on the RTX 3080 Ti:
61
 
62
+ | Run ID | Target Table | Component / Variable Tested | Exact Configuration | Why Sir Specifically Asked For This |
63
+ | :---: | :---: | :--- | :--- | :--- |
64
+ | **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. |
65
+ | **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. |
66
+ | **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"). |
67
+ | **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"*. |
68
+ | **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$. |
69
+ | **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. |
70
 
71
  ---
72
 
 
83
  pip install timm albumentations huggingface_hub scikit-learn pandas pillow kagglehub
84
  ```
85
 
86
+ ### Step 2: Run the Automated Ablation Suite
87
  Execute the pre-configured runner:
88
  ```bash
89
  python run_colab_remaining_ablations.py
90
  ```
91
+ * **Hardware Execution:** The script automatically binds to the NVIDIA RTX 3080 Ti GPU (16 GB VRAM).
92
+ * **Runtime:** Takes ~8 to 10 minutes total across all 6 runs (5 epochs per run on the Guangzhou train/val split).
93
  * **Evaluation:** Automatically evaluates each run on the official held-out 624-image test set.
94
  * **Outputs Generated:**
95
+ - Checkpoint `.pt` weights for each run (`Table3_Run1_lambda_0.2.pt`, etc.).
96
+ - `remaining_ablations_results.csv` containing genuine TP, TN, FP, FN, Accuracy, Precision, Recall, Specificity, F1, AUC, Model Parameters (M), and Inference Latency (ms).
97
  - Automatically uploads the results CSV to Hugging Face.
98
 
99
  ---
 
102
  Once `run_colab_remaining_ablations.py` completes:
103
 
104
  1. **Update Table 1 (`deliverables/2_table1_component_ablation.csv` and `deliverables/v2/2_table1_component_ablation.csv`):**
105
+ - Populate the Multi-Head Self-Attention (MHSA) row with the newly measured test accuracy, F1, parameters (M), and inference latency (ms).
106
+ 2. **Update Table 2 (`deliverables/3_table2_layer_hyperparameter_deduction.csv` and `deliverables/v2/3_table2_layer_hyperparameter_deduction.csv`):**
107
+ - Populate the $L=1$ block depth row and the No-Skip residual connection row with empirical metrics.
108
+ 3. **Update Table 3 (`deliverables/4_table3_loss_function_weighting.csv` and `deliverables/v2/4_table3_loss_function_weighting.csv`):**
109
+ - Populate the rows for $\lambda_{bio} = 0.2$, $\lambda_{bio} = 0.5$, and $\lambda_{bio} = 1.0$ from `remaining_ablations_results.csv`.
110
+ 4. **Update the Final Revision Report (`deliverables/tathagat_sir_revision_report.md`):**
111
+ - Populate Table 1, Table 2, and Table 3 with the exact empirical numbers.
112
  - 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.
113
+ 5. **Push Final Deliverables to Hugging Face:**
114
+ - Commit all updated CSVs, updated Markdown reports, and the new `.pt` checkpoints back to `unknownBrain/BioHCL-SSSM-Complete-Workspace`.