This study presents innovative methods for cleaning samples and counting cyst nematode eggs extracted from soil, utilizing density gradient centrifugation and advanced imaging techniques. The research introduces a scanner-based counting method and a lensless imaging setup that employs deep learning algorithms for real-time egg counting. Results demonstrate high efficiency and accuracy in egg recovery and counting, improving upon traditional methods.