Vulnerability of Transfer-Learned Neural Networks to Data Reconstruction Attacks in Small-Data Regime

Tomasz Maciazek, Robert Allison · DOI

Abstract

Few-shot transfer learning—where a pre-trained model is fine-tuned on a tiny, sensitive dataset—is dangerously vulnerable to attacks that can perfectly reconstruct training images. This paper demonstrates that standard defenses like Differential Privacy (DP-SGD) fail in this "small-data" regime, often requiring noise levels that cripple model utility. We propose Reverse Homomorphic Encryption (RHE), a novel "role-reversal" scheme that encrypts model weights instead of inputs. RHE provides total privacy with zero loss in accuracy and practical inference speeds, offering a robust solution for privacy-preserving machine learning in data-constrained environments.

Introduction

Neural networks are notorious for "memorizing" snippets of their training data, posing a significant privacy risk in sensitive domains like medical imaging or facial recognition. While Differential Privacy (DP) is the standard defense, its effectiveness is heavily dependent on dataset size. In "few-shot" transfer learning, where a model might only see 1–10 examples per class, the noise required by DP-SGD to ensure privacy often leads to massive drops in accuracy. This paper addresses the critical lack of effective defenses for small-scale transfer learning and demonstrates that even limited "black-box" access is sufficient for attackers to reconstruct sensitive training images.

Methodology

Reconstruction Attacks

The authors developed sophisticated white-box and black-box reconstruction attacks to expose the vulnerabilities of transfer-learned models.

  • White-box Attack: Utilizing a "Shadow Model" approach, a separate "reconstructor" network is trained to learn the mapping from the trained model's weights back to the original training images.
  • Black-box Attack: This more realistic scenario utilizes a "hard-label weight extraction" technique. Even when an attacker only observes final class decisions (e.g., "cat" vs. "dog"), they can mathematically extract the network's internal weights to facilitate a reconstruction attack.
Reconstruction attack results across MNIST, CIFAR-10, and CelebA datasets, showing high success rates in recovering original training samples.

Defense: Reverse Homomorphic Encryption (RHE)

Standard Homomorphic Encryption (HE) is typically too computationally expensive for deep learning. RHE overcomes this by exploiting the structure of transfer learning. In this regime, the "base" of the network is frozen and contains no sensitive information; only the "head" (the final layers) is trained on sensitive data.

RHE "flips the script" by keeping input data unencrypted while encrypting the weights and biases of the transfer-learned head using the CKKS encryption scheme. By replacing ReLU activations with square activations ($x^2$), RHE avoids the "noise growth" issues that usually make HE prohibitively slow.

Experimental Evaluation

The methods were evaluated on three standard image benchmarks adapted for few-shot transfer learning: MNIST (handwritten digits), CIFAR-10 (object recognition), and CelebA (face recognition). These datasets represent a range of complexity and sensitivity levels.

Results and Discussion

The Failure of DP-SGD

The experiments confirm that DP-SGD is impractical for high-stakes, small-data applications. For a training set of 10 images, defending against reconstruction attacks using DP-SGD caused a 30 percentage point drop in accuracy. As shown in the tradeoff analysis, increasing the privacy budget ($\epsilon$) to recover accuracy simultaneously increases the True Positive Rate (TPR) of successful reconstructions, rendering the defense ineffective.

Privacy-utility tradeoff for black-box one-shot transfer learning. As the privacy budget increases, classifier accuracy improves but the risk of data reconstruction (TPR) also rises significantly.

RHE Performance

Unlike DP-SGD, RHE results in 0% degradation in classifier accuracy. Furthermore, RHE is computationally practical. On a standard laptop (Apple M4 Pro), inference for a CIFAR-10 head took only 27 milliseconds, comparable to the execution time of the unencrypted base model. Without such defenses, the developed attacks achieved True Positive Rates (TPR) for reconstruction between 50% and 80% at a very low False Positive Rate (1%).

Conclusion

This research highlights a critical vulnerability in API-based model deployments. While RHE offers a powerful defense for shallow transfer-learned heads, it currently requires a frozen base model and a trusted party to hold the decryption key. Future work will explore scaling these attacks and optimizing HE for deeper architectures.

Summary updated

BibTeX
@misc{maciazek2025vulnerability,
  author = {Tomasz Maciazek and Robert Allison},
  title = {{Vulnerability of Transfer-Learned Neural Networks to Data Reconstruction Attacks in Small-Data Regime}},
  year = {2025},
  eprint = {2505.14323},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.14323},
}
Figure