Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 2.81 KB

File metadata and controls

45 lines (31 loc) · 2.81 KB

Privat1 Modernization Improvements (2026 Update)

This document details the major structural and functional improvements made to the Privat1 repository to align with 2026 systems and standards.

1. Core Framework Upgrade

Transition to Real-World Models

  • 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.

High-Resolution Perturbation Scaling

  • 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.

2. Structural Modernization

CLI and Automation

  • Added comprehensive argparse support 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.

Reliability and Logging

  • Replaced basic print statements with the Python logging module.
  • Improved error handling for missing files, corrupted images, and model loading failures.

Path Management

  • Migrated from legacy os.path strings to the modern pathlib.Path API for more robust and readable file manipulation.

3. Performance Optimizations

Parallel Processing

  • Introduced concurrent.futures.ThreadPoolExecutor in the main privat1.py module.
  • Batch processing of image directories is now significantly faster, especially on macOS systems utilizing tensorflow-metal acceleration.

Model Caching

  • 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.

4. Enhanced Obfuscation Logic

Chained Protection Flow

  • The main protection pipeline now chains multiple techniques:
    1. Structural Distortions: Pixel shift, pattern masks, and perspective transforms to break edge detectors and bounding-box algorithms.
    2. Adversarial Noise: Chained PGD and FGM attacks to flip classification logits.
    3. Metadata Hardening: Definitive stripping of EXIF, XMP, IPTC, and ICC profiles by re-saving raw pixel data.

Improved Metadata Stripping

  • 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.