P81 · 固定裁图分类与拒识 · 实验记录与相关篇目
输入是图标裁图,输出身份及有效性。保留 9 月 7 日的冻结结果;9 月 8 日仅更新实验编号和运行入口,没有重新训练。
本次重跑:2026 年 9 月 7 日。
阅读版本:production-costs-20260907。本文保留原实验的解释与案例,并用最新快照重新展开结果;历史实验单独注明数据和日期。
在《英雄无敌:上古纪元》的竞技场里,玩家依次选择英雄、技能、宝物和生物。我们希望程序能读出这些选择,但图标不仅会改变背景和大小,还会淡入、被提示框遮住,甚至在翻页时暂时消失。
本实验先假设图标槽位的位置已经知道:程序从槽位裁出小图,再回答“这是什么”和“现在能不能用”。本次增加了审核数据并修正了宝物裁图位置,重新训练原有三阶段模型。
在同一批 1,287 张有效的冻结开发测试裁图上,9 月 3 日保留的分类器正确 1,023 张(79.49%),本次分类器正确 1,277 张(99.22%),均相对于冻结标签计分。这是新旧完整训练流程的共同考题比较;训练数据、验证数据和选中的轮次均有变化,不能把全部提升解释成单纯增加图片的收益。生物识别改善最明显,有效性判断则仍存在“少误拒好图、多放过坏图”的取舍。
生产目标是少放过坏图,而不是尽量接受每张图。 好图被暂缓通常可等后续帧;坏图携带错误身份进入状态的代价更大。第 8 节据此加入双门槛复算,同时明确尚未验证的时序延迟。
图 1。两项比较:增加游戏裁图是否改善身份识别;单独学习有效性是否比分类置信度更会拒绝坏输入。图中有效与负样本数量包含训练、验证、测试三个分区。
1. 模型看的是裁图,不是完整截图
下图中的黄色框来自固定布局规则。框内像素才是本实验的输入;模型不负责在完整截图里寻找目标。
![]()
图 2a。上游必须先选对场景和布局。槽位裁错后,即使分类器输出了一个看起来合理的名字,也不代表检测成功。
模型覆盖四种图标:英雄头像、主技能图标、宝物图标和生物选择卡中的生物。子技能页中的主技能图标也在范围内,但不是把每个子技能都作为新身份类别。法术、属性数值和战场单位检测不属于这个实验。
这与在整屏中搜索图标的实验解决的是不同问题:搜索算法必须先找到框,本文直接拿到固定槽位的框。这样可以单独研究“框内像素能否被认对”,不会把定位失败混进身份准确率。
为什么有图鉴,还需要真实游戏图
同一个英雄,在图鉴里是干净美术图,在游戏里则带有边框、背景和光照。这种输入外观的变化称为域差异。我们能增加一些颜色和尺度扰动,但不能假定随机背景已经模拟了真实界面。
| 真实游戏裁图 | 同一英雄的图鉴 |
|---|---|
图 2b。同一身份,像素分布不同。这里比较的是监督分类:图鉴给出训练图和标签,推理时不会把输入逐一与 390 张参考图做相似度检索。
| 英雄 | 主技能 | 生物 | 修正后的宝物裁图 |
|---|---|---|---|
每张输入最终都会按比例整理到 224×224 RGB 画布,并按 ImageNet 均值与标准差归一化;训练时不同来源使用各自的增强,推理时不做随机增强。模型输出有效性、图标类型和该类型中的身份。它没有收到槽位编号、视频日期、场景标签或 OCR 文字;这些信息只用于上游裁图和数据管理。
这里的“有效”是任务定义:这张输入是否适合现在交给后续算法使用。一个仍能认出身份、但正在淡出的图标,也可以被标为无效,等下一帧再识别。
2. 新数据从哪里来,怎样避免相邻帧泄漏
数据积累采用反复审核的方式:先标注一部分,用训练后的分类器提出更多身份建议,再用 OCR 和原图交叉检查,修正错误并确认。模型建议本身不算真值;本次只导出已确认的身份或已确认的负样本。
其中 628 帧曾由助手审核,本次得到所有者明确的批量认可,数据库统一转为“人工确认”状态,表示所有者接受这些结果。审核历史仍保留“助手初审、所有者批量认可”的来源,不把它们描述为又逐帧进行了一次独立人工盲审。
| 数据量 | 9 月 3 日快照 | 本次 9 月 7 日快照 |
|---|---|---|
| 图鉴图片 / 身份类别 | 390 / 354 | 390 / 354 |
| 已审核原始游戏裁图 | 4,154 | 8,496 |
| 控制同视频相邻重复后 | 3,648 | 7,891 |
| 有效 / 负样本 | 3,341 / 307 | 7,406 / 485 |
| 游戏裁图覆盖身份 | 190 | 338 |
| 来源录像 | 16 | 21 |
图鉴是干净的参考美术图;游戏裁图带有界面边框、背景、光照和缩放差异。训练时对这些源图做随机增强,产生多个训练视图。训练步数和随机增强后的图片次数不能当作独立原图数量。
390 张图鉴对应 354 个身份,因为 20 种主技能有等级美术变体:16 种各 3 张,4 种各 2 张。它们仍分别共享一个技能身份标签。图鉴包含全部已知身份;这次测试的是已知身份在新录像里的外观,不是识别从未提供过的新物种或新宝物。
这次也使用了重新对齐后的 1,140 张宝物裁图。旧图与旧实验快照保留,当前训练读取新位置的像素;身份标签没有随裁图调整而改变。
用整段录像划分数据
| 分区 / 录像 | 有效 | 负样本 | 用途 |
|---|---|---|---|
| 训练 / 16 段 | 5718 | 379 | 更新权重 |
| 验证 / 2 段 | 401 | 19 | 选择轮次及阈值 |
| 测试 / 3 段 | 1287 | 87 | 冻结后评估 |
训练集更新权重;验证集选择训练轮次和接受阈值;测试集只用来报告结果。旧 16 段录像的归属不动,5 段新增录像在训练前按录制顺序分为 3 段训练、1 段验证、1 段测试。三个分区之间没有共享同一录像。
这是既有项目录像中的开发留出集,配置文件把它叫作 safety_validation,独立 final_test 目前为空。本文后续的“测试集”均指这 3 段开发留出录像;它们过去可能已被查看,不能称为从未接触过的盲测。数据按录像隔离,身份不隔离:同一宝物可以同时出现在训练与测试的不同录像中。
| 类型 | 训练:有效 / 无效 | 验证:有效 / 无效 | 测试:有效 / 无效 |
|---|---|---|---|
| 英雄 | 524 / 178 | 37 / 7 | 122 / 34 |
| 主技能 | 1492 / 86 | 112 / 3 | 343 / 21 |
| 宝物 | 2422 / 100 | 150 / 6 | 465 / 23 |
| 生物 | 1280 / 15 | 102 / 3 | 357 / 9 |
无效输入的“类型”只是来源槽位的分类,不是要求模型把遮挡文字识别为某一种生物。表中可以看出:当前四种槽位都有负样本,但生物验证负样本只有 3 张,仍远不充分。
同一录像、槽位、类型和标签下,时间相邻且画面相近的裁图按既有规则组成一组,最多保留首、中、尾三张,共减少 605 张相邻重复。它减少连续等待画面的重复权重,但不意味着所有保留裁图互相独立,也不证明不同文件绝不包含相同对局。
无效裁图留下来训练什么
| 卡片进入动画 | 淡出 | 空槽 | 弹框遮挡 |
|---|---|---|---|
图 3。来自训练分区的真实负样本。原图不删除,负样本原因也不合并成一个模糊的“错了”。
负样本只给有效性头提供 REJECT 目标,不训练类型和身份。原先被用户否定的身份建议仍保留在审核历史里,不能因为采用了负样本就把那个错误名字重新当作答案。
一个局限是:有些负样本来自“这一组三张卡还在进入,整组都先不用”的规则。某个独立裁图可能已经清楚,仅凭这个小图未必能知道整组是否稳定。同样,标题被遮住不一定意味着图标也被遮住。这些情况应在结果中观察,不能假定裁图有效性头能替代完整画面条件判断。
3. 三个阶段分别比较数据来源和拒识方法
三个阶段使用相同的 ConvNeXt-Tiny 图像网络。它先把裁图变成一组特征,再分别输出类型、类型内身份和有效性。初始图像网络来自 torchvision 的 ImageNet 预训练权重。
同一份图像特征,回答三个问题
网络的共享部分称为骨干(backbone),负责把像素转为视觉特征。对于 224×224 输入,它产生 768 通道、7×7 空间大小的特征图;平均池化和归一化后变成 768 个数。这 768 个数描述图像,不是 768 个类别。
输出头(head)是读这份特征的小型线性层:有效性头输出 1 个值,类型头输出 4 个值,还有 4 个分别针对不同类型的身份头。有效性值经过 sigmoid 转成 0–1 分数;类型和各身份头分别通过 softmax 比较自己内部的类别。
图 4。各头在一次前向计算中得到输出,类型预测决定读取哪个身份头,有效性阈值决定是否采用结果。REJECT 是可用性判断,不是第五种图标类型。
例如,一张真实宝物图在训练时使用已知的“宝物”标签:类型头学习四选一,宝物身份头学习具体名称,另外三个身份头不承担这张图的身份损失。推理时没有正确答案帮助路由,必须先用预测类型选身份头。因此把宝物误判为生物,即使宝物头内部其实能认对,也仍是实际失败。
处理一张新裁图的完整步骤是:填充并缩放到 224×224,提取共享特征,算出类型与身份候选,再用已冻结的接受阈值决定是否交给下游。低于阈值时保留拒绝结果、等待后续画面;不会因为网络总能选出一个名字就强行采用。这个决策流程在最后一节与整帧系统衔接。有效性分数必须来自完成 M2 训练的头,不能采用 M0/M1 阶段尚未训练的有效性输出。
两项对照实验分别改变什么
| 方法 | 训练输入 | 学习目标 |
|---|---|---|
| M0:只用图鉴 | 干净图鉴及随机增强 | 类型、身份 |
| M1:加入游戏裁图 | 图鉴与已确认的有效游戏裁图 | 类型、身份 |
| M2:单独学习有效性 | 有效图鉴/裁图与真实负样本 | 只更新有效性头 |
M0 和 M1 各自从同一份初始参数开始,使用相同的身份抽样顺序、批量大小和完整更新预算。“预算相同”指允许的最大训练计划相同;最终模型由同一验证规则分别选出,实际保留的训练步数可以不同。M1 将部分图鉴抽样换成相应身份的游戏裁图;缺少该身份的游戏训练样本时回退到图鉴。因此,配置中的 50% 是采样目标,不保证每一批恰好有一半游戏图片。
抽样时先选身份,再选该身份的一张图。这样,一个有几百张截图的宝物不会仅凭截图多就挤占只有几张图的英雄。M1 以游戏图替换部分图鉴抽样,不增加额外更新次数。图鉴与真实裁图使用各自的增强函数;M0/M1 沿用相同的函数配置,但实际输入来源不同。
因此,这组对照考察的是“引入真实游戏图及其既定处理方式”的收益,没有单独隔离来源变化与增强强度各自贡献多少。
随机增强怎样改变图片
图鉴训练先依据透明区域取出美术图,把它放在 256×256 的随机纯色背景上,改变尺度、位置和少量旋转,再调颜色、亮度、对比度,有时加轻微模糊。游戏裁图已经有真实背景,采用较弱的亮度、对比度与模糊变化,并保留整幅裁图的比例。两者最终均为 224×224,按 ImageNet 均值与标准差归一化。
![]()
图 5。调用本实验实际增强函数生成的说明图,固定示例随机种子为 20260907–20260909。它展示变换机制,不声称这些恰好是选中模型当时抽到的训练视图。三张增强图仍来自同一张原图。
推理时不做随机旋转或颜色变化,只把原始裁图按比例放入 224×224 画布并标准化。这里的增强是训练方法,不是后续用户截图必须经过的随机处理。
M2 从验证集选出的 M1 开始,冻结图像网络、类型头和身份头。它只训练一个判断 VALID / REJECT 的输出。M2 不会继续改善身份分类;如果它改变了身份预测,就说明冻结约束或实现有问题。
有效性训练交替抽取有效、无效样本。有效池包括图鉴及训练录像中的有效裁图;负样本按原因与录像分组轮转,避免某一种遮挡占满训练。真实负样本为这个输出提供监督,分类置信度基线则没有专门学习拒识。这两者是实用方案比较,不是训练监督量完全相同的比较。
身份分类按“先预测类型,再在预测类型内选身份”评分,类型错了也算身份失败。作为拒识基线,我们还使用 M1 的分类置信度:类型最高分与所选身份最高分的乘积。这个分数低于阈值时拒绝。M2 则用单独学习的有效性分数判断。
原实验的两个阈值都只在验证集上选择,以有效样本接受率和负样本拒绝率的平均值最高为准。这是历史对照的对称目标,不是我们现在的生产选择标准;第 8 节改用更重视坏图误放的评估。分数是模型输出,未经概率校准,不能解释成“这个结果有严格的 99% 概率正确”。
选择训练轮次与选择阈值,是两件事
一次训练轮次结束会保存权重,即 checkpoint。选择轮次是在选哪个模型;选择阈值只是规定怎样使用这个模型的分数,不改变权重。
分类模型先按验证集的“类型和身份都正确”比例选轮次;若相同,再比较按身份等权的平均准确率,然后比较类型准确率,完全相同则保留更早轮次。按身份等权意味着先分别计算每个身份的正确率,再取平均,防止某个常出现的身份主导结果。
有效性模型的每个轮次都先在验证集上尝试所有会改变接受决策的分数边界,选择两类召回平均值最高的阈值;阈值并列时优先保留更多有效图,再选较高阈值。随后比较各“轮次+阈值”组合:依次比较两类召回平均值、有效图接受率和排序指标 AUROC,完全相同保留早期轮次。AUROC 的含义在结果部分展开。
训练预算保持原样:M0/M1 各 12 轮,每轮 356 次更新;M2 为 8 轮,每轮 160 次更新;批量均为 32。本次只有一个随机种子,属于开发集复现实验。
这里一“轮”是规定的更新块,不代表把文件夹中每张图片恰好训练一遍。M0/M1 各有 4,272 次更新机会,本次验证分别保留第 10、5 轮;M2 保留第 1 轮。这是同一模型选择规则产生的结果,保留模型实际经历的更新次数不必相同。运行记录还逐参数核对了 M2 只改变有效性头的权重和偏置,分类输出保持一致。
4. 同一批测试图片上的实际结果
| 测试有效裁图 | M0 只用图鉴 | M1 加入游戏裁图 |
|---|---|---|
| 英雄 | 121/122(99.18%) | 122/122(100.00%) |
| 主技能 | 343/343(100.00%) | 343/343(100.00%) |
| 宝物 | 272/465(58.49%) | 457/465(98.28%) |
| 生物 | 11/357(3.08%) | 355/357(99.44%) |
| 全部 | 747/1,287(58.04%) | 1,277/1,287(99.22%) |
这里的身份准确率只计算测试集的有效裁图,必须类型和身份同时正确。M0 共匹配 747/1,287 张,M1 为 1,277/1,287 张。英雄与主技能全部匹配;生物由 11/357 提升到 355/357。相同测试集上的旧 M1 则是 1,023/1,287,说明这次新模型的进步不只是测试集换了。
逐图配对后,M0→M1 有 530 张从错变对,没有从对变错的样本。下面固定取英雄、宝物、生物中各自的首个改善项,而主技能本来全部正确,没有改善项可展示。
![]()
图 6。宝物“真理制造者”曾被 M0 路由成生物“披甲犬”;加入游戏裁图后的 M1 与冻结标签一致。具体样本 ID 与选例规则见示例记录。这三张是解释性例子,不代替全测试集统计。
错在类型,还是错在类型内部
| 测试有效图诊断 | M0 | M1 |
|---|---|---|
| 只要求类型正确 | 778/1287(60.45%) | 1287/1287(100%) |
| 告知正确类型,再判断身份 | 1091/1287(84.77%) | 1277/1287(99.22%) |
| 实际路由后类型与身份都正确 | 747/1287(58.04%) | 1277/1287(99.22%) |
| 每个身份等权平均的严格准确率 | 41.45% | 98.73% |
第二行是诊断用的“已知正确类型”测试,不是实际推理成绩。它说明 M0 很多错误发生在类型路由,但即使补给正确类型仍有身份混淆;M1 在当前有效图上已无类型错误,剩余 10 个不一致都发生在身份或标签关联层面。
改善是否只来自一段录像
| 测试录像 | M0 正确 / 有效图 | M1 正确 / 有效图 |
|---|---|---|
| HeroesOldenEra-2026-09-02-21-49-22 | 282/493 | 490/493 |
| QQ20260804-151259 | 349/577 | 574/577 |
| QQ2026730-14939 | 116/217 | 213/217 |
三段都有改善,不过统计单位仍主要是裁图,不能把 1,287 张相关帧理解成 1,287 段独立录像。测试中 232 个身份在训练分区有游戏图,共 1,235 张测试图,M1 正确 1,225 张;另外 8 个身份只提供过图鉴,共 52 张测试图,M1 全部匹配。这表明本次收益不完全局限于直接提供过游戏图的身份,但并没有证明面对新身份或其他游戏版本也能保持同样表现。
| 同一批新测试图 | 旧 M1(9 月 3 日) | 本次 M1 |
|---|---|---|
| 英雄 | 122/122(100.00%) | 122/122(100.00%) |
| 主技能 | 343/343(100.00%) | 343/343(100.00%) |
| 宝物 | 455/465(97.85%) | 457/465(98.28%) |
| 生物 | 103/357(28.85%) | 355/357(99.44%) |
| 全部 | 1,023/1,287(79.49%) | 1,277/1,287(99.22%) |
能不能同时保住好图、挡住坏图
“误拒绝”是把有效裁图挡住;“漏拒绝”是让负样本通过。两者都需要看。整体准确率容易被数量更多的有效图主导,不能单凭它说拒识更安全。
| 测试指标 | M1 分类置信度 | M2 有效性 |
|---|---|---|
| 接受阈值 | 1.0 | 0.494140625 |
| 有效裁图被正确接受 | 1159 | 1238 |
| 有效裁图被误拒绝 | 128 | 49 |
| 负样本被正确拒绝 | 80 | 71 |
| 负样本漏拒绝 | 7 | 16 |
| 两类召回率的平均值 | 91.00% | 88.90% |
| 裁图级最终决策正确率 | 89.96% | 94.54% |
有效图接受率分别是 1159/1287=90.05% 与 1238/1287=96.19%;负样本拒绝率分别是 80/87=91.95% 与 71/87=81.61%。两类召回平均值就是这两个百分比的算术平均,给有效与无效两组相同权重。
最后一行同时考核拒识和身份:M1 置信度方案有 1,156 张有效图被接受且身份正确,再加 80 张正确拒绝,共 1236/1374;M2 方案是 1,228+71=1299/1374。这里只是“裁图到接受结果”的完整正确率,不包含整帧找框等上游步骤。
M2 少误拒 79 张有效图,但多放过 9 张负样本;两类召回率的平均值从 91.00% 降到 88.90%。它更愿意接受图像,不能据此认定更安全。测试淡出样本只拒绝了 7/15,仍是弱项。验证集仅有 2 张明确标注为淡出的负样本,这提示覆盖不足,但不能证明是唯一原因。
置信度基线的阈值恰好是 1.0。这里的 1.0 不是“有 100% 概率正确”:本协议对 bfloat16 输出直接计算 softmax 和置信度乘积,未先转换成 float32;足够接近 1 的不同实数会舍入为同一个 1.0。因此验证集选择的是这个最高量化档位,实际规则为分数大于等于 1.0 就接受。不能把这个实现的结果推广为所有置信度方法的上限。下一轮应另行比较 float32 分数与概率校准,本轮的接受规则和计数保持冻结。
排序好,不等于当前阈值选得好
AUROC 衡量分数把有效图排在负样本前面的能力,可以直观理解为:随机各取一张,正确排序的比例,并把并列计作一半。PR 曲线描述不同阈值下的精确率与召回率关系;本实验把 VALID 当作正类,接受的图中有多少有效是精确率,有效图中接受了多少是召回率。
本文用平均精确率 AP 汇总 PR 表现:把同分样本作为一组一起接受,以每组新增的召回率加权精确率。这是非插值定义,和用梯形法计算曲线面积不同,见 scikit-learn 的定义。
| 排序指标(VALID 为正类) | M1 分类置信度 | M2 有效性 |
|---|---|---|
| AUROC | 0.9479 | 0.9470 |
| AP:同分按组计算,复核值 | 0.9934 | 0.9944 |
原报告 auprc:逐行排序旧实现 |
0.9931 | 0.9945 |
复核发现,原报告名为 auprc 的实现是按排序后的每一行累加精确率,并列分数仍保留文件行顺序,因此不宜直接视为标准阈值分组 AP。上表保留原值,并对同一份冻结预测按同分组复算;手工分组公式与 scikit-learn 的结果一致,见计分复核记录。这项报告修正不改变权重、阈值、身份计数或接受/拒绝结果。
两者排序指标接近;本文没有做统计显著性检验,不据此宣称某种方法具有可靠的排序优势。测试集 1287/1374≈93.67% 本来就是有效图,AP 很高也不代表坏图都被挡住。分数函数不同,两个阈值的数值大小本身没有优劣含义;评估应落在“误拒多少、漏过多少”上。
原始小数据实验曾出现 AUROC=1,却仍有误拒,原因是测试集能找到完美切分点,不代表先前在验证集选出的切分点恰好落在那里。这是一个值得保留的教学案例,见历史部分。当前快照两种分数的排序都不再完美。
| 测试负样本原因 | 数量 | 置信度正确拒绝 | 有效性正确拒绝 |
|---|---|---|---|
| 卡片进入动画 | 2 | 2 | 1 |
| 空槽 | 1 | 1 | 1 |
| 英雄槽中的非英雄内容 | 1 | 1 | 1 |
| 非有效目标 | 13 | 12 | 11 |
| 无效目标(细分标记) | 3 | 3 | 3 |
| 文字区遮挡 | 11 | 11 | 11 |
| 其他原因 | 4 | 4 | 4 |
| 其他不可用 | 9 | 7 | 9 |
| 场景不匹配 | 6 | 6 | 6 |
| 宝物队列里的法术画面 | 6 | 6 | 6 |
| 浮层遮挡 | 16 | 14 | 11 |
| 淡出 | 15 | 13 | 7 |
这些小类别的测试数量有限。例如某类只有几张时,漏掉一张就会明显改变百分比。未覆盖的情况不能当作已经通过测试。
导出了数据,不等于选中的模型看过全部数据
| 阶段 / 数据 | 可用池 | 选中模型实际见过 | 完整预算实际见过 |
|---|---|---|---|
| M1 / 游戏 VALID | 5718 | 5165 | 5588 |
| M2 / 游戏 VALID | 5718 | 2408 | 5642 |
| M2 / REJECT | 379 | 379 | 379 |
上表只计游戏裁图,图鉴另计。固定更新预算下,抽样会重复一些图,也可能遗漏另一些图。验证集如果选中较早的轮次,后续轮次看到的图片不会进入最终保留的分类器。这里分别报告完整训练和被选中模型实际使用过的数据。
5. 看错在哪,而不只看一个百分比
逐张检查全部 10 个分类不一致项后,8 个宝物呈现明显的图片与标签不匹配:例如图片是巫师斗篷却标为鸣唱排箫,是靴子却标为匕首,或是乐谱却标为护符。图片本身支持模型预测,提示已有标注或关联仍有错误。另 2 张连续生物裁图中,模型把圣光师认成大天使,这是需要改善的视觉混淆。
以下每行依次为真实裁图、冻结标签的图鉴、模型预测的图鉴。冻结测试仍按原标签计分,不把事后检查改写成模型达到 100%。
所以 99.22% 是相对于冻结测试标签的严格准确率。当前复查只检查了不一致项,尚未对整个测试集做新的独立审计;模型与标签相同的项目也可能同时出错。本文不报告推测性的“修正后准确率”。
![]()
图 7a。前三个来自新增录像,后两个来自旧测试录像;不能因为记录已确认就假定标签绝无错误。
![]()
图 7b。最后两行是同一段录像的相邻生物帧,不应解读成两个独立场景的成功或失败。
拒识方面,M2 的 16 次漏拒包含 8 张淡出、5 张提示框遮挡、2 张非目标内容与 1 张进入动画。训练更多可用图标有助于身份识别,却不会自动解决这些画面条件问题。
下面的训练曲线用于检查优化过程。M0/M1 优化分类,M2 优化有效性,三者的损失数值不能直接比较高低。
图 8。验证集选择模型,而不是自动选择最后一轮。完整预测、抽样记录和错误图库保存在本地实验目录。
6. 训练耗时与使用时速度
| 阶段 | 训练及该阶段评估耗时 | 选中轮次 |
|---|---|---|
| M0 | 9.36 分钟 | 10 |
| M1 | 11.53 分钟 | 5 |
| M2 | 1.86 分钟 | 1 |
硬件为 NVIDIA GeForce RTX 5080,推理使用 224×224 输入和 bfloat16 自动混合精度。新进程从 Python 脚本入口到首张预测完成为 3.27 秒;其中依赖导入 2.11 秒,构建模型、读 checkpoint 并搬到 GPU 为 0.27 秒。没有清空操作系统磁盘缓存,因此这是新进程启动,不能当成完全冷硬件启动。
| 已预热路径 / 批量 | 中位耗时每批 | P95 每批 | 裁图吞吐(crops/s) |
|---|---|---|---|
| 只含模型与输出 / 1 | 7.52 ms | 8.64 ms | 132.9 |
| 读裁图、预处理及模型 / 1 | 9.27 ms | 11.60 ms | 107.9 |
| 只含模型与输出 / 32 | 13.60 ms | 18.64 ms | 2353.1 |
| 读裁图、预处理及模型 / 32 | 54.72 ms | 59.72 ms | 584.8 |
每个配置预热 5 批、计时 30 次,GPU 同步后计时;后处理和将输出取回 CPU 计入。固定测试子集包含四种类型各 8 张,重复运行时文件缓存可能已经命中。原始裁图尺寸包括 120×151、121×149、136×139、208×227、275×320 像素,统一整理为模型输入大小。训练耗时含该阶段验证、测试和保存,另不含数据快照导出与报告生成。
P95 表示 95% 的计时批次不超过该耗时;这里的吞吐按每批张数除以中位耗时计算。
这些速度测量的输入是已经存在于磁盘上的裁图文件。它们不包含视频解码、场景分类、从整图切出槽位或 OCR,因此不能直接等同于完整游戏视频的处理帧率。增加训练数据会改变训练和评估工作量;在网络结构和输入大小不变时,不会自动增加每张裁图的推理计算量。
一帧如果有三个候选槽位,就有三张裁图需要处理;表里的每秒裁图数不能直接当成每秒视频帧数。
7. 为什么不能直接拿新旧准确率相减
这次扩充了生物覆盖、负样本、录像和裁图修正,也扩充了测试集。旧结果保留如下,属于各自冻结快照上的测量。
| 历史快照 | 测试有效 / 无效 | M0 身份正确 | M1 身份正确 | M2 有效图误拒 / 坏图漏拒 |
|---|---|---|---|---|
| 最初的小数据实验 | 370 / 28 | 353 / 370 | 370 / 370 | 16 / 0 |
| 9 月 3 日审核数据 | 714 / 53 | 562 / 714 | 708 / 714 | 2 / 11 |
最初和 9 月 3 日的测试都没有生物裁图。本次测试包含 357 张有效生物裁图,所以即使新模型分数与旧分数不同,也不能只归因于“多训练了一些图片”。本次 M0/M1 比较使用同一批新测试图;额外把冻结的旧 M1 放到这批图片上测试,才是比较新旧保留模型的共同考题。它仍不是只改变数据量的严格因果实验,因为验证数据和被选择的训练轮次也可能变化。
第一轮:为什么图鉴增强仍会认错宝物
最初快照有 1,473 张游戏裁图,只有 55 张宝物:27 张训练、0 张验证、28 张测试。M0 在测试宝物上正确 11/28,M1 正确 28/28;17 个改善都来自一段录像。M0 曾把其中 10 张路由为生物、7 张路由为技能,说明不只是宝物名字相近,连类型判断也受游戏外观影响。
| 历史改善例:慈悲匕首 | 历史改善例:真理制造者 | 历史改善例:第三只眼 |
|---|---|---|
图 9。这是第一轮 398 张总测试图中的例子,不是本次新增改善数量。界面边框与背景和图鉴不同,实际裁图提供了单靠随机增强未必覆盖的外观。
第一轮:完美排序为什么仍会误拒
当时的测试集有 370 张有效图和 28 张负样本,全部负样本都来自英雄槽位。两种分数都把有效图排在负样本之上,因此 AUROC/AUPRC 均为 1。但验证录像选出的阈值分别为 0.8828125 和 0.859375,仍误拒了 76 与 16 张有效图。
图 10。保留原文的排序与阈值示意图:图中位置是示意,不是真实分数直方图。它只解释第一轮的 76→16 次误拒,不代表本次测试排序完美。
当时有效性头的 16 次误拒里有 14 张宝物、1 张英雄、1 张技能。这些具体例子说明“有信心认出身份”和“判断画面可用”并不是同一目标。
| 历史误拒:木戒 | 历史误拒:英雄头像 | 历史误拒:技能 |
|---|---|---|
图 11。旧快照只有 27 张有效宝物训练图,负样本又全部来自英雄槽位。这种覆盖不均与宝物误拒较多相吻合,但实验没有单独证明它就是原因。
第二轮:增加淡出负样本后,旧结论不再成立
9 月 3 日快照扩大到 3,648 张游戏裁图,测试有效图 714 张、负样本 53 张。M1 身份匹配 708/714,仍然没有测试生物。置信度方案误拒 105 张、漏拒 3 张;有效性方案误拒 2 张、漏拒 11 张,其中 8 张是淡出。
这就是为什么更新数据时必须保留负面结果:第一轮的“有效性头少误拒且不增加漏拒”,不能自动延续到更多坏图的测试。现在第三轮进一步覆盖四种类型,仍观察到有效性头愿意保留更多好图、同时漏过更多坏图的取舍。
8. 这次重跑之后该怎么用
生产里,两种错误的代价不同
宁可暂时不读,也不要把不可靠的身份写入游戏状态。 一张好图被拒绝,通常只是下一帧再试;坏图被接受,尤其还输出错误身份时,可能污染后续选择或状态记录。因此,不能只按平均准确率、平衡准确率,或“少拒绝多少好图”来选择生产方案。
| 情况 | 下游动作与代价 |
|---|---|
| 有效图被拒绝 | 暂不更新,等待后续帧;主要成本是延迟,也可能错过短暂界面 |
| 无效图被接受 | 不可靠内容进入状态;即使碰巧认对身份,也不符合当前可用性约定 |
| 有效图被接受但身份错误 | 直接写错身份,必须单独统计 |
淡入淡出边界可以保守标为 REJECT,保留为有效性头的负样本。它不必同时把整个场景标成 Transition:裁图能否使用和场景是什么仍是两个问题。无效样本没有可靠的身份真值,所以本实验不能进一步准确计算“坏图被接受且身份错误”的数量;以下把任何坏图误放作为风险代理,再单列有效图上的错误身份。
保留历史模型,实际复算一个更保守的接受规则
现在加入一个可执行的双门槛:分类置信度与 M2 有效性必须同时通过。仍使用原验证集选定的 1.0 与 0.494140625,没有重训权重,也没有在测试集搜索新阈值。上游还必须给出场景与槽位可用信号;本次裁图复算将这个信号固定为通过,只测两种分数的组合。
| 开发测试:1,287 有效 / 87 无效 | 只用置信度 | 只用有效性 | 两者同时通过 |
|---|---|---|---|
| 坏图误放 / 87 | 7(8.05%) | 16(18.39%) | 5(5.75%) |
| 好图暂缓 / 1,287 | 128 | 49 | 168 |
| 接受的好图 / 1,287 | 1,159 | 1,238 | 1,119 |
| 已接受好图中身份错误 | 3 | 10 | 3 |
相对只用有效性,双门槛少放过 11 张坏图,多暂缓 119 张好图;相对只用置信度,少放过 2 张坏图,多暂缓 40 张好图。这更符合当前的代价偏好,但 5 次误放仍待解决,不能称为生产质量已达标。双门槛是在看过开发结果后提出的探索性组合,不是新的盲测胜出者。
验证集上双门槛接受 369/401 张好图、误放 0/19 张坏图。19 张负样本过少,且帧之间可能相关;零次观测不证明真实误放率接近零。下一轮在独立校准录像上先规定可接受的坏图误放上限,再在满足约束的候选中尽量保留好图。必须同时要求有用的覆盖率;若无可行方案就报告无法满足要求,不能靠“全部拒绝”宣称成功。目前没有足够依据为这些成本指定统一数值权重。
部署模块已经实现 ACCEPT / DEFER:分数缺失或异常、上游未就绪、身份缺失、任一门槛不通过都暂缓,不修改状态。本轮复算及检查没有自动替换线上模型。阈值绑定本次模型和分数精度,不是适用于其他模型的通用常量。下载接受规则复算结果。
等下一帧是策略,延迟仍要用连续录像测量
下一两帧恢复清晰是合理的使用假设,但当前静态、稀疏抽样数据没有测出恢复需要多久。系统必须记录从首次可读到首次接受的时间、连续拒绝长度、短界面漏读以及错误身份进入状态的次数。持续不确定时报告“暂时无法读取”;超时不能强行接受,也不能把旧状态冒充当前观测。连续两帧身份一致可作附加证据,但稳定的错误也可能连续出现,不能只靠投票保证正确。
与其他模块衔接
身份分类已经从新增游戏数据中获得明显收益,尤其是生物。下一步先依据原图修正本次记录下来的 8 个宝物标签关联问题,并从训练录像或新录像中补充圣光师与大天使的易混淆例子;本次冻结测试与成绩保留,不把测试图搬进训练集。
有效性方面,先扩充独立录像中的淡出、遮挡和卡片进入阶段,增加验证集覆盖,再比较更合适的分数计算与阈值。涉及整组卡片稳定性或标题区域遮挡的条件,应由上游结合整帧判断。现阶段没有足够证据把 M2 当作唯一的接受开关,也没有自动替换生产模型。
这是已知槽位上的图标分类实验,不能替代场景识别、战场生物检测或英雄属性读取。有效性头也应与上游的场景、布局、浮层和画面稳定性判断配合使用。
落到视频流程中,先由场景理解判断主场景、子场景和其他画面条件,选择对应版本的槽位;再由本文的像素分类器给出类型、身份与有效性。标题清楚时,名称 OCR可以提供额外证据。冲突或正在过渡时等待下一帧,稳定且证据一致时才采用身份。这是各模块预期的协作方式,本文的裁图实验还没有测量整条视频链的准确率。
公开预测与结果核验
读者可下载本次冻结的1,374 行测试预测 CSV和阈值、排序指标及冻结检查 JSON。CSV 每行含样本与录像标识、冻结有效性/身份、M0/M1 预测及两种分数;score >= threshold 接受。无效行的来源类型不能当作身份监督目标。配套的Python 核算脚本只依赖标准库,可直接重算两种方案的接受计数、最终决策正确率、AUROC 与 AP。这些文件不含原始录像、训练裁图和权重,因此不等于完整训练复现包。
复现路径与实验约束
历史实验目录:perception/experiments/b11_verified-gameplay-icon-classifier/(原 B04,2026 年 9 月 8 日调整编号)。旧 b04.* 数据格式和历史运行标识保留,本文现在归入 P81。
配置:configs/experiment-reviewed-2026-09-07.json。运行:reviewed-expanded-2026-09-07。数据快照:verified-gameplay-crops-2026-09-07-expanded。
这些是本文 9 月 7 日测量的原始标识。运行输出仍在 local_data/perception/experiments/b04_verified-gameplay-icon-classifier/runs/reviewed-expanded-2026-09-07/。新的 configs/experiment-reviewed-2026-09-08-b11.json 沿用既有训练协议与来源划分,把后续输出放到 project_data/perception/experiments/b11_verified-gameplay-icon-classifier/;这份配置尚未产生新快照或模型。
历史命令不能直接当作今天的运行入口。
这是历史实验的运行配方,不再提供依赖旧
perception-gpu环境的复制命令。复现时先按 Perception 当前 README 启用统一环境,再核对历史配置与数据路径;本文保留旧运行标识,便于追溯成绩。
当时的 --dry-run 只检查,不训练或导出。后续实际重跑使用独立的新运行和快照名称,并先明确新增视频的分区;不能让新视频自动进入已经冻结的测试集。
原始裁图物理复制到冻结快照,保存当时的标注;训练结束后的审核修改不会改变本次成绩。测试预测逐条保留,不为提高结果而回写测试标签或调节测试阈值。该运行不自动替换网页正在使用的生产模型。
图鉴训练采用背景、尺度、位置、轻微旋转、颜色和模糊增强;真实裁图使用较弱的颜色与模糊增强。两者最终都转换为 224×224。M0/M1 的分类损失权重为身份 1、类型 0.35;M2 只使用有效性二分类损失。优化器为 AdamW;精确参数、来源录像列表与选中轮次保存在配置及运行记录中。
| 关键配置 | M0 / M1 | M2 |
|---|---|---|
| 初始参数 | 同一 ImageNet1K_V1 骨干与相同初始化头,各自独立训练 | 从选中 M1 开始 |
| 骨干学习率 | 0.000012 | 0,冻结 |
| 输出头学习率 | 0.0004 | 仅有效性头 0.0004 |
| 权重衰减 / 梯度裁剪范数 | 0.02 / 1 | 0.02 / 1 |
| 分类目标 | 类型交叉熵×0.35+对应身份交叉熵 | 无分类更新 |
| 有效性目标 | 不训练 | 二分类交叉熵×1 |
| 更新预算 | 12×356,批量 32 | 8×160,批量 32 |
图鉴缩放目标为 256 画布的 62%–88%,位置抖动不超过 9 像素,可能旋转 ±6°;亮度 0.78–1.20、对比度 0.82–1.18、颜色 0.78–1.22,偶尔使用半径 0.2–1.1 的高斯模糊。游戏图亮度/对比度均为 0.90–1.10,偶尔模糊半径 0.1–0.6。不同来源采用不同强度,是既有训练协议的一部分。
原始模型定义在 src/verified_icon_classifier/model.py,增强在 data.py,独立冻结旧模型的共同测试由 compare_previous_checkpoint.py 执行,计时由 benchmark_runtime.py 执行。运行中保存了源代码副本、每轮抽样记录和完整预测。本次单种子为 20260831;训练和推理使用 PyTorch 2.13.0+cu130 及 RTX 5080。
数据重复控制沿用原实现的同视频、同槽位、同标签时序与图像相似度规则:间隔不超过 6.5 秒,相邻图像差异满足既有阈值,每组最多三张。保留这项规则是为了与历史协议一致,不把相邻视频帧误当成完全独立样本。
P81 · Fixed-crop classification and rejection · Experiment notes and related articles
Input: icon crops. Output: identity and usability. September 7 measurements remain frozen; September 8 updates numbering and execution paths without retraining.
Rerun: September 7, 2026. Reading revision: production-costs-20260907. The explanations and examples from earlier experiments remain; historical results identify their own datasets.
In Heroes of Might and Magic: Olden Era, Arena players choose Heroes, Skills, Artifacts and Creatures. We want software to read those choices. Their icons change size and background, fade in, disappear during paging and get covered by tooltips.
This experiment assumes the icon slots are already located. It classifies each crop and decides whether its pixels are usable now. The rerun adds reviewed gameplay data and repairs Artifact crop alignment while retaining the three-stage model protocol.
On the same 1,287 valid development-test crops, the retained September 3 classifier matches 1,023 labels (79.49%); the new classifier matches 1,277 (99.22%). This compares complete training procedures, including changed training/validation data and selected checkpoints. It does not isolate the causal effect of image count. Creature identification improves most; usability still trades rejecting good images against accepting bad ones.
Production prioritizes fewer bad-input acceptances over accepting every good crop. A deferred good crop can usually be retried; an unreliable identity entering state is more costly. Section 8 replays a joint acceptance rule and identifies the still-unmeasured temporal delay.
Figure 1. Two questions: does gameplay training improve identity classification, and does a learned validity score reject unusable inputs better than classification confidence? Dataset counts include all three partitions.
1. The model receives crops, not screenshots
The yellow rectangle below comes from a fixed-layout rule. Only its pixels enter this experiment; the classifier does not search the screenshot for objects.
![]()
Figure 2a. The upstream system must identify the correct scene and layout. A plausible name from a badly positioned crop does not establish successful detection.
The four families are Hero portraits, Main Skill icons, Artifact icons and Creature-selection artwork. Main Skill icons on subskill pages also count; each individual subskill is not a separate identity here. Spells, numerical attributes and battlefield unit detection are outside this experiment.
Unlike full-screen icon search, this experiment receives the slot rectangle. Separating localization lets us measure recognition without mixing box failures into identity accuracy.
Why catalog artwork is insufficient
The same Hero looks different in clean artwork and inside game borders, backgrounds and lighting. This input shift is called a domain gap. Artificial color and scale changes may help, but random backgrounds cannot be assumed to reproduce real interfaces.
| Gameplay crop | Catalog artwork of the same Hero |
|---|---|
Figure 2b. Same identity, different pixels. This is supervised classification: catalog images train the model. Inference does not retrieve a nearest neighbor from all 390 references.
| Hero | Main Skill | Creature | Realigned Artifact |
|---|---|---|---|
Every crop is fitted proportionally onto a 224×224 RGB canvas and normalized with ImageNet statistics. Training uses source-specific augmentation; inference has none. The outputs are validity, type and identity within that type. The model receives no slot index, recording date, scene label or OCR text; those belong to upstream cropping and data management.
“Valid” is task-specific: should the downstream system use this input now? A fading icon may remain recognizable yet be labeled unusable so the system waits for another frame.
2. Data growth and video-separated evaluation
Review is iterative: annotate some examples, train a classifier to suggest more labels, cross-check with OCR and source images, then correct and confirm them. A suggestion alone is not ground truth. This export includes confirmed identities or confirmed negatives.
The owner explicitly accepted 628 previously assistant-reviewed frames as a batch. Their workflow status became “human confirmed,” meaning owner acceptance. The audit history still records assistant review followed by owner batch acceptance; it does not claim an additional independent, frame-by-frame blind human review.
| Dataset count | September 3 | September 7 |
|---|---|---|
| Catalog images / identities | 390 / 354 | 390 / 354 |
| Reviewed raw gameplay crops | 4,154 | 8,496 |
| After nearby-frame repetition control | 3,648 | 7,891 |
| Valid / negative crops | 3,341 / 307 | 7,406 / 485 |
| Identities with gameplay crops | 190 | 338 |
| Source recordings | 16 | 21 |
Catalog images are clean artwork; gameplay crops contain borders, backgrounds, lighting and scaling. Random augmentation creates multiple training views from these sources. Update counts or augmented-view counts are not independent source-image counts.
The 390 catalog images represent 354 identities because Main Skills have level variants: 16 skills have three images each and four have two. Variants share the same skill identity. All known identities are available in the catalog. The test asks whether known identities transfer to new recordings, not whether the model recognizes unseen species or Artifacts.
The snapshot also incorporates 1,140 realigned Artifact crops. Historical pixels and snapshots remain preserved; current training reads the repaired coordinates without changing identity labels.
Split complete recordings
| Partition / recordings | Valid | Negative | Purpose |
|---|---|---|---|
| Training / 16 | 5,718 | 379 | Update weights |
| Validation / 2 | 401 | 19 | Choose checkpoints and thresholds |
| Test / 3 | 1,287 | 87 | Evaluate frozen choices |
The original 16 recordings keep their partitions. Before training, the five new recordings were assigned chronologically: three to training, one to validation and one to test. No recording spans partitions.
This is a development holdout from existing project recordings. Configuration calls it safety_validation; the independent final_test is empty. These three recordings may have been inspected before and are not an untouched blind benchmark. Recordings are isolated, identities are not: the same Artifact can appear in different training and test videos.
| Type | Train valid / invalid | Validation valid / invalid | Test valid / invalid |
|---|---|---|---|
| Hero | 524 / 178 | 37 / 7 | 122 / 34 |
| Main Skill | 1,492 / 86 | 112 / 3 | 343 / 21 |
| Artifact | 2,422 / 100 | 150 / 6 | 465 / 23 |
| Creature | 1,280 / 15 | 102 / 3 | 357 / 9 |
An invalid crop’s type describes its source slot, not a demand to classify tooltip prose as a Creature. All four slot types now have negatives, but three Creature-validation negatives are insufficient coverage.
Within a recording, slot, type and label, nearby visually similar crops form groups; at most the first, middle and last are retained. This removes 605 near-duplicates. It reduces repeated waiting-screen weight, but does not make all retained frames independent or prove different files never contain the same match.
What negatives teach
| Card entry | Fading | Empty slot | Panel occlusion |
|---|---|---|---|
Figure 3. Actual training negatives. Source images and distinct rejection reasons remain available.
Negatives supervise only the validity head with REJECT; they do not train type or identity. Rejected identity suggestions remain in review history and must not become positive labels again.
Some negatives mean “the three-card group is still entering; wait for the group.” One crop may already look clear, so its pixels alone cannot establish group stability. Likewise, a covered title does not always mean the icon is covered. Crop validity cannot replace full-screen readiness checks.
3. Three stages compare data sources and rejection methods
All stages use ConvNeXt-Tiny initialized from torchvision ImageNet weights. It extracts image features, then predicts type, identity within type and usability.
One feature vector, three questions
The shared backbone converts a 224×224 image to a 768-channel, 7×7 feature map. Average pooling and normalization yield 768 numbers describing the image, not 768 classes.
Small linear output heads read those features: one validity value, four type values, and four type-specific identity heads. Sigmoid maps validity to a 0–1 score. Each type/identity head uses its own softmax.
Figure 4. Outputs share a forward pass. Predicted type selects the identity head; acceptance uses the frozen score rule. REJECT is usability, not a fifth icon type.
During training, an Artifact’s known type routes its identity loss to the Artifact head; the other identity heads incur no loss for that image. Inference has no correct type available, so routing must use the predicted type. An Artifact routed as a Creature is a failure even if the unused Artifact head could name it correctly.
For a new crop: fit to 224×224, extract features, predict type and identity, then apply the frozen acceptance rule. Below threshold, defer rather than use a name just because softmax always supplies one. Validity must come from the trained M2 head, not the untrained validity outputs of M0/M1.
What changes between stages
| Stage | Training input | Objective |
|---|---|---|
| M0: catalog only | Catalog artwork with augmentation | Type and identity |
| M1: add gameplay | Catalog and confirmed valid gameplay | Type and identity |
| M2: learn validity | Valid catalog/gameplay and real negatives | Update validity head only |
M0/M1 start independently from identical initial parameters, using the same identity sampling schedule, batch size and maximum update budget. Equal budget means equal allowed schedules, not necessarily equal selected checkpoints. M1 replaces some catalog draws with gameplay of that identity; identities without gameplay fall back to catalog. The configured 50% is a sampling target, not exactly half of every batch.
Sampling chooses an identity first, then its image, preventing frequently recorded Artifacts from overwhelming rare Heroes. M1 replaces draws rather than adding update steps. Source-specific augmentation functions are unchanged between runs, but the actual input sources differ. This comparison measures introducing real gameplay with its existing preprocessing; it does not independently isolate source and augmentation effects.
What augmentation actually does
Catalog training trims transparency, places artwork on a random plain 256×256 background, varies scale, position and small rotations, changes color/brightness/contrast and occasionally blurs. Gameplay retains the real interface and aspect ratio with weaker brightness, contrast and blur changes. Both end at 224×224 with ImageNet normalization.
![]()
Figure 5. Illustrations generated by the actual training functions with example seeds 20260907–20260909. These explain the transformations; they are not claimed to be the exact random views seen by the selected checkpoint. Three views still share one source.
Inference uses proportional padding and normalization without random rotation or color changes.
M2 starts from selected M1 and freezes the backbone, type head and identity heads. Only VALID/REJECT learning continues. M2 cannot improve identity predictions; any changed identity output would violate the freezing contract.
Validity training alternates valid and invalid draws. Valid inputs include catalog and training gameplay. Negatives rotate through reason-by-recording groups so one occlusion type does not dominate. This learned head receives explicit negative supervision; the confidence baseline does not. They are practical alternatives, not equal-supervision experiments.
Identity scoring requires both predicted type and routed identity to match. M1 confidence is the maximum type probability multiplied by the maximum probability in the selected identity head. M2 instead supplies a learned validity score.
The historical protocol chooses each threshold on validation to maximize the mean of valid acceptance and negative rejection. This symmetric objective is not the current production preference; Section 8 prioritizes bad-input acceptance. Scores are uncalibrated model outputs, not guaranteed probabilities of correctness.
Checkpoint selection differs from threshold selection
A checkpoint contains weights. Selecting it chooses a model; selecting a threshold only chooses how to use its scores.
Classification checkpoints are ranked by validation type-and-identity accuracy, then identity-macro accuracy, then type accuracy, retaining earlier epochs on full ties. Identity-macro accuracy averages each identity equally rather than letting frequent identities dominate.
For each M2 epoch, the original implementation tries all validation score boundaries that change acceptance, maximizes balanced recall, then prefers greater valid acceptance and finally a higher cutoff on ties. Epoch/threshold pairs are ranked by balanced recall, valid acceptance, then AUROC, retaining earlier epochs on ties.
M0/M1 each allow 12 epochs × 356 updates; M2 allows 8 × 160; all use batch size 32 and one seed. An epoch here is a specified update block, not exactly one pass over every file. M0/M1 each allow 4,272 updates and retain epochs 10 and 5 respectively. M2 retains epoch 1. Parameter-by-parameter checks confirm that only M2 validity weights and bias change, with identical classification outputs.
4. Results on the same test crops
| Valid test crops | M0 catalog only | M1 with gameplay |
|---|---|---|
| Hero | 121/122 (99.18%) | 122/122 (100.00%) |
| Main Skill | 343/343 (100.00%) | 343/343 (100.00%) |
| Artifact | 272/465 (58.49%) | 457/465 (98.28%) |
| Creature | 11/357 (3.08%) | 355/357 (99.44%) |
| All | 747/1,287 (58.04%) | 1,277/1,287 (99.22%) |
Only valid crops enter identity accuracy, requiring correct type and identity together. The old M1 scores 1,023/1,287 on this same test, so the newer model’s improvement is not merely a changed test set.
Paired M0→M1 predictions contain 530 corrections and zero regressions. The following are the first improvement in each improved family in saved prediction order. Main Skills were already all correct, so have no improvement example.
![]()
Figure 6. M0 routed the Truthmaker Artifact as an Armored Hound Creature; M1 matches the frozen label. Sample IDs and the selection rule are in the example records. Examples explain behavior, not replace full-test statistics.
Type routing versus within-type errors
| Valid-crop diagnostic | M0 | M1 |
|---|---|---|
| Type alone correct | 778/1,287 (60.45%) | 1,287/1,287 (100%) |
| Identity given the true type | 1,091/1,287 (84.77%) | 1,277/1,287 (99.22%) |
| Actual routed type and identity | 747/1,287 (58.04%) | 1,277/1,287 (99.22%) |
| Equal-weight identity-macro accuracy | 41.45% | 98.73% |
True-type routing is a diagnostic oracle, not an inference result. It shows many M0 failures occur in routing, but even corrected routing would not solve all identity errors.
| Development-test recording | M0 correct | M1 correct |
|---|---|---|
| HeroesOldenEra-2026-09-02-21-49-22 | 282/493 | 490/493 |
| QQ20260804-151259 | 349/577 | 574/577 |
| QQ2026730-14939 | 116/217 | 213/217 |
Test includes 232 identities with gameplay-training coverage (1,235 crops; M1 correct on 1,225) and eight identities represented only by catalog training (52 crops, all matched). These 52 are not unseen identities; clean artwork was available during training.
| Same new test | September 3 M1 | New M1 |
|---|---|---|
| Hero | 122/122 (100.00%) | 122/122 (100.00%) |
| Main Skill | 343/343 (100.00%) | 343/343 (100.00%) |
| Artifact | 455/465 (97.85%) | 457/465 (98.28%) |
| Creature | 103/357 (28.85%) | 355/357 (99.44%) |
| All | 1,023/1,287 (79.49%) | 1,277/1,287 (99.22%) |
Accepting more good crops can also admit more bad ones
| Frozen operating point | M1 confidence | M2 validity |
|---|---|---|
| Threshold | 1.0 | 0.494140625 |
| Valid accepted | 1,159/1,287 | 1,238/1,287 |
| Valid rejected | 128 | 49 |
| Invalid accepted | 7/87 | 16/87 |
| Invalid rejected | 80/87 | 71/87 |
| Balanced accuracy | 91.00% | 88.90% |
| Crop-level final decision correct | 1,236/1,374 (89.96%) | 1,299/1,374 (94.54%) |
Final decision correctness counts accepted valid crops with correct type/identity plus rejected negatives. There are 1,156 correctly named accepted valid crops for confidence and 1,228 for validity. This aggregate favors the common valid class; it is not our asymmetric production objective.
Valid acceptance is 90.05% versus 96.19%; negative rejection is 91.95% versus 81.61%. Balanced accuracy averages those two rates with equal class weight. M2 rejects 79 fewer good crops but admits nine additional negatives. Only 7/15 fading test crops are rejected; validation has just two explicit fading negatives. Limited coverage is a concern, not an established sole cause.
The confidence cutoff of 1.0 does not mean certainty. The original path calculates softmax and the product in bfloat16 without first converting to float32. Values near one round into the same highest bin. The rule accepts scores ≥1.0. This implementation is not an upper bound on all confidence-based rejection. Float32 scores and calibration deserve separate comparison; original counts remain frozen.
Good ranking does not guarantee a good operating threshold
AUROC measures whether valid scores rank above negatives, counting ties as half. Precision asks how many accepted crops are valid; recall asks how many valid crops are accepted. VALID is the positive class.
Average precision (AP) groups tied scores and weights each precision by its newly added recall. It is non-interpolated and differs from trapezoidal area; see the scikit-learn definition.
| Ranking metric | M1 confidence | M2 validity |
|---|---|---|
| AUROC | 0.9479 | 0.9470 |
| Grouped-score AP, audited | 0.9934 | 0.9944 |
Original row-ordered auprc |
0.9931 | 0.9945 |
The original auprc accumulated precision row by row; tied scores retained file order, so it is not standard threshold-grouped AP. The original values remain, alongside a recomputation on the same predictions. A manual grouped formula matches scikit-learn; see the score audit. This correction changes no weights, thresholds or decisions.
The rankings are close and no statistical significance test was performed. The test is already 1,287/1,374≈93.67% valid, so high AP does not imply reliable rejection. Numeric cutoffs from different score functions are not directly comparable. Actual false rejects and false accepts matter.
The first small experiment had AUROC=1 yet still rejected good crops: a perfect test separator can exist without being the cutoff chosen on validation. Section 7 preserves that example; current ranking is no longer perfect.
| Negative reason | Count | Confidence rejected | Validity rejected |
|---|---|---|---|
| Card entry | 2 | 2 | 1 |
| Empty slot | 1 | 1 | 1 |
| Non-Hero in Hero slot | 1 | 1 | 1 |
| Not a target | 13 | 12 | 11 |
| Invalid target, finer flag | 3 | 3 | 3 |
| Text-region occlusion | 11 | 11 | 11 |
| Other reason | 4 | 4 | 4 |
| Other unusable | 9 | 7 | 9 |
| Scene mismatch | 6 | 6 | 6 |
| Spell page in Artifact queue | 6 | 6 | 6 |
| Tooltip overlay | 16 | 14 | 11 |
| Fading | 15 | 13 | 7 |
With such small reason groups, one mistake can change a rate substantially. Unrepresented conditions have not passed evaluation.
Exported data is not necessarily seen by the selected model
| Training source | Available pool | Seen by selected checkpoint | Seen across full budget |
|---|---|---|---|
| M1 gameplay VALID | 5,718 | 5,165 | 5,588 |
| M2 gameplay VALID | 5,718 | 2,408 | 5,642 |
| M2 REJECT | 379 | 379 | 379 |
Catalog draws are counted separately. Sampling can repeat some sources and miss others under a fixed budget. Images seen after the selected epoch do not contribute to that retained model.
5. Inspect errors, not just percentages
Inspecting all ten mismatches reveals eight Artifact image/label associations that visibly disagree: a cloak labeled as panpipes, boots as a dagger, or music as an amulet. Pixels support the model’s prediction in these cases, suggesting remaining annotation/association problems. The other two neighboring Creature frames confuse Hierophant with Archangel.
Each row below shows actual crop, catalog artwork for the frozen label, then artwork for the model prediction. The frozen test is still scored against its original labels. We do not rewrite it as 100% accuracy after inspection.
Thus 99.22% is strict agreement with frozen labels. Only mismatches received this audit; matching model/label pairs can also share an error. No speculative “corrected accuracy” is reported.
![]()
Figure 7a. The first three are from a new recording and the next two from older test footage. Confirmed status does not make a label infallible.
![]()
Figure 7b. The final two rows are neighboring frames from one recording, not two independent scenes.
M2’s 16 false accepts comprise eight fading crops, five tooltip occlusions, two non-targets and one card-entry crop. More valid training images help identity without automatically solving these conditions.
Figure 8. Validation chooses a checkpoint, not automatically the final epoch. M0/M1 optimize classification; M2 optimizes validity, so their loss magnitudes are not directly comparable. Full predictions, sampling logs and error galleries remain in the experiment.
6. Training time and inference speed
| Stage | Training plus stage evaluation | Selected epoch |
|---|---|---|
| M0 | 9.36 min | 10 |
| M1 | 11.53 min | 5 |
| M2 | 1.86 min | 1 |
Hardware is an NVIDIA GeForce RTX 5080, with 224×224 input and bfloat16 autocast. A fresh Python process takes 3.27 seconds from script entry through its first prediction: imports account for 2.11 seconds; model construction, checkpoint loading and GPU transfer for 0.27 seconds. OS file caches were not cleared, so this is fresh-process startup rather than fully cold hardware.
| Warm path / batch | Median per batch | P95 per batch | Crops/s |
|---|---|---|---|
| Model and output / 1 | 7.52 ms | 8.64 ms | 132.9 |
| File read, preprocessing, model / 1 | 9.27 ms | 11.60 ms | 107.9 |
| Model and output / 32 | 13.60 ms | 18.64 ms | 2,353.1 |
| File read, preprocessing, model / 32 | 54.72 ms | 59.72 ms | 584.8 |
Each configuration warms up for five batches and measures 30 trials with GPU synchronization; postprocessing and CPU output transfer count. The fixed subset has eight crops per type, and repeated reads may hit file cache. Original sizes include 120×151, 121×149, 136×139, 208×227 and 275×320, all converted to the same network input.
Training timing includes stage validation, testing and checkpoint saving, but not snapshot export/report generation. P95 is the time not exceeded by 95% of measured batches; throughput is batch size divided by median duration.
These inputs are existing crop files. Timings exclude video decoding, scene classification, extracting slots from screenshots and OCR. They are not end-to-end video FPS. More training data changes training/evaluation workload, not automatically per-crop inference computation when architecture/input size stay fixed. A frame with three slots needs three crop predictions.
7. Why historical accuracies cannot simply be subtracted
The new snapshot expands Creatures, negatives, videos, repaired crops and the test set. Earlier measurements belong to their own frozen snapshots.
| Snapshot | Test valid / invalid | M0 identities | M1 identities | M2 false rejects / false accepts |
|---|---|---|---|---|
| Original small dataset | 370 / 28 | 353/370 | 370/370 | 16 / 0 |
| September 3 review | 714 / 53 | 562/714 | 708/714 | 2 / 11 |
Neither old test contained Creatures; the new one has 357 valid Creature crops. Different scores cannot therefore be attributed only to more training images. Evaluating old and new models on the same new test provides common questions, though changed validation and selected epochs still prevent a pure data-count causal claim.
First round: why catalog augmentation misread Artifacts
The original snapshot contained 1,473 gameplay crops but only 55 Artifacts: 27 train, zero validation and 28 test. M0 matched 11/28 test Artifacts and M1 28/28. All 17 improvements came from one recording. M0 routed ten as Creatures and seven as Skills: the domain gap affected type, not merely neighboring Artifact names.
| Historical improvement: Misericorde | Truthmaker | Third Eye |
|---|---|---|
Figure 9. Examples from the original 398-crop test, not additional improvements in the new test. Real borders and backgrounds supply appearances not necessarily covered by random catalog augmentation.
First round: perfect ranking still rejected good images
The original test had 370 valid and 28 negative crops; all negatives came from Hero slots. Both scores ranked all valid crops above negatives, yielding AUROC/AUPRC=1. Yet validation-selected cutoffs of 0.8828125 and 0.859375 rejected 76 and 16 valid crops respectively.
Figure 10. A schematic, not a measured score histogram. It explains the historical 76→16 false-reject reduction, not perfect ranking in the current test.
The validity head’s 16 false rejects comprised 14 Artifacts, one Hero and one Skill. Recognizing identity confidently and judging current usability are distinct objectives.
| Historical false reject: ring | Hero | Skill |
|---|---|---|
Figure 11. Only 27 valid Artifact training crops and exclusively Hero-slot negatives are consistent with uneven Artifact rejection, but the experiment did not establish that imbalance as the cause.
Second round: fading negatives changed the conclusion
September 3 expanded to 3,648 gameplay crops and a test of 714 valid plus 53 negatives, still without test Creatures. M1 matched 708/714 identities. Confidence rejected 105 good images and admitted three bad ones; validity rejected two good images but admitted 11 bad ones, eight fading.
The first round’s “fewer false rejects without more false accepts” did not survive broader negative coverage. The third round now covers all four types and still shows validity keeping more good crops while admitting more bad ones.
8. How this should be used in production
Production errors have unequal costs
Prefer a delayed observation to an unreliable identity written into game state. Rejecting a good crop usually allows another attempt next frame. Accepting a bad crop, especially with a wrong identity, can corrupt subsequent decisions. Mean accuracy, balanced accuracy and reduced false rejection alone are insufficient production selection criteria.
| Event | Downstream consequence |
|---|---|
| Valid crop rejected | Defer the update; incur delay or potentially miss a brief screen |
| Invalid crop accepted | Admit unreliable content; even a lucky correct name violates current usability policy |
| Valid crop accepted with wrong identity | Write a wrong identity; measure separately |
Ambiguous fade boundaries may conservatively remain REJECT training examples. This does not require labeling the whole scene Transition: crop usability and scene identity are separate. Negatives lack reliable identity ground truth, so this test cannot count precisely “invalid and accepted and wrongly named.” It uses any invalid acceptance as a risk proxy and separately measures wrong identities on accepted valid crops.
Replay a more conservative acceptance rule
An executable rule now requires both classification confidence and M2 validity to pass. It retains the original validation-selected cutoffs, 1.0 and 0.494140625, without retraining or searching test thresholds. Upstream scene/slot readiness must also pass; this crop replay fixes that signal to true, isolating the two-score combination.
| Development test: 1,287 valid / 87 invalid | Confidence only | Validity only | Both required |
|---|---|---|---|
| Invalid accepted / 87 | 7 (8.05%) | 16 (18.39%) | 5 (5.75%) |
| Valid deferred / 1,287 | 128 | 49 | 168 |
| Valid accepted / 1,287 | 1,159 | 1,238 | 1,119 |
| Wrong identities among accepted valid | 3 | 10 | 3 |
Compared with validity alone, the joint rule blocks 11 additional bad crops and defers 119 additional good ones. Compared with confidence alone, it blocks two additional bad crops and defers 40 additional good ones. This better matches our cost preference, but five bad acceptances remain. The combination was proposed after inspecting development results; it is exploratory, not a fresh blind-test winner.
On validation it accepts 369/401 good crops and 0/19 bad ones. Nineteen negatives are too few, with possible temporal dependence; zero observed failures does not establish negligible real-world risk. The next calibration protocol should specify an acceptable bad-input rate first, then maximize useful valid coverage within that constraint on independent recordings. Require useful coverage as well: if no policy qualifies, report infeasibility rather than “winning” by rejecting everything. Current evidence does not justify universal numerical cost weights.
The deployable module implements ACCEPT/DEFER: missing or invalid scores, missing identity, unready upstream input or either failed cutoff defer rather than update state. This replay does not automatically replace the live model. Thresholds belong to this model and score precision, not all classifiers. Download the acceptance replay.
Waiting is a policy; latency needs continuous-video measurement
Recovery after one or two frames is a reasonable usage hypothesis, but this sparsely sampled static dataset does not measure recovery delay. Log first-readable-to-first-accepted time, rejection streaks, missed short screens and wrong identities entering state. Sustained uncertainty should report “temporarily unreadable”; a timeout must not force acceptance or present stale state as a current observation. Two consistent consecutive identities can add evidence, but a stable mistake can repeat too.
Connecting the modules
Gameplay training improves identity, especially Creatures. Next, repair the eight recorded Artifact associations using source images and add Hierophant/Archangel confusion examples from training or new videos. Preserve frozen scores and do not move test images into training.
For validity, independent fading, occlusion and entry examples are needed, especially for validation. Full-screen checks should handle group stability and title occlusion. M2 is not sufficiently supported as the sole acceptance switch; this run has not replaced the production model.
This known-slot classifier cannot replace scene classification, battlefield detection or attribute reading. Scene understanding selects the scene, subscene, condition and versioned layout; this classifier then supplies pixel type, identity and validity. Title OCR can provide complementary evidence. Conflicts or transitions defer an update. This is the intended module workflow, not a measured end-to-end video result.
Public predictions and verification
Download the frozen 1,374-row prediction CSV and threshold/ranking/invariant JSON. Rows include sample/recording IDs, frozen usability/identity, M0/M1 predictions and both scores; acceptance is score >= threshold. Invalid source types are not identity supervision.
The standard-library Python audit recomputes the original acceptance counts, final-decision accuracy, AUROC and AP. These files omit original videos, training crops and weights, so they are not a complete training reproduction package.
Reproduction paths and protocol details
Historical experiment directory: perception/experiments/b11_verified-gameplay-icon-classifier/, renamed from B04 on September 8, 2026. The historical b04.* schemas and saved run identifiers are retained; this article now belongs to P81.
The September 7 measurements use configs/experiment-reviewed-2026-09-07.json, run reviewed-expanded-2026-09-07, and snapshot verified-gameplay-crops-2026-09-07-expanded. Saved outputs remain at local_data/perception/experiments/b04_verified-gameplay-icon-classifier/runs/reviewed-expanded-2026-09-07/.
The September 8 configuration, configs/experiment-reviewed-2026-09-08-b11.json, retains the training protocol and source partitions while directing future outputs to project_data/perception/experiments/b11_verified-gameplay-icon-classifier/. That change did not produce a new snapshot or model. Check current paths before trying to reproduce the historical run.
This is a historical run recipe. The old
perception-gpucommand is retired. To reproduce it, start with the unified environment in the current Perception README, then check the archived configuration and data paths. Historical run identifiers remain here to trace the reported results.
In that historical runner, --dry-run neither exported nor trained. A later rerun needs distinct run and snapshot names and an explicit partition for each new video; new videos must not silently enter the frozen test partition.
Source crops are physically copied with frozen annotations. Later review changes do not alter these scores. Saved per-crop predictions are retained; labels and test thresholds are not edited to improve results. The run does not automatically replace the model used by the annotation website.
| Setting | M0 / M1 | M2 |
|---|---|---|
| Initialization | Same ImageNet1K_V1 backbone and identical heads; independent training | Selected M1 |
| Backbone learning rate | 0.000012 | 0, frozen |
| Head learning rate | 0.0004 | Validity only, 0.0004 |
| Weight decay / gradient clipping norm | 0.02 / 1 | 0.02 / 1 |
| Classification loss | Type cross-entropy×0.35 + routed identity cross-entropy | No classification update |
| Validity loss | Not trained | Binary cross-entropy×1 |
| Update budget | 12×356, batch 32 | 8×160, batch 32 |
AdamW is used throughout. Catalog artwork spans 62%–88% of the 256 canvas, shifts up to nine pixels and may rotate ±6°. Brightness is 0.78–1.20, contrast 0.82–1.18, color 0.78–1.22, with occasional Gaussian blur radius 0.2–1.1. Gameplay brightness/contrast are 0.90–1.10, occasional blur 0.1–0.6. Both ultimately become 224×224. Source-specific strengths are part of the existing protocol.
Model code is src/verified_icon_classifier/model.py, augmentation is in data.py, old-checkpoint common evaluation uses compare_previous_checkpoint.py, and timing uses benchmark_runtime.py. The run preserves code copies, epoch sampling logs and full predictions. Seed: 20260831; PyTorch 2.13.0+cu130; RTX 5080.
Duplicate control retains the existing same-recording/slot/label grouping, at most 6.5-second gaps, image-similarity threshold and up to three retained frames per group. It maintains historical protocol consistency without claiming temporal independence.
Comments