A comprehensive repository documenting my exploration into Artificial Intelligence and Neural Networks during my final year of study. This project serves as both a learning resource and a practical implementation guide for various neural network architectures.
This repository transitioned? from implementing a simple XOR operation using neural networks into a more extensive study of deep learning Neural Network.., with a focus on EEG Signal Processing and Motor Imagery Classification using advanced architectures.
The project began with building a simple Perceptron, to a Multi-Layer Perceptron (MLP) to solve the Exclusive OR (XOR) gate problem. This was chosen as a foundational exercise because it was:
- Relatively simple to implement
- Relatively easier to visualise mathematically, while demosntrating the nessesarry idea behind MLP and hidden layers
- Provides a clear, measurable success criterion
The scope expanded to tackle the MNIST dataset using MLPs. MNIST dataset, is regarded as the Hello World Of Artificial Intelligence, hence its neccessity in this problem space, but also, this was to explain the shortcomings of MLPs and the need to move towards more complex architectures, the core problem noted with MLPs is that:
- MLPs require flattening images, losing spatial information
- High dimensionality leads to inefficiency and overfitting
- Introduced the need for specialized architectures for computer vision
This phase built upon concepts from a prior module on Digital Signal Processing (DSP), which provided essential background in signal manipulation. For a deeper exploration of DSP techniques, see the related repository: Signals-Pamphile
Progressed through CNNs, RNNs, LSTMs, and hybrid architectures, ultimately focusing on:
- EEG Signal Processing: Real-world biomedical signal analysis
- Motor Imagery Classification: Using brain signals to classify motor intentions
- Subject-Specific Adaptation: Tailoring models to individual neural patterns
Neural-Network-XOR/
├── Assets/ # Project media and trained models
│ ├── Media/ # Visualizations and animations
│ │ ├── Convolution.gif
│ │ ├── Convolution.mov
│ │ ├── CSP_LDA_Confusion_Matrix.png
│ │ ├── MaxPooling.gif
│ │ └── MaxPooling.mov
│ └── Models/ # Pre-trained models
│ ├── brain_tumor_cnn.pkl
│ ├── csp_model.joblib
│ ├── lda_model.joblib
│ ├── model.npz
│ └── model.txt
├── notebooks/ # Jupyter Notebooks with all ExperimentationS
│ ├── CNN+LSTM.ipynb # Hybrid architecture exploration
│ ├── ConvolutionalNeuralNetwork.ipynb # CNN deep dive with visualizations
│ ├── RecurrentNeuralNetwork.ipynb # RNN concepts and implementations
│ ├── Model.ipynb # Core MLP implementations
│ ├── Mnist_Test.ipynb # MNIST dataset experiments
│ └── Preprocess_BCI.ipynb # EEG preprocessing pipeline
├── src/ # Code used for the EEG Headsets (Emotiv8)
│ ├── pipeline.py # Data preprocessing pipeline
│ └── test.py # Model evaluation & testing
├── requirements.txt
└── README.md
Basic → Advanced Architecture Progression:
Model.ipynb: Implements basic MLP for XOR problem, demonstrating why hidden layers are essentialMnist_Test.ipynb: Explores MLP limitations on image data, motivating the need for CNNsConvolutionalNeuralNetwork.ipynb: Deep exploration of convolutional operations with visualizations (Convolution.gif, MaxPooling.gif)RecurrentNeuralNetwork.ipynb: Introduces sequence modeling for temporal dataCNN+LSTM.ipynb: Combines CNNs and LSTMs for complex signal processingPreprocess_BCI.ipynb: Real-world EEG signal preprocessing and analysis
The Assets/Models/ directory contains trained models from different experiments:
- CSP + LDA: Classical signal processing approach with confusion matrix visualization
- CNN Model: Deep learning approach for image/signal classification
- Brain Tumor CNN: Specialized CNN for medical imaging
src/pipeline.py: Comprehensive preprocessing pipeline featuring:
- EEG signal filtering and normalization
- Artifact removal and noise reduction
- Feature extraction techniques
- Data augmentation strategies
src/test.py: Evaluation utilities including:
- Model performance metrics
- Confusion matrix generation
- Cross-validation procedures
- Subject-specific testing
The XOR problem is a canonical example in neural networks because:
- A single perceptron cannot solve it (demonstrates linear separability limits)
- Requires at least one hidden layer (introduces the power of deep learning)
- Provides immediate, intuitive feedback Last Updated: 2026-06-05