基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/hiyenwong/ai_collection --skill the-identity-trap-in-eeg-foundation-models命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Graph-native Python reimplementation of the Information Dynamics of Music (IDyOM) model that represents predictive memories as explicit graph objects for musical expectation modeling and network analysis.
Physics-aware end-to-end deep reinforcement learning methodology for quadcopter control with actuator dynamics modeling.
Reinforced Dreamer methodology for asymmetric reinforcement learning using latent guidance to improve world model representations and behaviors in model-based RL.
| skill_id | identity-trap-eeg-foundation-models |
| name | The Identity Trap in EEG Foundation Models |
| description | EEG基础模型的诊断审计方法论 - 揭示EEG基础模型在高准确率背后可能隐藏的主体身份特征陷阱,提出系统性评估框架区分真实临床生物标志物与主体识别特征。 |
| version | 1.0.0 |
| author | Jun-You Lin, Ying Choon Wu, Tzyy-Ping Jung |
| arxiv_id | 2606.06647v1 |
| categories | ["neuroscience","EEG","foundation models","machine learning","clinical neuroscience"] |
| tags | ["EEG foundation models","identity trap","subject identity","clinical biomarker","cross-validation","diagnostic audit","EEG基础模型","主体识别","生物标志物"] |
| activation_keywords | ["identity trap","identity trap","EEG foundation model","EEG FM","subject identity","主体身份","clinical biomarker","临床生物标志物","diagnostic audit","诊断审计","cross-validation","cross-validation"] |
| created_date | 2026-06-08T00:00:00.000Z |
| last_updated | 2026-06-08T00:00:00.000Z |
身份陷阱(Identity Trap):EEG基础模型在临床静息态EEG上报告的高准确率可能具有误导性——高准确率可能反映:
这种歧义导致模型评估的可靠性问题。
现状:
隐患:
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import cross_val_score
class IdentityTrapAudit:
"""
EEG基础模型身份陷阱诊断审计工具
"""
def __init__(self, model, eeg_data, labels, subject_ids):
self.model = model
self.eeg_data = eeg_data
self.labels = labels
self.subject_ids = subject_ids
def extract_features(self):
"""提取模型特征"""
features = self.model.encode(self.eeg_data)
return features
def test_identity_prediction(self, features):
"""
测试特征是否能预测主体身份
如果能预测,说明包含主体身份信息
"""
# 使用简单分类器测试身份预测
clf = LogisticRegression(max_iter=1000)
# 主体不相交交叉验证
unique_subjects = np.unique(self.subject_ids)
scores = []
for test_subject in unique_subjects:
train_mask = self.subject_ids != test_subject
test_mask = self.subject_ids == test_subject
clf.fit(features[train_mask], self.subject_ids[train_mask])
score = clf.score(features[test_mask], self.subject_ids[test_mask])
scores.append(score)
identity_accuracy = np.mean(scores)
print(f"Identity Prediction Accuracy: {identity_accuracy:.3f}")
print(f"Warning: If > 0.7, features contain strong identity signals")
return identity_accuracy
def test_label_correlation_with_identity(self):
"""
测试标签与主体身份的关联强度
如果强关联,身份陷阱风险高
"""
# 计算每个主体的标签分布
subject_label_counts = {}
for sid, label in zip(self.subject_ids, self.labels):
if sid not in subject_label_counts:
subject_label_counts[sid] = []
subject_label_counts[sid].append(label)
# 计算标签一致性(如果主体内标签高度一致,风险高)
label_consistency_scores = []
for sid, labels in subject_label_counts.items():
consistency = len(set(labels)) == 1 # 主体内标签是否单一
label_consistency_scores.append(consistency)
consistency_rate = np.mean(label_consistency_scores)
print(f"Subject-Label Consistency Rate: {consistency_rate:.3f}")
print(f"Warning: If > 0.8, high identity trap risk")
return consistency_rate
def compute_identity_trap_score(self):
"""
计算身份陷阱风险评分
"""
features = self.extract_features()
# 1. 主体身份预测能力
identity_acc = self.test_identity_prediction(features)
# 2. 标签-主体关联强度
consistency = self.test_label_correlation_with_identity()
# 综合风险评分
trap_score = (identity_acc * 0.6 + consistency * 0.4)
print(f"\n{'='*60}")
print(f"Identity Trap Score: {trap_score:.3f}")
print(f"Interpretation:")
if trap_score > 0.8:
print(" [HIGH RISK] Features likely encode subject identity")
elif trap_score > 0.6:
print(" [MODERATE RISK] Mixed identity and clinical signals")
else:
print(" [LOW RISK] Features likely encode clinical biomarkers")
print(f"{'='*60}\n")
return trap_score
def control_experiment_design():
"""
对照实验设计框架
"""
strategies = {
'label_balanced_within_subject': {
'description': '确保每个主体内部标签平衡',
'implementation': '每个主体包含多个标签类别'
},
'temporal_split': {
'description': '时间分割而非主体分割',
'implementation': '同一主体的不同时段作为训练/测试'
},
'shuffle_identity': {
'description': '打乱主体标签关联',
'implementation': '随机分配标签到主体'
},
'synthetic_baseline': {
'description': '合成数据基线测试',
'implementation': '测试模型在纯身份特征数据上的表现'
}
}
return strategies
def run_control_experiment(model, data, experiment_type):
"""
执行对照实验
"""
if experiment_type == 'shuffle_identity':
# 打乱主体-标签关联
shuffled_labels = shuffle_labels_across_subjects(data)
original_acc = model.evaluate(data, data.labels)
shuffled_acc = model.evaluate(data, shuffled_labels)
print(f"Original Accuracy: {original_acc:.3f}")
print(f"Shuffled Accuracy: {shuffled_acc:.3f}")
print(f"Drop: {original_acc - shuffled_acc:.3f}")
# 如果准确率大幅下降,说明依赖主体身份
if original_acc - shuffled_acc > 0.2:
print("[WARNING] High dependency on identity-label correlation")
return original_acc, shuffled_acc
# 示例:ADHD vs 正常对照组分类
audit = IdentityTrapAudit(
model=eeg_foundation_model,
eeg_data=eeg_signals,
labels=diagnosis_labels, # ADHD=1, Control=0
subject_ids=patient_ids
)
trap_score = audit.compute_identity_trap_score()
# 推荐后续步骤
if trap_score > 0.7:
print("\nRecommendation:")
print("1. Collect multi-session data per subject")
print("2. Use temporal cross-validation")
print("3. Test on independent hospital cohort")
print("4. Analyze feature attribution for clinical relevance")
已知发现:
陷阱机制:
data_collection_guidelines = {
'multi_session': {
'goal': '每个主体多次记录',
'benefit': '允许时间分割验证',
'sessions': '至少 2-3 次独立采集'
},
'diverse_population': {
'goal': '多样化群体',
'benefit': '减少身份-标签关联',
'implementation': '多个医院/地区合作'
},
'within_subject_label_variation': {
'goal': '主体内标签变化',
'benefit': '直接测试临床特征',
'example': '治疗前后、疾病进展阶段'
}
}
evaluation_protocol = [
{
'step': 1,
'test': 'Identity Trap Audit',
'criterion': 'Trap score < 0.6'
},
{
'step': 2,
'test': 'Temporal Cross-Validation',
'criterion': 'Stable accuracy across sessions'
},
{
'step': 3,
'test': 'Independent Cohort Validation',
'criterion': 'Performance on unseen hospital data'
},
{
'step': 4,
'test': 'Feature Attribution Analysis',
'criterion': 'Attributed features match known biomarkers'
}
]
def run_full_audit(model, data):
"""
执行完整审计流程
"""
results = {}
for step in evaluation_protocol:
print(f"\nStep {step['step']}: {step['test']}")
# 执行相应测试
result = execute_test(model, data, step['test'])
results[step['test']] = result
if result['pass']:
print(f" ✓ PASSED: {step['criterion']}")
else:
print(f" ✗ FAILED: {step['criterion']}")
print(f" Recommendation: {result['recommendation']}")
return results
身份陷阱是EEG基础模型评估中的隐蔽风险,可能导致:
通过系统诊断审计可以识别和防范这一陷阱,确保EEG基础模型的临床可靠性。