> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 Edge Impulse 用自定义数据微调 AI 模型

> 使用 Edge Impulse 在 Qualcomm Dragonwing 设备上构建、训练和部署自定义 AI 模型，并支持硬件加速的 NPU 推理。

Edge Impulse 是一个端到端平台，用于在 Qualcomm®
Dragonwing™ 设备上构建边缘 AI 模型。

它支持数据集创建、模型训练和硬件加速部署。
该平台支持音频、图像、传感器数据以及多种格式的自定义模型。

## 前提条件

* 确保您已为开发板完成设备设置。
* 确保您已与 Qualcomm 评估套件建立 SSH 连接。连接后，可通过其配置的 IP 地址访问评估套件。推送模型和产物以运行 AI/ML 应用时需要该 IP 地址。

## 训练 AI 模型

要开始使用 Edge Impulse 构建模型，请完成以下步骤：

1. 在 [Edge Impulse](https://studio.edgeimpulse.com) 注册一个免费的开发者账号。

2. 在设备上安装 Edge Impulse 命令行界面及依赖项。

   ```shell theme={null}
   wget https://cdn.edgeimpulse.com/firmware/linux/setup-edge-impulse-qc-linux.sh
   ```

   ```shell theme={null}
   sh setup-edge-impulse-qc-linux.sh
   ```

   ```shell theme={null}
   source ~/.profile
   ```

3. 将设备连接到 Edge Impulse。

   ```shell theme={null}
   edge-impulse-linux
   ```

   向导将启动并提示您登录和选择一个 Edge Impulse 项目。

   <Tip>
     要切换到其他项目或使用其他摄像头，请使用 `--clean` 参数重新运行该命令。
   </Tip>

4. 验证设备已连接到 Edge Impulse。

   a. 进入您的 Edge Impulse 项目并选择 **Devices**。

   b. 确认您的设备出现在列表中。

   <img src="https://mintcdn.com/qualcomm-prod/Sb9VrG0-ITL9uwLF/Key-Documents/AI-Developer-Workflow/_images/ai-edgeimpulse-connected-devices.png?fit=max&auto=format&n=Sb9VrG0-ITL9uwLF&q=85&s=d77a6ceaee905892243a3cc462b2a3e3" alt="Edge Impulse 已连接设备列表" width="744" height="104" data-path="Key-Documents/AI-Developer-Workflow/_images/ai-edgeimpulse-connected-devices.png" />

5. 要构建您的第一个 AI 模型，请按照 [Edge Impulse 教程](https://docs.edgeimpulse.com/tutorials)之一操作。

6. 要运行模型，请在开发板的终端或 SSH 会话中运行以下命令：

   ```shell theme={null}
   edge-impulse-linux-runner
   ```

   该命令会自动构建、下载并在 NPU 上运行模型。它仅支持量化模型。要手动下载 EIM 文件，请转到 Edge Impulse 项目的 **Deployment** 页面并搜索 `Linux (AARCH64 with Qualcomm QNN)`。

## 使用自有模型

Edge Impulse 还支持以 SavedModel、
ONNX、LiteRT、TensorRT 或 scikit-learn 等格式引入自有模型（BYOM）。通过 BYOM 部署的模型在
Qualcomm Dragonwing 平台上得到全面支持，量化模型可使用 NPU 加速。

如果您的模型尚未量化，可以上传具有代表性的数据集以提升性能。

要在 Qualcomm Dragonwing 设备上使用自有模型，请参见
[Edge Impulse > Bring Your Own Model](https://docs.edgeimpulse.com/studio/projects/dashboard/byom)。
