Inspiration
The global issue of counterfeit medication is a major concern, especially in regions with limited regulatory oversight. Millions unknowingly consume fake drugs, and vulnerable populations often bear the heaviest burden. Reading stories about the devastating impacts of counterfeit medicines inspired me to create a solution that empowers users to detect fake drugs using just a smartphone. Leveraging AI, I aimed to build a fast, simple, and accessible way for anyone—patients, pharmacists, or regulators—to verify the authenticity of medicines instantly.
What it does
MedGuard is a web-based platform that allows users to upload images of medicines and receive real-time predictions on whether they are genuine or counterfeit. Powered by a custom deep learning model, MedGuard analyzes the visual features of pills and packaging to detect anomalies and authenticity markers. The platform's user-friendly interface makes it accessible to a broad range of users, from individual consumers to health professionals and regulatory bodies.
How we built it
- Data Collection & Labeling I collected thousands of real and counterfeit medicine images, manually labeling authenticity markers such as company names, chemical names, medicine names, and logo markers. The dataset consisted of 7,000 training images, 2,000 test images, and 1,000 validation images. This comprehensive dataset formed the backbone for training a robust AI model.
- Data Augmentation & Enhancement To enrich the dataset, I applied a series of data augmentation techniques: color adjustments, rotations, and flips. These transformations simulated real-world image variations, ensuring that the model could handle diverse lighting conditions, orientations, and resolutions of real-life medicine images.
- Custom AI Model Development The core of the system employs a modified YOLOv10 architecture, optimized with AntNet for enhanced object detection. Key modifications to YOLOv10 include:
- Lightweight Backbone: Simplified convolutional layers to reduce computational complexity, enabling faster inference without sacrificing accuracy.
- PANet-like Neck: Improved feature fusion for better multi-scale detection, which is crucial for identifying both large-scale and small-scale features in medicine packaging.
- Reduced Model Parameters: Lowered the number of parameters, making the model more efficient for real-time deployment, particularly on mobile devices and in resource-constrained environments.
- Transformer-based Optical Character Recognition (OCR) A Transformer-based OCR was integrated to extract critical textual information from detected regions, such as the generic medicine name, company name, and manufacturer. This textual data is then cross-verified with a comprehensive drug database to confirm the authenticity of the medicine.
- Web Development & Deployment The platform’s frontend was built using HTML, CSS, and JavaScript, while the backend utilized Flask for handling image uploads and model inference. The AI model was deployed on cloud infrastructure to ensure scalability and accessibility, enabling users worldwide to access the tool instantly.
Challenges we ran into
Limited Dataset Availability: Counterfeit medicine datasets are scarce, and gathering enough labeled data posed a significant challenge. I performed substantial data augmentation and synthetic data generation to build a reliable training set.
Model Generalization: Ensuring that the model did not overfit on certain types of medicines was challenging, especially given the visual similarities between real and counterfeit pills. Striking the right balance between performance and generalization was a critical aspect of the model development.
Optimizing Deployment: Integrating a custom-trained, resource-intensive model with a lightweight web application for real-time image processing was a complex task. Optimizing both model inference time and web responsiveness for low-latency performance under real-world conditions required careful fine-tuning.
Establishing Trust: In a healthcare-related application, user trust is crucial. Designing a system that not only works efficiently but also earns the trust of users, especially in verifying critical health-related data, was an ongoing challenge throughout the development process.
Accomplishments that we're proud of
Real-time Counterfeit Detection: Successfully built and deployed a deep learning model capable of identifying counterfeit medicines in real-time, directly from images.
User Experience Focused: Developed a seamless and intuitive interface, making the complex process of medicine verification accessible to anyone, with just a click.
Social Impact: Created a tool that has the potential to save lives by empowering individuals to verify the authenticity of medicines, helping to raise awareness about counterfeit drugs.
Scalable & Mobile-Optimized: Optimized the solution to work efficiently in low-bandwidth environments and on mobile devices, ensuring accessibility even in resource-limited areas.
What we learned
Importance of Model Interpretability: In healthcare, it’s critical that AI models provide clear explanations for their decisions. Understanding and implementing model transparency became a key learning.
Balancing Performance and Usability: Achieving high model accuracy while ensuring quick response times and easy-to-use interfaces was a delicate balancing act.
Full-stack Development: I gained hands-on experience in full-stack development, combining web technologies, cloud infrastructure, and deep learning.
Model Optimization in Production: Learned how to deploy complex AI models to production while optimizing for real-time use on mobile devices and low-power environments.
What's next for MedGaurd
-Expand Dataset: Collaborate with health organizations and pharmacies to build a richer, more diverse dataset.
-Mobile App: Launch a lightweight mobile version for on-the-go detection, even in offline mode.
-Multilingual Support: Add support for multiple languages to make the tool globally accessible.
-Blockchain Integration: Explore the use of blockchain to store verified medicine data for traceability.
-Partner with NGOs and Hospitals: Drive real-world impact through partnerships with healthcare institutions.
Log in or sign up for Devpost to join the conversation.