Yolo 深圳
深セン
今すぐ参加
用語集

CPU

AIと機械学習におけるCPU重要な役割を探る。データ準備、推論、GPU/TPUとの比較におけるCPUの使用方法について学びます。

A Central Processing Unit (CPU) is the primary component of a computer that acts as its "brain," responsible for interpreting and executing instructions from hardware and software. In the context of artificial intelligence (AI), the CPU plays a fundamental role in data handling, system orchestration, and executing inference, particularly on edge devices where power efficiency is critical. While specialized hardware like GPUs are often associated with the heavy lifting of training deep learning models, the CPU remains indispensable for the overall machine learning (ML) pipeline.

AIワークフローにおけるCPUの役割

Although GPUs are celebrated for their massive parallelism during training, the CPU is the workhorse for many essential stages of the computer vision (CV) lifecycle. Its architecture, typically based on x86 (Intel, AMD) or ARM designs, is optimized for sequential processing and complex logic control.

  • Data Preprocessing: Before a neural network can learn, data must be prepared. CPUs excel at tasks such as file loading, data cleaning, and complex transformations using libraries like NumPy and OpenCV.
  • エッジ推論:実環境での展開において、大規模サーバー上でモデルを実行することは常に実現可能とは限りません。 CPUは、ノートパソコンやラズベリーパイ上でUltralytics Ultralytics を実行するなど、コンシューマー向けハードウェア上での効率的なモデル展開を可能にします。
  • Post-Processing: After a model outputs raw probabilities, the CPU often handles the final logic, such as Non-Maximum Suppression (NMS) in object detection, to filter out duplicate predictions and refine results.

CPU vs. GPU vs. TPU

ハードウェア環境を理解することは、機械学習オペレーション(MLOps)を最適化する上で極めて重要です。これらのプロセッサは、アーキテクチャと理想的なユースケースにおいて大きく異なります。

  • CPU: Designed for versatility and complex logic. It features a few powerful cores that process tasks sequentially. It is best for data augmentation, pipeline management, and low-latency inference on small batches.
  • GPU グラフィックス処理装置) もともとグラフィックス処理用に設計されたGPUは、 並列処理向けに設計された数千もの小型コアを備えています。 行列乗算CPUよりもはるかに高速に実行できるため、 モデルトレーニングの標準的な処理装置となっています。
  • TPU (Tensor Processing Unit): A specialized circuit (ASIC) developed by Google Cloud specifically for tensor math. While highly efficient for specific workloads, it lacks the general-purpose flexibility of a CPU.

実際のアプリケーション

CPUs are frequently the hardware of choice for applications where cost, availability, and energy consumption outweigh the need for massive raw throughput.

  1. Smart Security Cameras: In security alarm systems, cameras often process video feeds locally. A CPU-based object detection model can identify a person or vehicle and trigger an alert without sending video to the cloud, preserving bandwidth and user privacy.
  2. 産業オートメーション:工場現場では、 予知保全システムがCPUを用いて 機械からのセンサーデータを監視する。これらのシステムは振動や温度急上昇をリアルタイムで分析し、 故障を予測することで、高価なGPU 必要とせず 製造オートメーションを円滑に維持する。

Ultralytics CPU 上での推論実行

開発者はサーバーレス環境や低消費電力デバイスとの互換性を確認するため、モデルをCPU上でテストすることが多い。Ultralytics CPU容易にターゲットに設定でき、アプリケーションがどこでも確実に動作することを保証します。

以下の例は、軽量モデルを読み込み、CPU推論を実行する方法を示しています:

from ultralytics import YOLO

# Load the lightweight YOLO26 nano model
# Smaller models are optimized for faster CPU execution
model = YOLO("yolo26n.pt")

# Run inference on an image, explicitly setting the device to 'cpu'
results = model.predict("https://ultralytics.com/images/bus.jpg", device="cpu")

# Print the detection results (bounding boxes)
print(results[0].boxes.xywh)

To further improve performance on Intel CPUs, developers can export their models to the OpenVINO format, which optimizes the neural network structure specifically for x86 architecture. For managing datasets and orchestrating these deployments, tools like the Ultralytics Platform simplify the workflow from annotation to edge execution.

Ultralytics コミュニティに参加する

AIの未来を共に切り開きましょう。グローバルなイノベーターと繋がり、協力し、成長を。

今すぐ参加