Git Product home page Git Product logo

covid-detection-swin-transormers's Introduction

COVID-19 Detection using Swin Transformers

This project aims to detect COVID-19 cases from chest X-ray images using the Swin Transformer model. The model is trained on a dataset of chest X-ray images obtained from the Chest X-ray Dataset on Kaggle. By leveraging the power of Swin Transformers, the model achieves accurate classification of X-ray images into two categories: COVID-19 positive or normal.


Table of Contents


Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/MahtabRanjbar/covid-detection-Swin-Transormers.git
  2. Navigate to the project directory:

    cd covid-detection-Swin-Transormers 
    
  3. Install the required packages:

    pip install -r requirements.txt

Usage

Usage To run the project, follow these steps:

  1. Set the necessary configurations in the config.py file. Update the DataDir variable to the directory where the dataset is located.

  2. Run the main script:

    python src/main.py
  3. The script will load and preprocess the image data, split it into training and testing sets, and create data generators for training, validation, and testing.

  4. The Swin Transformer model will be built and trained using the training data. The model will be evaluated using the testing data, and the performance metrics will be displayed, including a confusion matrix and classification report.


Dataset

The dataset used for training and testing the model is the Chest X-ray Dataset from Kaggle. It contains a collection of chest X-ray images in two categories: COVID-19 positive and normal. To use this dataset, download the dataset from provided link.

The dataset has been split into three subsets: train set, validation set, and test set.


Model

The Swin Transformer model is a state-of-the-art architecture that combines the strengths of transformers and convolutional neural networks (CNNs) for image classification tasks. It introduces a hierarchical architecture that divides the image into patches and processes them with self-attention mechanisms. This allows the model to capture global and local dependencies effectively, enabling robust feature representation.

The Swin Transformer model used in this project is implemented using TensorFlow and Keras. It consists of several layers, including patch embedding, multi-scale self-attention, and feed-forward networks.


Evaluation Metrics

After training and testing the brain tumor detection model, several evaluation metrics have been computed to assess its performance. These evaluation metrics provide insights into the model's effectiveness in detecting covid-19. The metrics include accuracy, F1 score, recall, and precision.

Metric Value
Accuracy 0.971478718
F1 Score 0.971472654
Recall 0.971478718
Precision 0.971485011

For further evaluation metrics and details, please check the reports folder


Contributing

Contributions are always welcome! If you have any ideas or suggestions, please feel free to open an issue or a pull request.


License

This project is licensed under the MIT License. See the LICENSE file for more information


Contact

If you have any questions or comments about this project, please feel free to contact me at [email protected]

covid-detection-swin-transormers's People

Contributors

mahtabranjbar avatar

Stargazers

Siddharth Gupta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.