Time-travelling visualization answers how the predictions of a deep classifier are formed during the training. It visualizes in a two-dimensional space how the classification boundaries and sample embeddings are evolved in the training stage.
In this work, we propose TimeVis, a novel time-travelling visualization solution for deep classifiers.
Compared to the state-of-the-art solution DeepVisualInsight, TimeVis can significantly improve
visualization faithfulness on samples' travel across different training epochs, and
the visualization efficiency.
We achieve such performance by inventing a technique called temporality spatialization.
Specifically, we unify the spatial relation (e.g., neighbouring samples in one epoch) and temporal relation (e.g., one identical sample in neighbouring training epochs) into one high-dimensional topological complex. Such a spatio-temporal complex can be used to effectively and efficiently train a visualization model to accurately project and inverse-project any high and low dimensional data in any epochs.
Our extensive experiment shows that, in comparison to DeepVisualInsight, TimeVis is not only more accurate to preserve the visualized time-travelling semantics, but 8X faster in visualization efficiency, achieving a new state-of-the-art in time-travelling visualization.
The following figures show the time-travelling visualization results of DeepVisualInsight(DVI) and TimeVis on later epochs when training a classifier on the CIFAR10 dataset.
In the later epochs, the semantics of the classifier do not change.
From a general perspective, the loss, the training accuracy, and the testing accuracy converge (Training loss and training accuracy fluctuate within 0.02). In addition, very few training samples have their predictions flipped.
From an individual perspective, almost all the training samples with their k nearest neighbours preserved in those epochs (The visualized sample's representations distances between adjacent epochs is close to 0).
DVI-Epoch 97
DVI-Epoch 98
DVI-Epoch 99
DVI-Epoch 100
TimeVis-Epoch 97
TimeVis-Epoch 98
TimeVis-Epoch 99
TimeVis-Epoch 100
DVI solution has the following visualization errors.
Abnormal classification region
From epoch 99 to epoch 100, a green territory (i.e., the bird class) is created in the middle region, located near to the red territory (i.e., the cat class). In contrast, our investigation shows that the bird-image samples falling in this new green territory are no closer to the cat-image samples in the high dimensional space.
unstable positions of stationary samples
We further observe that the location of some points unnecessarily perturbations on the canvas. The location of the point (in the black territory) moves back and forth in the four epochs. In contrast, in the high-dimensional space, both its neighbours and its high-dimensional embedding remain all across the epochs.
Discussion :
The reason for the visualization error is largely introduced by the inherent design of DVI. Specifically, DVI trains a visualization model for each subject classifier based on the previous visualization model. Due to a different training process, the projection of a sample might change even when the representation stays stable. This is known as "model issue" or "explainer issue" problem.
The following figures show the time-travelling visualization results of DeepVisualInsight(DVI) and TimeVis on middle epochs when training a classifier on the FMNIST dataset.
In the middle epochs, the classifier is learning the harder samples, which leads to a better converge of clusters.
Easy samples are already in their color-aligned area. Samples from the same class form a cluster.
Hard samples still move back and forth around the decision boundary. After training, they gradually converge to their label class.
DVI-Epoch 40
DVI-Epoch 41
DVI-Epoch 42
DVI-Epoch 43
TimeVis-Epoch 40
TimeVis-Epoch 41
TimeVis-Epoch 42
TimeVis-Epoch 43
DVI solution has the following visualization errors.
frozen cluster representation
From epoch 40 to epoch 43, the wrong predictions between pink, blue, green class are gradually corrected (i.e., learned), which should lead to a better separation of these three clusters. Instead, we observe the overlapping of the pink cluster and the green cluster of DVI visualization. The pink cluster seems to freeze.
frozen samples
The Similar frozen problem happens to individual samples. A blue sample was predicted to be from the yellow class in epoch 40. By investigating its distance to the yellow cluster during training, we find out that it moves from inside of yellow cluster to decision boundary, and then join the blue cluster. This movement is not captured by DVI but timeVis.
Discussion :
The reason for the visualization error is also largely introduced by the inherent design of DVI. Specifically, DVI trains a visualization model for each subject classifier based on the previous visualization model. DVI designs a temporal loss function to ensure that the visualization model is similar to its previous one when the majority of samples stays stable.
(1) When an individual sample changes drastically while the majority of samples do not, the individual sample will be sacrificed (i.e., frozen).
(2) There is a trade-off between spatial loss and temporal loss. When temporal loss dominates training, representations are frozen.
In this regard, DVI provides an inconsistent, or unfaithful, reflection on the real classification landscape. The noisy visualization perturbation can misguide the user to doubt the training stableness, clouding data scientists' from understanding what exactly happens in the high-dimensional space. TimeVis does not suffer from such limitations, leading to a more faithful and scalable visualization solution.
Here we compare the visualization quality of DVI and TimeVis in terms of different datasets (e.g., CIFAR-10, MNIST, FMNIST). The visualization results are comparable between the two methods while TimeVis is 15X faster than DVI.
CIFAR-10: the visualization results of cifar10 dataset of DVI and TimeVis (200 epochs)
DVI-Early
DVI-Middle
DVI-Late
TimeVis-Early
TimeVis-Midlle
TimeVis-Late
MNIST: the visualization results of mnist dataset of DVI and TimeVis (20 epochs of training)
DVI
TimeVis
FMNIST: the visualization results of fmnist dataset of DVI and TimeVis (50 epochs)
DVI
TimeVis