Meet YOLO26: next-gen vision AI.
Ultralytics
Back to Ultralytics Glossary

Catastrophic Forgetting

Discover how to prevent catastrophic forgetting in neural networks. Explore proven mitigation strategies when training your Ultralytics YOLO models.

Catastrophic forgetting, frequently referred to as catastrophic interference, is a widely studied phenomenon in machine learning where an artificial neural network abruptly loses previously learned information upon learning new tasks. When a model undergoes sequential training to adapt to a new dataset, optimization algorithms using backpropagation update the model weights. This process often inadvertently overwrites the mathematical representations required for earlier tasks. Consequently, an AI system highly optimized for its original purpose may experience severe performance degradation on those initial tasks if it is exclusively trained on new data without specific countermeasures.

Link to this sectionWhy Catastrophic Forgetting Happens#

In deep learning, a model's knowledge is stored across a distributed network of interconnected neurons. During fine-tuning, optimization functions like Stochastic Gradient Descent adjust these connections to minimize the error on the new data. If the new training dataset does not contain examples of the original classes, the optimization process shifts the weights toward the new data distribution, effectively erasing the "memory" of the old distribution. Recent studies on structural shift indicate that this internal collapse fundamentally limits the ability of modern neural networks to achieve human-like, lifelong learning out-of-the-box.

It is crucial to contrast catastrophic forgetting with other AI concepts:

  • Catastrophic Forgetting vs. Model Collapse: While forgetting occurs due to learning new tasks incrementally, model collapse is a gradual degradation of performance on the same task when a model recursively trains on synthetic data generated by other AI models.
  • Catastrophic Forgetting vs. Continual Learning: Continual learning is the overarching research methodology aimed at solving catastrophic forgetting. Continual learning algorithms attempt to enable models to sequentially acquire new knowledge without forgetting.

Link to this sectionReal-World Examples#

Catastrophic forgetting poses a significant challenge across various AI domains operating in dynamic real-world environments:

  • Autonomous Systems: In perception pipelines for autonomous vehicles, a computer vision system initially trained to recognize pedestrians and standard traffic signs might be fine-tuned to recognize new, region-specific construction signs. Without safeguards, the system may suddenly struggle to reliably detect pedestrians, creating a severe safety risk.
  • Language and Cognitive AI: When customizing large language models for domain-specific tasks—such as medical diagnostics—the model might forget its conversational alignment or general reasoning skills. A recent comparative analysis on LLMs shows that standard fine-tuning on highly specialized texts often erodes prior safety alignment, causing models to lose their primary instruction-following capabilities.

Link to this sectionOvercoming Catastrophic Forgetting#

AI engineers utilize several strategies to mitigate this issue and maintain an optimal plasticity-stability dilemma:

Link to this sectionImplementation Example in Vision AI#

When adapting Ultralytics YOLO for a new object detection task, freezing layers is an effective, accessible approach. The following example demonstrates how to train an Ultralytics YOLO26 model on a new dataset while preventing catastrophic forgetting by freezing the initial 10 layers.

from ultralytics import YOLO

# Load a pretrained Ultralytics YOLO26 model
model = YOLO("yolo26n.pt")

# Train on a combined dataset while freezing core backbone layers
# The 'freeze=10' argument prevents catastrophic forgetting of foundational visual features
results = model.train(data="combined_dataset.yaml", epochs=20, freeze=10, lr0=0.001)

# Evaluate the model to ensure it retains performance on old and new tasks
metrics = model.val()

Explore solutions

Real-time AI that works with your team

AI in Robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.

Learn more
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.

Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.

Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.

Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.

Learn more
Real-time AI that works with your operation

AI in Automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.

Learn more
Real-time AI tailored to your operation

AI in Agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.

Learn more
Real-time AI that works with your team

AI in Robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.

Learn more
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.

Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.

Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.

Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.

Learn more
Real-time AI that works with your operation

AI in Automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.

Learn more
Real-time AI tailored to your operation

AI in Agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.

Learn more
Real-time AI that works with your team

AI in Robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.

Learn more
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.

Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.

Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.

Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.

Learn more
Real-time AI that works with your operation

AI in Automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.

Learn more
Real-time AI tailored to your operation

AI in Agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.

Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning