Skip to content

This repository contains code for a deep learning model that detects cancerous cells in histopathologic images using computer vision. The model utilizes ViT (Vision Transformer) and CovNExt (Convolutional Neural Network with Extra-Width and Random-Erasing Augmentation) architectures for training.

Notifications You must be signed in to change notification settings

pvhuwung/Histopathologic-Cancer-Detection

Repository files navigation

This repository contains code for a deep learning model that detects cancerous cells in histopathologic images using computer vision. The model utilizes ViT (Vision Transformer) and CovNExt (Convolutional Neural Network with Extra-Width and Random-Erasing Augmentation) architectures for training.

Requirements

  • Python 3.7+
  • PyTorch
  • Transformers library
  • NumPy
  • Pandas
  • Matplotlib
  • Seaborn
  • Tqdm
  • Pillow

Dataset

The dataset used for training and evaluation is the PatchCamelyon dataset, which contains 327,680 color images of size 96x96 pixels. The dataset is split into training and testing subsets with a ratio of 90:10.

The dataset can be loaded using the Hugging Face's datasets library by calling load_dataset('patch_camelyon'). The images in the dataset are of size 96x96 pixels, but to be used with the ViT model, they need to be resized to 224x224 pixels.

Training

The train.py script trains the model using the CovNExt and ViT architectures. The script loads the dataset, splits it into training and validation sets, processes the examples using the transform function, and trains the model using PyTorch.

Evaluation

The eval.py script evaluates the trained model on the test set. The script loads the test set, processes the examples using the process_example function, and computes the accuracy of the model.

Results

The model achieves an accuracy of 92.03% on the test set.

Conclusion

The combination of CovNExt and ViT architectures provides a powerful model for histopathologic cancer detection using computer vision. The model achieves high accuracy on the test set and can be used for automated diagnosis of cancerous cells in histopathologic images.

About

This repository contains code for a deep learning model that detects cancerous cells in histopathologic images using computer vision. The model utilizes ViT (Vision Transformer) and CovNExt (Convolutional Neural Network with Extra-Width and Random-Erasing Augmentation) architectures for training.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published