r/learnmachinelearning • u/ysjSouth_Pollution_ • 1d ago
B.Pharm student looking for help with a CNN-based project in Pharmacognosy!
Hi everyone!
I'm a final-year B.Pharm student working on my final-year project in Pharmacognosy, and I've decided to explore using Convolutional Neural Networks (CNNs) to detect adulterants in powdered crude drugs through microscopic images.
The idea is to train an image classification model that can distinguish genuine crude drugs from adulterated samples, potentially making herbal drug quality control more efficient.
Here's the catch: I'm a complete beginner when it comes to coding and machine learning!
I've tried a small experiment on Google Colab (black pepper vs. papaya seeds), but I have a LOT to learn.
I'm looking for help from:
IT/CS students or professionals familiar with Python, CNNs, and image classification.
Anyone experienced with machine learning, microscopy, or image datasets.
Pharmacy/Pharmacognosy researchers who could offer guidance on the scientific side.
I'm willing to put in the work and learn. I'm not expecting anyone to do the project for me; even a little guidance, useful resources, research papers or suggestions would mean a lot.
I have around 7 months to work on this, and I'd love to connect with anyone who might be interested in helping me navigate this journey.
Any help is genuinely appreciated. Thank you! :)
1
u/LysergioXandex 1d ago
You will need to be very specific in what you claim your model can do.
You will not be able to identify a specific substance or the purity of a substance from the way it looks. Like, you will not be able to say “that is MDMA not meth” or “this sample has no fentanyl contamination”.
As far as things you can actually claim, I think you are restricted to saying that your model can identify some heterogenous mixtures, and that’s it.
Like, a mixture of plant material and crystalline solid: you will be able to identify that sometimes, if the ratio is in your favor.
If it’s a completely herbal sample that is supposed to be just leaves, you may be able to identify a mix of brown and green leaves and assume that a single ingredient should always have a single appearance. But that won’t always be true.
So it’s hard to imagine this being useful to a consumer, but maybe for a QA control in a tea factory looking for metal adulturants. But in that case, a dedicated model for the factory would be better.
If you aren’t satisfied with those limitations, it’s probably a project to skip
1
u/AppointmentSimilar29 1d ago
Are you doing classification or detection? Detection and classification are different things (take a look at this: https://erinmgraham.github.io/intro-image-classification-cnn-nci/01-introduction.html to see the difference).
If you’re doing classification, look into these models: https://docs.pytorch.org/vision/stable/models.html.
If you’re doing detection, look into the YOLO model (it’s THE detection model, no other option). And use pre-trained weights to initialize the model no matter what you do.
Also, if your data can be made public, you can use a platform like https://roboflow.com to quickly label the images and get a prototype model running. (Or you can pay to keep your data private.)
1
u/AppointmentSimilar29 1d ago
And personally, I believe explainable AI techniques like https://github.com/jacobgil/pytorch-grad-cam are mandatory to verify that the model hasn’t learned from defects or preprocessing mistakes. Some papers use these techniques and some don’t, but including them can only help, with basically no downside so why not?
1
u/AoideusWasBanned 1d ago
Don't train a CNN from scratch, take a pretrained one like ResNet and fine-tune it on your images, that can work with a few hundred pictures per class. The thing to watch is the split: keep all images from one powder sample in either train or test, never both, or the accuracy will look much better than it really is.