FAI Practical Project · Neural Network Simulator

NeuroPredict

Understand How Neural Networks Learn.

NeuroPredict trains a real neural network, written from scratch in Python and NumPy, on the classic XOR problem. You can watch its weights change, follow its loss going down, and test its predictions – all from your browser.

Live view of the current model · line thickness = weight size

What is a neural network?

A neural network is a computer model inspired by the brain. It is made of small units called neurons arranged in layers. Each connection has a weight that says how important it is. The network learns by looking at examples, measuring how wrong it is (the loss), and slowly adjusting its weights to become less wrong. This adjusting process is called training.

Key features

🧠

Real neural network

A 2-input, 1-hidden-layer, 1-output network coded from scratch with NumPy – no ML libraries.

🕸️

Interactive visualizer

See every neuron and weight. Run a forward pass and watch data flow through the layers.

⚙️

Training simulator

Choose epochs, learning rate and hidden neurons. Start, stop and reset training anytime.

🎯

Live predictions

Enter two binary inputs and get the model's real output probability and confidence.

📈

Real training graphs

Loss and accuracy charts drawn from the values the Python backend actually records.

📘

Learning centre

15 short lessons on AI, ML and neural networks in simple English with examples.

How the system works

Choose settings

Pick epochs, learning rate and hidden neurons in the simulator.

Flask receives

The browser sends the settings to the Flask backend as JSON.

NumPy trains

Forward pass → loss → backpropagation → gradient descent, repeated every epoch.

See results

The website reads real loss, accuracy and weights and updates the charts and diagram.

Overview

Dashboard

Current state of the neural network. Every value below comes from the Python backend.

Total epochs
0
trained so far
Current loss
–
binary cross-entropy
Training accuracy
–
correct of 4 XOR samples
Model status
untrained
learning rate: –

Model predictions on the XOR dataset

Input 1Input 2ExpectedModel output (probability)PredictedResult

Dataset information

DatasetXOR Samples4 Input features2 Output classes2 (0 / 1) Architecture2-4-1 ActivationSigmoid Loss functionBCE Random seed42

XOR is not linearly separable, so a single straight line cannot separate the classes. A hidden layer solves this.

Inside the model

Neural Network Visualizer

The diagram is drawn from the model's real weights. Blue lines are positive weights, pink lines are negative, and thicker lines mean bigger weights. Pick an input to run a forward pass.

XOR network

untrained
positive weight negative weight neuron activation (brightness) b = bias

Run a forward pass

Choose an XOR input:

Activation function: Sigmoid

σ(z) = 1 / (1 + e−z)

Sigmoid turns any number into a value between 0 and 1. Large positive inputs give values near 1, large negative inputs give values near 0. That is why the output can be read as a probability.

Current weights and biases

Train the model

Training Simulator

Training runs in the Python backend. The website only sends your settings and displays the real progress.

Settings

Changing hidden neurons creates a new network. Starting again without reset continues training from the current weights.

Live training

untrained
Epoch
0
Loss
–
Accuracy
–
Progress
0%

Training log

Ask the model

Prediction Module

Enter two binary values. They are sent to Flask, passed through the trained network, and the real output is shown.

Inputs

Result

Press Predict to see the model's answer.

All four XOR inputs

Input 1Input 2ExpectedModel outputPredictedResult
Training insights

Training Graphs

These graphs are drawn only from values recorded by the backend during training. Before training they are empty.

Loss vs Epochs

Accuracy vs Epochs

Training progress

0%

0 / 0 epochs

Summary of the last run

First recorded loss– Latest loss– Loss reduction– First epoch with 100% accuracy– Learning rate / hidden neurons– Recorded points–
Learn the basics

Learning Centre

Fifteen short lessons, in order. Click a topic to open it.

Project details

About NeuroPredict

Project title

NeuroPredict – An Interactive Neural Network Simulator

Project objective

To build a website that shows, step by step and with real computation, how an artificial neural network learns the XOR function using forward propagation, backpropagation and gradient descent.

Problem statement

Neural networks are usually taught with formulas and static diagrams, so beginners find it hard to "see" how weights change and how a network actually learns. Ready-made libraries also hide the internal steps.

Proposed solution

A from-scratch NumPy neural network served by Flask, with a web interface that trains it live, draws its weights, plots real loss and accuracy, makes predictions and explains each concept in simple language.

Technologies used

HTML5CSS3JavaScriptChart.jsSVGPython 3FlaskNumPy

Project scope

Educational demonstration of a small feed-forward network (2 inputs, 2–8 hidden neurons, 1 output) on the 4-sample XOR dataset. Runs locally on a laptop; no cloud services or paid APIs. Not intended for large real-world datasets.

Team details

InstituteUnitedworld Institute of Technology (UIT), Karnavati University
Programme / SemesterB.Tech CSE (Cyber Security) – Semester I
SubjectFundamentals of Artificial Intelligence (FAI) – 26UTU01003
Group number14
Class / Section1-CYBER-A
Team membersKasak Nikhil Shah – 2000012734
Heer Vishal Khatri – 2000014761
Harshil Samir Shah – 2000016272
Faculty guidesKhyati Karia and Bhaumik Patel
Academic year2026–27