换一台脉象仪,热力图还是同一张吗:SHAP 跨设备迁移的两个变化源与止损线

Written by

in

Language

Evidence level: B

「SHAP 热力图和经络理论吻合 Kappa 0.62」——这句话里藏着一个没写出来的前提:吻合是在某一台机器上算出来的。换一台同型号、同厂家的机器,那张热力图还长得一样吗?如果不一样,Kappa 0.62 到底测的是经络,还是测的是这台机器的滤波设置?

一、先说清一件事:热力图变的不止一个源

我们已经做过两步:先用随机森林把 32 维脉搏谐波特征(HRI)映射到证候,再用 Tree SHAP 拆出「哪个谐波分量在给哪个证候投票」,最后拿这张热力图去对经络理论的脏腑归属。这一步的结论是「中度吻合」,证据层级 B。

但整条链上有两个独立的、可以被换掉的东西:

  1. 测量端:换一台脉象仪。传感器的频响、加压档位的标定、采样率、抗混叠滤波的截止频率,任何一项不同,同一只手同一分钟采出来的波形就不是同一个波形。
  2. 模型端:换一批数据重训。随机森林本身有随机性(自助采样 + 特征子采样),更关键的是,一旦训练集换成了另一台设备的数据,树的切分点会整体挪动。

很多人做跨设备验证时,把这两件事一起做了——用 A 设备的数据训一个模型,用 B 设备的数据训另一个模型,然后比较两张热力图,发现不像,就说”跨设备不可迁移”。这个结论其实是关于「A 数据 vs B 数据」的,不是关于「A 机器 vs B 机器」的。

所以第一步不是比,是拆。

二、一个不用任何外部参数的基准线:随机抓阄能重叠几个

跨设备一致性最直觉的指标是「top-k 关键特征重叠几个」——两台设备各自排出的前 5 名重要特征,有几个是同一个。

问题是没有基准线的时候,”重叠 3 个”听起来不错,”重叠 4 个”听起来很好。但这两个数字到底多难得?

这里有一个可以手算的零参数基准:在 p 个特征里随机各抽 k 个,期望重叠个数 = k²/p。

我们的特征是 32 维(C1–C10 幅值比 ×2 压力档 + C1–C10 相位差 + 功率比 + THD)。取 k=5:

期望重叠 = 5 × 5 / 32 = 25/32 ≈ 0.78 个(重叠率 15.6%)

也说是说,两台毫无关系的设备,随便排个 top-5,平均也能对上 0.78 个。所以”重叠 1 个”没有任何信息量,”重叠 2 个”也只是略高于抓阄。真正有意义的门槛必须明显高于 0.78,而不是明显高于 0。

同理,贡献符号一致率的随机基线是 0.5(正负各半时)。热力图里”这个谐波分量对脾虚是加分还是减分”,如果两台设备的一致率是 0.55,那就是抓阄水平,不能叫”方向稳定”。

这两个基准值不依赖任何文献、任何参数、任何设备型号——它们只依赖特征维度。这就是零参数判据的用处:它能证伪,但不能证明。一致率高不等于热力图对,可能只是两台设备的偏差同向相消。

三、三条必须同时报的指标(少一条就会误判)

指标一:top-k 重叠(对随机基线 0.78/5 判)
回答”关键特征是不是同一批”。

指标二:SHAP 向量的符号一致率(对随机基线 0.5 判)
回答”方向是不是同一套”。重叠高但符号反了,是最危险的情形——同一个特征在两台机器上都是第一名,但一台说”这个高就偏虚”,另一台说”这个高就偏实”。这种情形在只报 top-k 的论文里完全看不出来。

指标三:基线值 φ₀ 的漂移占比
这是最容易被漏掉的一条。SHAP 的加性分解是:

f(x) = φ₀ + Σᵢ φᵢ

热力图画的通常只有 Σᵢ φᵢ 那一堆,φ₀(训练集上的期望输出)被丢掉了。而两台设备各自重训时,φ₀ = E[f(X)] 会因为训练集类别比例、特征分布整体平移而移动。

后果很具体:热力图看起来几乎一样,但绝对预测值整体偏了一档。 判”哪个证候”靠的是 argmax,argmax 不变;但判”虚到什么程度”靠的是绝对值,绝对值全错。所以只要报告里出现”证候严重度评分”这类连续量,φ₀ 就必须单独报,不能藏在热力图后面。

一个便于自检的比值:φ₀ 的跨设备差值 ÷ 同一设备上 Σ|φᵢ| 的中位数。这个比值超过约 0.5,意味着”基线漂移的量级已经和特征贡献本身同阶”,此时热力图再像也没意义。

四、分解设计:路径 I 与路径 II

把两个变化源分开,只需要跑两条路径:

路径 模型 输入数据 变了什么 对应问题
I 设备移植 同一个 M₀(用 A 设备数据训练,固定不动) A 数据 vs B 数据 只换输入 设备本身让 SHAP 变了多少
II 独立重训 M_A(A 数据训)、M_B(B 数据训) 各自的设备数据 换了输入 + 换了模型 实际部署时会遇到多少差异

路径 I 的一致性 = 设备噪声底。 这个数是这条研究线的”分辨率下限”。

路径 II 的一致性 < 路径 I 的那部分差额,才是”重训”这个动作的代价。

这个设计的价值在于:它把”跨设备不可迁移”从一个形容词变成了两个可以分别归因的数。如果是路径 I 就不一致,问题在传感器;如果只有路径 II 不一致,问题在模型对数据分布的敏感性——后者是可以靠固定预处理、共享标定、联合训练来缓解的。

五、止损线:它决定了 Kappa 0.6 这个门槛还算不算数

这是本文最该说清的一句:

如果设备噪声底本身就能让热力图与经络映射的 Kappa 摆动 0.3 以上,那么”Kappa ≥ 0.6 才算吻合”这条门槛就不可判。

因为 0.6 与 0.3 之间的差距,正好是噪声能吃掉的那一段。这时观察到 0.62,你没法说它是”吻合”,也没法说它是”不吻合”——它落在噪声带里。

所以止损线要写成前置条件,而不是事后解释:

  • S0(前置):路径 I 的 top-5 重叠 ≥ 4/5 且 符号一致率 ≥ 0.80。达不到,则任何”热力图 ↔ 经络映射”的吻合度结论都不得跨设备外推,只能限定在”该型号该标定条件下”。
  • S1(数值):φ₀ 漂移占比 > 0.5 → 禁止输出任何连续严重度评分,只允许输出 argmax 分类。
  • S2(判据):设备噪声底导致的 Kappa 摆动 > 0.2 → 把 #74 的 Kappa 门槛从 0.6 上调到「0.6 + 噪声带宽」,或直接改报”不可判”。

这三条都不是”更严格”,而是把本来就不该说的结论停下。

六、证据与局限

证据层级 B(间接证据链),理由如下:

  • 跨设备不一致这件事本身,在相邻领域有直接的实测证据:颈-股脉搏波速度(cfPWV)在 Vicorder 与 SphygmoCor 两台仪器上的对比显示,两机结果不可直接互换,需设备特异的参考值(PMID 20498619);在老年男性队列中两套设备的差异同样具有系统性(PMID 29344365);儿童队列中两种 PWV 设备对”是否异常”的判定并不一致(PMID 31482076)。这是”同一生理量、不同仪器、结论会变”的硬证据,但都不是脉象仪。
  • 可解释模型在生理信号上的可行性有直接支持:基于光电容积脉搏波的可解释机器学习模型已能给出可读的特征贡献(PMID 42305919);中医方向的机器学习应用有系统综述覆盖(PMID 34931589)。
  • 多设备测量的信度与设备间一致性,已有明确的方法学范式(多部位 HRV 测量的信度与设备间一致性研究,PMID 42859155),本设计沿用它的一致性统计框架,但样本量按多分类预测模型的最小样本量要求另算(PMID 36660777),外部验证部分按二分类扩展口径(PMID 34031906),报告规范遵循 TRIPOD+AI(PMID 38626949)。

必须写明的局限:

  1. 本文没有做任何实测。 所有门槛(4/5、0.80、0.5、0.2)都是设计参数,不是从数据里估出来的。真实噪声底可能远大于此,那说明止损线还要收紧,不是说明设计错了。
  2. “SHAP 稳定”不等于”机制正确”。 若两台设备用同一个错的特征定义(例如 C3/C1 比值的分子分母来自不同滤波段),热力图会漂亮地一致,而这个一致性毫无价值。这与我们此前在趋肤深度表上踩过的坑同型:表格自洽 ≠ 输入正确。
  3. 随机森林的随机性本身会贡献一部分路径 II 的差异,所以路径 II 必须固定随机种子并报告种子敏感性,否则会把”随机性”算成”设备效应”。
  4. 32 维特征是这套模型的选择,换特征集则 k²/p 基准随 p 变,不能跨研究直接比。
  5. 本文不主张任何脉象仪可以或不可以用于诊断;不主张经络理论已被证明或已被推翻。所有讨论限定在”同一套方法学在不同测量链上还能不能复现”。

七、下一步

按这个分解设计落一张独立实验卡(P3-EXP-059):三台同型号设备 + 一台异型号对照,120 人同日四测,路径 I / II 双轨。它不替代 #74 的盲法验证,是它的前置分辨率检查——先知道尺子换一台还准不准,再谈量出来的东西像不像经络。


免责声明:本文为方法学研究与实验设计讨论,不构成任何医疗建议、诊断意见或器械选型建议。文中所有门槛数值均为设计假设,未经实验验证。涉及脉诊与证候判断的内容仅供研究参考,任何健康问题请咨询执业医师。


免责说明:本文属传统知识与科学文献的整理、对照与研究设计讨论,仅供理解与参考,不构成医疗建议,不能替代专业诊断与治疗。文中涉及的效应量、频率区间与暴露结论多为研究报告层面的推断,个体情况差异很大;如有身体不适或健康疑虑,请就医并由专业医师判断。

Swapping a pulse diagnosis device, does the heatmap remain the same: Two sources of variation and stop-loss lines for SHAP cross-device transfer

Evidence level: B

“SHAP heatmaps align with meridian theory (Kappa 0.62)” — this statement hides an unstated premise: the alignment was calculated on one specific machine. If we switch to another device of the same model and manufacturer, does the heatmap look identical? If not, what exactly does Kappa 0.62 measure: the meridian system or the filtering settings of this particular machine?

I. Clarifying One Thing: The Heatmap Changes Due to More Than One Source

We have already completed two steps: first, using Random Forest to map 32-dimensional pulse harmonic features (HRI) to syndromes; second, using Tree SHAP to decompose “which harmonic component votes for which syndrome,” and finally comparing this heatmap against the organ attribution of meridian theory. The conclusion was “moderate alignment,” at evidence level B.

However, two independent elements along this chain can be replaced:

  1. Measurement End: Switching to a different pulse instrument. Differences in sensor frequency response, pressure range calibration, sampling rate, or anti-aliasing filter cutoff frequency mean that the waveform captured from the same hand within the same minute is not identical.
  2. Model End: Retraining with a new dataset. Random Forest itself introduces randomness (bootstrap sampling + feature subsampling). More critically, once the training set is replaced with data from another device, the tree split points shift globally.

When performing cross-device validation, many researchers do both simultaneously — train one model with Device A data and another with Device B data, then compare the heatmaps. Finding them dissimilar leads to the conclusion of “non-transferability.” However, this conclusion actually pertains to “Data A vs. Data B,” not “Machine A vs. Machine B.”

Therefore, the first step is not comparison, but decomposition.

II. A Zero-Parameter Baseline: How Many Overlaps Occur When Randomly Drawing Lots

The most intuitive indicator of cross-device consistency is “how many top-k key features overlap” — specifically, how many of the top 5 important features identified by each device are identical.

Without a baseline, “overlapping 3” sounds good, and “overlapping 4” sounds excellent. But how rare are these numbers?

Here is a manually calculable zero-parameter baseline: in p features, randomly drawing k from each, the expected overlap is k²/p.

Our features are 32-dimensional (C1–C10 amplitude ratios × 2 pressure ranges + C1–C10 phase differences + power ratio + THD). Taking k=5:

Expected overlap = 5 × 5 / 32 = 25/32 ≈ 0.78 features (overlap rate 15.6%)

In other words, two completely unrelated devices, randomly ranking their top-5, will on average match 0.78 features. Thus, “overlapping 1” carries no information, and “overlapping 2” is only slightly above random chance. A meaningful threshold must be significantly higher than 0.78, not just higher than 0.

Similarly, the random baseline for sign consistency is 0.5 (half positive, half negative). If the heatmap states “this harmonic component adds or subtracts from spleen deficiency,” and the consistency rate between two devices is 0.55, it is merely random chance, not “stable direction.”

These baseline values do not depend on any literature, parameters, or device models — they rely solely on feature dimensionality. This is the utility of zero-parameter criteria: they can falsify, but not prove. High consistency does not mean the heatmap is correct; it may simply be that biases from both devices cancel each other out.

III. Three Metrics That Must Be Reported Together (Missing One Leads to Misjudgment)

Metric 1: Top-k Overlap (vs. random baseline 0.78/5)
Answers “Are the key features the same set?”

Metric 2: SHAP Vector Sign Consistency (vs. random baseline 0.5)
Answers “Is the direction the same?” High overlap with reversed signs is the most dangerous scenario — the same feature ranks first on both machines, but one says “high means deficient” while the other says “high means excess.” This cannot be detected in papers reporting only top-k.

Metric 3: Drift Ratio of Baseline Value φ₀
This is the most easily overlooked metric. SHAP’s additive decomposition is:

f(x) = φ₀ + Σᵢ φᵢ

Heatmaps typically display only the Σᵢ φᵢ components, omitting φ₀ (the expected output on the training set). When each device retrains independently, φ₀ = E[f(X)] shifts due to changes in training set class proportions and overall feature distribution translation.

The consequence is concrete: the heatmap appears nearly identical, but absolute predictions shift by one order of magnitude. Determining “which syndrome” relies on argmax, which remains unchanged; but determining “how severe the deficiency is” relies on absolute values, which are entirely wrong. Therefore, if any report includes “syndrome severity scores” (continuous variables), φ₀ must be reported separately, not hidden behind the heatmap.

A convenient self-check ratio: φ₀ cross-device difference ÷ median of Σ|φᵢ| on the same device. If this ratio exceeds 0.5, it means “the magnitude of baseline drift is comparable to feature contribution itself,” rendering the heatmap meaningless regardless of how similar it looks.

IV. Decomposition Design: Path I and Path II

Separating the two change sources requires running two paths:

Path Model Input Data What Changed Corresponding Question
I Device Transfer Same M₀ (trained on A data, fixed) A data vs. B data Only input changed How much does the device itself alter SHAP?
II Independent Retrain M_A (trained on A), M_B (trained on B) 各自的设备数据 Both input and model changed How much difference occurs in actual deployment?

Consistency of Path I = device noise floor. This number represents the “resolution limit” of this research line.

Consistency of Path II < Path I — the difference represents the cost of “retraining.”

The value of this design lies in transforming “cross-device non-transferability” from an adjective into two numbers that can be attributed separately. If Path I shows inconsistency, the problem lies with the sensor; if only Path II shows inconsistency, the problem lies with the model’s sensitivity to data distribution — the latter can be mitigated via fixed preprocessing, shared calibration, or joint training.

V. Stop-Loss Lines: They Determine Whether Kappa 0.6 Threshold Remains Valid

This is the most crucial statement in this paper:

If the device noise floor itself causes the heatmap-to-meridian mapping Kappa to swing by more than 0.3, then “Kappa ≥ 0.6 counts as alignment” is unverifiable.

Because the gap between 0.6 and 0.3 is exactly what noise can consume. Observing 0.62 in such a scenario means we cannot determine whether it represents “alignment” or “misalignment” — it falls within the noise band.

Therefore, stop-loss lines must be stated as prerequisites, not post-hoc explanations:

  • S0 (Prerequisite): Path I top-5 overlap ≥ 4/5 and sign consistency ≥ 0.80. If not met, any conclusion about “heatmap ↔ meridian mapping alignment” cannot be extrapolated across devices, limited only to “this model, this calibration condition.”
  • S1 (Numerical): φ₀ drift ratio > 0.5 → prohibit any continuous severity scoring, allow only argmax classification.
  • S2 (Criterion): Device noise floor causing Kappa swing > 0.2 → raise the #74 Kappa threshold from 0.6 to “0.6 + noise bandwidth,” or directly report “unverifiable.”

These three are not “stricter” — they stop conclusions that should never have been drawn.

VI. Evidence and Limitations

Evidence Level B (indirect evidence chain), for the following reasons:

  • The fact of cross-device inconsistency itself has direct empirical evidence in adjacent fields: carotid-femoral pulse wave velocity (cfPWV) comparison between Vicorder and SphygmoCor devices shows results cannot be directly interchanged, requiring device-specific reference values (PMID 20498619); in elderly male cohorts, differences between the two devices are systematic (PMID 29344365); in pediatric cohorts, two PWV devices disagree on “abnormality” determination (PMID 31482076). This is hard evidence that “same physiological quantity, different instruments, different conclusions,” though none involve pulse instruments.
  • Feasibility of interpretable models on physiological signals has direct support: interpretable machine learning models based on photoplethysmography can provide readable feature contributions (PMID 42305919); systematic reviews cover TCM-oriented machine learning applications (PMID 34931589).
  • Reliability and inter-device consistency of multi-device measurement have established methodological paradigms (multi-site HRV measurement reliability and inter-device consistency study, PMID 42859155). This design adopts their consistency statistical framework, but sample size is calculated separately according to minimum requirements for multi-class prediction models (PMID 36660777); external validation expands to binary classification scope (PMID 34031906); reporting standards follow TRIPOD+AI (PMID 38626949).

Limitations that must be stated:

  1. This paper contains no empirical testing. All thresholds (4/5, 0.80, 0.5, 0.2) are design parameters, not estimated from data. True noise floors may be far larger, meaning stop-loss lines must be tightened — not that the design is wrong.
  2. “SHAP stability” does not equal “mechanism correctness.” If both devices use the same incorrect feature definition (e.g., numerator/denominator of C3/C1 ratio come from different filter bands), the heatmap will beautifully align, yet this consistency is worthless. This mirrors pitfalls encountered earlier on skin depth tables: table self-consistency ≠ input correctness.
  3. Randomness of Random Forest itself contributes part of Path II difference, so Path II must fix random seeds and report seed sensitivity, otherwise “randomness” will be counted as “device effect.”
  4. 32-dimensional features are this model’s choice; changing the feature set alters k²/p baseline, preventing direct cross-study comparison.
  5. This paper does not advocate any pulse instrument being suitable or unsuitable for diagnosis; nor does it claim meridian theory has been proven or disproven. All discussion is limited to “whether the same methodology can be reproduced across different measurement chains.”

VII. Next Steps

Implementing this decomposition design requires an independent experimental card (P3-EXP-059): three same-model devices plus one different-model control, 120 subjects tested four times on the same day, Path I/II dual-track. This does not replace #74’s blind validation — it serves as its prerequisite resolution check — first knowing whether changing the ruler still yields accurate measurements, then discussing whether measured results resemble meridian patterns.


Disclaimer: This paper is a methodological study and experimental design discussion, constituting no medical advice, diagnostic opinion, or instrument selection recommendation. All threshold values in this text are design assumptions, unverified by experiment. Content related to pulse diagnosis and syndrome judgment is for research reference only; any health concerns should be consulted with licensed physicians.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *