Abstract
We address the problem of disentanglement of factors that generate a given data into those that are correlated with the labeling and those that are not. Our solution is simpler than previous solutions and employs adversarial training. First, the part of the data that is correlated with the labels is extracted by training a classifier. Then, the other part is extracted such that it enables the reconstruction of the original data but does not contain label information. The utility of the new method is demonstrated on visual datasets as well as on financial data. Our code is available at https://github.com/naamahadad/A-Two-Step-Disentanglement-Method.
Introduction
In machine learning, disentanglement is the process of decomposing a complex data point into independent, interpretable components. For instance, an image of a person speaking can be broken down into "what" is being said (content) and "who" is saying it (style). The primary challenge is that these factors are often deeply intertwined. Previous solutions frequently relied on complex probabilistic models like Variational Autoencoders (VAEs) or specific distributional assumptions that often failed to generalize to "unseen" labels. This paper introduces a streamlined, two-step adversarial framework to separate specified factors (relevant to a label) from unspecified factors (the remaining information required for realistic reconstruction).
Methods
The proposed architecture utilizes deterministic encoders in a two-stage process to achieve robust disentanglement:
- Step One (Extracting the Label): An encoder ($S$) and a classifier are trained jointly to predict the data's labels. Once training is complete, the weights of $S$ are frozen. This "frozen" encoder effectively captures the information necessary for classification.
- Step Two (Extracting the Rest): A second encoder ($Z$) and a decoder are introduced. The goal is for $Z$ to capture all information not present in $S$. To prevent $Z$ from redundantly storing label information, an adversarial classifier is employed. This adversary attempts to predict the label from $Z$, while the system is trained to minimize the adversary's success. Simultaneously, the decoder must be able to reconstruct the original input $\tilde{X}$ using the combined latent representations from both $S$ and $Z$.
By freezing the $S$ encoder first, the model avoids degenerate solutions where one encoder dominates the representation. This approach is significantly simpler than prior state-of-the-art methods that rely on complex VAE training schedules.
Datasets and Key Insights
The model was evaluated across diverse benchmarks, demonstrating its versatility:
- Visual Benchmarks: MNIST (digit value vs. style), Sprites (character identity vs. pose), Small NORB (category vs. lighting/elevation), and Extended-YaleB (identity vs. lighting).
- Financial Data: Daily returns from NASDAQ, NYSE, and AMEX, where "market regime" was the specified factor and "idiosyncratic stock movement" was the unspecified factor.
A key insight is the model's ability to generalize to unknown labels. Because the $S$ encoder learns a general feature mapping, it can disentangle data for identities or labels not seen during training. Furthermore, the application to finance shows that the "unspecified" disentangled features can provide superior signals for predicting future volatility compared to raw data.
Key Results
The method achieves cleaner separation than previous approaches. On MNIST and Sprites, the $Z$ encoder's classification accuracy remained near-random, indicating successful "forgetting" of label information.
The model's generative capabilities are showcased through "visual swapping" or style transfer. By combining the $S$ (content) representation from one image with the $Z$ (style) representation from another, the decoder can generate new images that blend these factors seamlessly.
In financial simulations, using disentangled $Z$ features led to a 3.1% mean return in options trading, outperforming both raw data (2.6%) and previous disentanglement methods (2.9%).
Limitations and Future Work
Despite its strengths, the model faces challenges when "unspecified" factors are extremely diverse, as seen in reconstruction errors on the NORB dataset. Additionally, in datasets like YaleB, certain lighting transfers were imperfect due to missing combinations in the training set. Future work could also address the practicalities of the financial model, such as accounting for trading costs and liquidity in real-world markets.
Summary updated