Quality control and inspection play an im
portant role in the fast-moving consumer goods (FMCG)
industry, which historically has relied on manual visual
inspection that is slow, time-consuming and susceptible to
human error. This research overcomes these constraints
with a strong automatic inspection system that has been
created with the specific purpose of identifying and count
ing small items, including cigarettes, from high-resolution
industrial images. We introduce an optimized method
that integrates YOLOv5 object detection with a Slicing
Aided Hyper Inference (SAHI) approach. To maximize
the detection performance and the efficiency of training,
the original high-resolution images (12 megapixels) are
split strategically into equally-sized patches of 640×640.
We trained the YOLOv5 model on the patches and con
ducted inference with the SAHI technique for the original
high-resolution images. Experimental tests established that
patch-based training dramatically enhanced detection ac
curacy and yielded about 229 extra objects detected when
compared to training on the full-sized images. The model
trained from patches achieved faster convergence with
lower computation resources. This solution is effectively
used in actual FMCG companies such as Surya Nepal,
with accurate, reliable, and efficient quality checks.