How 1997alireza/face-off works
Main components
• User Interface and Configuration:
• Files: options.html and options.js.
• Purpose: Provide an interface for users to set parameters (e.g., epsilon values, attack settings) and view results.
• Core Attack Modules:
• Face Detection Attack Module:
– File: face-detector.js
– Associated scripts: perturbation.js and image-tools.js.
• Face Recognition Attack Module:
– File: pgd-impersonator.js
– Likely integrated with faceprivacy.js (or serves as an orchestrator).
• Utility and Reporting:
• Files: tools.js and report-generator.js.
• Purpose: Provide common utilities for image manipulation and generate reports that document how the perturbations have affected output (also indicated by the documentation in docs/).
Relationships and interactions
• Input and Preprocessing:
• An image (or dataset from datasets/victims.json) is loaded.
• Utility functions (from image-tools.js and tools.js) preprocess the image.
• Diverging attack pipelines:
• The core controller (possibly faceprivacy.js) decides which attack (detection or recognition) to run based on user input or config parameters.
• In the face detection route, face-detector.js applies the detection model using pre-trained weights (found in models/faceapi-ssdMobilenetV1-weights), and perturbation.js modifies the image based on a loss function that reduces the model’s detection capability.
• Output:
• The resulting perturbed images are stored or visualized.
• A report is generated (with report-generator.js) and documented within the docs/ directory (as evidenced by sample outputs and reports in the docs folder).
Architectural design principles
• Modularity: The system is clearly split into separate modules for detection and recognition attacks.
• Reusability: Shared utility functions and tools are kept separate.
• Extensibility: Separate pipelines make it straightforward to integrate additional models or attack types in the future.
• Separation of Concerns: UI (options.html/js) allows configuration while core processing is handled by distinct modules.
Relevant technologies
• JavaScript (for both front-end and core logic).
• Pre-trained models (SSD MobileNet V1 for detection and InceptionResnetV1 for recognition) stored under the models directory.
• Adversarial attack algorithms (PGD with momentum) and image augmentation methods.
• Possibly web technologies (HTML/CSS/JS) if this is deployed as a web tool.
– “User Interface & Configuration” for options.html/options.js.
– “Image Input & Preprocessing” for loading images/datasets using tools from image-tools.js.
– “Face Detection Module” (including face-detector.js, perturbation.js, models/faceapi-ssdMobilenetV1-weights).
– “Face Recognition Module” (including pgd-impersonator.js, faceprivacy.js, FaceNet model integration).
– “Utilities & Reporting” (tools.js and report-generator.js).
– From UI to image ingestion,
– From preprocessing to both attack modules,
– And then converge outputs to the reporting module.
– Core processing logic,
– Configuration/Interface elements,
– External models/data.