콘텐츠로 건너뛰기

Advanced YOLO11 Experiment Tracking with DVCLive

Experiment tracking in machine learning is critical to model development and evaluation. It involves recording and analyzing various parameters, metrics, and outcomes from numerous training runs. This process is essential for understanding model performance and making data-driven decisions to refine and optimize models.

Integrating DVCLive with Ultralytics YOLO11 transforms the way experiments are tracked and managed. This integration offers a seamless solution for automatically logging key experiment details, comparing results across different runs, and visualizing data for in-depth analysis. In this guide, we'll understand how DVCLive can be used to streamline the process.

DVCLive

DVCLive 개요

DVCLive, developed by DVC, is an innovative open-source tool for experiment tracking in machine learning. Integrating seamlessly with Git and DVC, it automates the logging of crucial experiment data like model parameters and training metrics. Designed for simplicity, DVCLive enables effortless comparison and analysis of multiple runs, enhancing the efficiency of machine learning projects with intuitive data visualization and analysis tools.

YOLO11 Training with DVCLive

YOLO11 training sessions can be effectively monitored with DVCLive. Additionally, DVC provides integral features for visualizing these experiments, including the generation of a report that enables the comparison of metric plots across all tracked experiments, offering a comprehensive view of the training process.

설치

필요한 패키지를 설치하려면 실행합니다:

설치

# Install the required packages for YOLO11 and DVCLive
pip install ultralytics dvclive

For detailed instructions and best practices related to the installation process, be sure to check our YOLO11 Installation guide. While installing the required packages for YOLO11, if you encounter any difficulties, consult our Common Issues guide for solutions and tips.

DVCLive 구성

필요한 패키지를 설치했으면 다음 단계는 필요한 자격 증명을 사용하여 환경을 설정하고 구성하는 것입니다. 이 설정을 통해 기존 워크플로우에 DVCLive를 원활하게 통합할 수 있습니다.

Git은 코드와 DVCLive 구성 모두에 대한 버전 관리에 중요한 역할을 하므로 Git 리포지토리를 초기화하는 것부터 시작하세요.

초기 환경 설정

# Initialize a Git repository
git init -q

# Configure Git with your details
git config --local user.email "you@example.com"
git config --local user.name "Your Name"

# Initialize DVCLive in your project
dvc init -q

# Commit the DVCLive setup to your Git repository
git commit -m "DVC init"

이 명령에서 "you@example.com"를 Git 계정과 연결된 이메일 주소로, "사용자 이름"을 Git 계정 사용자 이름으로 바꿔야 합니다.

사용법

Before diving into the usage instructions, be sure to check out the range of YOLO11 models offered by Ultralytics. This will help you choose the most appropriate model for your project requirements.

Training YOLO11 Models with DVCLive

Start by running your YOLO11 training sessions. You can use different model configurations and training parameters to suit your project needs. For instance:

# Example training commands for YOLO11 with varying configurations
yolo train model=yolo11n.pt data=coco8.yaml epochs=5 imgsz=512
yolo train model=yolo11n.pt data=coco8.yaml epochs=5 imgsz=640

Adjust the model, data, epochs, and imgsz parameters according to your specific requirements. For a detailed understanding of the model training process and best practices, refer to our YOLO11 Model Training guide.

DVCLive로 실험 모니터링

DVCLive enhances the training process by enabling the tracking and visualization of key metrics. When installed, Ultralytics YOLO11 automatically integrates with DVCLive for experiment tracking, which you can later analyze for performance insights. For a comprehensive understanding of the specific performance metrics used during training, be sure to explore our detailed guide on performance metrics.

결과 분석

After your YOLO11 training sessions are complete, you can leverage DVCLive's powerful visualization tools for in-depth analysis of the results. DVCLive's integration ensures that all training metrics are systematically logged, facilitating a comprehensive evaluation of your model's performance.

분석을 시작하려면 DVC의 API를 사용하여 실험 데이터를 추출한 다음, 이를 Pandas로 처리하여 보다 쉽게 처리하고 시각화할 수 있습니다:

import dvc.api
import pandas as pd

# Define the columns of interest
columns = ["Experiment", "epochs", "imgsz", "model", "metrics.mAP50-95(B)"]

# Retrieve experiment data
df = pd.DataFrame(dvc.api.exp_show(), columns=columns)

# Clean the data
df.dropna(inplace=True)
df.reset_index(drop=True, inplace=True)

# Display the DataFrame
print(df)

The output of the code snippet above provides a clear tabular view of the different experiments conducted with YOLO11 models. Each row represents a different training run, detailing the experiment's name, the number of epochs, image size (imgsz), the specific model used, and the mAP50-95(B) metric. This metric is crucial for evaluating the model's accuracy, with higher values indicating better performance.

Plotly로 결과 시각화하기

실험 결과를 보다 대화형적이고 시각적으로 분석하려면 Plotly의 평행 좌표 플롯을 사용할 수 있습니다. 이 유형의 플롯은 다양한 매개변수와 메트릭 간의 관계와 절충점을 이해하는 데 특히 유용합니다.

from plotly.express import parallel_coordinates

# Create a parallel coordinates plot
fig = parallel_coordinates(df, columns, color="metrics.mAP50-95(B)")

# Display the plot
fig.show()

위 코드 스니펫의 출력은 시대, 이미지 크기, 모델 유형 및 해당 mAP50-95(B) 점수 간의 관계를 시각적으로 나타내는 플롯을 생성하여 실험 데이터의 추세와 패턴을 파악할 수 있게 해줍니다.

DVC로 비교 비주얼리제이션 생성

DVC는 실험을 위한 비교 플롯을 생성하는 데 유용한 명령을 제공합니다. 이는 다양한 훈련 실행에 걸쳐 여러 모델의 성능을 비교하는 데 특히 유용할 수 있습니다.

# Generate DVC comparative plots
dvc plots diff $(dvc exp list --names-only)

After executing this command, DVC generates plots comparing the metrics across different experiments, which are saved as HTML files. Below is an example image illustrating typical plots generated by this process. The image showcases various graphs, including those representing mAP, recall, precision, loss values, and more, providing a visual overview of key performance metrics:

DVCLive 플롯

DVC 플롯 표시

주피터 노트북을 사용 중이고 생성된 DVC 플롯을 표시하려면 IPython 표시 기능을 사용하면 됩니다.

from IPython.display import HTML

# Display the DVC plots as HTML
HTML(filename="./dvc_plots/index.html")

이 코드는 시각화된 실험 데이터를 쉽고 편리하게 분석할 수 있는 방법을 제공하기 위해 DVC 플롯이 포함된 HTML 파일을 Jupyter 노트북에서 바로 렌더링합니다.

데이터 기반 의사 결정

Use the insights gained from these visualizations to make informed decisions about model optimizations, hyperparameter tuning, and other modifications to enhance your model's performance.

실험 반복하기

분석 결과를 바탕으로 실험을 반복합니다. 모델 구성, 학습 매개변수 또는 데이터 입력을 조정하고 학습 및 분석 프로세스를 반복합니다. 이러한 반복적인 접근 방식은 최상의 성능을 위해 모델을 개선하는 데 핵심적인 역할을 합니다.

요약

This guide has led you through the process of integrating DVCLive with Ultralytics' YOLO11. You have learned how to harness the power of DVCLive for detailed experiment monitoring, effective visualization, and insightful analysis in your machine learning endeavors.

사용법에 대한 자세한 내용은 DVCLive의 공식 문서를 참조하세요.

또한, 유용한 리소스와 인사이트를 모아놓은 Ultralytics 통합 가이드 페이지를 방문하여 Ultralytics 의 더 많은 통합과 기능을 살펴보세요.

자주 묻는 질문

How do I integrate DVCLive with Ultralytics YOLO11 for experiment tracking?

Integrating DVCLive with Ultralytics YOLO11 is straightforward. Start by installing the necessary packages:

설치

pip install ultralytics dvclive

그런 다음 Git 리포지토리를 초기화하고 프로젝트에서 DVCLive를 구성합니다:

초기 환경 설정

git init -q
git config --local user.email "you@example.com"
git config --local user.name "Your Name"
dvc init -q
git commit -m "DVC init"

Follow our YOLO11 Installation guide for detailed setup instructions.

Why should I use DVCLive for tracking YOLO11 experiments?

Using DVCLive with YOLO11 provides several advantages, such as:

  • 자동화된 로깅: DVCLive는 모델 파라미터 및 메트릭과 같은 주요 실험 세부 정보를 자동으로 기록합니다.
  • 간편한 비교: 여러 실행에서 결과를 쉽게 비교할 수 있습니다.
  • 시각화 도구: 심층 분석을 위해 DVCLive의 강력한 데이터 시각화 기능을 활용합니다.

For further details, refer to our guide on YOLO11 Model Training and YOLO Performance Metrics to maximize your experiment tracking efficiency.

How can DVCLive improve my results analysis for YOLO11 training sessions?

After completing your YOLO11 training sessions, DVCLive helps in visualizing and analyzing the results effectively. Example code for loading and displaying experiment data:

import dvc.api
import pandas as pd

# Define columns of interest
columns = ["Experiment", "epochs", "imgsz", "model", "metrics.mAP50-95(B)"]

# Retrieve experiment data
df = pd.DataFrame(dvc.api.exp_show(), columns=columns)

# Clean data
df.dropna(inplace=True)
df.reset_index(drop=True, inplace=True)

# Display DataFrame
print(df)

결과를 대화형으로 시각화하려면 Plotly의 평행 좌표 플롯을 사용하세요:

from plotly.express import parallel_coordinates

fig = parallel_coordinates(df, columns, color="metrics.mAP50-95(B)")
fig.show()

Refer to our guide on YOLO11 Training with DVCLive for more examples and best practices.

What are the steps to configure my environment for DVCLive and YOLO11 integration?

To configure your environment for a smooth integration of DVCLive and YOLO11, follow these steps:

  1. 필수 패키지 설치: 사용 pip install ultralytics dvclive.
  2. Git 리포지토리 초기화: 실행 git init -q.
  3. DVCLive 설정: 실행 dvc init -q.
  4. Git에 커밋: 사용 git commit -m "DVC init".

이 단계는 실험 추적을 위한 적절한 버전 관리 및 설정을 보장합니다. 자세한 구성 내용은 구성 가이드를 참조하세요.

How do I visualize YOLO11 experiment results using DVCLive?

DVCLive offers powerful tools to visualize the results of YOLO11 experiments. Here's how you can generate comparative plots:

비교 플롯 생성

dvc plots diff $(dvc exp list --names-only)

이러한 플롯을 Jupyter 노트북에 표시하려면 다음을 사용하세요:

from IPython.display import HTML

# Display plots as HTML
HTML(filename="./dvc_plots/index.html")

These visualizations help identify trends and optimize model performance. Check our detailed guides on YOLO11 Experiment Analysis for comprehensive steps and examples.

📅 Created 10 months ago ✏️ Updated 22 days ago

댓글