Automatic detection of carina and ETT in chest X-rays using deep learning
Project description
CarinaNet
Automatic detection of carina and ETT (endotracheal tube) in chest X-rays using deep learning. CarinaNet provides a simple, pip-installable package for medical image analysis with state-of-the-art accuracy.
Features
- 🔬 Medical AI: Specialized for carina and ETT detection in chest X-rays
- 🚀 Easy to Use: Simple Python API and command-line interface
- 🎯 High Accuracy: Based on RetinaNet architecture optimized for medical imaging
- 📦 Pip Installable: Just
pip install carinanetand you're ready to go - 🔧 Flexible Input: Supports various image formats (JPG, PNG, DICOM)
- 💾 Bundled Model: Pre-trained weights included - no separate downloads needed
Installation
Install CarinaNet with pip:
pip install carinanet
Quick Start
Python API
import carinanet
# Simple prediction on an image file
result = carinanet.predict_carina_ett("chest_xray.jpg")
print(f"Carina: {result['carina']}")
print(f"ETT: {result['ett']}")
print(f"Carina confidence: {result['carina_confidence']}")
print(f"ETT confidence: {result['ett_confidence']}")
# Using the model class for multiple predictions
model = carinanet.CarinaNetModel()
result = model.predict("chest_xray.jpg")
# Works with PIL Images and numpy arrays too
from PIL import Image
import numpy as np
image = Image.open("chest_xray.jpg")
result = carinanet.predict_carina_ett(image)
# Or with numpy arrays
image_array = np.array(image)
result = carinanet.predict_carina_ett(image_array)
Command Line Interface
# Predict on a single image
carinanet predict chest_xray.jpg
# Get package information
carinanet info
# Show help
carinanet --help
Output Format
CarinaNet returns predictions as dictionaries with the following structure:
{
'carina': (x, y), # Carina coordinates
'ett': (x, y), # ETT coordinates
'carina_confidence': 0.95, # Confidence score (0-1)
'ett_confidence': 0.87 # Confidence score (0-1)
}
Coordinates are in image pixel space (x, y) where (0, 0) is the top-left corner.
Requirements
- Python 3.8+
- PyTorch 1.9+
- See
requirements.txtfor full dependency list
Model Information
CarinaNet uses a RetinaNet-based architecture fine-tuned specifically for carina and ETT detection in chest X-rays. The model:
- Architecture: RetinaNet with ResNet backbone
- Input Size: 640x640 pixels (automatically resized)
- Output: Bounding box coordinates converted to center points
- Training Data: Curated medical imaging dataset
- Performance: High accuracy on clinical validation sets
Use Cases
CarinaNet is designed for:
- 🏥 Clinical Decision Support: Assist radiologists in identifying anatomical landmarks
- 📊 Research: Batch processing of chest X-ray datasets
- 🎓 Education: Teaching anatomical landmark identification
- 🔬 Quality Control: Automated verification of ETT placement
Device Support
CarinaNet automatically detects and uses:
- GPU: CUDA-enabled GPUs for faster inference
- CPU: Fallback to CPU if GPU not available
- Apple Silicon: Optimized for M1/M2 Macs
Contributing
We welcome contributions! Please see our contributing guidelines for details.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Citation
If you use CarinaNet in your research, please cite:
@misc{heiman2025factchexckermitigatingmeasurementhallucinations,
title={FactCheXcker: Mitigating Measurement Hallucinations in Chest X-ray Report Generation Models},
author={Alice Heiman and Xiaoman Zhang and Emma Chen and Sung Eun Kim and Pranav Rajpurkar},
year={2025},
eprint={2411.18672},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2411.18672},
}
Support
- 📖 Documentation: See this README and inline documentation
- 🐛 Issues: Report bugs on GitHub Issues
- 💬 Discussions: Join our GitHub Discussions
Disclaimer: CarinaNet is intended for research and educational purposes. It should not be used as the sole basis for clinical decisions. Always consult with qualified medical professionals.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file factchexcker_carinanet-1.1.0.tar.gz.
File metadata
- Download URL: factchexcker_carinanet-1.1.0.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.25.0 requests-toolbelt/1.0.0 urllib3/2.4.0 tqdm/4.67.1 importlib-metadata/8.7.0 keyring/25.6.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53dddd5d4ebb3cc1d7375539be924898e3f1724854c3ecc62840a9bf5c6dc040
|
|
| MD5 |
2e2e77d113f582174bf9d9fae12beaad
|
|
| BLAKE2b-256 |
f7020f54d8ad33d110b084d0ebf1fab806b3aadc8ad315e622735dbe08f229dd
|
File details
Details for the file factchexcker_carinanet-1.1.0-py3-none-any.whl.
File metadata
- Download URL: factchexcker_carinanet-1.1.0-py3-none-any.whl
- Upload date:
- Size: 33.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.25.0 requests-toolbelt/1.0.0 urllib3/2.4.0 tqdm/4.67.1 importlib-metadata/8.7.0 keyring/25.6.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c2c0ea013b5496d8e7da087a041bb7b3961be11db5f46a723a0cd7be35b4031
|
|
| MD5 |
326e3ec46cdd1085f872d20b4c771e01
|
|
| BLAKE2b-256 |
e360242539481e55d14c46bc97b5009121a55071a4d2ade3f421aee18fdd2c3f
|