deeplearning-lab-ktu

Deep Learning Lab Activities

A comprehensive collection of educational deep learning programs demonstrating fundamental concepts in computer vision, natural language processing, and sequence modeling.

The easiest way to run and visualize the labs is through the web interface:

1. Install Dependencies

pip install -r requirements.txt
cd web_interface
pip install -r requirements.txt

2. Start the Web Server

cd web_interface
python app.py

3. Open in Browser

Navigate to http://localhost:5000 in your web browser.

4. Run Labs

Features:

For detailed web interface documentation, see web_interface/README.md

It’s highly recommended to use a virtual environment to avoid dependency conflicts:

Option 1: Using venv (Python built-in)

# Create virtual environment
python -m venv venv

# Activate virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
cd web_interface
pip install -r requirements.txt
cd ..

# Run web interface
cd web_interface
python app.py

Option 2: Using conda

# Create conda environment
conda create -n dl-lab python=3.9

# Activate environment
conda activate dl-lab

# Install dependencies
pip install -r requirements.txt
cd web_interface
pip install -r requirements.txt
cd ..

# Run web interface
cd web_interface
python app.py

Deactivating Virtual Environment

When you’re done:

# For venv:
deactivate

# For conda:
conda deactivate

Benefits of Virtual Environment:

πŸ“š Overview

This repository contains 10 self-contained lab activities designed for academic learning. Each lab includes:

πŸ—‚οΈ Lab Activities

Lab 1: Basic Image Processing Operations

Directory: labs_full/lab_01_image_processing/ | Lite: labs_lite/lab_01_image_processing/

Lab 2: CIFAR-10 Classifiers

Directory: labs_full/lab_02_cifar10_classifiers/ | Lite: labs_lite/lab_02_cifar10_classifiers/

Lab 3: Batch Normalization and Dropout Study

Directory: labs_full/lab_03_batchnorm_dropout/ | Lite: labs_lite/lab_03_batchnorm_dropout/

Lab 4: Image Labeling Tools Demonstration

Directory: labs_full/lab_04_labeling_tools/ | Lite: labs_lite/lab_04_labeling_tools/

Lab 5: Image Segmentation with UNet

Directory: labs_full/lab_05_segmentation/ | Lite: labs_lite/lab_05_segmentation/

Lab 6: Object Detection with YOLO

Directory: labs_full/lab_06_object_detection/ | Lite: labs_lite/lab_06_object_detection/

Lab 7: Image Captioning with RNN/LSTM

Directory: labs_full/lab_07_image_captioning/ | Lite: labs_lite/lab_07_image_captioning/

Lab 8: Chatbot with Bi-directional LSTM

Directory: labs_full/lab_08_chatbot/ | Lite: labs_lite/lab_08_chatbot/

Lab 9: Time Series Forecasting with LSTM

Directory: labs_full/lab_09_time_series/ | Lite: labs_lite/lab_09_time_series/

Lab 10: Sequence to Sequence Learning

Directory: labs_full/lab_10_seq2seq/ | Lite: labs_lite/lab_10_seq2seq/

πŸ’» Alternative: Command Line

If you prefer running labs directly from the command line:

Prerequisites

Installation

  1. Clone or download this repository
  2. Install dependencies:
    pip install -r requirements.txt
    

Running Individual Labs

Each lab is self-contained with an executable Python program. Navigate to the lab directory and run:

# Lab 1: Image Processing
cd labs_full/lab_01_image_processing
python image_processing.py

# Lab 2: CIFAR-10 Classifiers
cd labs_full/lab_02_cifar10_classifiers
python cifar10_classifiers.py

# Lab 3: Batch Normalization & Dropout
cd labs_full/lab_03_batchnorm_dropout
python batchnorm_dropout_study.py

# Lab 4: Labeling Tools Demo
cd labs_full/lab_04_labeling_tools
python labeling_demo.py

# Lab 5: Image Segmentation
cd labs_full/lab_05_segmentation
python segmentation_demo.py

# Lab 6: Object Detection
cd labs_full/lab_06_object_detection
python object_detection_demo.py

# Lab 7: Image Captioning
cd labs_full/lab_07_image_captioning
python image_captioning_demo.py

# Lab 8: Chatbot
cd labs_full/lab_08_chatbot
python chatbot_demo.py

# Lab 9: Time Series Forecasting
cd labs_full/lab_09_time_series
python time_series_demo.py

# Lab 10: Sequence to Sequence
cd labs_full/lab_10_seq2seq
python seq2seq_demo.py

Or run all labs sequentially:

cd labs_full
bash run_all_labs.sh

For lightweight versions with faster execution:

cd labs_lite
bash run_all_labs.sh

Note: Each program creates an output/ directory in its lab folder with visualizations and results.

πŸ“¦ Dependencies

Core libraries used across labs:

See requirements.txt for complete list with versions.

πŸ“Š Expected Execution Times

All labs are designed to complete within 5 minutes on standard hardware (CPU):

Lab Program Execution Time Notes
Lab 1 image_processing.py < 30 seconds Image processing operations
Lab 2 cifar10_classifiers.py 2-3 minutes KNN, SVM, 3-layer NN training
Lab 3 batchnorm_dropout_study.py 2-3 minutes 4 model variants comparison
Lab 4 labeling_demo.py < 30 seconds Synthetic data generation
Lab 5 segmentation_demo.py 3-4 minutes UNet + baseline training
Lab 6 object_detection_demo.py 3-4 minutes YOLO-style detector training
Lab 7 image_captioning_demo.py 3-4 minutes RNN + LSTM training
Lab 8 chatbot_demo.py 2-3 minutes BiLSTM + LSTM training
Lab 9 time_series_demo.py 2-3 minutes LSTM + GRU forecasting
Lab 10 seq2seq_demo.py 3-4 minutes Seq2Seq + Attention training

Total time for all labs: ~25-30 minutes

With GPU: Execution times can be 2-5x faster depending on GPU model.

Lite versions: Execute 2-3x faster with reduced dataset sizes and epochs.

πŸŽ“ Learning Objectives

By completing these labs, you will:

  1. Understand fundamental image processing techniques
  2. Implement and compare different classification approaches
  3. Master regularization techniques in neural networks
  4. Learn data annotation workflows for computer vision
  5. Build semantic and instance segmentation models
  6. Implement modern object detection architectures
  7. Create image captioning systems with RNNs and LSTMs
  8. Develop conversational AI with bi-directional LSTMs
  9. Apply deep learning to time series problems
  10. Understand sequence-to-sequence architectures

πŸ“ Repository Structure

dl-lab/
β”œβ”€β”€ web_interface/         # Web-based interface (recommended)
β”‚   β”œβ”€β”€ app.py            # Flask application
β”‚   β”œβ”€β”€ templates/        # HTML templates
β”‚   └── requirements.txt  # Web interface dependencies
β”œβ”€β”€ labs_full/            # Full-featured lab programs
β”‚   └── lab_XX_name/
β”‚       β”œβ”€β”€ README.md     # Lab-specific instructions
β”‚       β”œβ”€β”€ program.py    # Main executable
β”‚       └── output/       # Generated results (created on run)
β”œβ”€β”€ labs_lite/            # Lightweight versions (faster execution)
β”‚   └── lab_XX_name/
β”‚       β”œβ”€β”€ program_lite.py
β”‚       └── output/
β”œβ”€β”€ docs/                 # Additional documentation
└── requirements.txt      # Main dependencies

All programs:

πŸ”§ Troubleshooting

Common Issues

Import Errors:

pip install --upgrade -r requirements.txt

CUDA Out of Memory:

Slow Execution:

πŸ“š Documentation

For more detailed information, see:

πŸ“š Additional Resources

🀝 Contributing

This is an educational repository. Feel free to:

πŸ“„ License

This project is created for educational purposes. Feel free to use and modify for learning.

✨ Acknowledgments

These labs are designed for academic learning and incorporate best practices from:


Note: All programs are designed to be self-contained and educational. They prioritize clarity and learning over production optimization.

Last Updated: March 2026