/foolbox-tensorflow-keras-applications

The pretrained TensorFlow Keras models with a Foolbox Zoo compatible interface

Primary LanguagePython

TensorFlow pretrained ImageNet models for Foolbox

This repository provides the Keras Applications (pretrained ImageNet models) in a Foolbox Native compatible format.

This code requires Foolbox 3.0 or newer.

Example

import foolbox as fbn

url = "https://github.com/jonasrauber/foolbox-tensorflow-keras-applications"
fmodel = fbn.zoo.get_model(url, name="MobileNetV2")

images, labels = fbn.samples(fmodel, dataset='imagenet', batchsize=16)
print(fbn.accuracy(fmodel, images, labels))
# -> 0.9375

# you can now attack fmodel using Foolbox attacks
# ...

Supported Models

  • DenseNet121
  • DenseNet169
  • DenseNet201
  • InceptionResNetV2
  • InceptionV3
  • MobileNet
  • MobileNetV2
  • NASNetLarge
  • NASNetMobile
  • ResNet50
  • ResNet101
  • ResNet152
  • ResNet50V2
  • ResNet101V2
  • ResNet152V2
  • VGG16
  • VGG19
  • Xception