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.
Слой отсева — это фундаментальный метод регуляризации, используемый в нейронных сетях (NN) для борьбы с распространенной проблемой переобучения. Когда модель обучается на конечном наборе примеров, она часто учится запоминать шум и конкретные детали обучающих данных, а не различать лежащие в основе общие закономерности. Такое запоминание приводит к высокой точности во время разработки, но к низкой производительности при работе с новыми, невиданными входами. Дроп-аут решает эту проблему путем случайной деактивации — или «выпадения» — части нейронов в слое на каждом этапе процесса обучения. Эта простая, но эффективная стратегия, представленная в основополагающей научной статье Сривастава и др., значительно повысила стабильность и производительность архитектур глубокого обучения (ДО).
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.
Во время вывода в реальном времени или на этапе тестирования слой отсева обычно деактивируется. Все нейроны остаются активными, чтобы использовать полную предсказательную способность обученной модели. Чтобы обеспечить соответствие общих значений активации значениям на этапе обучения, веса часто автоматически масштабируются фреймворком. Современные библиотеки, такие как PyTorch беспроблемно обрабатывают эти математические операции масштабирования , позволяя разработчикам сосредоточиться на архитектуре, а не на арифметике.
Для пользователей ultralytics пакет, применяя отсев к современной модели, такой как
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)
Дропдаут незаменим в различных областях искусственного интеллекта (ИИ), где модели используют большое количество параметров по отношению к доступным данным.
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.