Projects
Completed · 2024

PCOS Chatbot

An educational health-assistant prototype combining multilingual conversation with an internally trained CNN for experimental ultrasound-image screening.

PythonStreamlitPyTorchtorchvisionGroqLlama 3 70BGPT-OSS 120BJupyter

Overview

PCOS Chatbot is an educational health-assistant prototype that combines conversational guidance with a custom ultrasound-image classifier. The Streamlit application answers general questions about Polycystic Ovary Syndrome, supports English and Bangla conversations, and guides users through uploading an ultrasound image for an experimental classification workflow.

Features

  • Explains general PCOS topics, symptoms, self-care, and prevention-oriented habits
  • Maintains multi-turn conversations through Streamlit session state
  • Responds in English or Bangla according to the user’s language
  • Reveals an ultrasound uploader when the conversation reaches the image workflow
  • Preprocesses uploaded images and runs an internally trained two-class PyTorch CNN
  • Returns the CNN label to the conversational model for a user-facing explanation
  • Displays uploaded images alongside the surrounding conversation

Problem

People looking for introductory PCOS information may need help understanding symptoms, preparing questions for a clinician, or navigating unfamiliar medical language. An image-enabled workflow also needs a clear handoff between conversation, file upload, machine-learning inference, and appropriately cautious guidance.

Solution

The application connects a multilingual Streamlit conversation to an internally trained two-class PyTorch CNN. It detects when a conversation calls for an ultrasound upload, preprocesses the submitted image, runs local inference, and returns the prototype label to the conversational model so it can explain appropriate next steps.

Architecture

Conversation layer: Streamlit stores messages, images, and turn state, then selects normal chat, image upload, or conversation end. The original conversational model was Llama 3 70B through Groq; it was later migrated to openai/gpt-oss-120b after Groq removed support for the original model.

Image preprocessing: Pillow and torchvision convert an upload to RGB, resize it to 256 × 256, convert it to a tensor, and apply channel normalization.

Internal CNN: Three 3 × 3 convolution blocks use 12, 15, and 10 output channels. Each block applies ReLU and 3 × 3 max-pooling, producing a 10 × 9 × 9 representation that is flattened to 810 features and classified by a Linear(810, 2) layer.

Inference handoff: The saved PyTorch weights are loaded on CUDA when available or CPU otherwise. The experimental Infected / Not Infected label is added to the conversation for cautious user-facing guidance.

Results

The completed prototype demonstrates English and Bangla PCOS conversations, an upload-triggered ultrasound workflow, local inference with the internally trained CNN, and the insertion of its two-class output into the continuing conversation. No clinical performance claim is made from the supplied materials.

Challenges

A two-class ultrasound model cannot establish a PCOS diagnosis, and performance can vary with image source, quality, device, framing, and dataset shift. Ultrasound alone is insufficient for clinical diagnosis. A production healthcare deployment would require clinical validation, stronger privacy controls, consent and retention policies, secure authentication, auditability, and medical and regulatory review.

Portfolio assistant

Ask about Niloy

Answers use published portfolio information.

AI

Ask me about Niloy's research, teaching, education, supervision, projects, honors, or academic background.

Public portfolio context only. Chats are not stored by the site.