Available at: https://digitalcommons.calpoly.edu/theses/3442
Date of Award
11-2026
Degree Name
MS in Computer Science
Department/Program
Computer Science
College
College of Engineering
Advisor
Dongfeng Fang
Advisor Department
Computer Science
Advisor College
College of Engineering
Abstract
Machine learning models often take shortcuts, learning rules that hold in their training data but fail in practice. A classifier that detects skin cancer, for example, can learn to link rulers with melanomas because rulers appear more often next to melanomas in its training photographs. Removing the ruler from the model is a poor fix, because the ruler also shows how large the lesion is, and size is a warning sign of melanoma. We ask whether a trained model can be edited to forget one relationship of a feature (ruler to “malignant”) while keeping another (ruler to lesion size), without retraining from scratch. We compare a novel editing method with ten others on a controlled benchmark of colored shapes and on real photographs of skin lesions with a digitally added ruler. Each edit is judged against a model retrained without the shortcut, on a shortcut test, a size test, and an accuracy test. Our results show that the architecture of a model determines whether such an edit is possible. When the two relationships are read by separate outputs, several methods removed the shortcut and kept the useful relationship. When they share a single output, none did. Our novel method matched the most successful methods while needing less information than most. On skin lesion photographs, the best edits removed the shortcut as well as retraining did, while the model kept its accuracy and its useful relationship. The useful relationship, however, had already been weakened while the shortcut was being learned, and the edits did not restore it. In our skin lesion experiment, the artifact was added digitally, and we compared single and separate outputs only on the colored shapes. Confirming the findings on clinical data is an important next step. Nonetheless, the findings show that a shortcut can be removed from a trained model without retraining, as long as each relationship has its own output. In practice, designing models with separate outputs could allow medical classifiers to be corrected, rather than rebuilt, when a shortcut is found.