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.
Metadata
Release files for factchexcker-carinanet 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| factchexcker_carinanet-1.1.0.tar.gz | 31.0 kB | Without provenance | Details for factchexcker_carinanet-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| factchexcker_carinanet-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for factchexcker_carinanet-1.1.0-py3-none-any.whl |
Total release size: 64.3 kB
Release files / factchexcker_carinanet-1.1.0.tar.gz
| Download URL | factchexcker_carinanet-1.1.0.tar.gz |
|---|---|
| Size | 31.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53dddd5d4ebb3cc1d7375539be924898e3f1724854c3ecc62840a9bf5c6dc040
|
|
BLAKE2b-256 checksum How to use checksums |
f7020f54d8ad33d110b084d0ebf1fab806b3aadc8ad315e622735dbe08f229dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / factchexcker_carinanet-1.1.0-py3-none-any.whl
| Download URL | factchexcker_carinanet-1.1.0-py3-none-any.whl |
|---|---|
| Size | 33.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c2c0ea013b5496d8e7da087a041bb7b3961be11db5f46a723a0cd7be35b4031
|
|
BLAKE2b-256 checksum How to use checksums |
e360242539481e55d14c46bc97b5009121a55071a4d2ade3f421aee18fdd2c3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for factchexcker-carinanet 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.