This document details the major structural and functional improvements made to the Privat1 repository to align with 2026 systems and standards.
- Legacy: The previous implementation used a dummy scikit-learn Logistic Regression model for adversarial attacks, which offered minimal protection against real-world deep learning models.
- Improved: All attacks now utilize MobileNetV2 (pre-trained on ImageNet) loaded via TensorFlow Hub. This ensures that adversarial perturbations are calculated against a representative feature space used by modern surveillance and detection systems.
- Implemented a standardized "upscale delta" technique. Attacks are computed at the model's native resolution (224x224), and the resulting adversarial noise (delta) is upscaled to the original image resolution using linear interpolation. This preserves image quality while maintaining effectiveness.
- Added comprehensive
argparsesupport to all scripts (privat1.py,FGM.py,PGD.py, etc.). - Users can now configure attack strength (
epsilon), target classes, parallel workers, and specific transformations directly from the terminal.
- Replaced basic
printstatements with the Pythonloggingmodule. - Improved error handling for missing files, corrupted images, and model loading failures.
- Migrated from legacy
os.pathstrings to the modernpathlib.PathAPI for more robust and readable file manipulation.
- Introduced
concurrent.futures.ThreadPoolExecutorin the mainprivat1.pymodule. - Batch processing of image directories is now significantly faster, especially on macOS systems utilizing
tensorflow-metalacceleration.
- Implemented a global model cache in
helpers.py. This prevents redundant downloads and re-initialization of the TensorFlow model when processing multiple images in a single session.
- The main protection pipeline now chains multiple techniques:
- Structural Distortions: Pixel shift, pattern masks, and perspective transforms to break edge detectors and bounding-box algorithms.
- Adversarial Noise: Chained PGD and FGM attacks to flip classification logits.
- Metadata Hardening: Definitive stripping of EXIF, XMP, IPTC, and ICC profiles by re-saving raw pixel data.
- Refined the metadata removal utility to ensure that even embedded LSB steganography is sanitized (unless specifically requested otherwise in the flow), preventing any forensic leakage.