r/learnpython • • 21h 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 under 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! :)

2 Upvotes

1 comment sorted by

1

u/Fun-Sandwich-2667 19h ago

Seven months is plenty of time for this, especially since you already got a working baseline running in Google Colab with the black pepper vs. papaya seed test.

A few practical tips that will save you a lot of frustration with microscopy datasets:

  • Use Transfer Learning, not a CNN from scratch: Microscopy datasets usually have hundreds or a few thousand images rather than millions. Fine-tuning a lightweight pretrained model (like ResNet18, MobileNetV3, or EfficientNet-B0 in PyTorch or Keras) will give you much higher accuracy and train in minutes on Colab's free GPU.
  • Keep slide capture conditions identical: Standardize magnification, illumination, and white balance across all genuine and adulterated samples. Otherwise, the CNN can accidentally learn lighting differences instead of actual powder morphology.
  • Avoid data leakage when splitting: If you take multiple photos or crops from the same physical slide/batch, put all images from that slide into either the training set or the validation set—never both—so your accuracy metrics stay honest.
  • Best beginner resource: Look up the free Practical Deep Learning for Coders (fast.ai) course or the official TensorFlow/PyTorch image classification Colab notebooks, and swap in your own dataset right away.