Enhancing YOLOv8n with Mamba-like linear attention for defect detection and coating thickness analysis of irregular film tablet.
Journal:
International journal of pharmaceutics
Published Date:
Jun 10, 2025
Abstract
This study presents a real-time system that integrates deep learning and machine vision for defect detection and coating thickness measurement of irregularly shaped film-coated tablets. To overcome the accuracy and speed limitations of the traditional YOLOv8 model on irregular shapes, we propose an enhanced YOLOv8n architecture incorporating a Mamba-Like Linear Attention (MLLA) mechanism. This modification significantly improves the model's ability to detect subtle defects with higher precision. The system captures real-time tablet images using industrial cameras, ensuring reliable and accurate defect identification. For coating thickness measurement, the system employs sub-pixel image processing techniques to precisely measure the Feret diameter of tablets, while weight analysis is integrated to assess coating uniformity. By establishing a strong linear correlation between tablet diameter and weight, the system enables accurate estimation of coating thickness. Experimental validation demonstrates a Root Mean Square Error of Prediction (RMSEP) of 2.2 mg, which ensures highly precise weight monitoring throughout the coating process. The proposed system achieves an overall classification accuracy of 91.87 % across eight types of coated tablets, confirming its robustness and effectiveness. This innovative solution offers pharmaceutical manufacturers a scalable and cost-efficient tool for real-time quality assessment of irregularly shaped tablets, enhancing production efficiency, optimizing quality control, and minimizing defects in continuous manufacturing environments.