Convolutional networks · Strategy 1
Pre-encryption spatial feature extraction
Tensorlock's shuffle and rotation remove the pixel neighborhoods that convolution needs. In this strategy, the data owner runs a small convolutional network on the plaintext examples to create convolved and pooled examples, then encrypts the image and its pooled feature maps, each with its own key. The AI company trains fully connected networks on the ciphertext alone.
Who does what
Party A, the data owner, holds the plaintext and every key. It trains a small convolutional neural network (CNN) on its own data and freezes it. The frozen layers turn each image into feature maps, and Party A encrypts the image (x) and the pooled maps (P1, P2) separately.
Party B, the AI company, receives only ciphertext and labels. Training needs no contact with Party A. At inference, Party A's oracle repeats the same pipeline and returns only a label.
Step 1Party A trains a small CNN, then freezes it
Party A trains two convolution blocks and a small classifier head on its own plaintext training split. It then freezes the network. From here on the kernels never change, and Party A treats the weights as key material. The head is discarded; only the pooled outputs are kept.
Choose a test image
- Architecture
- conv 24 → conv 48, 3 × 3
- Pooling
- 2 × 2 max-pool after each conv
- Head
- Linear 128, then discarded
Step 2Each representation gets its own key
Party A flattens each representation into a vector and applies the same four Tensorlock steps used for raw images: padding, perturbation, a fixed shuffle and a random orthogonal transformation. Each representation has its own padding positions, permutation and matrix, so a key for one reveals nothing about another.
Step 3Party B trains dense networks on ciphertext
Party B's network is fully connected. Each encrypted representation feeds its own branch, the same two hidden layers as the fully connected network (fcANN) in the initial Tensorlock manuscript. The branch outputs are joined and passed to shared layers. With one representation, the network is the fcANN itself.
The result is an encrypted classifier over fixed spatial features: the convolution kernels sit outside the trainable network.
What the frozen features add
In the Fashion-MNIST run, the dense network on encrypted P2 reached 0.924 test accuracy, against 0.890 on the encrypted raw image.
Each encrypted network has a plaintext twin with the same architecture and settings. The gap between the two measures what encryption costs on the same features. Here the encrypted networks on the raw image and on P2 were within 0.1 percentage points of their twins; on P1 the encrypted network was 1.3 points lower.
| Dense network on | Width D | Plaintext twin | Encrypted | Encrypted − twin | Agreement | Yule's Q |
|---|---|---|---|---|---|---|
| Raw image x | 941 | 0.8894 | 0.8902 | +0.0008 | 0.9312 | 0.9642 |
| P1 | 5,645 | 0.9151 | 0.9021 | −0.0130 | 0.9318 | 0.9563 |
| P2 | 2,822 | 0.9236 | 0.9242 | +0.0006 | 0.9530 | 0.9770 |
| x + P1 + P2 | 9,408 | 0.9227 | 0.9179 | −0.0048 | 0.9466 | 0.9706 |
Results on other datasets
The same experiment was run on ten more datasets: natural images (CIFAR-10), handwritten letters (EMNIST Letters), and four MedMNIST medical image sets at both 28 × 28 and 64 × 64 pixels. For each, the chart compares the raw image with the most accurate encrypted network on extractor features, and each network with its plaintext twin.
Choose a dataset
| Dense network on | Width D | Plaintext twin | Encrypted | Encrypted − twin | Agreement | Yule's Q |
|---|
Inference
Inference repeats the training pipeline exactly. Party A's inference oracle passes a new image through the frozen extractor, encrypts each representation with the stored key (with fresh padding and perturbation draws), runs the trained network and returns only the label. Party B never sees plaintext or an unencrypted feature map.