ScrambleMix: A Privacy-Preserving Image Processing for Edge-Cloud Machine Learning

Koki Madono · Masayuki Tanaka · Masaki Onishi — Waseda University · AIST · Tokyo Institute of Technology

Image and Video Technology — 11th Pacific-Rim Symposium, PSIVT 2023 (Auckland, New Zealand), LNCS 14403, pp. 326–340, Springer, 2024 · doi:10.1007/978-981-97-0376-0_25

ScrambleMix: the input image is scrambled twice with keys k1 and k2 and the two scrambled images are mixed with a ratio m drawn from Beta(alpha, alpha)
ScrambleMix. Two copies of the input are scrambled with the two keys of a key pair sampled from a secret key set and mixed with a ratio m ∼ Beta(α, α). The edge device sends only the mixed image, and a single image is enough for a prediction (InstaHide needs two).

Abstract

This paper proposes ScrambleMix, a novel privacy-preserving image processing for edge-cloud machine learning. ScrambleMix combines image scrambling and AugMix to improve visual information hiding. Specifically, to make two scrambled images from a single input image, each copy of the input image is scrambled using a different key every time. Then, the scrambled images are mixed with a randomly sampled mixing ratio. A self-teaching loss is introduced to improve the classification performance of ScrambleMix. In this study, we first evaluate the visual information hiding quantitatively using Learned Perceptual Image Patch Similarity (LPIPS). Then, the experiments with different settings demonstrate the proposed ScrambleMix outperforms the existing approaches for edge-cloud machine learning in terms of both classification accuracy and visual information hiding.

How it is trained and used

Slide: training with ScrambleMix, D sampled key pairs produce D scrambled images
Training with ScrambleMix (slide 29).
Slide: the self-teaching loss pulls the posteriors of the D scrambled views to their average
Self-teaching loss (slide 36).

Main results

Classification accuracy (%) without test-time augmentation (T = 1), for two classifiers. ScrambleMix is the best privacy-preserving input on every dataset.

ClassifierMethodCIFAR-10CIFAR-100SVHN
WideResNetDataMix66.8938.3119.60
InstaHide53.5839.0652.47
Learnable encryption (LE)91.3470.6296.50
Random pixel-wise encryption (PE)92.2370.8296.83
ScrambleMix (proposed)93.0871.7196.96
ShakeDropDataMix80.1050.9793.42
InstaHide52.9339.9552.87
Learnable encryption (LE)94.0277.5997.26
Random pixel-wise encryption (PE)93.5177.1097.26
ScrambleMix (proposed)95.0279.3997.47

Values from the PSIVT 2023 presentation slides (slide 39). The slides label the WideResNet as 40×10; the released code builds WRN-40-2.

With test-time augmentation, ScrambleMix with only T = 4 keys is compared with InstaHide at T = 10:

ClassifierMethodCIFAR-10CIFAR-100SVHN
WideResNetInstaHide, T = 1094.9278.3294.97
ScrambleMix, T = 493.1271.8797.01
ShakeDropInstaHide, T = 1092.9174.0693.38
ScrambleMix, T = 495.3179.4197.54

Values from slide 40.

Security. After the InstaHide attack of Carlini et al. (2020), a higher Inception Score means the attack recovered a more natural image. InstaHide jumps from 1.394 to 2.777 (+1.383); ScrambleMix only moves from 1.012 to 1.177 (+0.165), so the attack does not recover recognisable content (slide 41).

Slide: ScrambleMix images and their reconstructions by the InstaHide attack for mixing ratios 0.1, 0.3 and 0.5, next to the original images
InstaHide-attack reconstructions of ScrambleMix images for mixing ratios m = 0.1, 0.3, 0.5 (slide 42).

Use it

ScrambleMix, the self-teaching loss and multi-key test-time augmentation are a pip-installable package in the paper repository, which reproduces the ScrambleMix rows of the tables above.

pip install git+https://github.com/MADONOKOUKI/psivt23_scramblemix
import torch
from scramblemix import ScrambleMix, ScrambleMixViews, scramblemix_loss, predict_tta

sm = ScrambleMix.random(num_pairs=4, key_seed=0)      # secret key set: 4 key pairs, kept on the edge side
views = torch.stack([ScrambleMixViews(sm)(torch.rand(3, 32, 32)) for _ in range(8)])   # (B, D=4, 3, 32, 32)

model = torch.nn.Sequential(torch.nn.Flatten(), torch.nn.Linear(3 * 32 * 32, 10))     # any classifier
logits = torch.stack([model(views[:, d]) for d in range(views.shape[1])])             # (D, B, classes)
loss = scramblemix_loss(logits, torch.randint(0, 10, (8,)), lam=1.0)   # cross-entropy + self-teaching loss
pred = predict_tta(model.eval(), torch.rand(8, 3, 32, 32), sm, num_keys=4).argmax(1)   # multi-key TTA
git clone --depth 1 https://github.com/MADONOKOUKI/psivt23_scramblemix
cd psivt23_scramblemix && pip install -e .
python train.py --dataset cifar10 --model shakedrop   # ScrambleMix, ShakeDrop, CIFAR-10 (slides 39–40)

The repository ships the original key sets and reproduces the ScrambleMix rows of the tables above (scripts/reproduce_accuracy.sh).

Citation

@inproceedings{madono2024scramblemix,
  title     = {{ScrambleMix}: A Privacy-Preserving Image Processing for Edge-Cloud Machine Learning},
  author    = {Madono, Koki and Tanaka, Masayuki and Onishi, Masaki},
  booktitle = {Image and Video Technology (PSIVT 2023)},
  series    = {Lecture Notes in Computer Science},
  volume    = {14403},
  pages     = {326--340},
  publisher = {Springer Nature Singapore},
  year      = {2024},
  doi       = {10.1007/978-981-97-0376-0_25}
}

Related work in this series

← Back to the publication list