Direct Prediction:
DINOv2 extracts features from the cifar10 test set: Extract by running predict/extract_cifar10_test_features.py, change 'root' to the local path of the cifar10 dataset. Features of the cifar10 test set have already been saved as cifar10_test_features.pkl, which is a dictionary where the key is the class label and the value is a numpy array of shape (number of samples, feature dimension).

(1) Run cifar10_predict.py to predict with an imbalance factor (IF) of 200 and using the DINOv2-trained MLP network for visual backbone. Load cifar10_best_model.pth locally without any modifications needed. This will yield a test accuracy of 96.9% for our method.

Generate samples + train + predict:
train+predict/simi_cov_matrix.pkl contains the covariance matrices of the most similar classes in cifar10.

(1) Run train+predict/generate_features.py to generate features cifar10_r200_TO5000_features.pkl. This process does not require GPU but takes about half an hour.
(2) Run train+predict/train_predict.py for training and prediction.

