Skip to content

Latest commit

 

History

History
48 lines (44 loc) · 5.26 KB

File metadata and controls

48 lines (44 loc) · 5.26 KB

COVID-19-Xray-Dataset--CNN-ResNet50-MobileNetV2

COVID-19 Deep Learning Project

Introduction

  • Dataset Overview: Briefly describe the COVID-19 X-ray dataset. Mention the input data (X-ray images), target labels (COVID-19, normal, pneumonia), and any preprocessing steps.
  • Objective: Explain the goal of using the dataset. For example, detecting COVID-19 from X-ray images using deep learning models

Tools and Libraries

This project uses a combination of deep learning frameworks and utilities for image processing, model building, and evaluation. Below is an overview of the key tools and libraries used:

1.1 TensorFlow and Keras
  • TensorFlow: A powerful open-source platform for building machine learning models. In this project, TensorFlow is used to implement and train deep learning models such as MobileNetV2 and ResNet50.
  • Keras (within TensorFlow): Keras provides a high-level API for building and training neural networks. Keras layers and models make it easier to build custom CNN architectures.
1.2 Keras Models and Layers
  • Sequential Model: This is used for stacking layers sequentially to create custom Convolutional Neural Networks (CNNs).
  • Layers: Layers like Conv2D, MaxPool2D, Dropout, Flatten, and Dense are used to build the structure of the CNN.
  • Pre-trained Models (ResNet50 and MobileNetV2): Used for transfer learning. These models come with pre-trained weights and are adapted to the X-ray dataset.
1.3 Image Processing and Data Augmentation
  • ImageDataGenerator: This Keras utility is used for real-time data augmentation, which helps prevent overfitting by applying transformations like rotations, flips, and rescaling to the input images.
1.4 Optimization and Loss Functions
  • Adam Optimizer: This optimization algorithm is used for updating the weights of the neural network during training.
1.5 Evaluation Metrics
  • Confusion Matrix and Classification Report: Provided by sklearn.metrics, these are used for evaluating model performance by calculating precision, recall, and F1-score for each class. python
1.6 Warnings Handling
  • Warnings Module: This is used to suppress unnecessary warnings that may clutter the output during training and evaluation.

Deep Learning Models

This project focuses on three deep learning models: ResNet50, MobileNetV2, and a custom CNN model. Each model is trained on the COVID-19 X-ray dataset to classify the images into different categories such as COVID-19, pneumonia, or normal.

2.1 ResNet50 Model
  • Overview: ResNet50 is a 50-layer deep Convolutional Neural Network (CNN) that uses residual learning. It helps overcome the vanishing gradient problem by introducing skip connections (residuals) that allow the model to learn deeper layers more effectively.

  • Architecture: ResNet50 consists of multiple convolutional layers, batch normalization, and skip connections, followed by global average pooling and dense layers for classification.

  • Transfer Learning: Pre-trained weights (on ImageNet) are used, and the final layers are fine-tuned for the COVID-19 X-ray dataset.

2.2 MobileNetV2 Model
  • Overview: MobileNetV2 is designed for efficient performance on mobile and embedded devices. It uses depthwise separable convolutions, which reduce the number of parameters and computations required while maintaining accuracy.
  • Architecture: The MobileNetV2 architecture is lightweight, with a combination of depthwise convolutions, bottleneck layers, and a linear classifier.
  • Transfer Learning: Like ResNet50, MobileNetV2 is pre-trained on ImageNet and fine-tuned for the COVID-19 X-ray classification task.
CNN Model
  • Overview: The custom CNN model is a simpler, sequentially stacked convolutional network designed from scratch. It consists of convolutional layers followed by max pooling, dropout for regularization, and fully connected layers for classification.
  • Architecture: The model includes several convolutional layers (with ReLU activation), max pooling layers, and dropout to prevent overfitting. The final layer is a dense layer with softmax activation for multi-class classification.

3. Model Comparisons

  • ResNet50: Known for high accuracy and depth, ResNet50 typically performs well in complex classification tasks but is computationally heavier than MobileNetV2.
  • MobileNetV2: More efficient in terms of memory and computation, MobileNetV2 is a good choice when working with hardware limitations while maintaining high accuracy.
  • CNN: Simpler and more interpretable, the custom CNN can be useful when trying to experiment with architectures or when computational resources are limited. Each model has been fine-tuned for the COVID-19 X-ray dataset and can be evaluated based on accuracy, precision, recall, F1-score, and overall performance on the validation set.

Links: