@ericyocam6
Eric YocamDeveloper▲35
Professor, California Polytechnic State University
4d ago · New project · Agents · San Luis Obispo

Shipped: Defending Classical Neural Networks Against Adversarial AI

An open-source AI security research proof of concept investigating how adversarial training can improve the robustness of classical Convolutional Neural Networks (CNNs).

The framework trains a neural network for handwritten digit recognition and evaluates its performance against multiple white-box adversarial attacks.

Attack techniques include Fast Gradient Sign Method (FGSM), Carlini-Wagner (CW), and Projected Gradient Descent (PGD), along with compounded attack combinations.

The project applies adversarial training by incorporating manipulated examples into the model's training process, allowing researchers to compare classification performance before and after defensive training.

The framework supports handwritten digit datasets including MNIST and EMNIST, with additional dataset options documented in the repository.

Experiments examine model accuracy, adversarial misclassification, and the effectiveness of defensive training under selected attack conditions.

Designed for AI security researchers, machine learning engineers, students, and educators exploring practical adversarial robustness techniques.

This is an educational research demonstration rather than a certified production defense. Its findings do not establish robustness against all possible attacks or adaptive adversaries.

Defending Classical Neural Networks Against Adversarial AI logoDefending Classical Neural Networks Against Adversarial AI@ericyocam/classical-cnn-adversarial-defense · github.com/ericyoc/adversarial-defense-cnn-poc
Adversarial AIAI SecurityAdversarial TrainingCNNDeep LearningMachine LearningModel RobustnessPyTorch

Comments2

  • @ryanallis
    Ryan Allis
    Founder of AI Lounge and SaasRise, helping founders reach $100M+ exits
    3d ago

    Teaching the system with the very images meant to trick it, then showing how many digits it still reads correctly afterward, turns a scary idea into something a student can watch get better. Teachers who need to show that AI can be fooled and also fixed get that second half here, and most demos leave it out.

  • @ericyocam
    Eric Yocam
    Agentic AI that performs cyber quantum ai activities
    3d ago

    Thanks, Ryan! That's exactly what I wanted to demonstrate. Students often learn how adversarial attacks can fool AI models, but it's equally important to understand how those models can be defended. By comparing classification accuracy before and after adversarial training, they can see both the benefits and limitations of the defense. The goal is to show that AI security isn't just about identifying vulnerabilities, but also developing and testing ways to mitigate them. Appreciate your perspective!

Log in to join the thread.