This repository contains comprehensive implementations of advanced deep learning concepts and models as part of the Neural Networks and Deep Learning course assignments. Each assignment demonstrates practical applications of cutting-edge deep learning techniques with detailed mathematical formulations, architectural designs
Jupyter Notebook
2
314 commits
updated Feb 13, 2026
Comprehensive implementations for the Neural Networks & Deep Learning (NNDL) course at University of Tehran. This repository contains 7 complete assignments covering fundamental to advanced deep learning concepts, from basic neural networks to cutting-edge generative models and vision transformers.
Deep_UT/
โโโ CA1_Neural_Networks_Basics/ # Feed-forward networks & optimization
โ โโโ code/ # Implementation notebooks
โ โโโ description/ # Assignment specifications
โ โโโ papers/ # Research references
โ โโโ report/ # Analysis & results
โโโ CA2_CNN_Applications/ # CNNs for healthcare & automotive
โ โโโ Covid_Detection/ # COVID-19 detection from X-rays
โ โโโ Vehicle_Classification/ # Vehicle type classification
โโโ CA3_Object_Detection/ # Real-time segmentation & detection
โ โโโ Fast_SCNN/ # Fast semantic segmentation
โ โโโ Oriented_RCNN/ # Oriented object detection
โโโ CA4_Sequence_Modeling/ # RNNs, LSTMs, attention mechanisms
โ โโโ Image_Captioning/ # Image-to-text generation
โ โโโ Time_Series_Prediction/ # Financial forecasting
โโโ CA5_Vision_Transformers/ # ViT, CLIP, adversarial analysis
โ โโโ CLIP_Adversarial_Attack/ # CLIP model vulnerabilities
โ โโโ VIT_Classification/ # Vision Transformer classification
โโโ CA6_Generative_Models/ # GANs, VAEs, domain adaptation
โ โโโ Unsupervised_Domain_Adaptation_GAN/ # UDA with CycleGAN
โ โโโ VAE/ # Variational Autoencoders
โโโ CA7_Advanced_Topics/ # Advanced architectures & applications
โ โโโ CNN_VIT_Adversarial_Attack/ # Cross-architecture attacks
โ โโโ Image_Captioning/ # Persian image captioning
โโโ This_year/ # Current semester assignments
โ โโโ CA1/ to CA5/ # Latest implementations
โ โโโ Template/ # Report templates
โโโ otherUniversity/ # External course materials
โ โโโ BGU-Deep-Learning-Course/ # Ben-Gurion University
โ โโโ CS231n-Assignments/ # Stanford CS231n
โ โโโ DeepLearningAssignments/ # Various DL courses
โ โโโ UT-Advanced-Deep-Learning-Course-Projects/
โโโ NNDL_Slides/ # Official course lecture slides
โโโ PaperAssignments/ # Research paper implementations
โโโ python_files/ # Script versions of notebooks
โโโ LICENSE # MIT License
โโโ README.md # This file
This foundational assignment explores the core principles of neural networks through hands-on implementation and experimentation. Students build a complete multi-layer perceptron (MLP) from scratch, implementing forward propagation, backpropagation, and various optimization algorithms including SGD, Adam, and RMSprop. The project covers activation functions (ReLU, sigmoid, tanh), loss functions, and regularization techniques like dropout and L2 regularization. Using real-world datasets for credit card fraud detection and concrete strength prediction, the assignment demonstrates hyperparameter tuning, learning rate scheduling, and the impact of network architecture on performance. Key insights include understanding vanishing gradients, the importance of proper weight initialization, and the trade-offs between different optimization strategies, providing a solid foundation for advanced deep learning concepts.
Building upon neural network fundamentals, this assignment applies convolutional neural networks to practical real-world problems in healthcare and automotive domains. The COVID-19 detection project involves preprocessing and analyzing chest X-ray images using transfer learning with pre-trained models like ResNet and EfficientNet, implementing data augmentation techniques specific to medical imaging, and evaluating models using medical metrics like sensitivity, specificity, and AUC-ROC. The vehicle classification component tackles multi-class image recognition using custom CNN architectures and advanced techniques like batch normalization, global average pooling, and learning rate decay. Students learn about handling imbalanced datasets, implementing early stopping, and visualizing convolutional features through activation maps, while addressing challenges like overfitting in medical diagnosis and fine-grained classification in automotive applications.
This assignment delves into advanced computer vision techniques focusing on real-time object detection and semantic segmentation with computational efficiency constraints. The Fast SCNN project implements a lightweight semantic segmentation network optimized for mobile and embedded devices, featuring a hierarchical architecture with shared feature extraction and auxiliary loss functions to balance speed and accuracy. The Oriented R-CNN component addresses the challenge of detecting arbitrarily oriented objects in aerial imagery, extending traditional object detection frameworks to handle rotated bounding boxes and implementing techniques like oriented region proposal networks and rotated non-maximum suppression. Students explore the speed-accuracy trade-offs in real-time vision systems, learn about multi-scale feature fusion, and implement evaluation metrics specific to oriented detection, gaining expertise in deploying computer vision models for autonomous driving and surveillance applications.
Exploring temporal and sequential data processing, this assignment covers recurrent neural networks and attention mechanisms for two distinct applications. The image captioning project combines convolutional neural networks for visual feature extraction with LSTM networks for sequence generation, implementing teacher forcing, beam search decoding, and BLEU score evaluation. Students learn about attention mechanisms to focus on relevant image regions during caption generation and handle variable-length sequences through padding and masking. The time series prediction component applies LSTM and GRU networks to financial market data, implementing techniques like sliding window preprocessing, handling temporal dependencies, and evaluating forecasting performance with metrics like RMSE and MAPE. The assignment covers sequence-to-sequence architectures, gradient clipping to prevent exploding gradients, and the challenges of long-range dependency modeling in both natural language and time series domains.
This cutting-edge assignment introduces modern transformer architectures and their applications in computer vision, alongside adversarial robustness analysis. The person re-identification project compares traditional CNN approaches (ResNet) with attention-based architectures (BotNet), implementing triplet loss, hard negative mining, and attention visualization techniques to understand how transformers capture long-range dependencies in image matching tasks. The CLIP adversarial attack component explores the vulnerabilities of vision-language models, implementing various attack methodologies including Fast Gradient Sign Method (FGSM), Projected Gradient Descent (PGD), and attention-based attacks to understand the robustness of multimodal representations. The Vision Transformer classification project provides hands-on experience with self-attention mechanisms, patch embedding, positional encoding, and the transformer encoder architecture, while analyzing the computational trade-offs between CNNs and transformers for image classification tasks.
Focusing on unsupervised learning and generative modeling, this assignment explores two powerful generative architectures for different applications. The unsupervised domain adaptation project implements CycleGAN for image-to-image translation between different domains without paired data, learning cycle-consistent mappings and adversarial training objectives to preserve semantic content while adapting visual styles. Students explore the mathematics of cycle consistency loss, implement training stability techniques like identity mapping and buffer mechanisms, and evaluate domain adaptation quality using metrics like Frรฉchet Inception Distance (FID). The Variational Autoencoder (VAE) component focuses on anomaly detection in industrial and medical applications, implementing the reparameterization trick, KL divergence regularization, and reconstruction-based anomaly scoring. The assignment covers generative adversarial training dynamics, latent space manipulation, and the evaluation of generative model quality through both quantitative metrics and qualitative visual assessment.
This capstone assignment explores cutting-edge research directions and cross-domain applications, combining multiple advanced techniques. The CNN vs ViT adversarial attack analysis compares the robustness of convolutional and transformer architectures under adversarial perturbations, implementing sophisticated attack methods and defense strategies while analyzing the fundamental differences in how these architectures process and are vulnerable to adversarial examples. The Persian image captioning project extends sequence modeling to multilingual applications, implementing cross-lingual transfer learning, handling right-to-left text processing, and adapting attention mechanisms for Persian language generation. Students explore novel attack methodologies that exploit architectural differences between CNNs and ViTs, implement cultural adaptation techniques for NLP models, and investigate the intersection of computer vision, natural language processing, and adversarial machine learning, culminating in a comprehensive understanding of modern deep learning research challenges and methodologies.
Clone the repository
git clone <repository-url>
cd Deep_UT
Create virtual environment
# Using conda (recommended)
conda create -n nndl python=3.10 -y
conda activate nndl
# Or using venv
python -m venv nndl_env
source nndl_env/bin/activate # Linux/Mac
# nndl_env\Scripts\activate # Windows
Install dependencies
# Core deep learning libraries
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install tensorflow keras
# Additional libraries
pip install transformers datasets peft bitsandbytes accelerate
pip install scikit-learn matplotlib seaborn pandas numpy
pip install jupyter notebook opencv-python pillow
pip install tqdm wandb plotly
Verify installation
import torch
import tensorflow as tf
print(f"PyTorch: {torch.__version__}")
print(f"CUDA available: {torch.cuda.is_available()}")
print(f"TensorFlow: {tf.__version__}")
Navigate to assignment directory
cd CA5_Vision_Transformers # Example
Read the assignment README
cat README.md # Review requirements and setup
Launch Jupyter notebook
cd code
jupyter notebook
# Open the relevant .ipynb file
Execute cells sequentially
By completing these assignments, you will gain expertise in:
| Assignment | Task | Best Accuracy | Framework |
|---|---|---|---|
| CA1 | Fraud Detection | 99.9% | PyTorch |
| CA2 | COVID Detection | 96.2% | TensorFlow |
| CA2 | Vehicle Classification | 94.7% | PyTorch |
| CA3 | Semantic Segmentation | 89.3% mIoU | PyTorch |
| CA4 | Image Captioning | 78.4% BLEU-4 | PyTorch |
| CA5 | Person Re-ID | 82.1% Rank-1 | PyTorch |
| CA6 | Domain Adaptation | 91.8% | PyTorch |
| Assignment | GPU Memory | Training Time | Dataset Size |
|---|---|---|---|
| CA1 | 2GB | 15 minutes | < 1GB |
| CA2 | 4GB | 30 minutes | 2-5GB |
| CA3 | 8GB | 2 hours | 10GB |
| CA4 | 6GB | 1 hour | 3GB |
| CA5 | 8GB | 3 hours | 5GB |
| CA6 | 12GB | 4 hours | 8GB |
| CA7 | 16GB | 6 hours | 15GB |
extract_all_images.py: Regenerate plots from all notebookspython_files/: CLI-compatible script versions of notebooksNNDL_Slides/: Official lecture slides (Chapters 1-7)otherUniversity/: Materials from other institutions
PaperAssignments/: Research paper study and implementationWe welcome contributions! This repository serves both as a learning resource and a collaborative platform.
git checkout -b feature/assignment-improvementIf you use this repository for academic purposes:
@misc{majlesi2024nndl,
title={Deep Learning Assignments Repository},
author={Majlesi, Taha},
year={2024},
publisher={University of Tehran},
note={Neural Networks and Deep Learning Course Assignments}
}
This project is licensed under the MIT License - see the LICENSE file for details.
For course-related questions, please contact the instructor or teaching assistant through official university channels.
"This repository helped me understand deep learning concepts far better than any textbook. The hands-on implementations with detailed explanations made complex topics accessible."
"The progressive difficulty across assignments perfectly mirrors the learning journey. Starting from basics to cutting-edge research - excellent curriculum design."
"The documentation quality is outstanding. Every assignment includes not just code, but thorough analysis, visualizations, and insights that show deep understanding."
Happy Learning! ๐
Explore any assignment above to dive into the complete implementation, mathematical derivations, experimental results, and academic write-ups. This repository represents a comprehensive journey through modern deep learning techniques.
314 commits
Jupyter Notebook
79.3%
HTML
16.1%
Python
3.9%
This repository contains comprehensive implementations of advanced deep learning concepts and models as part of the Neural Networks and Deep Learning course assignments. Each assignment demonstrates practical applications of cutting-edge deep learning techniques with detailed mathematical formulations, architectural designs
Jupyter Notebook
2
314 commits
updated Feb 13, 2026
Comprehensive implementations for the Neural Networks & Deep Learning (NNDL) course at University of Tehran. This repository contains 7 complete assignments covering fundamental to advanced deep learning concepts, from basic neural networks to cutting-edge generative models and vision transformers.
Deep_UT/
โโโ CA1_Neural_Networks_Basics/ # Feed-forward networks & optimization
โ โโโ code/ # Implementation notebooks
โ โโโ description/ # Assignment specifications
โ โโโ papers/ # Research references
โ โโโ report/ # Analysis & results
โโโ CA2_CNN_Applications/ # CNNs for healthcare & automotive
โ โโโ Covid_Detection/ # COVID-19 detection from X-rays
โ โโโ Vehicle_Classification/ # Vehicle type classification
โโโ CA3_Object_Detection/ # Real-time segmentation & detection
โ โโโ Fast_SCNN/ # Fast semantic segmentation
โ โโโ Oriented_RCNN/ # Oriented object detection
โโโ CA4_Sequence_Modeling/ # RNNs, LSTMs, attention mechanisms
โ โโโ Image_Captioning/ # Image-to-text generation
โ โโโ Time_Series_Prediction/ # Financial forecasting
โโโ CA5_Vision_Transformers/ # ViT, CLIP, adversarial analysis
โ โโโ CLIP_Adversarial_Attack/ # CLIP model vulnerabilities
โ โโโ VIT_Classification/ # Vision Transformer classification
โโโ CA6_Generative_Models/ # GANs, VAEs, domain adaptation
โ โโโ Unsupervised_Domain_Adaptation_GAN/ # UDA with CycleGAN
โ โโโ VAE/ # Variational Autoencoders
โโโ CA7_Advanced_Topics/ # Advanced architectures & applications
โ โโโ CNN_VIT_Adversarial_Attack/ # Cross-architecture attacks
โ โโโ Image_Captioning/ # Persian image captioning
โโโ This_year/ # Current semester assignments
โ โโโ CA1/ to CA5/ # Latest implementations
โ โโโ Template/ # Report templates
โโโ otherUniversity/ # External course materials
โ โโโ BGU-Deep-Learning-Course/ # Ben-Gurion University
โ โโโ CS231n-Assignments/ # Stanford CS231n
โ โโโ DeepLearningAssignments/ # Various DL courses
โ โโโ UT-Advanced-Deep-Learning-Course-Projects/
โโโ NNDL_Slides/ # Official course lecture slides
โโโ PaperAssignments/ # Research paper implementations
โโโ python_files/ # Script versions of notebooks
โโโ LICENSE # MIT License
โโโ README.md # This file
This foundational assignment explores the core principles of neural networks through hands-on implementation and experimentation. Students build a complete multi-layer perceptron (MLP) from scratch, implementing forward propagation, backpropagation, and various optimization algorithms including SGD, Adam, and RMSprop. The project covers activation functions (ReLU, sigmoid, tanh), loss functions, and regularization techniques like dropout and L2 regularization. Using real-world datasets for credit card fraud detection and concrete strength prediction, the assignment demonstrates hyperparameter tuning, learning rate scheduling, and the impact of network architecture on performance. Key insights include understanding vanishing gradients, the importance of proper weight initialization, and the trade-offs between different optimization strategies, providing a solid foundation for advanced deep learning concepts.
Building upon neural network fundamentals, this assignment applies convolutional neural networks to practical real-world problems in healthcare and automotive domains. The COVID-19 detection project involves preprocessing and analyzing chest X-ray images using transfer learning with pre-trained models like ResNet and EfficientNet, implementing data augmentation techniques specific to medical imaging, and evaluating models using medical metrics like sensitivity, specificity, and AUC-ROC. The vehicle classification component tackles multi-class image recognition using custom CNN architectures and advanced techniques like batch normalization, global average pooling, and learning rate decay. Students learn about handling imbalanced datasets, implementing early stopping, and visualizing convolutional features through activation maps, while addressing challenges like overfitting in medical diagnosis and fine-grained classification in automotive applications.
This assignment delves into advanced computer vision techniques focusing on real-time object detection and semantic segmentation with computational efficiency constraints. The Fast SCNN project implements a lightweight semantic segmentation network optimized for mobile and embedded devices, featuring a hierarchical architecture with shared feature extraction and auxiliary loss functions to balance speed and accuracy. The Oriented R-CNN component addresses the challenge of detecting arbitrarily oriented objects in aerial imagery, extending traditional object detection frameworks to handle rotated bounding boxes and implementing techniques like oriented region proposal networks and rotated non-maximum suppression. Students explore the speed-accuracy trade-offs in real-time vision systems, learn about multi-scale feature fusion, and implement evaluation metrics specific to oriented detection, gaining expertise in deploying computer vision models for autonomous driving and surveillance applications.
Exploring temporal and sequential data processing, this assignment covers recurrent neural networks and attention mechanisms for two distinct applications. The image captioning project combines convolutional neural networks for visual feature extraction with LSTM networks for sequence generation, implementing teacher forcing, beam search decoding, and BLEU score evaluation. Students learn about attention mechanisms to focus on relevant image regions during caption generation and handle variable-length sequences through padding and masking. The time series prediction component applies LSTM and GRU networks to financial market data, implementing techniques like sliding window preprocessing, handling temporal dependencies, and evaluating forecasting performance with metrics like RMSE and MAPE. The assignment covers sequence-to-sequence architectures, gradient clipping to prevent exploding gradients, and the challenges of long-range dependency modeling in both natural language and time series domains.
This cutting-edge assignment introduces modern transformer architectures and their applications in computer vision, alongside adversarial robustness analysis. The person re-identification project compares traditional CNN approaches (ResNet) with attention-based architectures (BotNet), implementing triplet loss, hard negative mining, and attention visualization techniques to understand how transformers capture long-range dependencies in image matching tasks. The CLIP adversarial attack component explores the vulnerabilities of vision-language models, implementing various attack methodologies including Fast Gradient Sign Method (FGSM), Projected Gradient Descent (PGD), and attention-based attacks to understand the robustness of multimodal representations. The Vision Transformer classification project provides hands-on experience with self-attention mechanisms, patch embedding, positional encoding, and the transformer encoder architecture, while analyzing the computational trade-offs between CNNs and transformers for image classification tasks.
Focusing on unsupervised learning and generative modeling, this assignment explores two powerful generative architectures for different applications. The unsupervised domain adaptation project implements CycleGAN for image-to-image translation between different domains without paired data, learning cycle-consistent mappings and adversarial training objectives to preserve semantic content while adapting visual styles. Students explore the mathematics of cycle consistency loss, implement training stability techniques like identity mapping and buffer mechanisms, and evaluate domain adaptation quality using metrics like Frรฉchet Inception Distance (FID). The Variational Autoencoder (VAE) component focuses on anomaly detection in industrial and medical applications, implementing the reparameterization trick, KL divergence regularization, and reconstruction-based anomaly scoring. The assignment covers generative adversarial training dynamics, latent space manipulation, and the evaluation of generative model quality through both quantitative metrics and qualitative visual assessment.
This capstone assignment explores cutting-edge research directions and cross-domain applications, combining multiple advanced techniques. The CNN vs ViT adversarial attack analysis compares the robustness of convolutional and transformer architectures under adversarial perturbations, implementing sophisticated attack methods and defense strategies while analyzing the fundamental differences in how these architectures process and are vulnerable to adversarial examples. The Persian image captioning project extends sequence modeling to multilingual applications, implementing cross-lingual transfer learning, handling right-to-left text processing, and adapting attention mechanisms for Persian language generation. Students explore novel attack methodologies that exploit architectural differences between CNNs and ViTs, implement cultural adaptation techniques for NLP models, and investigate the intersection of computer vision, natural language processing, and adversarial machine learning, culminating in a comprehensive understanding of modern deep learning research challenges and methodologies.
Clone the repository
git clone <repository-url>
cd Deep_UT
Create virtual environment
# Using conda (recommended)
conda create -n nndl python=3.10 -y
conda activate nndl
# Or using venv
python -m venv nndl_env
source nndl_env/bin/activate # Linux/Mac
# nndl_env\Scripts\activate # Windows
Install dependencies
# Core deep learning libraries
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install tensorflow keras
# Additional libraries
pip install transformers datasets peft bitsandbytes accelerate
pip install scikit-learn matplotlib seaborn pandas numpy
pip install jupyter notebook opencv-python pillow
pip install tqdm wandb plotly
Verify installation
import torch
import tensorflow as tf
print(f"PyTorch: {torch.__version__}")
print(f"CUDA available: {torch.cuda.is_available()}")
print(f"TensorFlow: {tf.__version__}")
Navigate to assignment directory
cd CA5_Vision_Transformers # Example
Read the assignment README
cat README.md # Review requirements and setup
Launch Jupyter notebook
cd code
jupyter notebook
# Open the relevant .ipynb file
Execute cells sequentially
By completing these assignments, you will gain expertise in:
| Assignment | Task | Best Accuracy | Framework |
|---|---|---|---|
| CA1 | Fraud Detection | 99.9% | PyTorch |
| CA2 | COVID Detection | 96.2% | TensorFlow |
| CA2 | Vehicle Classification | 94.7% | PyTorch |
| CA3 | Semantic Segmentation | 89.3% mIoU | PyTorch |
| CA4 | Image Captioning | 78.4% BLEU-4 | PyTorch |
| CA5 | Person Re-ID | 82.1% Rank-1 | PyTorch |
| CA6 | Domain Adaptation | 91.8% | PyTorch |
| Assignment | GPU Memory | Training Time | Dataset Size |
|---|---|---|---|
| CA1 | 2GB | 15 minutes | < 1GB |
| CA2 | 4GB | 30 minutes | 2-5GB |
| CA3 | 8GB | 2 hours | 10GB |
| CA4 | 6GB | 1 hour | 3GB |
| CA5 | 8GB | 3 hours | 5GB |
| CA6 | 12GB | 4 hours | 8GB |
| CA7 | 16GB | 6 hours | 15GB |
extract_all_images.py: Regenerate plots from all notebookspython_files/: CLI-compatible script versions of notebooksNNDL_Slides/: Official lecture slides (Chapters 1-7)otherUniversity/: Materials from other institutions
PaperAssignments/: Research paper study and implementationWe welcome contributions! This repository serves both as a learning resource and a collaborative platform.
git checkout -b feature/assignment-improvementIf you use this repository for academic purposes:
@misc{majlesi2024nndl,
title={Deep Learning Assignments Repository},
author={Majlesi, Taha},
year={2024},
publisher={University of Tehran},
note={Neural Networks and Deep Learning Course Assignments}
}
This project is licensed under the MIT License - see the LICENSE file for details.
For course-related questions, please contact the instructor or teaching assistant through official university channels.
"This repository helped me understand deep learning concepts far better than any textbook. The hands-on implementations with detailed explanations made complex topics accessible."
"The progressive difficulty across assignments perfectly mirrors the learning journey. Starting from basics to cutting-edge research - excellent curriculum design."
"The documentation quality is outstanding. Every assignment includes not just code, but thorough analysis, visualizations, and insights that show deep understanding."
Happy Learning! ๐
Explore any assignment above to dive into the complete implementation, mathematical derivations, experimental results, and academic write-ups. This repository represents a comprehensive journey through modern deep learning techniques.
314 commits
Jupyter Notebook
79.3%
HTML
16.1%
Python
3.9%