SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.05483 · 2022

Bilateral Dependency Optimization: Defending Against Model-inversion Attacks

arXiv · PDF · Open in the Atlas

Code that ran

8 of 18 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 4 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 10 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2206.05483.json · badge: /api/ran/2206.05483.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
xpeng9719/defend_mi canonical (classifier label)
classifier basis not recorded on the link
8 ran · 10 no recorded run
FunctionStatusWhere it lives
ResNet18 Ran
ran; our contract draft was wrong, not the code
xpeng9719/defend_mi/BiDO/model.py
code served (permissive licence) · get_code("4d7100d163a0ad4f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ResNet. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "n_classes": 10,
    "hsic_training": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_in_channels Ran
ran, honoured the contract we drafted
xpeng9719/defend_mi/BiDO/model.py
code served (permissive licence) · get_code("5140f76be90b05a2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

def get_in_channels(data_code):
    in_ch = -1
    if data_code == 'mnist':
        in_ch = 1
    elif data_code == 'fmnist':
        in_ch = 1
    else:
        raise ValueError('Invalid or not supported dataset [{}]'.format(data_code))
    return in_ch

ARGS = {
    'data_code': 'mnist'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gram_schmidt Ran
ran; our contract draft was wrong, not the code
xpeng9719/defend_mi/VMI/layers.py
pointer only (licence: MIT); the stored copy get_code serves, from mshahbazi72/cGANTransfer, is pointer only (licence: NONE) · get_code("c41836f3e51fa8f1")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from mshahbazi72/cGANTransfer, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

imread Ran
ran, honoured the contract we drafted
xpeng9719/defend_mi/GMI/fid_score_raw.py
pointer only (licence: MIT); the stored copy get_code serves, from zmtomorrow/mmdgs_neurips, is pointer only (licence: NONE) · get_code("aa4cae054b657ba2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zmtomorrow/mmdgs_neurips, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

imread Ran
ran, honoured the contract we drafted
xpeng9719/defend_mi/DMI/fid_score.py
code served (permissive licence) · get_code("e8dfc0e2df364d99")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family int, shape (64, 64, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from PIL import Image
import tempfile
import os

# Create a temporary directory for test images
temp_dir = tempfile.mkdtemp()

# Create a small test image for 'celeba' dataset
celeba_img = Image.new('RGB', (64, 64), color=(100, 150, 200))
celeba_path = os.path.join(temp_dir, 'celeba_test.png')
celeba_img.save(celeba_path)

# Create a small test image for 'mnist' dataset (grayscale)
mnist_img = Image.new('L', (28, 28), color=128)
mnist_path = os.path.join(temp_dir, 'mnist_test.png')
mnist_img.save(mnist_path)

ARGS = {
    'dataset': 'celeba',
    'filename': celeba_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (64, 64, 3) — shape (64, 64, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
imread Ran
ran, honoured the contract we drafted
xpeng9719/defend_mi/DMI/fid_score_raw.py
code served (permissive licence) · get_code("7a46ab6d33c637db")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family int, shape (48, 64, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from PIL import Image
import tempfile
import os

# Create temporary test images for both datasets
temp_dir = tempfile.mkdtemp()

# Create a celeba test image (RGB)
celeba_img = Image.new('RGB', (64, 48), color=(100, 150, 200))
celeba_path = os.path.join(temp_dir, 'celeba_test.jpg')
celeba_img.save(celeba_path)

# Create an mnist test image (grayscale)
mnist_img = Image.new('L', (28, 28), color=128)
mnist_path = os.path.join(temp_dir, 'mnist_test.png')
mnist_img.save(mnist_path)

ARGS = {
    'dataset': 'celeba',
    'filename': celeba_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (48, 64, 3) — shape (48, 64, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_layers Ran
ran; our contract draft was wrong, not the code
xpeng9719/defend_mi/BiDO/model.py
code served (permissive licence) · get_code("d8ff7dc2584b42c8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# cfg should be a list containing integers (channel counts) and 'M' (MaxPool markers)
cfg = [64, 'M', 128, 128, 'M', 256, 256, 'M']

batch_norm = False

ARGS = {
    'cfg': cfg,
    'batch_norm': batch_norm
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
power_iteration Ran
ran; our contract draft was wrong, not the code
xpeng9719/defend_mi/VMI/layers.py
code served (permissive licence) · get_code("28d3a35157f2916d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Construct valid arguments for power_iteration
# W: weight matrix that will be multiplied with u and v vectors
# Shape should allow matmul operations: (4, 3) so u (1, 4) @ W (4, 3) = (1, 3)
W = torch.randn(4, 3)

# u_: list of initial vectors
# Each should be a 1D tensor with size matching W's first dimension
u_ = [
    torch.randn(1, 4),
    torch.randn(1, 4),
]

# update: boolean flag
update = True

# eps: small epsilon for numerical stability
eps = 1e-12

ARGS = {
    "W": W,
    "u_": u_,
    "update": update,
    "eps": eps,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ResNet10 Not yet run
unverified (harvested, no recorded run)
xpeng9719/defend_mi/BiDO/backbone.py
code served (permissive licence) · get_code("d30f849071ebea54")
How it ran

no invocation recorded.

ResNet10_64 Not yet run
unverified (harvested, no recorded run)
xpeng9719/defend_mi/BiDO/backbone.py
code served (permissive licence) · get_code("83d772c48bd4e1cc")
How it ran

no invocation recorded.

ResNetL_IH Not yet run
unverified (harvested, no recorded run)
xpeng9719/defend_mi/BiDO/backbone.py
code served (permissive licence) · get_code("231adc85ec00eba1")
How it ran

no invocation recorded.

calculate_frechet_distance Not yet run
unverified (harvested, no recorded run)
xpeng9719/defend_mi/DMI/fid_score.py
code served (permissive licence) · get_code("0def50a351111624")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

get_activations Not yet run
unverified (harvested, no recorded run)
xpeng9719/defend_mi/GMI/fid_score_raw.py
pointer only (licence: MIT); the stored copy get_code serves, from zmtomorrow/mmdgs_neurips, is pointer only (licence: NONE) · get_code("56afde1af5757691")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zmtomorrow/mmdgs_neurips, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_activations Not yet run
unverified (harvested, no recorded run)
xpeng9719/defend_mi/DMI/fid_score.py
code served (permissive licence) · get_code("8dcbb65408aae9e3")
How it ran

no invocation recorded.

get_activations Not yet run
unverified (harvested, no recorded run)
xpeng9719/defend_mi/DMI/fid_score_raw.py
code served (permissive licence) · get_code("c945372835eb9223")
How it ran

no invocation recorded.

get_activations Not yet run
unverified (harvested, no recorded run)
xpeng9719/defend_mi/GMI/fid_score.py
code served (permissive licence) · get_code("7a33df383fc5fb9d")
How it ran

no invocation recorded.

parse_kwargs Not yet run
unverified (harvested, no recorded run)
xpeng9719/defend_mi/VMI/model_utils.py
code served (permissive licence) · get_code("cd1a232569d08a1b")
How it ran

no invocation recorded.

proj Not yet run
unverified (harvested, no recorded run)
xpeng9719/defend_mi/VMI/layers.py
pointer only (licence: MIT); the stored copy get_code serves, from mshahbazi72/cGANTransfer, is pointer only (licence: NONE) · get_code("4015ab1f3ab9b881")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from mshahbazi72/cGANTransfer, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 18 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 3 the same month, 18 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
calculate_frechet_distance 74 other papers
28 dated earlier, 46 later
1610.09585 (2016-10)
Conditional Image Synthesis With Auxiliary Classifier GANs
1706.08500 (2017-06)
GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium
1807.11458 (2018-07)
To learn image super-resolution, use a GAN to learn how to do image degradation first
and 71 more not named here
gram_schmidt 28 other papers
17 dated earlier, 1 the same month, 8 later, 2 same year, order not determinable · 5 only as an assembly brick
1809.11096 (2018-09)
Large Scale GAN Training for High Fidelity Natural Image Synthesis
1811.10597 (2018-11)
GAN Dissection: Visualizing and Understanding Generative Adversarial Networks
1910.05852 (2019-10)
Implicit competitive regularization in GANs
and 25 more not named here
proj 28 other papers
17 dated earlier, 1 the same month, 8 later, 2 same year, order not determinable · 5 only as an assembly brick
1809.11096 (2018-09)
Large Scale GAN Training for High Fidelity Natural Image Synthesis
1811.10597 (2018-11)
GAN Dissection: Visualizing and Understanding Generative Adversarial Networks
1910.05852 (2019-10)
Implicit competitive regularization in GANs
and 25 more not named here
power_iteration 25 other papers
15 dated earlier, 1 the same month, 7 later, 2 same year, order not determinable · 5 only as an assembly brick
1809.11096 (2018-09)
Large Scale GAN Training for High Fidelity Natural Image Synthesis
1811.10597 (2018-11)
GAN Dissection: Visualizing and Understanding Generative Adversarial Networks
1910.05852 (2019-10)
Implicit competitive regularization in GANs
and 22 more not named here
imread 12 other papers
5 dated earlier, 7 later
2009.05475 (2020-09)
Adversarial score matching and improved sampling for image generation
2106.01954 (2021-06)
Do Neural Optimal Transport Solvers Work? A Continuous Wasserstein-2 Benchmark
2112.05134 (2021-12)
A Shared Representation for Photorealistic Driving Simulators
and 9 more not named here
get_activations 10 other papers
4 dated earlier, 6 later
2106.01954 (2021-06)
Do Neural Optimal Transport Solvers Work? A Continuous Wasserstein-2 Benchmark
2112.05134 (2021-12)
A Shared Representation for Photorealistic Driving Simulators
2201.12220 (2022-01)
Neural Optimal Transport
and 7 more not named here
make_layers 2 other papers
2 later
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
2411.08460 (2024-11)
Trap-MID: Trapdoor-based Defense against Model Inversion Attacks
ResNet10 1 other paper
1 later
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
ResNet10_64 1 other paper
1 later
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
ResNet18 1 other paper
1 later
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
ResNetL_IH 1 other paper
1 later
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
get_activations 1 other paper
1 later
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
get_activations 1 other paper
1 later
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
get_activations 1 other paper
1 later
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
get_in_channels 1 other paper
1 later
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
imread 1 other paper
1 later
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
imread 1 other paper
1 later
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
parse_kwargs 1 other paper
1 later
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Through using only a well-trained classifier, model-inversion (MI) attacks can recover the data used for training the classifier, leading to the privacy leakage of the training data. To defend against MI attacks, previous work utilizes a unilateral dependency optimization strategy, i.e., minimizing the dependency between inputs (i.e., features) and outputs (i.e., labels) during training the classifier. However, such a minimization process conflicts with minimizing the supervised loss that aims to maximize the dependency between inputs and outputs, causing an explicit trade-off between model robustness against MI attacks and model utility on classification tasks. In this paper, we aim to minimize the dependency between the latent representations and the inputs while maximizing the dependency between latent representations and the outputs, named a bilateral dependency optimization (BiDO) strategy. In particular, we use the dependency constraints as a universally applicable regularizer in addition to commonly used losses for deep neural networks (e.g., cross-entropy), which can be instantiated with appropriate dependency criteria according to different tasks. To verify the efficacy of our strategy, we propose two implementations of BiDO, by using two different dependency measures: BiDO with constrained covariance (BiDO-COCO) and BiDO with Hilbert-Schmidt Independence Criterion (BiDO-HSIC). Experiments show that BiDO achieves the state-of-the-art defense performance for a variety of datasets, classifiers, and MI attacks while suffering a minor classification-accuracy drop compared to the well-trained classifier with no defense, which lights up a novel road to defend against MI attacks.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2206.05483")
get_code_for_paper("2206.05483")
have("2206.05483")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2206.05483.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2206.05483.svg)](https://syntology.ai/paper/2206.05483)

Connect an agent — have() is free.