AI 驱动文档
您想了解什么?
添加数据和重新训练
本教程演示如何通过向现有配方添加新图像并重新训练模型来提高 AI 模型的准确性。当模型错误地将良品判定为不良,或在生产中遇到新的变体时,此过程尤为关键。
视频指南
请查看实操演示: OV Auto-Defect Creator Studio
你将学到:
- 如何查找并选择用于重新训练的图像
- 如何向现有 trainset 添加图像
- 如何为新的训练数据打标签
- 如何使用新数据重新训练模型
适用时机: 当良品在检验中被误判为不良,或出现新的零件变体,或需要通过额外示例提升模型的准确性时。
先决条件
- 具备经过训练的 AI 模型的活动配方(classification 或 segmentation)
- 访问 OV10i 摄像头界面
- Library 中需要添加到训练的图像
Step 1: Find Images for Retraining
1.1 Navigate to Library
- Open the OV10i interface
- Click "Library" in the left navigation menu
- You'll see all captured images from your camera
1.2 Filter Images
- Filter by Recipe: Select the recipe you want to improve
- Filter by Pass/Fail: Select "FAIL" to see failed images, or "PASS" to see passed images
- Sort By: Choose date or other criteria to organize results
- Click "Search" to display filtered results
Goal: Find images that were incorrectly classified - either good parts that failed or bad parts that passed.
Step 2: Add Images to Trainset
2.1 Select Images
- Review each image to identify incorrectly classified parts
- Select images that show:
- Good parts that were incorrectly marked as failed
- Bad parts that were incorrectly marked as passed
- Click the checkbox on each image you want to add
Important
Add images that were incorrectly classified - this includes good parts that failed AND bad parts that passed. Both help improve model accuracy.

2.2 Add to Trainset
- After selecting images, click "Add to the active recipe's trainset" at the bottom
- A success message will confirm the images were added
- Click "Go to recipe editor" to continue
Step 3: Label New Training Data
3.1 Navigate to Label and Train
- From Recipe Editor, go to:
- Classification Recipe: "Classification Block"
- Segmentation Recipe: "Label And Train"
- Click "View All ROIs"
3.2 Find Unlabeled Images
- Use "Filter By Class" dropdown
- Select "Unlabeled" to show only unlabeled images
- You'll see the images you just added to the trainset

3.3 标注已选图像
- 选择你添加的所有未标注的图像
- 在底部左下角点击 “Label Selected ROIs”
- 从下拉菜单中选择正确的标签(例如 “Pass”、“Good” 等)
- 点击 “OK” 以应用该标签
重要
在不同标注会话之间点击 “Clear Selection” 以避免错误标注。

3.4 关闭 ROI 视图
- 关闭 “View All ROIs” 模态框
- 返回到主页面:标注与训练
第4步:重新训练模型
4.1 开始重新训练
- 点击 “训练分类器模型” 或 “训练分割器模型”
- 系统将使用所有现有数据以及您新增的图像进行重新训练
- 监控训练进度
4.2 训练过程
- 模型从旧的和新的带标签数据中学习
- 训练时间取决于数据总量
- 在测试之前等待训练完成
4.3 测试改进后的模型
- 使用 “实时预览模式” 测试重新训练的模型
- 使用此前被错误判定为不良的相同图像进行测试
- 验证模型现在是否能正确将良品识别为通过
第5步:验证结果
5.1 使用新图像进行测试
- 捕获相似零件的新图像
- 检查模型在边缘情形下的表现是否有所提升
- 验证先前良好的图像现在是否正确通过
5.2 监控性能
- 关注是否出现新的误报或漏报
- 记录准确性的提升
- 记录仍存在的问题以便未来重新训练
成功!您的模型已重新训练
您的改进后 AI 模型现在可以:
✅ 更好地识别此前被误判为不良的良品
✅ 能处理生产零件中的新变体
✅ 减少误判为不良的情况并提高准确性
✅ 适应制造过程中的变更
成功的关键提示
数据质量
- 添加被错误分类的图像(包括误判通过和误判为不良)
- 标注要保持一致——将良品标注为“Pass”,不良品标注为“Fail”
- 包含通过和不通过条件的多样化示例
- 在不同标注会话之间清除选择
何时重新训练
- 误判为不良的情况增加(良品被判定为不良)
- 误判为通过的情况增加(不良品通过)
- 生产中出现新的零件变体
- 工艺变更影响零件外观
- 材料或照明的季节性变化
最佳实践
- 从小做起 — 一次添加 10-20 张图像
- 在每次重新训练后进行彻底测试
- 记录变更和改进
- 在进行重大重新训练前保留工作模型的备份
下一步
在重新训练模型后:
- 监控生产以提升准确性
- 继续收集有问题的图像以便未来重新训练
- 如有需要,设置定期重新训练计划
- 培训操作员,了解何时将图像标记为需要重新训练
- 记录重新训练过程以保持一致性