DEF-rfpar / README.md
ilessio-aiflowlab's picture
Upload folder using huggingface_hub
7322757 verified
metadata
tags:
  - robotics
  - anima
  - adversarial-attacks
  - reinforcement-learning
  - pixel-attack
  - image-classification
  - object-detection
  - robot-flow-labs
library_name: pytorch
pipeline_tag: robotics
license: apache-2.0
datasets:
  - imagenet-1k
  - coco

DEF-rfpar — RFPAR: Remember and Forget Pixel Attack using RL

Part of the ANIMA Perception Suite by Robot Flow Labs.

Paper

RFPAR: Remember and Forget Pixel Attack using Reinforcement Learning (ArXiv 2502.07821) Dongsu Song, Daehwa Ko, Jay Hoon Jung — Korea Aerospace University

Architecture

RFPAR uses a REINFORCE policy network (Conv2d + FC) to select optimal pixel perturbations for black-box adversarial attacks. The Remember and Forget process:

  • Remember: Train RL agent to find effective pixel perturbations via one-step policy gradient
  • Forget: Reset agent parameters, keep successful perturbations in memory, re-optimize

CUDA-accelerated pixel perturbation kernels (sm_89, L4) for parallel sampling and batch reward computation.

Results

Classification (200 ImageNet images, ResNeXt50, alpha=0.01, T=3)

Metric Our Result Paper
Attack Success Rate 94.0% ~93%
Mean L0 151.7 138
Mean L2 6.41
Average Queries 454 ~500
Forget Iterations 100 100

Detection (5000 COCO val2017, YOLOv8n, alpha=0.05, T=20)

Campaign running — results will be updated.

Paper reference: RM=0.91, mAP=0.111, L0=2043, Queries=1254

Exported Formats

Format Classification Use Case
PyTorch (.pth) pytorch/rfpar_cls_v1.pth Training, fine-tuning
SafeTensors pytorch/rfpar_cls_v1.safetensors Fast loading, safe
ONNX onnx/rfpar_cls_v1.onnx Cross-platform inference
TensorRT FP16 tensorrt/rfpar_cls_v1_fp16.trt Edge deployment (Jetson/L4)
TensorRT FP32 tensorrt/rfpar_cls_v1_fp32.trt Full precision inference

Usage

import torch
from anima_rfpar.agent import REINFORCEAgent

agent = REINFORCEAgent(224, 224, 3, detector_mode=False)
ckpt = torch.load("pytorch/rfpar_cls_v1.pth", weights_only=False)
agent.load_state_dict(ckpt["agent_state_dict"])
agent.eval()

image = torch.randn(1, 3, 224, 224)  # [0, 1] normalized
action_mean, action_std = agent(image)
# action_mean: (1, 5) -> sigmoid -> (x, y, r, g, b)

Training

  • Hardware: NVIDIA L4 (23GB VRAM)
  • CUDA: 12.8 (PyTorch cu128) + custom CUDA kernels (sm_89)
  • Framework: PyTorch 2.11
  • Time: 1019s (classification, 200 images, 100 Forget iterations)

Product Stack

ATLAS / ORACLE — Defense Marketplace

License

Apache 2.0 — Robot Flow Labs / AIFLOW LABS LIMITED

Built with ANIMA by Robot Flow Labs