This project implements an API-driven, secure and error-proof medical report handling system using DCT-based image steganography. It is specifically designed to embed patient IDs into medical images (like X-rays, MRI scans, etc.) for automated verification, ensuring privacy, accuracy, and tamper-proof storage in hospital databases.
- 🧠 DCT-Based Medical Report Steganography API
Hospitals currently rely on manual entry or non-validated automation for storing patient medical reports. This can result in:
- Human errors (wrong report mapped to wrong patient)
- No security validation between stored image and patient ID
- No privacy control in case of unauthorized report viewing
✅ This project uses DCT (Discrete Cosine Transform) and adaptive steganography to:
- Embed the patient ID securely into a medical image
- Automate storage of these verified stego-images
- Allow the doctor to extract the embedded ID for cross-validation before report viewing
The solution ensures zero human dependency, no data mix-up, and enhanced patient confidentiality.
- 🔒 DCT-based adaptive image steganography
- 🧠 Texture and perceptual masking for imperceptibility
- 📷 Embed any patient ID into any image (X-ray, MRI, CT)
- ✅ REST API with
/embed
and/extract
endpoints - 🌐 No need for image to be in any specific folder
- 🔁 Support for image uploads and dynamic processing
- 💾 Stego-image returned automatically after upload
- 📜 Extraction matches embedded ID with ground truth
python3 -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
pip install -r requirements.txt
uvicorn dct_fast_api:app --reload
Uploads an image and patient ID, returns a stego-image.
Form Data:
file
: image file (JPG/PNG)patient_id
: patient ID string
Returns:
Stego-image with the embedded patient ID.
Uploads a stego-image and extracts the embedded patient ID.
Form Data:
file
: stego-image
Returns:
Extracted patient ID string.
.
├── dct_fast_api.py # FastAPI app
├── dct_claude_quant.py # Embedding & extraction logic
├── README.md # This file
├── requirements.txt
├── Embedded-image/ # Output images
├── Decoded-message/ # Extracted text
├── Images/ # Input images (optional)
├── screenshots/ # Screenshots for demonstration
.
├── fastapi
├── uvicorn
├── opencv-python
├── numpy
├── pillow
├── scipy
├── python-multipart
** Installing dependencies **
pip install -r requirements.txt
- Ensures privacy-preserving storage of medical images
- Prevents unauthorized report access
- Protects against mismatched patient-report mapping
- Automates the workflow of hospital database entry
- 🔒 AES encryption of patient ID before embedding
- 🖥️ GUI for hospital-side integration
- 🔌 Plugin for PACS/RIS systems
- 📜 Embed medical report hash + timestamp for audit trail
- 📦 Embed multiple fields (name, ID, report date) in compressed form
Saniel Bhattarai
B.Tech in Computer Science Engineering
Specialization: Information Security
Final Year Capstone Project (2025)
Riya Vaid
B.Tech in Computer Science Engineering
Specialization: Information Security
VIT Vellore
Final Year Capstone Project (2025)