Skip to content

This repository contains an implementation of an autoencoder using a fully connected neural network (FCNN) to reconstruct handwritten digits from the MNIST dataset.

Notifications You must be signed in to change notification settings

shakeeluetp1041/Autoencoder_Fullyconnected_Neural-Network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fully Connected Autoencoder for MNIST Digits

🔍 What is an Autoencoder?

An autoencoder is a type of neural network that learns to compress (encode) input data into a lower-dimensional latent space and then reconstruct (decode) the input from this compressed representation.

It is made up of two main parts:

  • Encoder: Reduces input dimensions (compression)
  • Decoder: Reconstructs the original data from encoded features

🧮 Mathematical Overview

Given input data x, the encoder function f(x) maps it to a latent representation z:

z = f(x) = encoder(x)

The decoder then attempts to reconstruct x as:

x' = g(z) = decoder(z)

The model is trained by minimizing the reconstruction loss, commonly Mean Squared Error (MSE):

Loss = ||x - x'||²


📌 Applications of Autoencoders

  • Anomaly Detection: Unusual data has high reconstruction error.
  • Dimensionality Reduction: Autoencoders can serve as a non-linear alternative to PCA.
  • Clustering: The latent space learned can be used for unsupervised clustering.
  • Feature Extraction: Compressed latent vectors can be used as inputs for downstream models.

🗃️ Repository Structure

File/Folder Description
code.ipynb Jupyter Notebook to train and visualize the Fully Connected Autoencoder
requirements.txt Contains all dependencies to ensure reproducibility
data/ Folder that stores MNIST dataset (downloaded automatically)

🚀 How to Use This Repository

Using Python Virtual Environment (Recommended for Development)

  1. Create a virtual environment (Windows)

    python -m venv venv
    venv\Scripts\activate
  2. Install the dependencies

    pip install -r requirements.txt
  3. Run the Jupyter Notebook

    jupyter notebook code.ipynb

🧾 Requirements

  • Python 3.8+
  • PyTorch
  • torchvision
  • matplotlib
  • scikit-learn
  • jupyter (if running .ipynb locally)

All required libraries are listed in requirements.txt and pre-installed in the Docker image.


📝 Author

Shakeel Ahmed

About

This repository contains an implementation of an autoencoder using a fully connected neural network (FCNN) to reconstruct handwritten digits from the MNIST dataset.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published