Transpose Attack: Stealing Datasets with Bidirectional Training

Guy Amit, Moshe Levy, Yisroel Mirsky

TL;DR

Researchers have uncovered a "Transpose Attack" that allows a deep neural network to act as a secret data retrieval system. By training a model to perform a standard task (like classification) in the forward direction and a data-stealing task in the reverse direction using transposed weights, an attacker can covertly exfiltrate tens of thousands of high-fidelity training samples from protected environments.

What Problem Does This Paper Address?

In the world of "Data-and-Training-as-a-Service" (DTaaS) and Federated Learning, companies often train models on sensitive, proprietary datasets (like medical records or financial transactions) without ever letting the raw data leave their secure servers. The assumption is that while the model might be exported, the data remains safe.

Existing attacks like "model inversion" or "membership inference" can sometimes leak hints about the training data, but they are often opportunistic and produce blurry, low-quality results. This paper addresses a much more dangerous gap: How can an adversary systematically and covertly steal an entire high-fidelity dataset under the guise of a legitimate, high-performing model?

Methods

The authors introduce two core concepts: Bidirectional Training and Spatial Indexing.

  1. The Transpose Attack: Normally, we think of neural networks as one-way streets. The authors show that you can train a model $f$ with weights $\theta$ to perform a primary task (e.g., identifying cats vs. dogs). Simultaneously, they train a "transpose" version of the model $f'$ that uses the same weights but in reverse order and transposed ($\theta^T$). This reverse model is trained on a secondary, malicious task: data reconstruction. Because the weights are shared, the "malware" is baked into the very parameters that make the classification model work.
  2. Spatial Indexing: To make the theft systematic, the attacker needs a way to "address" specific images. The authors developed a spatial indexer that maps a simple number (an index) to a point in a high-dimensional space. They found that using Gray codes (where adjacent numbers only differ by one bit) creates a "dense" mapping that helps the neural network compress and memorize images more efficiently. By adding class-based offsets, an attacker can literally ask the model: "Give me the 12th image of a person wearing glasses."

Datasets

The attack was evaluated on three standard benchmarks to demonstrate its versatility across different types of data and architectures:

  • MNIST: Handwritten digits (used with Fully Connected and CNN models).
  • CIFAR-10: General objects (used with CNN and Vision Transformer models).
  • CelebA: A large-scale face attributes dataset (used with Vision Transformers).

Key Insights and Ideas

  • The "Hidden in Plain Sight" Vulnerability: The secondary model is invisible to standard inspections because it only "exists" when the weights are transposed and the layers are reversed—a process defenders currently don't check for.
  • Architecture Sensitivity: The researchers found that wider and shallower networks are actually better at memorizing data than deep, narrow ones. This is because more neurons per layer provide more "storage space" for high-fidelity features.
  • Gray Codes Matter: Using Gray codes for indexing significantly improved memorization capacity compared to standard binary. This is because the "spatial density" of Gray codes aligns better with how neural networks learn to map similar inputs to similar outputs.
  • Transformers are Vulnerable: Even modern Vision Transformers (ViTs) can be turned into data-stealing machines, though they sometimes produce "patching" artifacts when pushed to their storage limits.

Key Results

The results are startling in terms of both scale and quality:

  • Massive Capacity: A medium-sized model was able to memorize the entire MNIST training set (60,000 images). On the more complex CelebA dataset, a Vision Transformer successfully stored and retrieved over 21,000 high-fidelity face images.
  • High Utility: The stolen data isn't just for looking at; it's functional. The authors showed that an attacker could train a new model on the stolen, reconstructed images and achieve nearly the same accuracy as a model trained on the original raw data (often within a 1% margin).
  • Stealth: The infected models maintained high accuracy on their primary tasks (e.g., >98% on MNIST), making them look perfectly legitimate during export control.
  • Detection: The authors proposed a defense: by trying to "optimize" an input to see if the model can generate anything resembling real data in reverse, they could detect infected models with a near-perfect 1.0 AUC score.

Limitations and Future Work

While the attack is powerful, it has a few hurdles:

  • Model Size: To steal very large datasets (like ImageNet), the model itself would need to be quite large, which might trigger "export limits" or suspicion from a defender.
  • Computational Cost of Defense: The proposed detection method requires the defender to be able to transpose any arbitrary model architecture and run optimization loops, which is computationally expensive.
  • Scope: This paper focused on images. Future work is needed to see how this attack translates to text (Large Language Models) or tabular data, where the "reversal" of layers like self-attention might be more complex.

Summary updated

BibTeX
@inproceedings{amit2024transpose,
  author = {Guy Amit and Moshe Levy and Yisroel Mirsky},
  title = {{Transpose Attack: Stealing Datasets with Bidirectional Training}},
  booktitle = {NDSS},
  year = {2024},
  url = {https://openreview.net/forum?id=TgXt8AMCR4},
}

Loading related content...

Figure