Giter Club home page Giter Club logo

plami's Introduction

Enhancing Pixel-Level Analysis in Medical Imaging through Visual Instruction Tuning: Introducing PLAMi

PLAMi Framework

Model Overview

PLAMi (Pixel-Level Analysis in Medical Imaging) precisely aligns image and text data through Visual Instruction Tuning technology, significantly enhancing the accuracy of medical image analysis. This framework incorporates a specialized visual encoder and a pixel-level regional feature extractor, both tailored for medical imaging, to capture and deeply analyze subtle features within images. PLAMi not only improves diagnostic accuracy but also provides detailed visual and textual analysis when handling complex medical images, offering robust support for clinical diagnosis.

This overview is based on findings from the article "Enhancing Pixel-Level Analysis in Medical Imaging through Visual Instruction Tuning: Introducing PLAMi."

Installation

Clone the repository and set up the environment with all necessary packages using these commands:

git clone https://github.com/MaochengBai/PLAMi
cd PLAMi
conda create -n plami python=3.10 -y
conda activate plami
pip install --upgrade pip
pip install -e .
pip install -e ".[train]"
pip install flash-attn --no-build-isolation

Demo

To run the demo, navigate to the demo directory and execute app.py. Before starting, ensure you have set the model_path for the model, data_folder for the image data, json_file for the image instructions, and description_type to specify the description format in app.py. Make sure all parameters are correctly configured to match your setup.

cd demo
python app.py 

Training

Stage 1: Image-Text Biomedical Concept Feature Alignment

Utilize the LLaVA training approach to train text-image alignment projectors and refine the mm_projector. This stage does not introduce a feature extractor.

Stage 2: Regional Feature-Text Alignment

  • Set model_name_or_path to the path of Mistral-7B-Instruct-v0.2 in stage2.sh.
  • Set pretrain_mm_mlp_adapter to the path of mm_projector in stage2.sh.
  • Run sh scripts/stage2.sh.

Stage 3: End-to-End Fine-Tuning

  • Set model_name_or_path to the path of stage2 checkpoint in stage2.sh.
  • Set vision_tower to the path of BioMedCLIP in stage2.sh.
  • Run sh scripts/stage3.sh.

Data

The datasets generated and/or analyzed during the current study are available from the author on reasonable request. The data will be made publicly available after the publication of the paper. If you are interested in accessing the data before then, please contact the author via email at [email protected].

plami's People

Contributors

maochengbai avatar

Watchers

 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.