콘텐츠로 건너뛰기

모델 평가 및 미세 조정에 대한 인사이트

소개

컴퓨터 비전 모델을 학습시킨 후에는 최적의 성능을 발휘하도록 평가하고 개선하는 것이 필수적입니다. 모델을 훈련하는 것만으로는 충분하지 않습니다. 모델이 정확하고 효율적인지, 컴퓨터 비전 프로젝트의 목표를 달성하는지 확인해야 합니다. 모델을 평가하고 미세 조정함으로써 약점을 파악하고 정확도를 개선하며 전반적인 성능을 향상시킬 수 있습니다.

이 가이드에서는 컴퓨터 비전 프로젝트의단계에 보다 쉽게 접근할 수 있도록 모델 평가 및 미세 조정에 대한 인사이트를 공유합니다. 평가 메트릭을 이해하고 미세 조정 기술을 구현하는 방법을 설명하여 모델의 기능을 향상시키는 데 필요한 지식을 제공합니다.

메트릭을 사용하여 모델 성능 평가

모델의 성능을 평가하면 모델이 얼마나 효과적으로 작동하는지 이해하는 데 도움이 됩니다. 성능을 측정하기 위해 다양한 지표가 사용됩니다. 이러한 성능 지표는 모델이 의도한 목표를 달성할 수 있도록 개선 방향을 제시할 수 있는 명확한 수치 인사이트를 제공합니다. 몇 가지 주요 지표를 자세히 살펴보겠습니다.

신뢰 점수

신뢰도 점수는 감지된 객체가 특정 클래스에 속한다는 모델의 확신을 나타냅니다. 0에서 1 사이의 범위로, 점수가 높을수록 신뢰도가 높음을 나타냅니다. 신뢰도 점수는 예측을 필터링하는 데 도움이 되며, 신뢰도 점수가 지정된 임계값 이상인 탐지만 유효한 것으로 간주됩니다.

빠른 팁: 추론을 실행할 때 예측이 표시되지 않고 다른 모든 항목을 확인했다면 신뢰도 점수를 낮춰 보세요. 임계값이 너무 높아서 모델이 유효한 예측을 무시하는 경우가 있습니다. 점수를 낮추면 모델이 더 많은 가능성을 고려할 수 있습니다. 이렇게 하면 프로젝트 목표에 부합하지 않을 수도 있지만 모델의 성능을 확인하고 미세 조정 방법을 결정할 수 있는 좋은 방법입니다.

유니온을 통한 교차로

Intersection over Union (IoU) is a metric in object detection that measures how well the predicted bounding box overlaps with the ground truth bounding box. IoU values range from 0 to 1, where one stands for a perfect match. IoU is essential because it measures how closely the predicted boundaries match the actual object boundaries.

유니온 개요를 통한 교차점

Mean Average Precision

Mean Average Precision (mAP) is a way to measure how well an object detection model performs. It looks at the precision of detecting each object class, averages these scores, and gives an overall number that shows how accurately the model can identify and classify objects.

두 가지 특정 맵 메트릭에 집중해 보겠습니다:

  • mAP@.5: Measures the average precision at a single IoU (Intersection over Union) threshold of 0.5. This metric checks if the model can correctly find objects with a looser accuracy requirement. It focuses on whether the object is roughly in the right place, not needing perfect placement. It helps see if the model is generally good at spotting objects.
  • mAP@.5:.95: 0.5에서 0.95까지 0.05 단위로 여러 IoU 임계값에서 계산된 mAP 값의 평균을 구합니다. 이 메트릭은 더 상세하고 엄격합니다. 모델이 다양한 수준의 엄격함에서 얼마나 정확하게 물체를 찾을 수 있는지를 더 자세히 파악할 수 있으며, 특히 정밀한 물체 감지가 필요한 애플리케이션에 유용합니다.

다른 mAP 지표로는 0.75의 더 엄격한 IoU 임계값을 사용하는 mAP@0.75, 다양한 크기의 오브젝트에서 정밀도를 평가하는 mAP@small, medium, large가 있습니다.

평균 정밀도 개요

Evaluating YOLO11 Model Performance

With respect to YOLO11, you can use the validation mode to evaluate the model. Also, be sure to take a look at our guide that goes in-depth into YOLO11 performance metrics and how they can be interpreted.

커뮤니티에서 자주 묻는 질문

When evaluating your YOLO11 model, you might run into a few hiccups. Based on common community questions, here are some tips to help you get the most out of your YOLO11 model:

가변 이미지 크기 처리

Evaluating your YOLO11 model with images of different sizes can help you understand its performance on diverse datasets. Using the rect=true validation parameter, YOLO11 adjusts the network's stride for each batch based on the image sizes, allowing the model to handle rectangular images without forcing them to a single size.

그리고 imgsz 유효성 검사 매개변수는 이미지 크기 조정의 최대 치수를 설정하며, 기본값은 640입니다. 데이터 세트의 최대 크기와 사용 가능한 GPU 메모리에 따라 이를 조정할 수 있습니다. 심지어 imgsz 설정합니다, rect=true 를 사용하면 모델이 보폭을 동적으로 조정하여 다양한 이미지 크기를 효과적으로 관리할 수 있습니다.

Accessing YOLO11 Metrics

If you want to get a deeper understanding of your YOLO11 model's performance, you can easily access specific evaluation metrics with a few lines of Python code. The code snippet below will let you load your model, run an evaluation, and print out various metrics that show how well your model is doing.

사용법

from ultralytics import YOLO

# Load the model
model = YOLO("yolo11n.pt")

# Run the evaluation
results = model.val(data="coco8.yaml")

# Print specific metrics
print("Class indices with average precision:", results.ap_class_index)
print("Average precision for all classes:", results.box.all_ap)
print("Average precision:", results.box.ap)
print("Average precision at IoU=0.50:", results.box.ap50)
print("Class indices for average precision:", results.box.ap_class_index)
print("Class-specific results:", results.box.class_result)
print("F1 score:", results.box.f1)
print("F1 score curve:", results.box.f1_curve)
print("Overall fitness score:", results.box.fitness)
print("Mean average precision:", results.box.map)
print("Mean average precision at IoU=0.50:", results.box.map50)
print("Mean average precision at IoU=0.75:", results.box.map75)
print("Mean average precision for different IoU thresholds:", results.box.maps)
print("Mean results for different metrics:", results.box.mean_results)
print("Mean precision:", results.box.mp)
print("Mean recall:", results.box.mr)
print("Precision:", results.box.p)
print("Precision curve:", results.box.p_curve)
print("Precision values:", results.box.prec_values)
print("Specific precision metrics:", results.box.px)
print("Recall:", results.box.r)
print("Recall curve:", results.box.r_curve)

The results object also includes speed metrics like preprocess time, inference time, loss, and postprocess time. By analyzing these metrics, you can fine-tune and optimize your YOLO11 model for better performance, making it more effective for your specific use case.

미세 조정은 어떻게 이루어지나요?

미세 조정에는 사전 학습된 모델을 사용하여 특정 작업이나 데이터 세트의 성능을 개선하기 위해 매개변수를 조정하는 작업이 포함됩니다. 모델 재학습이라고도 하는 이 프로세스를 통해 모델은 실제 애플리케이션에서 접하게 될 특정 데이터에 대한 결과를 더 잘 이해하고 예측할 수 있습니다. 모델 평가를 기반으로 모델을 재학습하여 최적의 결과를 얻을 수 있습니다.

모델 미세 조정을 위한 팁

모델을 미세 조정한다는 것은 최적의 성능을 달성하기 위해 몇 가지 중요한 매개변수와 기술에 세심한 주의를 기울이는 것을 의미합니다. 다음은 이 과정을 안내하는 몇 가지 필수 팁입니다.

Starting With a Higher Learning Rate

Usually, during the initial training epochs, the learning rate starts low and gradually increases to stabilize the training process. However, since your model has already learned some features from the previous dataset, starting with a higher learning rate right away can be more beneficial.

When evaluating your YOLO11 model, you can set the warmup_epochs 유효성 검사 매개변수를 warmup_epochs=0 를 설정하여 학습률이 너무 높게 시작되는 것을 방지할 수 있습니다. 이 과정을 따라가면 제공된 가중치에서 새로운 데이터의 뉘앙스에 맞춰 학습이 계속됩니다.

작은 물체를 위한 이미지 타일링

Image tiling can improve detection accuracy for small objects. By dividing larger images into smaller segments, such as splitting 1280x1280 images into multiple 640x640 segments, you maintain the original resolution, and the model can learn from high-resolution fragments. When using YOLO11, make sure to adjust your labels for these new segments correctly.

커뮤니티 참여

Sharing your ideas and questions with other computer vision enthusiasts can inspire creative solutions to roadblocks in your projects. Here are some excellent ways to learn, troubleshoot, and connect.

도움말 및 지원 찾기

  • GitHub Issues: Explore the YOLO11 GitHub repository and use the Issues tab to ask questions, report bugs, and suggest features. The community and maintainers are available to assist with any issues you encounter.
  • Ultralytics 디스코드 서버: Ultralytics Discord 서버에 가입하여 다른 사용자 및 개발자와 소통하고, 지원을 받고, 지식을 공유하고, 아이디어를 브레인스토밍하세요.

공식 문서

  • Ultralytics YOLO11 Documentation: Check out the official YOLO11 documentation for comprehensive guides and valuable insights on various computer vision tasks and projects.

최종 생각

Evaluating and fine-tuning your computer vision model are important steps for successful model deployment. These steps help make sure that your model is accurate, efficient, and suited to your overall application. The key to training the best model possible is continuous experimentation and learning. Don't hesitate to tweak parameters, try new techniques, and explore different datasets. Keep experimenting and pushing the boundaries of what's possible!

자주 묻는 질문

What are the key metrics for evaluating YOLO11 model performance?

To evaluate YOLO11 model performance, important metrics include Confidence Score, Intersection over Union (IoU), and Mean Average Precision (mAP). Confidence Score measures the model's certainty for each detected object class. IoU evaluates how well the predicted bounding box overlaps with the ground truth. Mean Average Precision (mAP) aggregates precision scores across classes, with mAP@.5 and mAP@.5:.95 being two common types for varying IoU thresholds. Learn more about these metrics in our YOLO11 performance metrics guide.

How can I fine-tune a pre-trained YOLO11 model for my specific dataset?

Fine-tuning a pre-trained YOLO11 model involves adjusting its parameters to improve performance on a specific task or dataset. Start by evaluating your model using metrics, then set a higher initial learning rate by adjusting the warmup_epochs 매개변수를 0으로 설정하여 즉각적인 안정성을 확보하세요. 다음과 같은 매개 변수를 사용하세요. rect=true 를 사용하여 다양한 이미지 크기를 효과적으로 처리할 수 있습니다. 자세한 지침은 다음 섹션을 참조하세요. fine-tuning YOLO11 models.

How can I handle variable image sizes when evaluating my YOLO11 model?

평가 중에 가변 이미지 크기를 처리하려면 rect=true parameter in YOLO11, which adjusts the network's stride for each batch based on image sizes. The imgsz 매개변수는 이미지 크기 조정의 최대 치수를 설정하며 기본값은 640입니다. 조정 imgsz 를 데이터 세트와 GPU 메모리에 맞게 조정하세요. 자세한 내용은 가변 이미지 크기 처리에 대한 섹션.

What practical steps can I take to improve mean average precision for my YOLO11 model?

Improving mean average precision (mAP) for a YOLO11 model involves several steps:

  1. Tuning Hyperparameters: Experiment with different learning rates, batch sizes, and image augmentations.
  2. Data Augmentation: Use techniques like Mosaic and MixUp to create diverse training samples.
  3. Image Tiling: Split larger images into smaller tiles to improve detection accuracy for small objects. Refer to our detailed guide on model fine-tuning for specific strategies.

How do I access YOLO11 model evaluation metrics in Python?

You can access YOLO11 model evaluation metrics using Python with the following steps:

사용법

from ultralytics import YOLO

# Load the model
model = YOLO("yolo11n.pt")

# Run the evaluation
results = model.val(data="coco8.yaml")

# Print specific metrics
print("Class indices with average precision:", results.ap_class_index)
print("Average precision for all classes:", results.box.all_ap)
print("Mean average precision at IoU=0.50:", results.box.map50)
print("Mean recall:", results.box.mr)

Analyzing these metrics helps fine-tune and optimize your YOLO11 model. For a deeper dive, check out our guide on YOLO11 metrics.

📅 Created 3 months ago ✏️ Updated 22 days ago

댓글