Frontiers in Intelligent Colonoscopy [ColonSurvey | ColonINST | ColonGPT]
See the code
๐ฌ Paper (๐ arXiv, ๐ Springer, ๐ค Huggingface, ๐ค AIModels.fyi |
๐ ColonSurvey (๐ Online Sheet) |
๐ฅ ColonINST (๐ Google Drive, ๐ค Huggingface,
wisemodel) |
๐ค ColonGPT (๐ Google Drive, ๐ค Huggingface,
wisemodel) |
๐ Multimodal benchmark (๐ Google Drive, ๐ PaperWithCode)
Keyworks: Intelligent Colonoscopy, Multimodal Colonoscopy Dataset, Multimodal Language Model, Vision-language Understanding, Endoscopic Image Analysis, Healthcare AI, Abdomen.
Colonoscopy is currently one of the most sensitive screening methods for colorectal cancer (๐ Wikipedia). Have you ever wondered how to make colonoscopy smarter? Well, buckle up, let's enter the exciting world of intelligent colonoscopy!
Figure 1: Introductary diagram.
Our "ColonSurvey" project contributes various useful resources for the community. We investigate 63 colonoscopy datasets and 137 deep learning models focused on colonoscopic scene perception, all sourced from leading conferences or journals since 2015. This is a quick overview of our investigation; for a more detailed discussion, please refer to our paper in PDF format.
Figure 2: The investigation of colonoscopy datasets and models.
To better understand developments in this rapidly changing field and accelerate researchersโ progress, we are building a ๐ paper reading list, which includes a number of AI-based scientific studies on colonoscopy imaging from the past 12 years. [UPDATE ON OCT-14-2024] In detail, our online list contains:
Make our community great again. If we miss your valuable work in google sheet, please add it and this project would be a nice platform to promote your work. Or anyone can inform us via email (๐ฎ gepengai.ji@gmail.com) or push a PR in github. We will work on your request as soon as possible. Thank you for your active feedback.
Figure 3: Details of our multimodal instruction tuning dataset, ColonINST. (a) Three sequential steps to create the instruction tuning dataset for multimodal research. (b) Numbers of colonoscopy images designated for training, validation, and testing purposes. (c) Data taxonomy of three-level categories. (d) A word cloud of the category distribution by name size. (e) Caption generation pipeline using the VL prompting mode of GPT-4V. (f) Numbers of human-machine dialogues created for four downstream tasks.
Our data contains two parts: colonoscopy images and human-machine dialogues (available at ๐ค huggingface and ๐ google drive). However, due to privacy-preserving concerns, we can not directly share the origin medical images without its authorization. DO NOT WORRY! We prepare a data download list and an easy-to-use script to organise our ColonINST. The operation instructions are detailed in our document (๐ ./docs/guideline-for-ColonINST.md)
Apply full data of the proposed ColonINST via google form: ๐ธ https://forms.gle/C3FqtnCZmo5aZLR26
Figure 4: Details of our multimodal language model, ColonGPT.
Our ColonGPT is a standard multimodal language model, which has been released at ๐ google drive platform. It contains four basic components: a language tokenizer, an visual encoder (๐ค SigLIP-SO or ๐ google drive), a multimodal connector, and a language model (๐ค Phi1.5 or ๐ google drive).
We show a code snippet to show you how to quickly try-on our ColonGPT model with HuggingFace transformers quickly. For convenience, we manually combined some configuration and code files and merged the weights. Please note that this is a quick code, we recommend you installing ColonGPT's source code to explore more.
Before running the snippet, you only need to install the following minimum dependencies.
conda create -n quickstart python=3.10
conda activate quickstart
pip install torch transformers accelerate pillow
Then you can use python script/quick_start/quickstart.py to start.
import torch
import transformers
from transformers import AutoModelForCausalLM, AutoTokenizer, StoppingCriteria
from PIL import Image
import warnings
transformers.logging.set_verbosity_error()
transformers.logging.disable_progress_bar()
warnings.filterwarnings('ignore')
device = 'cuda' # or cpu
torch.set_default_device(device)
model_name = "ai4colonoscopy/ColonGPT"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16, # or float32 for cpu
device_map='auto',
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
model_name,
trust_remote_code=True
)
class KeywordsStoppingCriteria(StoppingCriteria):
def __init__(self, keyword, tokenizer, input_ids):
self.keyword_id = tokenizer(keyword).input_ids
self.tokenizer = tokenizer
self.start_len = input_ids.shape[1]
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -> bool:
for keyword_id in self.keyword_id:
if keyword_id in input_ids[0, -len(self.keyword_id):]:
return True
return False
prompt = "Categorize the object."
text = f"USER: <image>\n{prompt} ASSISTANT:"
text_chunks = [tokenizer(chunk).input_ids for chunk in text.split('<image>')]
input_ids = torch.tensor(text_chunks[0] + [-200] + text_chunks[1], dtype=torch.long).unsqueeze(0).to(device)
image = Image.open('cache/examples/example2.png')
image_tensor = model.process_images([image], model.config).to(dtype=model.dtype, device=device)
stop_str = "<|endoftext|>"
stopping_criteria = KeywordsStoppingCriteria(stop_str, tokenizer, input_ids)
output_ids = model.generate(
input_ids,
images=image_tensor,
do_sample=False,
temperature=0,
max_new_tokens=512,
use_cache=True,
stopping_criteria=[stopping_criteria]
)
outputs = tokenizer.decode(output_ids[0, input_ids.shape[1]:]).replace("<|endoftext|>", "").strip()
print(outputs)
The complete workflow scheme has been officially released, providing a streamlined and user-friendly process. This allows even average community users to easily develop, customize, and enhance their own models. To ensure a smooth experience, we have included comprehensive step-by-step instructions (๐ ./docs/guideline-for-ColonGPT.md), which can be found in our detailed documentation. These resources are designed to guide users through every stage of the development process, making it accessible and efficient for both beginners and advanced practitioners.
Figure 4: Multimodal benchmark.
We provide a comprehensive benchmark of eight latest multimodal competitors across three multimodal colonoscopy tasks, including MiniGPT-V2, LLaVA-v1, LLaVA-v1.5, Bunny-v1.0-3B, Mini-Gemini-2B, MobileVLM-1.7B, and LLaVA-Med-v1.0, and LLaVA-Med-v1.5. We provide ๐ the meta prediction files, ๐ the evaluation instructions. We believe these resources facilitate everyone to conveniently access their newly developed model, or rapidly conduct proof-of-concept development for follow-up research.
We gratefully acknowledge the contributions of the following projects, which served as the foundation and inspiration for our work:
Please use the following reference if you find this project useful for your research or applications:
@article{ji2026frontiers,
title={Frontiers in intelligent colonoscopy},
author={Ji, Ge-Peng and Liu, Jingyi and Xu, Peng and Barnes, Nick and Khan, Fahad Shahbaz and Khan, Salman and Fan, Deng-Ping},
journal={Machine Intelligence Research},
volume={23},
number={1},
pages={70--114},
year={2026},
publisher={Springer}
}
ColonGPT is designed to assist in medical colonoscopy by leveraging multimodal capabilities, but it comes with no guarantees regarding its predictive accuracy or reliability in clinical practice. Users should be aware that the datasets and pre-trained models used in ColonGPT may contain inherent biases, including socioeconomic factors, which can lead to misclassification or other undesirable behaviors, such as the generation of offensive or inappropriate content.
We urge users and developers to carefully review and validate the performance of pre-trained models, particularly those integrated through the ColonGPT framework, before considering practical applications in a clinical setting. It is crucial that any AI-driven tool used in healthcare undergoes rigorous testing to ensure patient safety and avoid unintended consequences. Our commitment to ethical AI use extends to ongoing efforts to investigate, address, and mitigate the risks of bias and inappropriate behavior in ColonGPT. Continuous improvement of this codebase is a priority to ensure that the system aligns with responsible and equitable healthcare standards.
Python
98.4%
Shell
1.6%
Frontiers in Intelligent Colonoscopy [ColonSurvey | ColonINST | ColonGPT]
See the code
๐ฌ Paper (๐ arXiv, ๐ Springer, ๐ค Huggingface, ๐ค AIModels.fyi |
๐ ColonSurvey (๐ Online Sheet) |
๐ฅ ColonINST (๐ Google Drive, ๐ค Huggingface,
wisemodel) |
๐ค ColonGPT (๐ Google Drive, ๐ค Huggingface,
wisemodel) |
๐ Multimodal benchmark (๐ Google Drive, ๐ PaperWithCode)
Keyworks: Intelligent Colonoscopy, Multimodal Colonoscopy Dataset, Multimodal Language Model, Vision-language Understanding, Endoscopic Image Analysis, Healthcare AI, Abdomen.
Colonoscopy is currently one of the most sensitive screening methods for colorectal cancer (๐ Wikipedia). Have you ever wondered how to make colonoscopy smarter? Well, buckle up, let's enter the exciting world of intelligent colonoscopy!
Figure 1: Introductary diagram.
Our "ColonSurvey" project contributes various useful resources for the community. We investigate 63 colonoscopy datasets and 137 deep learning models focused on colonoscopic scene perception, all sourced from leading conferences or journals since 2015. This is a quick overview of our investigation; for a more detailed discussion, please refer to our paper in PDF format.
Figure 2: The investigation of colonoscopy datasets and models.
To better understand developments in this rapidly changing field and accelerate researchersโ progress, we are building a ๐ paper reading list, which includes a number of AI-based scientific studies on colonoscopy imaging from the past 12 years. [UPDATE ON OCT-14-2024] In detail, our online list contains:
Make our community great again. If we miss your valuable work in google sheet, please add it and this project would be a nice platform to promote your work. Or anyone can inform us via email (๐ฎ gepengai.ji@gmail.com) or push a PR in github. We will work on your request as soon as possible. Thank you for your active feedback.
Figure 3: Details of our multimodal instruction tuning dataset, ColonINST. (a) Three sequential steps to create the instruction tuning dataset for multimodal research. (b) Numbers of colonoscopy images designated for training, validation, and testing purposes. (c) Data taxonomy of three-level categories. (d) A word cloud of the category distribution by name size. (e) Caption generation pipeline using the VL prompting mode of GPT-4V. (f) Numbers of human-machine dialogues created for four downstream tasks.
Our data contains two parts: colonoscopy images and human-machine dialogues (available at ๐ค huggingface and ๐ google drive). However, due to privacy-preserving concerns, we can not directly share the origin medical images without its authorization. DO NOT WORRY! We prepare a data download list and an easy-to-use script to organise our ColonINST. The operation instructions are detailed in our document (๐ ./docs/guideline-for-ColonINST.md)
Apply full data of the proposed ColonINST via google form: ๐ธ https://forms.gle/C3FqtnCZmo5aZLR26
Figure 4: Details of our multimodal language model, ColonGPT.
Our ColonGPT is a standard multimodal language model, which has been released at ๐ google drive platform. It contains four basic components: a language tokenizer, an visual encoder (๐ค SigLIP-SO or ๐ google drive), a multimodal connector, and a language model (๐ค Phi1.5 or ๐ google drive).
We show a code snippet to show you how to quickly try-on our ColonGPT model with HuggingFace transformers quickly. For convenience, we manually combined some configuration and code files and merged the weights. Please note that this is a quick code, we recommend you installing ColonGPT's source code to explore more.
Before running the snippet, you only need to install the following minimum dependencies.
conda create -n quickstart python=3.10
conda activate quickstart
pip install torch transformers accelerate pillow
Then you can use python script/quick_start/quickstart.py to start.
import torch
import transformers
from transformers import AutoModelForCausalLM, AutoTokenizer, StoppingCriteria
from PIL import Image
import warnings
transformers.logging.set_verbosity_error()
transformers.logging.disable_progress_bar()
warnings.filterwarnings('ignore')
device = 'cuda' # or cpu
torch.set_default_device(device)
model_name = "ai4colonoscopy/ColonGPT"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16, # or float32 for cpu
device_map='auto',
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
model_name,
trust_remote_code=True
)
class KeywordsStoppingCriteria(StoppingCriteria):
def __init__(self, keyword, tokenizer, input_ids):
self.keyword_id = tokenizer(keyword).input_ids
self.tokenizer = tokenizer
self.start_len = input_ids.shape[1]
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -> bool:
for keyword_id in self.keyword_id:
if keyword_id in input_ids[0, -len(self.keyword_id):]:
return True
return False
prompt = "Categorize the object."
text = f"USER: <image>\n{prompt} ASSISTANT:"
text_chunks = [tokenizer(chunk).input_ids for chunk in text.split('<image>')]
input_ids = torch.tensor(text_chunks[0] + [-200] + text_chunks[1], dtype=torch.long).unsqueeze(0).to(device)
image = Image.open('cache/examples/example2.png')
image_tensor = model.process_images([image], model.config).to(dtype=model.dtype, device=device)
stop_str = "<|endoftext|>"
stopping_criteria = KeywordsStoppingCriteria(stop_str, tokenizer, input_ids)
output_ids = model.generate(
input_ids,
images=image_tensor,
do_sample=False,
temperature=0,
max_new_tokens=512,
use_cache=True,
stopping_criteria=[stopping_criteria]
)
outputs = tokenizer.decode(output_ids[0, input_ids.shape[1]:]).replace("<|endoftext|>", "").strip()
print(outputs)
The complete workflow scheme has been officially released, providing a streamlined and user-friendly process. This allows even average community users to easily develop, customize, and enhance their own models. To ensure a smooth experience, we have included comprehensive step-by-step instructions (๐ ./docs/guideline-for-ColonGPT.md), which can be found in our detailed documentation. These resources are designed to guide users through every stage of the development process, making it accessible and efficient for both beginners and advanced practitioners.
Figure 4: Multimodal benchmark.
We provide a comprehensive benchmark of eight latest multimodal competitors across three multimodal colonoscopy tasks, including MiniGPT-V2, LLaVA-v1, LLaVA-v1.5, Bunny-v1.0-3B, Mini-Gemini-2B, MobileVLM-1.7B, and LLaVA-Med-v1.0, and LLaVA-Med-v1.5. We provide ๐ the meta prediction files, ๐ the evaluation instructions. We believe these resources facilitate everyone to conveniently access their newly developed model, or rapidly conduct proof-of-concept development for follow-up research.
We gratefully acknowledge the contributions of the following projects, which served as the foundation and inspiration for our work:
Please use the following reference if you find this project useful for your research or applications:
@article{ji2026frontiers,
title={Frontiers in intelligent colonoscopy},
author={Ji, Ge-Peng and Liu, Jingyi and Xu, Peng and Barnes, Nick and Khan, Fahad Shahbaz and Khan, Salman and Fan, Deng-Ping},
journal={Machine Intelligence Research},
volume={23},
number={1},
pages={70--114},
year={2026},
publisher={Springer}
}
ColonGPT is designed to assist in medical colonoscopy by leveraging multimodal capabilities, but it comes with no guarantees regarding its predictive accuracy or reliability in clinical practice. Users should be aware that the datasets and pre-trained models used in ColonGPT may contain inherent biases, including socioeconomic factors, which can lead to misclassification or other undesirable behaviors, such as the generation of offensive or inappropriate content.
We urge users and developers to carefully review and validate the performance of pre-trained models, particularly those integrated through the ColonGPT framework, before considering practical applications in a clinical setting. It is crucial that any AI-driven tool used in healthcare undergoes rigorous testing to ensure patient safety and avoid unintended consequences. Our commitment to ethical AI use extends to ongoing efforts to investigate, address, and mitigate the risks of bias and inappropriate behavior in ColonGPT. Continuous improvement of this codebase is a priority to ensure that the system aligns with responsible and equitable healthcare standards.
Python
98.4%
Shell
1.6%