Medi Hacks 2024: Urine Strip Analyzer

Revolutionizing home urinalysis with AI-driven, real-time test strip analysis and comprehensive health insights.A cutting-edge platform utilizing computer vision and generative AI to analyze urine test strips, offering instant results and detailed medical interpretations for proactive health management.

UrineVital

$${\color{red}Note:- For -first- time- request(analysis)- may- take- time- because- of- cold- start- in- free- tier- hosting}$$

Check out the live version of UrineVital.

The backend for this project is available at UrineVital Backend.

You can find the research paper related to this project here.

Image Processing

The image processing part of this project is implemented using OpenCV.

Process used for extracting the rgb values from the strip are:

  1. Converting image to grayscale.
  2. Bilateral Filtering
  3. Applied Adaptive thresholding(changing grayscale to binary)
  4. Complement of binary image.
  5. Dilation
  6. Errosion
  7. Again Complement
  8. finding contours
  9. now selecting some specific 10 contours
  10. finding coordinates of center of each contour and reading rgb from original image.

To run openCV code use (change the path of image)

python imageProcessing.py

Table of Contents

Features

  • Upload urine strip images through the web interface. image

  • Analyze the image using OpenCV to extract 10 values from different chemical pads. image

  • Display the results in report format. image

  • User-friendly interface built with React. image image

  • Integrated with chat bot

image

Tech Stack

  • Frontend: React
  • Backend: Flask
  • Image Processing: OpenCV
  • Styling: CSS
  • Version Control: Git
  • Other Tools: Generative AI

Setup Instructions

Prerequisites

  • Python 3.12.4
  • Git

Local Setup

  1. Clone the repository:
    git clone 

##Backend

  1. Navigate to backend directory:
  cd server_flask
  1. Install the required packages:
  pip install -r requirements.txt
  1. Start the backend server
       python app.py

Frontend Setup

  1. Navigate to frontend directory:
  cd ../client
  1. Install the required packages:
  npm install
  1. Start the React development server:
  npm start

Running the Application

Ensure both the backend and frontend servers are running. Open your web browser and navigate to http://localhost:3000 to access the application.

Usage

  1. Upload an image of a urine strip using the upload button.
  2. Click the submit button to analyze the image.
  3. View the report of the Urine analysis.

API Endpoints

  POST /upload
Parameter Type Description
image file Required. Image file(urine strip)
  POST /gemini
Parameter Type Description
prompt [] Required. Report
  POST /chat
Parameter Type Description
prompt string Required. pass message

Description: Upload an image of the urine strip and receive the result of the 10 colors pads along with RGB.

Request Body: Multipart form data containing the image file.

Response: JSON object with the result values.

Code Structure

image

Developers (Team)

@VishalKumar369 @Anish-kumar7641 @Anand930singh @Avinav-kashyap