Ultralytics YOLO27: Join the waitlist.
License YOLO
Back to Ultralytics Glossary

Catastrophic Forgetting

Catastrophic forgetting is the abrupt loss of earlier skills when a neural network trains on new data. Covers why it happens, examples, and mitigations.

Catastrophic forgetting, also called catastrophic interference, is the abrupt loss of previously learned skills when a neural network is trained on new data that no longer includes examples of the old task. Training updates the same shared model weights that stored the old knowledge, and nothing in the new loss rewards keeping it, so accuracy on the original task can collapse within a few hundred updates. McCloskey and Cohen described the effect in 1989 in networks that learned arithmetic facts in sequence, and it remains the central obstacle for continual learning and a routine risk in fine-tuning.

Why Catastrophic Forgetting Happens#

Knowledge in a neural network is distributed: each weight contributes to many outputs, and each output depends on many weights. Training on a new task moves the weights wherever its loss falls fastest, with no term that measures the old task, so the model drifts out of the region where the old task worked. Classification sharpens the effect at the output layer. When only new classes appear in the training data, every step pushes the scores of the absent classes down, until the model stops predicting them at all. A small network trained on handwritten digits 0–4 and then on digits 5–9 shows this, along with how replaying a small sample of old data limits it:

import torch
from sklearn.datasets import load_digits

torch.manual_seed(0)
X, y = load_digits(return_X_y=True)
X, y = torch.tensor(X / 16, dtype=torch.float32), torch.tensor(y)
train = torch.arange(len(y)) < 1400  # hold out the last 397 images for testing
task_a, task_b, test_a = train & (y < 5), train & (y >= 5), ~train & (y < 5)
replay = task_a & (torch.rand(len(y)) < 0.1)  # keep 10% of task A for replay

for name, second_task in [("task B only", task_b), ("task B + 10% replay", task_b | replay)]:
    model = torch.nn.Sequential(torch.nn.Linear(64, 64), torch.nn.ReLU(), torch.nn.Linear(64, 10))
    optimizer = torch.optim.Adam(model.parameters(), lr=0.01)
    # Train on digits 0-4 (task A), then on digits 5-9 (task B)
    for mask in (task_a, second_task):
        for _ in range(200):
            loss = torch.nn.functional.cross_entropy(model(X[mask]), y[mask])
            optimizer.zero_grad()
            loss.backward()
            optimizer.step()
        accuracy = (model(X[test_a]).argmax(1) == y[test_a]).float().mean()
        print(f"{name}: held-out digits 0-4 accuracy {accuracy:.1%}")

After task A, the network classifies 92.4% of the 198 held-out 0–4 digits correctly. Training on digits 5–9 alone drops that to 0.0%, because the model now predicts only the new classes. Mixing 66 replayed task A images into the second stage keeps 74.7% accuracy.

Catastrophic Forgetting in Practice#

  • Continual learning: The research field that studies how to learn a sequence of tasks without forgetting earlier ones. Catastrophic forgetting is the problem it addresses.
  • Model collapse: A gradual loss of quality and diversity when models are trained on data generated by earlier models, even on the same task.
  • Overfitting: Fitting the noise of the current training data so closely that performance on new data from the same task drops. Forgetting is the loss of a previous task.
  • Machine unlearning: Deliberately removing specific data or knowledge from a trained model, the intentional counterpart of forgetting.
  • Stability-plasticity dilemma: The trade-off between keeping old knowledge stable and staying plastic enough to learn new tasks, which every mitigation balances differently.

How to Reduce Catastrophic Forgetting#

Mitigations fall into three families, replay, regularization, and parameter isolation, and the constraints of a project usually decide which one applies:

  • Replay: Mixing stored examples of earlier tasks into new training is the most reliable fix, as the digit example shows. For YOLO26 detectors, Ultralytics data YAML files accept a list of training image folders, so replay means listing a sample of the original images beside the new ones under one combined class list.
  • Regularization: Elastic weight consolidation (EWC) penalizes changes to each weight in proportion to its importance for earlier tasks, estimated from the Fisher information. Learning without Forgetting uses knowledge distillation instead, training the model to keep matching its old outputs on the new data.
  • Parameter isolation: Freezing shared layers, adding task-specific heads, or training adapters such as LoRA leaves the original weights untouched. On programming and mathematics tasks, LoRA learned less than full fine-tuning but forgot less, and full fine-tuning learned weight changes with 10 to 100 times higher rank than typical LoRA configurations.

Explore solutions

Computer vision in sports

Computer vision in sports

Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Transform drone and aerial imagery into real-time insights for agriculture, aquaculture, environmental monitoring, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Bring vision AI to aerial monitoring with Ultralytics YOLO models. Power drones, aerospace workflows, environmental conservation & geospatial industries with computer vision solutions.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision 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
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

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

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision 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
Computer vision in agriculture

Computer vision 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
Computer vision in sports
Computer vision in sports
Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery
Computer vision for aerial imagery
Transform drone and aerial imagery into real-time insights for agriculture, aquaculture, environmental monitoring, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace
Computer vision in aerospace
Bring vision AI to aerial monitoring with Ultralytics YOLO models. Power drones, aerospace workflows, environmental conservation & geospatial industries with computer vision solutions.
Learn more
Computer vision in security
Computer vision in security
Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics
Computer vision 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
Computer vision in logistics
Computer vision in logistics
Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail
Computer vision in retail
Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare
Computer vision in healthcare
Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing
Computer vision in manufacturing
Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive
Computer vision 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
Computer vision in agriculture
Computer vision 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
Computer vision in sports
Computer vision in sports
Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery
Computer vision for aerial imagery
Transform drone and aerial imagery into real-time insights for agriculture, aquaculture, environmental monitoring, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace
Computer vision in aerospace
Bring vision AI to aerial monitoring with Ultralytics YOLO models. Power drones, aerospace workflows, environmental conservation & geospatial industries with computer vision solutions.
Learn more
Computer vision in security
Computer vision in security
Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics
Computer vision 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
Computer vision in logistics
Computer vision in logistics
Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail
Computer vision in retail
Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare
Computer vision in healthcare
Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing
Computer vision in manufacturing
Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive
Computer vision 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
Computer vision in agriculture
Computer vision 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