跳到主要内容

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

  1. Open the OV20i interface
  2. 点击 "Library" 在左导航菜单
  3. 您将看到来自相机的所有捕获图像

1.2 Filter Images

  1. Filter by Recipe: Select the recipe you want to improve
  2. Filter by Pass/Fail: Select "FAIL" to see failed images, or "PASS" to see passed images
  3. Sort By: Choose date or other criteria to organize results
  4. 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

  1. Review each image to identify incorrectly classified parts
  2. Select images that show:
    • Good parts that were incorrectly marked as failed
    • Bad parts that were incorrectly marked as passed
  3. 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.

image.png

2.2 Add to Trainset

  1. After selecting images, click "Add to the active recipe's trainset" at the bottom
  2. A success message will confirm the images were added
  3. Click "Go to recipe editor" to continue

Step 3: Label New Training Data

3.1 Navigate to Label and Train

  1. From Recipe Editor, go to:
    • Classification Recipe: "Classification Block"
    • Segmentation Recipe: "Label And Train"
  2. Click "View All ROIs"

3.2 Find Unlabeled Images

  1. Use "Filter By Class" dropdown
  2. Select "Unlabeled" to show only unlabeled images
  3. You'll see the images you just added to the trainset

image.png

3.3 Label Selected Images

  1. Select all the unlabeled images you added
  2. Click "Label Selected ROIs" in the bottom-left corner
  3. Choose the correct label from the dropdown (e.g., "Pass", "Good", etc.)
  4. Click "OK" to apply the label
重要

Click "Clear Selection" between different labeling sessions to avoid mislabeling.

image.png

3.4 关闭 ROI 视图

  1. 关闭 "View All ROIs" 模态框
  2. 返回到主页面:标注与训练页面

第4步:重新训练模型

4.1 开始重新训练

  1. 点击 "Train Classification Model""Train Segmentation Model"
  2. 系统将使用所有现有数据以及您的新图像进行重新训练
  3. 监控训练进度

4.2 训练过程

  • 该模型同时从旧的和新的带标签数据中学习
  • 训练时间取决于数据总量
  • 测试前请等待训练完成

4.3 测试改进后的模型

  1. 使用 "Live Preview Mode" 来测试重新训练的模型
  2. 使用之前错误标记的相同图像进行测试
  3. 验证模型现在能够正确识别通过的良品

第5步:验证结果

5.1 使用新图像进行测试

  1. 捕捉类似部件的新图像
  2. 检查模型在边缘情况上的表现是否更好
  3. 验证之前能通过的图像现在是否正确通过

5.2 监控性能

  1. 关注是否出现新的误报或漏报
  2. 记录准确性的提升
  3. 记录任何剩余的问题以便未来重新训练

成功!您的模型已重新训练

您的改进的 AI 模型现在可以:

✅ 能更好地识别此前被误判为不合格的良品

✅ 能处理生产部件中的新变体

✅ 降低误判为不良的情况并提高准确性

✅ 适应制造过程中的变化

成功要点

数据质量

  • 添加错误分类的图像(包括误判为通过和误判为失败)
  • 标签保持一致:将良品标注为“Pass”,将不良品标注为“Fail”
  • 包含通过与不通过条件的多样化示例
  • 在不同的标注会话之间保持清晰的区分

何时重新训练

  • 误判为不良的情况增加(良品错误判定为不良)
  • 误判为通过的情况增加(不良品错误通过)
  • 生产中出现新的部件变体
  • 工艺变更影响零件外观
  • 材料或照明的季节性变化

最佳做法

  • 从小做起 - 一次添加 10-20 张图像
  • 每次重新训练后进行全面测试
  • 记录变更与改进
  • 在进行重大重新训练前备份工作模型
更多图像并不总是更好

在未审阅的情况下添加大量图像可能会让您的模型变差。您添加的每一张图像都会向 AI 学习某些东西。如果这些图像包含错误标注的部件、不一致的照明、模糊捕捉,或不代表实际生产条件的边缘情况,模型就会学习错误的模式,准确性下降。输入好数据,输出好结果。

在添加图像之前,请核实每张图像是否为:正确标注(通过实际上显示良品,未通过实际上显示缺陷)、代表真实生产条件清晰且聚焦(不过分模糊或曝光过度)、以及与模型需要学习的特征相关。如果重新训练后准确性下降,请先回顾最近添加的图像。删除少量错误示例通常比添加数十个新示例更有帮助。

后续步骤

在重新训练您的模型之后:

  1. 监控生产 以提升准确性
  2. 继续收集 有问题的图像以便未来重新训练
  3. 如有需要,设立定期重新训练计划
  4. 培训操作员在何时对图像进行重新训练标记
  5. 将重新训练过程文档化 以确保一致性

🔗 相关链接