BreadTopo Jumper Trace Policy 2.0
English | 简体中文
2.0 is an experimental release. This behavior-cloning policy starts at a detected jumper-wire endpoint and traces the wire across a breadboard. The BreadTopo photo pipeline combines the policy with endpoint detection, wire instance segmentation and board mapping to identify the two holes each jumper connects.
Model details
| Item | Description |
|---|---|
| Public version | 2.0 |
| Initialization | Public Jumper Trace Policy 1.0 |
| Architecture | Feed-forward convolutional network with action, jump-distance and four-point path prediction heads |
| Input | Heading-aligned 128 × 128 crop, with RGB (3 channels), trace history (1), candidate-endpoint heatmap (1) and the target wire's instance mask (1) |
| Action output | Scores for 32 relative directions, jump and stop |
| Jump output | A scalar the tracing controller uses to estimate jump distance |
| Path output | Four 2D positions in normalized crop coordinates, targeting nominal distances of 8, 16, 24 and 32 pixels along the wire. Targets past the wire end stay at the endpoint. |
| Parameters | 1,138,699 total, including 67,848 in the path prediction head |
model.pt SHA-256 |
ea69366668eeecde241cdfca8e1fd891cd86692ed6e2ac1611495112d3536567 |
| License | AGPL-3.0 |
How tracing and pairing work
- Build a local view of the wire. The endpoint detector supplies candidate locations, and the segmentation model supplies separate masks for the visible wires. The controller assigns a wire mask to a starting endpoint when one is available. At each step it crops around the current trace position and rotates the crop so the current heading points up. The controller draws the path already traced into one channel and adds a heatmap of the other detected endpoints into another. The assigned mask gives the model a cue about which wire to follow where wires cross or pass close together.
- Predict movement from the local view. Three strided convolution blocks and a dilated convolution block produce a feature map. The network reads its central 5 × 5 window into a 256-dimensional feature vector shared by all three heads. The action head scores relative directions, jump and stop. The jump-distance head estimates how far a jump should go. The path head regresses four points together in coordinates centered on the crop.
- Choose an initial heading, then advance the trace. At a detected endpoint, the controller runs short action-based traces in several directions and continues from the best-ranked hypotheses. During continued tracing, ordinary movement goes directly to the third predicted point. The controller maps that point back to the tracing image, updates the heading from the displacement and builds a fresh crop. The nominal 24 pixels describe distance along the wire in the training target. The displacement in the image depends on the predicted curve. When the action head selects a jump, the controller moves along the current heading by a distance derived from the jump-distance output.
- Recognize an arrival. During continued tracing, arrival is based on approaching another detected endpoint, with a target-mask check where applicable. The controller checks for arrival at the chosen landing point. A trajectory can also end on leaving the image or reaching the step budget without finding a partner. The result of tracing is a directed endpoint match, which the photo pipeline reports with the hole IDs supplied by board mapping.
- Combine the two tracing directions. The controller first selects reciprocal matches and applies its regular recovery steps. For a remaining one-way match from A to B with two free endpoints, it can retry from B using A’s wire mask. The retry must return to A and follow a similar route. The controller checks the 90th percentile of nearest-point distances in both directions against a 12-pixel tolerance in the tracing image. A successful retry adds a pair while preserving all previously assigned endpoints.
Training data and procedure
The encoder, feature readout, action head and jump-distance head were frozen from public release 1.0. Training updated only the new path prediction head using synthetic wire trajectories and ground-truth instance masks. 1.0 initialization weights · Pinned training dataset
| Item | Setting |
|---|---|
| Training split | 1,247 images, 5,291 wire records |
| Checkpoint-selection split | 96 images, 416 wire records |
| Training configuration | CUDA, 8 epochs, batch size 256, learning rate 0.0003, seed 0 |
| Selected checkpoint | Epoch 6, which had the lowest validation Smooth L1 loss for the predicted path points |
Each training example places the coordinate origin at the current wire position and rotates the annotated trajectory into the same frame as the crop. The supervision takes four points ahead along that trajectory at nominal 8-pixel intervals and uses the endpoint for targets beyond the wire end. Smooth L1 loss is applied to the four normalized coordinate pairs.
The pinned dataset provides the public reference for the training data. Per-image checksums from the original training run were unavailable, so exact equality with the inputs read during that run could not be established.
Evaluation
All three comparisons use frozen validation sets. Within each set, both pipelines use the same images and supporting model weights. The control uses public 1.0 weights with action-based tracing. The 2.0 results include the new path prediction and reverse-tracing pairing step. A pair counts as correct when both hole IDs match the same ground-truth pair. An image is exact when its complete predicted pair set matches the ground truth.
| Validation set | Hole IDs | 1.0 control F1 / exact | 2.0 F1 / exact | F1 difference, 95% interval (pp) |
|---|---|---|---|---|
| 400 synthetic images, including 40 empty boards | Ground truth | 0.7000 / 180 | 0.7256 / 190 | +2.56 [+0.91, +4.26] |
| 21 real photos | Automatically detected | 0.4898 / 3 | 0.5312 / 4 | +4.15 [−1.80, +10.14] |
| 30 real photos | Automatically detected | 0.7468 / 16 | 0.7200 / 17 | −2.68 [−11.23, +4.54] |
| Validation set | Precision, 1.0 → 2.0 | Recall, 1.0 → 2.0 |
|---|---|---|
| 400 synthetic images | 0.8975 → 0.8598 | 0.5737 → 0.6276 |
| 21 real photos | 0.5275 → 0.5862 | 0.4571 → 0.4857 |
| 30 real photos | 0.7867 → 0.8060 | 0.7108 → 0.6506 |
On the synthetic set, 2.0 recovered more correct connections while also producing more incorrect pairs. This evaluation used ground-truth hole locations and predicted endpoints and masks. The photo evaluations included automatic hole identification, and their F1 changes went in opposite directions. Both photo intervals include zero. The intervals use paired resampling of images and reflect uncertainty across images in these sets. Variation across training runs was not measured. Match each row by sample count in the bundled model-manifest.json for evaluation IDs, metric versions, split checksums and raw counts.
Usage
Run the following from the matching 2.0 inference source bundle. Open the local photo GUI, select the jumper-tracing route and upload a breadboard photo. The bundle pins the endpoint detector and wire instance-segmentation weights by revision and checksum.
python -m pip install -r configs/requirements-public-inference.txt
hf download BreadTopo/jumper-trace-policy model.pt --revision 2.0 --local-dir weights/2.0
python jumper-vision/tools/photo_gui.py --public-models --policy weights/2.0/model.pt
Limitations
The 2.0 results cover validation sets. Independent test performance has yet to be measured. The model was trained on synthetic scenes, and accuracy can vary with lighting, camera angle, occlusion and dense crossings. Errors in endpoint detection, wire masks or board mapping can produce missed connections or wrong hole IDs. Check the predicted pairs before using them for circuit analysis.
Related resources
简体中文
English | 简体中文
2.0 是实验版本。 该行为克隆策略从检测到的跳线端点出发,沿面包板上的跳线追踪。BreadTopo 照片识别流程将它与端点检测、跳线实例分割和板面孔位映射结合,确定每根跳线连接的两个孔位。
模型信息
| 项目 | 说明 |
|---|---|
| 公开版本 | 2.0 |
| 初始化 | 跳线追踪策略公开发行版 1.0 |
| 架构 | 前馈卷积网络,包含动作、跳跃距离和四点路径预测三个输出头 |
| 输入 | 与追踪方向对齐的 128 × 128 图像裁剪,含 RGB(3 通道)、已追踪路径(1 通道)、候选端点热图(1 通道)和目标跳线实例掩膜(1 通道) |
| 动作输出 | 32 个相对方向、跳跃和停止的分数 |
| 跳跃输出 | 供追踪控制器估计跳跃距离的标量 |
| 路径输出 | 裁剪坐标系中的 4 个归一化二维点,对应沿线约 8、16、24 和 32 像素处。超出线尾的目标点取线尾位置。 |
| 参数量 | 共 1,138,699 个,其中路径预测头 67,848 个 |
model.pt SHA-256 |
ea69366668eeecde241cdfca8e1fd891cd86692ed6e2ac1611495112d3536567 |
| 许可证 | AGPL-3.0 |
追踪和配对机制
- 构造跳线的局部视图。 端点检测模型提供候选位置,实例分割模型为可见跳线分别生成掩膜。有可用掩膜时,控制器为起始端点分配一根线的掩膜。每一步以当前追踪位置为中心裁剪图像,并旋转到当前朝向指向上方。控制器将已走过的路径画入一个通道,把其他检测端点画成热图放入另一个通道。在跳线交叉或靠得很近时,目标线掩膜为模型提供该跟踪哪根线的提示。
- 从局部视图预测移动。 三个带步长的卷积块和一个空洞卷积块生成特征图。网络从中心 5 × 5 窗口读出一个由三个输出头共享的 256 维向量。动作头给相对方向、跳跃和停止打分,跳跃距离头估计应跳多远,路径头在以裁剪中心为原点的坐标系中同时回归四个点。
- 选择起步朝向并续追。 控制器先从检测端点出发,用动作头在多个朝向上试走几步,再沿排名靠前的假设继续追踪。普通续追直接以第 3 个预测点为落点,将它变换回追踪图像,再根据位移更新朝向并裁剪下一次输入。约 24 像素是训练目标的沿线距离,图像中的实际位移取决于预测曲线。动作头选中跳跃时,控制器沿当前朝向移动,跳跃距离由跳跃距离头的输出决定。
- 判定到达。 续追时,控制器在选定的落点检查是否靠近另一处检测端点,并在适用时检查目标线掩膜。一条轨迹也可能因越出图像或达到步数上限而结束,无法找到配对端点。追踪给出有方向的端点匹配,照片识别流程再结合板面映射给出的孔号报告结果。
- 合并两个方向的追踪结果。 控制器先选取能互相追到的端点并执行常规补配。若仍有两个空闲端点,且已从 A 单向追到 B,就可以用 A 的线掩膜从 B 反向再追一次。反向轨迹需要回到 A,且走过的路线相近。控制器分别计算两个方向上各轨迹点到另一条轨迹最近点的距离,以追踪图像中的 12 像素为容差检查距离的第 90 百分位。通过后才追加配对,已配对的端点继续保留原结果。
训练数据与过程
以公开发行版 1.0 初始化,冻结编码器、特征读出、动作头和跳跃距离头,仅用合成跳线轨迹和真值实例掩膜训练新增的路径预测头。1.0 初始权重 · 固定版本的训练数据
| 项目 | 设置 |
|---|---|
| 训练划分 | 1,247 张图、5,291 条跳线记录 |
| 选轮划分 | 96 张图、416 条跳线记录 |
| 训练配置 | CUDA、8 轮、批大小 256、学习率 0.0003、随机种子 0 |
| 选用权重 | 第 6 轮,预测路径点的验证 Smooth L1 损失最低 |
训练样本以线上的当前位置为原点,将标注轨迹旋转到与输入裁剪一致的坐标系。沿标注轨迹每隔约 8 像素取一个前方监督点,共取四个,超过线尾的点使用线尾位置。训练对四组归一化坐标使用 Smooth L1 损失。
固定版本的公开数据包可用于查阅训练数据。由于原训练未保留逐图校验值,无法确认公开数据与当时读取的文件逐字节一致。
评测
三组对照均使用冻结的验证集。同一组内,两种流程使用相同图像和辅助模型权重。对照流程使用公开 1.0 权重,按动作逐步追踪。2.0 的结果包含路径预测和反向追踪补配。两个孔号同时与同一真值孔对匹配时才算正确配对。一张图的全部预测孔对与真值一致时计为整图全对。
| 验证集 | 孔号来源 | 1.0 对照 F1 / 整图全对 | 2.0 F1 / 整图全对 | F1 差值及 95% 区间(百分点) |
|---|---|---|---|---|
| 400 张合成图,含 40 张空板 | 真值 | 0.7000 / 180 | 0.7256 / 190 | +2.56 [+0.91, +4.26] |
| 21 张实拍图 | 自动识别 | 0.4898 / 3 | 0.5312 / 4 | +4.15 [−1.80, +10.14] |
| 30 张实拍图 | 自动识别 | 0.7468 / 16 | 0.7200 / 17 | −2.68 [−11.23, +4.54] |
| 验证集 | 精确率,1.0 → 2.0 | 召回率,1.0 → 2.0 |
|---|---|---|
| 400 张合成图 | 0.8975 → 0.8598 | 0.5737 → 0.6276 |
| 21 张实拍图 | 0.5275 → 0.5862 | 0.4571 → 0.4857 |
| 30 张实拍图 | 0.7867 → 0.8060 | 0.7108 → 0.6506 |
在合成图上,2.0 找回了更多正确连接,同时也输出了更多错误配对。合成评测使用真值孔位和模型预测的端点、掩膜。两组实拍均包含自动孔位识别,F1 变化方向相反,区间均包含零。区间通过对图像进行配对重抽样得到,反映这批验证图的抽样不确定性。训练运行之间的波动尚未测量。每行的评测编号、指标版本、划分校验值和原始计数可按样本数在随包附带的 model-manifest.json 中查到。
使用
在配套的 2.0 推理源码包目录中运行以下命令。打开本地照片识别页面,选择跳线追踪路线并上传面包板照片。源码包按固定版本和校验值加载端点检测与跳线实例分割权重。
python -m pip install -r configs/requirements-public-inference.txt
hf download BreadTopo/jumper-trace-policy model.pt --revision 2.0 --local-dir weights/2.0
python jumper-vision/tools/photo_gui.py --public-models --policy weights/2.0/model.pt
局限
2.0 目前报告验证集结果,独立测试表现尚未测量。模型使用合成场景训练,光照、拍摄角度、遮挡和密集交叉都可能影响准确率。端点检测、跳线掩膜或板面映射错误可能导致漏配或孔号错误。用于电路分析前,请复核预测孔号和配对。