Skip to content

This is an application for ultrasound tumor segmentation using advanced models such as DCFN+PBAC, U-Net, and a basic CNN. Users can upload custom models. They can compare segmentation results and view performance side by side.

License

Notifications You must be signed in to change notification settings

soheilkooklan/Tumor-from-Ultrasound-Image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Tumor-from-Ultrasound-Image

Python License

Ultrasound Tumor Segmentation with DCFN+PBAC, U-Net, and Custom Model Comparison

This project offers a graphical user interface (GUI) application for segmenting tumors in ultrasound images using various models, including the Dilated Fully Convolutional Network with Phase-Based Active Contour (DFCN+PBAC) and U-Net, as well as a basic CNN model. Users can also upload a custom model to compare performance models.

Features

  • Automatic Tumor Segmentation with DCFN+PBAC, U-Net, and a simple CNN.
  • Custom Model Support: Upload and compare your model against preloaded models.
  • Interactive GUI: Built with Tkinter to load images, display segmentation results, and facilitate model comparison.
  • Segmentation Comparison: View results and placeholder accuracy scores for each model side-by-side.

⚠️ Warning

This software is not intended for medical diagnosis, treatment, or patient advice. The code is designed for research purposes only, specifically for students and researchers to develop and contribute to tumor segmentation.

Important:

  • The model is incomplete and has low accuracy for real-world medical diagnosis.
  • Do not rely on this software for any clinical decisions or patient care.

It can explore ultrasound image processing in tumor research as a learning tool.

AI Assistance

Several AI-based tools were utilized to complete and debug the code, including tools for automating model tuning, error detection, and optimizing image processing functions.


Installation

  • Install the required dependencies:
    pip install numpy tkinter PIL tensorflow keras cv2 os
  • or a Newer version of Python written in CMD
    py -m pip install numpy tkinter PIL tensorflow keras cv2 os

Download or Prepare Model Files

  • Place dcfn_pbac_model.keras and unet_model.keras in the root directory.
  • If these pre-trained models are unavailable, the code defaults to the simple CNN model for segmentation.

Usage

  1. Using the Interface
    • Load Ultrasound Image: Upload an ultrasound image via "Load Ultrasound Image". The simple CNN model will automatically segment the image and display results.
    • View DCFN+PBAC and U-Net Results: The DCFN+PBAC and U-Net models (if available) apply their segmentation to the uploaded image for comparison. Upload Custom Model: Use "Upload Model for Comparison" to load a custom model that segments the image.
    • Compare Results: Segmentation results and accuracy estimates from each model are displayed side-by-side for easy comparison.
    • Mask Loading and Preprocessing: A ground truth mask is loaded using a similar filename convention (e.g., image.jpg and image_mask.png). If a matching mask is not found, a warning message is shown, and segmentation won’t proceed with the accuracy calculation.

Implemented Models

  1. Dilated Fully Convolutional Network with Phase-Based Active Contour (DFCN+PBAC)

  2. U-Net

  3. Simple CNN Model

    • This lightweight CNN model provides fast, straightforward segmentation and requires no pre-trained weights.
  4. Custom Model Support

    • Users can upload additional models, which the application will directly integrate for comparison with the preloaded models.

References

This project implements techniques from several fundamental research studies:

  1. Dilated Fully Convolutional Network (DFCN) and Phase-Based Active Contour (PBAC)

  2. U-Net for Biomedical Image Segmentation

  3. Comparison of Deep Learning Models for Ultrasound Image Analysis

License

  • This project is licensed under the MIT License. See the LICENSE file for details.
  • This project was inspired by tutorials on working with image processing in Python. Thanks to the Python community and scientific libraries like numpy, tkinter, PIL, tensorflow, keras, cv2 and os for making such projects possible.

Contributing

I welcome researchers, students, and developers to contribute to this project, which aims to enhance the framework for Tumor-from-Ultrasound-Image using machine learning. While the current code provides a foundation with DCFN+PBAC, U-Net, there is potential to improve model accuracy, usability, and overall functionality.

How You Can Contribute:

  • Improve Model Accuracy: Enhance the current segmentation models or explore alternative deep learning architectures.
  • Optimize Feature Extraction: Implement advanced image preprocessing or segmentation techniques to improve model performance.
  • Expand Model Support: Add compatibility for additional pre-trained models commonly used in ultrasound or medical imaging.
  • Refine GUI Usability: Enhance the GUI for better accessibility, adding intuitive controls and improved visualization options.
  • Dataset Integration: Integrate real ultrasound datasets for more robust training and validation of model performance.
  • Segmentation Metrics: Add support for additional performance metrics to assess segmentation quality across models better.

How to Get Started:

  1. Fork the Repository: Create your copy of the project by clicking "Fork" at the top of this page.
  2. Make Your Improvements: Work on your chosen area and commit changes.
  3. Submit a Pull Request: Once complete, open a pull request with a detailed explanation of your contributions.

Your contributions are highly valued, and collaborative development is encouraged to make this project a powerful research tool. We can build a more accurate and accessible ultrasound tumor segmentation system.

About

This is an application for ultrasound tumor segmentation using advanced models such as DCFN+PBAC, U-Net, and a basic CNN. Users can upload custom models. They can compare segmentation results and view performance side by side.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages