Papers › UnMask: Adversarial Detection and Defense Through Robust Feature Alignment

UnMask: Adversarial Detection and Defense Through Robust Feature Alignment

21 Feb 2020arXiv:2002.09576archive 2025-07-28

Scott Freitas, Shang-Tse Chen, Zijie J. Wang, Duen Horng Chau

Deep learning models are being integrated into a wide range of high-impact, security-critical systems, from self-driving cars to medical diagnosis. However, recent research has demonstrated that many of these deep learning architectures are vulnerable to adversarial attacks--highlighting the vital need for defensive techniques to detect and mitigate these attacks before they occur. To combat these adversarial attacks, we developed UnMask, an adversarial detection and defense framework based on robust feature alignment. The core idea behind UnMask is to protect these models by verifying that an image's predicted class ("bird") contains the expected robust features (e.g., beak, wings, eyes). For example, if an image is classified as "bird", but the extracted features are wheel, saddle and frame, the model may be under attack. UnMask detects such attacks and defends the model by rectifying the misclassification, re-classifying the image based on its robust features. Our extensive evaluation shows that UnMask (1) detects up to 96.75% of attacks, and (2) defends the model by correctly classifying up to 93% of adversarial images produced by the current strongest attack, Projected Gradient Descent, in the gray-box setting. UnMask provides significantly better protection than adversarial training across 8 attack vectors, averaging 31.18% higher accuracy. We open source the code repository and data with this paper: https://github.com/safreita1/unmask.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2002.09576")

Code

Syntology Ran 5 of 12 code samples harvested from 1 repository linked to this paper; 7 have no recorded run. Of those that ran: 2 ran · our draft was wrong; 3 ran with no contract checked.

By repository: official repository: 12 samples from 1 repository, 5 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

safreita1/unmask officialmentioned in papermentioned on GitHubtfMIT report
Yuxin33/unmask mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 5 ran; 0 honoured the contract we drafted; 7 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · our draft was wrong
3ran
7unverified

Licence: 0 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from safreita1/unmask. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

binary_mask_to_rle safreita1/unmask/pycococreatortools/pycococreatortools.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · d805cf01161ac845 · report
close_contour safreita1/unmask/pycococreatortools/pycococreatortools.py official repository ran fingerprinted MIT (permissive) · 24680b34da633bbd · report
compute_backbone_shapes safreita1/unmask/Mask_RCNN/mrcnn/model.py official repository ran · our draft was wrong MIT (permissive) · ae91aee49740c295 · report
conv_block safreita1/unmask/Mask_RCNN/mrcnn/model.py official repository ran MIT (permissive) · 719785e60bebf517 · report
resize_binary_mask safreita1/unmask/pycococreatortools/pycococreatortools.py official repository ran MIT (permissive) · 85747a26d672282d · report
color_map safreita1/unmask/parts_extraction/VOClabelcolormap.py official repository unverified MIT (permissive) · 1288df8c4540b10d · report
get_ax safreita1/unmask/extract_features.py official repository unverified MIT (permissive) · 217810b770db68cd · report
get_layer_from_idx safreita1/unmask/utils.py official repository unverified MIT (permissive) · 36e7b417b97a66fb · report
get_layers safreita1/unmask/utils.py official repository unverified MIT (permissive) · 068d3d6699b81f75 · report
identity_block safreita1/unmask/Mask_RCNN/mrcnn/model.py official repository unverified MIT (permissive) · 28c3981539e97ab6 · report
make_idx_dict safreita1/unmask/utils.py official repository unverified MIT (permissive) · e0fb1cfd384c630b · report
train_valid_split safreita1/unmask/models/model_builder.py official repository unverified MIT (permissive) · d05450b2f519a8c0 · report

Tasks

Medical DiagnosisSelf-Driving Cars

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections