what API documentation

# what

WHite-box Adversarial Toolbox (WHAT) is a python library for Deep Learning Security that focuses on realtime white-box attacks.

## Installation

    pip install whitebox-adversarial-toolbox

Then you can use the cli tool `what` to try real-time adversarial attacks.

    sage: what [OPTIONS] COMMAND [ARGS]...

      The CLI tool for WHite-box Adversarial Toolbox (WHAT).

    Options:
      --help  Show this message and exit.

    Commands:
      attack   Manage Attacks
      example  Manage Examples
      model    Manage Deep Learning Models

## what.models

Use `what model list` to list available models:

                    Model                      Model Type           Description
    ----------------------------------------------------------------------------------------------------
    [ ] 1 : YOLOv3      (    Darknet    )   Object Detection        YOLOv3 pretrained on MS COCO dataset.
    [ ] 2 : YOLOv3      (   Mobilenet   )   Object Detection        YOLOv3 pretrained on MS COCO dataset.
    [ ] 3 : YOLOv3 Tiny (    Darknet    )   Object Detection        YOLOv3 Tiny pretrained on MS COCO dataset.
    [ ] 4 : YOLOv3 Tiny (   MobileNet   )   Object Detection        YOLOv3 Tiny pretrained on MS COCO dataset.
    [ ] 5 : YOLOv4      (    Darknet    )   Object Detection        YOLOv4 pretrained on MS COCO dataset.
    [ ] 6 : YOLOv4 Tiny (    Darknet    )   Object Detection        YOLOv4 Tiny pretrained on MS COCO dataset.
    [ ] 7 : SSD         ( MobileNet  v1 )   Object Detection        SSD pretrained on VOC-2012 dataset.
    [ ] 8 : SSD         ( MobileNet  v2 )   Object Detection        SSD pretrained on VOC-2012 dataset.
    [ ] 9 : FasterRCNN  (     VGG16     )   Object Detection        Faster-RCNN pretrained on VOC-2012 dataset.

Use `what model download` to download pre-trained models:

                    Model                      Model Type           Description
    ----------------------------------------------------------------------------------------------------
    [x] 1 : YOLOv3      (    Darknet    )   Object Detection        YOLOv3 pretrained on MS COCO dataset.
    [x] 2 : YOLOv3      (   Mobilenet   )   Object Detection        YOLOv3 pretrained on MS COCO dataset.
    [x] 3 : YOLOv3 Tiny (    Darknet    )   Object Detection        YOLOv3 Tiny pretrained on MS COCO dataset.
    [x] 4 : YOLOv3 Tiny (   MobileNet   )   Object Detection        YOLOv3 Tiny pretrained on MS COCO dataset.
    [x] 5 : YOLOv4      (    Darknet    )   Object Detection        YOLOv4 pretrained on MS COCO dataset.
    [x] 6 : YOLOv4 Tiny (    Darknet    )   Object Detection        YOLOv4 Tiny pretrained on MS COCO dataset.
    [x] 7 : SSD         ( MobileNet  v1 )   Object Detection        SSD pretrained on VOC-2012 dataset.
    [x] 8 : SSD         ( MobileNet  v2 )   Object Detection        SSD pretrained on VOC-2012 dataset.
    [x] 9 : FasterRCNN  (     VGG16     )   Object Detection        Faster-RCNN pretrained on VOC-2012 dataset.

    Please input the model index:

## what.attacks

Use `what attack list` to list available attacks:

    1 : TOG Attack  Object Detection
    2 : PCB Attack  Object Detection

Related Papers:

- Adversarial Objectness Gradient Attacks in Real-time Object Detection Systems.
- A Man-in-the-Middle Attack against Object Detection Systems.

## what.examples

Use `what example list` to list available examples:

               Demo                Type             Description
    --------------------------------------------------------------------------------
    1 :     Yolov3 Demo      Model Inference        Yolov3 Object Detection.
    2 :     Yolov4 Demo      Model Inference        Yolov4 Object Detection.
    3 :   FasterRCNN Demo    Model Inference        FRCNN Object Detection.
    4 : MobileNet SSD Demo   Model Inference        MobileNet SSD Object Detection.
    5 :  TOG Attack Demo    Adversarial Attack      Real-time TOG Attack against Yolov3 Tiny.
    6 :  PCB Attack Demo    Adversarial Attack      Real-time PCB Attack against Yolov3 Tiny.

Use `what example run` to run examples.

               Demo                Type             Description
    --------------------------------------------------------------------------------
    1 :     Yolov3 Demo      Model Inference        Yolov3 Object Detection.
    2 :     Yolov4 Demo      Model Inference        Yolov4 Object Detection.
    3 :   FasterRCNN Demo    Model Inference        FRCNN Object Detection.
    4 : MobileNet SSD Demo   Model Inference        MobileNet SSD Object Detection.
    5 :  TOG Attack Demo    Adversarial Attack      Real-time TOG Attack against Yolov3 Tiny.
    6 :  PCB Attack Demo    Adversarial Attack      Real-time PCB Attack against Yolov3 Tiny.

    Please input the example index:

## what.utils

This module implements several utility functions.

View Source

      1r'''
      2WHite-box Adversarial Toolbox (WHAT) is a python library for Deep Learning Security that focuses on realtime white-box attacks.
      3
      4## Installation
      5
      6```
      7pip install whitebox-adversarial-toolbox
      8```
      9
     10Then you can use the cli tool `what` to try real-time adversarial attacks.
     11
     12```
     13sage: what [OPTIONS] COMMAND [ARGS]...
     14
     15  The CLI tool for WHite-box Adversarial Toolbox (WHAT).
     16
     17Options:
     18  --help  Show this message and exit.
     19
     20Commands:
     21  attack   Manage Attacks
     22  example  Manage Examples
     23  model    Manage Deep Learning Models
     24```
     25
     26<br />
     27
     28## what.models
     29
     30Use `what model list` to list available models:
     31
     32```
     33                Model                      Model Type           Description
     34----------------------------------------------------------------------------------------------------
     35[ ] 1 : YOLOv3      (    Darknet    )   Object Detection        YOLOv3 pretrained on MS COCO dataset.
     36[ ] 2 : YOLOv3      (   Mobilenet   )   Object Detection        YOLOv3 pretrained on MS COCO dataset.
     37[ ] 3 : YOLOv3 Tiny (    Darknet    )   Object Detection        YOLOv3 Tiny pretrained on MS COCO dataset.
     38[ ] 4 : YOLOv3 Tiny (   MobileNet   )   Object Detection        YOLOv3 Tiny pretrained on MS COCO dataset.
     39[ ] 5 : YOLOv4      (    Darknet    )   Object Detection        YOLOv4 pretrained on MS COCO dataset.
     40[ ] 6 : YOLOv4 Tiny (    Darknet    )   Object Detection        YOLOv4 Tiny pretrained on MS COCO dataset.
     41[ ] 7 : SSD         ( MobileNet  v1 )   Object Detection        SSD pretrained on VOC-2012 dataset.
     42[ ] 8 : SSD         ( MobileNet  v2 )   Object Detection        SSD pretrained on VOC-2012 dataset.
     43[ ] 9 : FasterRCNN  (     VGG16     )   Object Detection        Faster-RCNN pretrained on VOC-2012 dataset.
     44```
     45
     46Use `what model download` to download pre-trained models:
     47
     48```
     49                Model                      Model Type           Description
     50----------------------------------------------------------------------------------------------------
     51[x] 1 : YOLOv3      (    Darknet    )   Object Detection        YOLOv3 pretrained on MS COCO dataset.
     52[x] 2 : YOLOv3      (   Mobilenet   )   Object Detection        YOLOv3 pretrained on MS COCO dataset.
     53[x] 3 : YOLOv3 Tiny (    Darknet    )   Object Detection        YOLOv3 Tiny pretrained on MS COCO dataset.
     54[x] 4 : YOLOv3 Tiny (   MobileNet   )   Object Detection        YOLOv3 Tiny pretrained on MS COCO dataset.
     55[x] 5 : YOLOv4      (    Darknet    )   Object Detection        YOLOv4 pretrained on MS COCO dataset.
     56[x] 6 : YOLOv4 Tiny (    Darknet    )   Object Detection        YOLOv4 Tiny pretrained on MS COCO dataset.
     57[x] 7 : SSD         ( MobileNet  v1 )   Object Detection        SSD pretrained on VOC-2012 dataset.
     58[x] 8 : SSD         ( MobileNet  v2 )   Object Detection        SSD pretrained on VOC-2012 dataset.
     59[x] 9 : FasterRCNN  (     VGG16     )   Object Detection        Faster-RCNN pretrained on VOC-2012 dataset.
     60
     61Please input the model index:
     62```
     63
     64<br />
     65
     66## what.attacks
     67
     68Use `what attack list` to list available attacks:
     69
     70```
     711 : TOG Attack  Object Detection
     722 : PCB Attack  Object Detection
     73```
     74
     75Related Papers:
     76
     77- [Adversarial Objectness Gradient Attacks in Real-time Object Detection Systems](https://ieeexplore.ieee.org/document/9325397).
     78- [A Man-in-the-Middle Attack against Object Detection Systems](https://arxiv.org/abs/2208.07174).
     79
     80<br />
     81
     82## what.examples
     83
     84Use `what example list` to list available examples:
     85
     86```
     87           Demo                Type             Description
     88--------------------------------------------------------------------------------
     891 :     Yolov3 Demo      Model Inference        Yolov3 Object Detection.
     902 :     Yolov4 Demo      Model Inference        Yolov4 Object Detection.
     913 :   FasterRCNN Demo    Model Inference        FRCNN Object Detection.
     924 : MobileNet SSD Demo   Model Inference        MobileNet SSD Object Detection.
     935 :  TOG Attack Demo    Adversarial Attack      Real-time TOG Attack against Yolov3 Tiny.
     946 :  PCB Attack Demo    Adversarial Attack      Real-time PCB Attack against Yolov3 Tiny.
     95```
     96
     97Use `what example run` to run examples.
     98
     99```
    100           Demo                Type             Description
    101--------------------------------------------------------------------------------
    1021 :     Yolov3 Demo      Model Inference        Yolov3 Object Detection.
    1032 :     Yolov4 Demo      Model Inference        Yolov4 Object Detection.
    1043 :   FasterRCNN Demo    Model Inference        FRCNN Object Detection.
    1054 : MobileNet SSD Demo   Model Inference        MobileNet SSD Object Detection.
    1065 :  TOG Attack Demo    Adversarial Attack      Real-time TOG Attack against Yolov3 Tiny.
    1076 :  PCB Attack Demo    Adversarial Attack      Real-time PCB Attack against Yolov3 Tiny.
    108
    109Please input the example index:
    110```
    111
    112<br />
    113
    114## what.utils
    115
    116This module implements several utility functions.
    117
    118<br />
    119
    120'''
    121
    122# Project Imports
    123from what import models
    124from what import attacks
    125from what import utils
    126
    127# Semantic Version
    128__version__ = "0.1.0"