AI 驱动文档
您想了解什么?
添加数据和重新训练
本教程演示如何通过向现有配方添加新图像并重新训练模型来提高 AI 模型的准确性。当模型错误地将良品判定为不良,或在生产中遇到新变体时,此过程尤为重要。
请在实际演示中查看本主题:OV Auto-Defect Creator Studio
你将学习:
- 如何查找并选择用于重新训练的图像
- 如何将图像添加到现有的 trainset
- 如何标注新的训练数据
- 如何使用新数据对模型进行重新训练
何时使用此功能: 当良品在检验中被判定为不合格、当你遇到新的零件变体,或当你需要通过额外示例来提高模型的准确性时。
先决条件
- 具有训练 AI 模型(classification 或 segmentation)的活动配方
- 访问 OV20i 相机界面
- Library 中需要添加到 training 的图像
Step 1: Find Images for Retraining
1.1 Navigate to Library
- Open the OV20i interface
- 点击 "Library" 在左导航菜单
- 您将看到来自相机的所有捕获图像
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
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 Images
- Select all the unlabeled images you added
- Click "Label Selected ROIs" in the bottom-left corner
- Choose the correct label from the dropdown (e.g., "Pass", "Good", etc.)
- Click "OK" to apply the label
Click "Clear Selection" between different labeling sessions to avoid mislabeling.

3.4 关闭 ROI 视图
- 关闭 "View All ROIs" 模态框
- 返回到主页面:标注与训练页面
第4步:重新训练模型
4.1 开始重新训练
- 点击 "Train Classification Model" 或 "Train Segmentation Model"
- 系统将使用所有现有数据以及您的新图像进行重新训练
- 监控训练进度
4.2 训练过程
- 该模型同时从旧的和新的带标签数据中学习
- 训练时间取决于数据总量
- 测试前请等待训练完成
4.3 测试改进后的模型
- 使用 "Live Preview Mode" 来测试重新训练的模型
- 使用之前错误标记的相同图像进行测试
- 验证模型现在能够正确识别通过的良品
第5步:验证结果
5.1 使用新图像进行测试
- 捕捉类似部件的新图像
- 检查模型在边缘情况上的表现是否更好
- 验证之前能通过的图像现在是否正确通过
5.2 监控性能
- 关注是否出现新的误报或漏报
- 记录准确性的提升
- 记录任何剩余的问题以便未来重新训练
成功!您的模型已重新训练
您的改进的 AI 模型现在可以:
✅ 能更好地识别此前被误判为不合格的良品
✅ 能处理生产部件中的新变体
✅ 降低误判为不良的情况并提高准确性
✅ 适应制造过程中的变化
成功要点
数据质量
- 添加错误分类的图像(包括误判为通过和误判为失败)
- 标签保持一致:将良品标注为“Pass”,将不良品标注为“Fail”
- 包含通过与不通过条件的多样化示例
- 在不同的标注会话之间保持清晰的区分
何时重新训练
- 误判为不良的情况增加(良品错误判定为不良)
- 误判为通过的情况增加(不良品错误通过)
- 生产中出现新的部件变体
- 工艺变更影响零件外观
- 材料或照明的季节性变化
最佳做法
- 从小做起 - 一次添加 10-20 张图像
- 每次重新训练后进行全面测试
- 记录变更与改进
- 在进行重大重新训练前备份工作模型
在未审阅的情况下添加大量图像可能会让您的模型变差。您添加的每一张图像都会向 AI 学习某些东西。如果这些图像包含错误标注的部件、不一致的照明、模糊捕捉,或不代表实际生产条件的边缘情况,模型就会学习错误的模式,准确性下降。输入好数据,输出好结果。
在添加图像之前,请核实每张图像是否为:正确标注(通过实际上显示良品,未通过实际上显示缺陷)、代表真实生产条件、清晰且聚焦(不过分模糊或曝光过度)、以及与模型需要学习的特征相关。如果重新训练后准确性下降,请先回顾最近添加的图像。删除少量错误示例通常比添加数十个新示例更有帮助。
后续步骤
在重新训练您的模型之后:
- 监控生产 以提升准确性
- 继续收集 有问题的图像以便未来重新训练
- 如有需要,设立定期重新训练计划
- 培训操作员在何时对图像进行重新训练标记
- 将重新训练过程文档化 以确保一致性