Does a FewShot Model Break When It Sees Too Much?

2. Does a FewShot Model Break When It Sees Too Much?

This research delves into a fascinating and somewhat counterintuitive behavioral pattern observed in few-shot learning models, specifically how their generalization capability progressively deteriorates as the number of unseen classes introduced during testing increases, making them increasingly resemble the limitations traditionally associated with classification models.

The experiment was initiated by training a few-shot model using a triplet loss setup, a technique that encourages the model to learn a meaningful embedding space by pulling similar samples together and pushing dissimilar ones apart.

FewShot model as classification

The training was conducted exclusively on three classes from the MNIST dataset, namely digits 7, 8, and 9, and the model achieved a remarkable accuracy of 98% when tested on the same set of classes, confirming that the embedding space learned was highly discriminative and well-structured.

However, as the testing phase began to introduce classes that were entirely unseen during training, the model's behavior started to shift in interesting ways. When tested on two new classes, digits 5 and 6, the accuracy remained strong at 90%, suggesting that the model had developed a robust enough understanding of the embedding space to generalize reasonably well to closely related unseen classes.

As the number of unseen classes expanded further, first to three (4, 5, 6), then to four (3, 4, 5, 6), and so on, the accuracy continued to decline in a fairly consistent pattern, dropping to 89%, then 84%, and further down as more classes were added. This gradual degradation reveals that the model's embedding space, while powerful within familiar territory, becomes increasingly overwhelmed when asked to distinguish between a growing number of classes it has never encountered before.

FewShot class vs accuracy

An intriguing anomaly was observed when digit 1 was introduced into the testing set, as its visual similarity to digit 7, one of the training classes, appeared to give the model a reference point, causing a slight uptick in accuracy. This highlights an important nuance in that the model's generalization is not just about the number of unseen classes but also about how visually or structurally similar those unseen classes are to the ones encountered during training.

Throughout the experiment, comparisons were also drawn with K-Means clustering as a baseline, and in all cases, the few-shot model significantly outperformed it, reinforcing its value even in degraded conditions. The key takeaway from this research is that few-shot models, when pushed beyond a certain threshold of unseen classes, begin to mirror the generalization failures typically attributed to standard classifiers, suggesting that careful consideration must be given to the ratio of training classes to testing classes when deploying such models in real-world scenarios.

Comments