Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Keras implementation of "One pixel attack for fooling deep neural networks" using differential evolution on Cifar10 and ImageNet
| Date | Stars |
|---|---|
| 2026-07-24 | 1235 |
| 2026-07-25 | 1235 |
| 2026-07-28 | 1235 |
| 2026-07-30 | 1235 |
| 2026-07-31 | 1236 |
| 2026-08-06 | 1236 |
Today
— stars today
This week
+1 stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.08%/day
# One Pixel Attack [](https://colab.research.google.com/github/hyperparticle/one-pixel-attack-keras/blob/master/1_one-pixel-attack-cifar10.ipynb) [](CONTRIBUTING.md) [](LICENSE) [](https://www.reddit.com/r/ProgrammerHumor/comments/79g0m6/one_pixel_attack_for_fooling_deep_neural_networks/?ref=share&ref_source=link) How simple is it to cause a deep neural network to misclassify an image if an attacker is only allowed to modify the color of one pixel and only see the prediction probability? Turns out it is very simple. In many cases, an attacker can even cause the network to return any answer they want. The following project is a Keras reimplementation and tutorial of ["One pixel attack for fooling deep neural networks"](https://arxiv.org/abs/1710.08864). The official code for the paper can be found [here](https://github.com/Carina02/One-Pixel-Attack). ## How It Works For this attack, we will use the [Cifar10 dataset](https://www.cs.toronto.edu/~kriz/cifar.html). The task of the dataset is to correctly classify a 32x32 pixel image in 1 of 10 categories (e.g., bird, deer, truck). The black-box attack requires only the probability labels (the probability value for each category) that get outputted by the neural network. We generate adversarial images by selecting a pixel and modifying it to a certain color. By using an Evolutionary Algorithm called [Differential Evolution](https://en.wikipedia.org/wiki/Differential_evolution) (DE), we can iteratively generate adversarial images to try to minimize the confidence (probability) of the neural network's classification. [](https://en.wikipedia.org/wiki/Differential_evolution) <sub><sup>Credit: [Pablo R. Mier's Blog](https://pablormier.github.io/2017/09/05/a-tutorial-on-differential-evolution-with-python/)</sup></sub> First, generate several adversarial samples that modify a random pixel and run the images through the neural network. Next, combine the previous pixels' positions and colors together, generate several more adversarial samples from them, and run the new images through the neural network. If there were pixels that lowered the confidence of the network from the last step, replace them as the current best known solutions. Repeat these steps for a few iterations; then on the last step return the adversarial image that reduced the network's confidence the most. If successful, the confidence would be reduced so much that a new (incorrect) category now has the highest classification confidence. See below for some examples of successful attacks: [](1_one-pixel-attack-cifar10.ipynb) ## Getting Started Need a GPU or just want to read? [View the first tutorial notebook with Google Colab](https://colab.research.google.com/github/hyperparticle/one-pixel-attack-keras/blob/master/1_one-pixel-attack-cifar10.ipynb). To run the code in the tutorial locally, a dedicated GPU suitable for running with Keras (`tensorflow-gpu`) is recommended. Python 3.5+ required. 1. Clone the repository. ```bash git clone https://github.com/Hyperparticle/one-pixel-attack-keras cd ./one-pixel-attack-keras ``` 2. Install the python packages in requirements.txt if you don't have them already. ```bash pip install -r ./requirements.txt ``` 3. Run the iPython tutorial notebook with Jupyter. ```bash jupyter notebook ./one-pixel-attack.ipynb ``` ## Training and Testing To train a model, run `train.py`. The model will be checkpointed (saved) after each epoch to the `networks/models` directory. For example, to train a ResNet with 200 epochs and a batch size of 128: ```bash python train.py --model resnet --epochs 200 --batch_size
Excerpt of 9,357 characters
Read on GitHub54
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:3c3ee5cf6ea27a45, topic:deep-learning, topic:neural-network, topic:tensorflow