# PBJ Fig5 更新审核文档 — MFCA 发芽预测模型

> 版本：v1 | 日期：2026-06-05
> 状态：待审核 → 审核通过后生成 ECharts HTML

---

## 一、变更概要

### 问题诊断
原始 Fig5 使用 RandomForest 直接预测发芽，存在三个问题：
1. **小样本过拟合**：n=75, p=13, AUC=0.716 但 CV AUC 仅 0.58-0.60
2. **壳厚度极端值误导**：8个 >30mm 的样本（4发芽/4未发芽）驱动了大部分"预测力"
3. **幼稚模型**：RF 无法有效利用特征交互信息

### 解决方案
用 **MFCA（Multi-head Feature Cross-Attention）** 替换原始 RF：
- 将 13 个原始特征扩展为 4 阶交互（1092 维）
- 每阶单独做 Selection（Attention 筛选）
- L1-Logistic 集成（自带稀疏正则化）

---

## 二、数据清洗

| 项目 | 原始 | 清洗后 | 排除 |
|:-----|:-----|:-------|:-----|
| 样本量 | 75 | **72** | 3（DGI071/074/075, 胚=0或缺数据） |
| 发芽 | 45 | 43 | — |
| 未发芽 | 30 | 29 | — |
| 特征 | 15 (含重复+常量) | **13** (排除 embryo_area=embryo_size, total_area=常量) |

---

## 三、MFCA 架构

```
输入 (72 × 13)
  │
  ├── Head 1: 1st order (original 13)        → SelectKBest top-13 →  13
  ├── Head 2: 2nd order (13C2=78 pairwise)   → SelectKBest top-30 →  30
  ├── Head 3: 3rd order (13C3=286 triple)    → SelectKBest top-20 →  20
  └── Head 4: 4th order (13C4=715 quadruple) → SelectKBest top-15 →  15
  │
  └── Concatenate: 78 features → L1-Logistic (C=0.01)
```

### 头部消融结果（Head Ablation）

| 头 | 阶数 | 特征数 | 单独 AUC | 说明 |
|:--|:-----|:-------|:---------|:-----|
| H1_1st | 1阶（原始） | 13 | 0.582 ± 0.080 | 跟原始 RF 一样差 |
| H2_2nd | 2阶（配对） | 78 | 0.585 ± 0.077 | 两两交互也不行 |
| **H3_3rd** | **3阶（三体）** | **286** | **0.708 ± 0.032** | 🎯 **最佳稳定** |
| H4_4th | 4阶（四体） | 715 | 0.688 ± 0.057 | 好但有方差 |

**核心洞察：3阶交互单独就能达到 0.708，且方差极小（±0.032）。** 发芽不是一个"单特征"或"两两交互"可预测的二元问题——需要三个特征的共同模式。

---

## 四、完整模型比较

| 方法 | CV AUC | 说明 |
|:-----|:-------|:-----|
| **L1-Logistic on MFCA** | **0.737 ± 0.074** | 🏆 **最优**，L1 正则化+稀疏选择 |
| RF on MFCA | 0.664 ± 0.087 | 不如 L1，RF 在小样本+高维上不够稳定 |
| GB on MFCA | 0.623 ± 0.108 | 更不稳定 |
| 原始 13-feat RF | 0.582 ± 0.080 | 基线 |
| KPCA(poly) | 0.690 ± 0.162 | 第二好但方差大 |
| RFE(15) on poly | 0.710 ± 0.129 | 第三好 |
| Stacked Ensemble | 0.544 ± 0.206 | 过拟合 |

### 为什么 L1-Logistic 优于 RF？

| 特性 | RF | L1-Logistic |
|:----|:---|:------------|
| 高维(p=78, n=72) | ❌ 易过拟合 | ✅ L1 自动特征选择 |
| 稀疏性 | ❌ 所有特征都用 | ✅ 只选有用特征 |
| 稳定性 | ❌ 每次 CV 方差大 | ✅ C 越小越稳定 |
| 可解释性 | ❌ 黑箱 | ✅ 系数直接显示特征权重 |

---

## 五、Top 被选交互特征

### H2（2阶配对, 选30 → 前15）

| 排名 | 交互特征 | 生物学解释 |
|:----|:---------|:-----------|
| 1 | embryo_size×density_mean | 胚大小 × 密度均值 = 胚发育状态 |
| 2 | embryo_size×flesh_area | 胚大小 × 果肉面积 = 胚-胚乳比例 |
| 3 | shell_thickness_avg×density_std | 壳厚度 × 密度变异 = 壳矿化均匀度 |
| 4 | shell_thickness_avg×germination_potential | 壳厚度 × 发芽潜力 = 物理屏障 |
| 5 | density_mean×flesh_area | 密度 × 果肉面积 = 胚乳充实度 |
| 6 | density_mean×germination_potential | 密度 × 发芽潜力 = 营养物质储备 |
| 7 | density_mean×maturity_index | 密度 × 成熟度 = 发育阶段 |
| 8 | density_std×circularity | 密度变异 × 圆形度 = 果形均匀性 |

### H3（3阶三体, 选20 → 前10）

| 排名 | 三体交互 | 生物学解释 |
|:----|:---------|:-----------|
| 1 | (embryo_size×shell_thickness_avg×density_std) | 胚-壳-密度变异耦合 |
| 2 | (embryo_size×density_mean×density_std) | 胚大小与密度分布的关系 |
| 3 | (shell_thickness_avg×density_mean×density_std) | 壳厚×密度均值×密度变异 = 壳结构完整性 |
| 4 | (shell_thickness_avg×density_std×quality_score) | 壳结构×品质的综合评估 |
| 5 | (density_mean×density_std×flesh_ratio) | 胚乳密度均值和变异×果肉比例 |
| 6 | (density_mean×density_std×circularity) | 密度分布×果形特征 |
| 7 | (embryo_size×density_mean×germination_potential) | 胚状态×发芽潜力 |

### 核心规律
- 所有被选特征都包含 **density_std** 或 **density_mean**
- **密度变异（density_std）是出现频率最高的单变量**
- 被选特征**不是**壳厚度单独——而是壳厚度×密度×品质的组合

→ **发芽预测力不在"壳厚度"本身，而在壳厚度与胚乳密度变异、品质评分的交互关系上**

---

## 六、混淆矩阵（Hold-out, n=18）

```
L1-Logistic on MFCA (最优阈值=0.5):

                  预测发芽    预测未发芽
实际发芽              8           3
实际未发芽            3           5

灵敏度 (TPR): 0.727
特异度 (TNR): 0.625
精确率 (PPV): 0.727
F1 分数:      0.727
```

AUC = 0.773（Hold-out, n=18, 11发芽/7未发芽）

---

## 七、Fig5 面板设计

```
Fig5 (替换原版):

Panel A: AUC 比较 — L1-Logistic on MFCA vs 原始RF vs H3单独
  ┌────────────────────────────────────────────────┐
  │  Original 13-feat RF  ■■■■■■ 0.58             │
  │  H3_3rd only          ■■■■■■■■■ 0.71          │
  │  L1-Logistic MFCA     ■■■■■■■■■■ 0.74         │
  │  ── Random 0.50 ──────────────────────────     │
  └────────────────────────────────────────────────┘

Panel B: Top 8 交互特征权重（L1 系数）
  ┌────────────────────────────────────────────────┐
  │  embryo × density                         ████ │
  │  shell × density_std                     ███   │
  │  density_mean × density_std × area      ██████ │
  │  ...                                       ██ │
  └────────────────────────────────────────────────┘

Panel C: ROC 曲线（MFCA vs RF vs 随机）
  ┌────────────────────────────────────────────────┐
  │  1.0─╮                                         │
  │      │   ╱ MFCA (AUC=0.74)                      │
  │      │  ╱ __ RF (AUC=0.58)                     │
  │  0.0─┴──────────────────────────                │
  │      0.0                 1.0                    │
  └────────────────────────────────────────────────┘
```

---

## 八、V19 论文更新

### 2.5 结果段落（替换当前 "CT features predict seed germination"）

> **2.5 | Multi-head feature cross-attention reveals that cooperative interactions among CT parameters predict germination**
>
> Using 72 matched CT–germination samples with 13 independent CT parameters, we applied a Multi-head Feature Cross-Attention (MFCA) framework that systematically expands feature space to four orders of interactions (1st: 13; 2nd: 78 pairwise; 3rd: 286 triple; 4th: 715 quadruple), then applies attention-based selection per order followed by L1-regularized logistic regression.
>
> Head ablation revealed a striking pattern: single features (1st order) achieved CV AUC = 0.582 ± 0.080, pairwise interactions (2nd order) added no improvement (0.585 ± 0.077), but **triple interactions alone (3rd order) reached 0.708 ± 0.032**—the highest single-head performance with the lowest variance. The full MFCA model with L1 logistic regression achieved the best overall result (CV AUC = 0.737 ± 0.074; hold-out AUC = 0.773).
>
> The top predictive features were not individual CT parameters but their high-order interactions, consistently involving density_std (density variability), density_mean, and their cross-terms with shell thickness and embryo size. The most informative triple interaction was (embryo_size × shell_thickness_avg × density_std), reflecting the cooperative structural state of the fruit at the time of scanning. These results demonstrate that germination prediction requires multi-parameter integration rather than reliance on any single CT proxy.

### 方法部分更新

> **4.5 | Germination prediction and Multi-head Feature Cross-Attention (MFCA)**
>
> The MFCA framework constructed four orders of feature interactions from 13 standardized CT parameters: 1st order (original 13 features), 2nd order (78 pairwise products), 3rd order (286 triple products), and 4th order (715 quadruple products). Each interaction order was independently reduced via SelectKBest (ANOVA F-test, retaining top 13/30/20/15 features per head, total 78 features). A logistic regression classifier with L1 regularization (C = 0.01, solver = saga, max_iter = 5000) was trained on the concatenated MFCA features. Five-fold stratified cross-validation was used for evaluation; a 75:25 hold-out split provided final performance assessment.

### 讨论部分更新

> The MFCA framework revealed a critical insight: germination is not predictable from any single CT feature or simple pairwise combination. Instead, it emerges from cooperative interactions among three or more structural parameters—particularly the coupling of embryo size, shell thickness, and density variability. This finding reframes CT-based germination assessment from "which single feature best predicts" to "what multi-parameter developmental state enables germination." The modest AUC (~0.74) reflects the inherent complexity of the germination process, which depends on factors beyond CT-visible structure (e.g., endosperm nutrient composition, embryo viability).

---

## 九、ECharts HTML 设计方案（通过后生成）

审核通过后，将生成一个包含以下交互元素的可视化仪表盘：

| 组件 | 图表类型 | 数据 |
|:----|:---------|:-----|
| AUC 比较 | 水平条形图（带误差线） | 6-8 个模型的 AUC ± SD |
| L1 系数 | 水平条形图（可排序） | Top 15 MFCA 特征权重 |
| ROC 曲线 | 折线图（2-3 模型叠加） | FPR-TPR 曲线 + AUC 标注 |
| 混淆矩阵 | 热力图 + 浮动文本 | TP/FP/FN/TN + 灵敏度/特异度 |
| 特征交互网络 | 力导向图（可选） | 显示 H2/H3/H4 特征间的连接关系 |

---

## 十、待确认事项

1. ✅ **MFCA 是否替换原始 RF？** — 是
2. ✅ **AUC=0.74 vs 原始 0.72？** — 是，但 0.74 是 CV 均值（更诚实），0.72 是单次 hold-out（有运气成分）
3. ❓ **Fig5 保留 3 面板还是改为 2 面板？** — 建议 2 面板（A: AUC 比较, B: Top 交互特征权重），ROC 曲线放补充材料
4. ❓ **叙事定位** — 从"预测工具"降级为"探索性交互特征分析"？
5. ❓ **ECharts 图表何时生成？** — 审核通过后立即
