Learn how to use a [dropout layer](https://www.ultralytics.com/glossary/dropout-layer) to prevent overfitting. Discover how to train [YOLO26](https://docs.ultralytics.com/models/yolo26/) for more robust AI models.
Lớp dropout là một kỹ thuật điều chỉnh cơ bản được sử dụng trong mạng nơ-ron (NN) để chống lại vấn đề quá khớp (overfitting ) phổ biến. Khi một mô hình được huấn luyện trên một tập hợp hữu hạn các ví dụ, nó thường học cách ghi nhớ nhiễu và các chi tiết cụ thể của dữ liệu huấn luyện thay vì nhận biết các mẫu tổng quát cơ bản. Việc ghi nhớ này dẫn đến độ chính xác cao trong quá trình phát triển nhưng hiệu suất kém trên các đầu vào mới, chưa từng thấy. Dropout giải quyết vấn đề này bằng cách ngẫu nhiên vô hiệu hóa—hay "loại bỏ"—một phần các nơ-ron trong một lớp trong mỗi bước của quá trình huấn luyện. Chiến lược đơn giản nhưng hiệu quả này, được giới thiệu trong một bài báo nghiên cứu quan trọng của Srivastava và cộng sự , đã cải thiện đáng kể tính ổn định và hiệu suất của các kiến trúc học sâu (DL) .
The mechanism behind a dropout layer is intuitively similar to removing players from a sports team during practice to force the remaining players to work harder and not rely on a single star athlete. During the model training phase, the layer generates a probabilistic mask of zeros and ones. If the dropout rate is set to 0.5, approximately 50% of the neurons are temporarily ignored during that specific forward and backward pass. This process forces the remaining active neurons to learn robust features independently, preventing the network from relying too heavily on any single neuron—a phenomenon known in machine learning (ML) as feature co-adaptation.
Trong quá trình suy luận thời gian thực , hay giai đoạn kiểm thử, lớp dropout thường bị vô hiệu hóa. Tất cả các nơron vẫn hoạt động để tận dụng tối đa khả năng dự đoán của mô hình đã được huấn luyện. Để đảm bảo tổng giá trị kích hoạt vẫn nhất quán với giai đoạn huấn luyện, trọng số thường được framework tự động điều chỉnh tỷ lệ. Các thư viện hiện đại như PyTorch xử lý các phép toán điều chỉnh tỷ lệ này một cách liền mạch, cho phép các nhà phát triển tập trung vào kiến trúc hơn là các phép toán số học.
Đối với người dùng ultralytics gói phần mềm, áp dụng phương pháp bỏ qua dữ liệu (dropout) vào một mô hình hiện đại như...
YOLO26 is as simple as adjusting a training argument. This
is particularly useful when working with smaller datasets where the risk of overfitting is higher. By introducing
randomness, you can encourage the model to generalize better across diverse environments.
from ultralytics import YOLO
# Load the latest YOLO26 model (recommended for new projects)
model = YOLO("yolo26n.pt")
# Train the model with a custom dropout rate of 0.1 (10%)
# This encourages the model to learn more generalized features
results = model.train(data="coco8.yaml", epochs=50, dropout=0.1)
Dropout là một kỹ thuật không thể thiếu trong nhiều lĩnh vực trí tuệ nhân tạo (AI) nơi các mô hình sử dụng số lượng tham số lớn so với dữ liệu có sẵn.
While dropout is highly effective, it is often used alongside other techniques. It is distinct from data augmentation, which modifies the input images (e.g., flipping or rotating) rather than the network architecture itself. Similarly, it differs from batch normalization, which normalizes layer inputs to stabilize learning but does not explicitly deactivate neurons.
For complex projects, managing these hyperparameters can be challenging. The Ultralytics Platform simplifies this by providing tools to visualize training metrics, helping users determine if their dropout rates are effectively reducing validation loss. Whether you are building a custom image classification system or a sophisticated segmentation pipeline, understanding dropout is key to building resilient AI systems.