Skip to content

Adding e2e testing for all mia attacks#375

Open
henrikfo wants to merge 9 commits intomainfrom
e2e_mia
Open

Adding e2e testing for all mia attacks#375
henrikfo wants to merge 9 commits intomainfrom
e2e_mia

Conversation

@henrikfo
Copy link
Copy Markdown
Collaborator

@henrikfo henrikfo commented Feb 18, 2026

Description

Adding e2e testing for all mia attacks.
Making sure that if any attack breaking feature is introduced, it should be caught.

------ WiP -----
loss_traj and HSJ are failing, but these issues will be dealt with.

Resolved Issues

How Has This Been Tested?

Ran the tests that is implemented here.

@henrikfo henrikfo added priority - 2 High priority. Can break core features of LeakPro. Needs to be fixed as soon as possible. Testing labels Feb 18, 2026
@henrikfo henrikfo self-assigned this Feb 18, 2026
@henrikfo henrikfo changed the title Adding e2e testing for all mia attacks WiP - Adding e2e testing for all mia attacks Feb 19, 2026
out_member_indices = self.audit_dataset["out_members"]

audit_in_member_indicies = np.random.choice(in_member_indices,
self.audit_in_member_indicies = np.random.choice(in_member_indices,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fazelehh When I updated the return statement for HSJ with MIAResult.from_full_scores(...) it complained that len(true_labels) != len(perturbation_distances), so I updated how the true_labels are created.

@henrikfo henrikfo changed the title WiP - Adding e2e testing for all mia attacks Adding e2e testing for all mia attacks Mar 1, 2026
Copy link
Copy Markdown
Collaborator

@fazelehh fazelehh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. PATCHED_ATTACK_BLOCKERS is empty but the meta-test doesn't warn about it

PATCHED_ATTACK_BLOCKERS = {} # empty
assert all(len(reason) > 0 for reason in PATCHED_ATTACK_BLOCKERS.values()) # vacuously True
This is fine logically, but if someone adds an attack to PATCHED_ATTACKS without a reason, the assertion silently passes. A comment here would help future contributors.

  1. seqmia special-case sets input_size=5 with a comment about "5 metrics per trajectory step" , but TinyTimeSeriesTargetModel.input_size=2. Worth confirming seqmia uses the image path (not time-series) and that input_size in its AttackConfig is independent of the model input size.

  2. result.id assumed to exist
    result_file = output_dir / "results" / result.id / "result.txt"
    This will fail with an AttributeError if MIAResult doesn't have an id field. Worth adding an assertion like assert hasattr(result, 'id') before using it, or confirming MIAResult always has this.

4.(optional) RMIA uses full population for train+test. A comment explaining why RMIA gets a different split would help reviewers.

@henrikfo
Copy link
Copy Markdown
Collaborator Author

henrikfo commented Apr 8, 2026

  1. PATCHED_ATTACK_BLOCKERS is empty but the meta-test doesn't warn about it

PATCHED_ATTACK_BLOCKERS = {} # empty assert all(len(reason) > 0 for reason in PATCHED_ATTACK_BLOCKERS.values()) # vacuously True This is fine logically, but if someone adds an attack to PATCHED_ATTACKS without a reason, the assertion silently passes. A comment here would help future contributors.

Removed the "Patched" logic. It's unnecessary all implemented attack now runs the real attack. Might Implement something like this for an e2e for minva instead, where there might exist blockers or hard compute constraints than mia.

  1. seqmia special-case sets input_size=5 with a comment about "5 metrics per trajectory step" , but TinyTimeSeriesTargetModel.input_size=2. Worth confirming seqmia uses the image path (not time-series) and that input_size in its AttackConfig is independent of the model input size.

seqmia uses TinyImageInputHandler and not TinyTimeSeriesTargetModel since the LSTM model in the attack is evaluating the loss trajectory and not the data itself.

  1. result.id assumed to exist
    result_file = output_dir / "results" / result.id / "result.txt"
    This will fail with an AttributeError if MIAResult doesn't have an id field. Worth adding an assertion like assert hasattr(result, 'id') before using it, or confirming MIAResult always has this.

Fixed! Added a few statements that checks this and makes sure that MIAResult.id is a string exists etc.

4.(optional) RMIA uses full population for train+test. A comment explaining why RMIA gets a different split would help reviewers.

Added comments mentioning the fact that it does sample from the full population. But I assume that you meant why RMIA does sample like this and not like the paper or? Because from what I remember, RMIA could not have train + test sizes = 1. Why was this changed, do you know? I have not really followed that change and now the z, the known-out data is sampled from the whole population

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority - 2 High priority. Can break core features of LeakPro. Needs to be fixed as soon as possible. Review Needed Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thorough LeakPro runtime test.

2 participants