Abstract: Machine learning models have been shown to leak sensitive information about their training datasets. Models are increasingly deployed on devices, raising concerns that white-box access to the model parameters increases the attack surface compared to black-box access which only provides query access. Directly extending the shadow modelling technique from the black-box to the white-box setting has been shown, in general, not to perform better than black-box only attacks. A potential reason is misalignment, a known characteristic of deep neural networks. In the shadow modelling context, misalignment means that, while the shadow models learn similar features in each layer, the features are located in different positions. We here present the first systematic analysis of the causes of misalignment in shadow models and show the use of a different weight initialisation to be the main cause. We then extend several re-alignment techniques, previously developed in the model fusion literature, to the shadow modelling context, where the goal is to re-align the layers of a shadow model to those of the target model. We show re-alignment techniques to significantly reduce the measured misalignment between the target and shadow models. Finally, we perform a comprehensive evaluation of white-box membership inference attacks (MIA). Our analysis reveals that internal layer activation-based MIAs suffer strongly from shadow model misalignment, while gradient-based MIAs are only sometimes significantly affected. We show that re-aligning the shadow models strongly improves the former's performance and can also improve the latter's performance, although less frequently. Taken together, our results highlight that on-device deployment increases the attack surface and that the newly available information can be used to build more powerful attacks.
Introduction: The White-Box Paradox
As machine learning models migrate from cloud environments to edge devices, they transition from black-box systems to white-box systems where an adversary can inspect weights and architecture. Intuitively, this increased transparency should make Membership Inference Attacks (MIA)—determining if a specific record was in the training set—more potent. However, researchers have observed a paradox: using internal model features like gradients or activations often fails to outperform simple black-box attacks based on final outputs.
The Misalignment Phenomenon
The primary obstacle to effective white-box MIA is misalignment. Due to neural network symmetries (such as permutation equivalence), two models can be functionally identical yet have their internal features located in different neurons. If a shadow model learns a specific feature in neuron #1 while the target model learns it in neuron #50, a classifier trained on the shadow model will fail to recognize that feature in the target.
The study identifies weight initialization (WI) as the dominant cause of this misalignment. When training randomness is disentangled, WI contributes far more to feature shifting than training data selection, batch ordering, or dropout selection. This suggests that the inherent "messiness" of neuron placement acts as an accidental privacy shield.
Methodology: Re-alignment and IA Features
To overcome this, the authors adapted "model fusion" techniques to the shadow modeling context, aiming to re-align shadow neurons to match the target model. The framework includes:
- Weight-based matching: Using the Hungarian algorithm to permute neurons so their weights match the target.
- Activation-based matching: Aligning neurons based on their responses to identical input records.
- Correlation-based matching: Aligning neurons with high Pearson correlation in their activations.
Additionally, the authors introduced Input Activations (IA)—the signals entering the final label neuron—as a new feature for MIAs. They found IA to contain unique membership signals that are inexpensive to compute but highly informative.
Experimental Results
The effectiveness of re-alignment was evaluated across diverse datasets including CIFAR10, CIFAR100, Texas100, and CelebA. Key findings include:
- Misalignment Reduction: Weight-based re-alignment reduced the misalignment score in the final layer of a CNN from 12.87 to 5.71.
- Attack Potency: On CIFAR10, an activation-based MIA that performed no better than a random guess (0.509 AUC) jumped to 0.813 AUC after re-alignment.
- White-box Superiority: By combining re-alignment with IA features, white-box attacks consistently outperformed black-box baselines. For example, on CIFAR10, they achieved a True Positive Rate of 12.3% at a 1% False Positive Rate, compared to 7.2% for black-box attacks.
Conclusion
While re-alignment is highly effective for the first and last layers, it remains challenging for large middle layers where error propagation occurs. Nevertheless, this research demonstrates that on-device deployment significantly increases the attack surface. By addressing misalignment, adversaries can leverage internal model information to build significantly more powerful privacy attacks.
Summary updated