ABSTRACT In pharmaceutical manufacturing, tablets experience flaws like half‐grain tablets, multi‐pill tablets and paste tablets as a result of breaking, adhesion or inadequate pressing. The packaging material, typically composed of dual aluminium foil, exhibits high reflectivity. This reduces the overall image contrast and weakens the feature differences between defective areas and the background. This phenomenon significantly affects the accuracy of defect detection in pharmaceutical quality control. To address the above problems, this paper proposes a contrast enhancement method called Wavelet Quadtree Contrast Limited Adaptive Histogram Equalisation Tablet Enhancement (WCTE) for tablet images. The method combines Haar Wavelet Transform and CLAHE with adaptive quadtree chunking to enhance the detection accuracy of low‐contrast tablets. The proposed approach uses Haar wavelets to decompose tablet images at multiple scales. It then applies power transform enhancement and soft‐threshold denoising to sub‐bands of different frequencies, highlighting edge details and suppressing background interference. The image is reconstructed by the inverse wavelet transform. To avoid edge artefacts and local over‐enhancement from fixed blocks, an adaptive quadtree CLAHE strategy driven by local variance is applied. This allows adaptive segmentation of enhancement regions and ensures smooth transitions. The YOLOv11 model is utilised to identify the target in the augmented tablet image, facilitating the precise classification of typical flaws such as half‐grain tablets, multi‐pill tablets and paste tablets. Experimental results show that WCTE‐enhanced images outperform both traditional CLAHE and unenhanced ones in entropy, contrast, clarity and average gradient. The comprehensive scores improve by 27.15% and 11.42% relative to the original and CLAHE images, respectively. The YOLOv11 model demonstrates a significant enhancement in defect detection accuracy for WCTE‐enhanced images, with improvements of 13.33% and 9.06% for half‐grain tablets and paste‐like defects, respectively. The accuracy for multi‐pill defects remains stable, while the overall mean average precision (mAP) increases by 2.5%, and the false detection rate decreases by 9%. This improvement further substantiates the efficacy and applicability of this method in low‐contrast target detection tasks.
Tu et al. (Thu,) studied this question.