머신러닝에서 정확도의 중요성, 계산 방법, 불균형 데이터세트의 제한 사항 및 모델 성능을 개선하는 방법을 알아보세요.
Accuracy serves as a fundamental benchmark in the evaluation of artificial intelligence systems, quantifying the percentage of correct predictions a model makes relative to the total number of predictions. In the context of machine learning and specifically supervised learning, this metric provides a high-level snapshot of how effectively an algorithm aligns with the ground truth provided during the training process. While it is the most intuitive measure of performance—answering the simple question, "How often is the model right?"—it acts as a primary indicator of a system's reliability before developers dive into more granular metrics.
While accuracy is an excellent starting point, it is most effective when applied to balanced training data where all classes are represented equally. For example, in a standard image classification task distinguishing between cats and dogs, if the dataset contains 500 images of each, accuracy is a trustworthy metric. However, challenges arise with imbalanced datasets, leading to the "accuracy paradox."
If a model is trained for fraud detection where only 1% of transactions are fraudulent, a model that simply predicts every transaction as "legitimate" would achieve 99% accuracy while failing completely at its intended task. To mitigate this, engineers often use the Ultralytics Platform to visualize dataset distribution and ensure models are not simply memorizing the majority class.
To fully understand model performance, it is crucial to differentiate accuracy from similar metrics:
While accuracy provides a global view of correctness, precision and recall offer insights into specific types of errors, such as false positives or false negatives.
The utility of accuracy extends across diverse industries, validating the reliability of computer vision and predictive models in critical environments.
In practical scenarios using Python, developers can easily measure the accuracy of a model using established libraries. The following example demonstrates how to validate a YOLO26 classification model to obtain its top-1 accuracy. Top-1 accuracy refers to the frequency with which the model's highest-probability prediction matches the correct label.
from ultralytics import YOLO
# Load a pre-trained YOLO26 classification model
model = YOLO("yolo26n-cls.pt")
# Validate the model on a standard dataset (e.g., MNIST)
metrics = model.val(data="mnist")
# Print the Top-1 Accuracy
print(f"Top-1 Accuracy: {metrics.top1:.4f}")
When a model suffers from low accuracy, several techniques can be employed to enhance performance. Engineers often utilize data augmentation to artificially increase the diversity of the training set, preventing the model from overfitting. Additionally, hyperparameter tuning—adjusting settings like the learning rate—can significantly impact convergence. For complex tasks, transfer learning allows a model to leverage knowledge from a large, pre-trained dataset (like ImageNet) to achieve higher accuracy on a smaller, specific dataset.