Ampoule injection is a routinely used treatment in hospitals due to its rapid effect after intravenous injection. During manufacturing, tiny foreign particles can be present in the ampoule injection. Therefore, strict inspection must be performed before ampoule injections can be sold for hospital use. In the quality control inspection process, most ampoule enterprises still rely on manual inspection which suffers from inherent inconsistency and unreliability. This paper reports an automated system for inspecting foreign particles within ampoule injections. A custom-designed hardware platform is applied for ampoule transportation, particle agitation, and image capturing and analysis. Constructed trajectories of moving objects within liquid are proposed for use to differentiate foreign particles from air bubbles and random noise. To accurately classify foreign particles, multiple features including particle area, mean gray value, geometric invariant moments, and wavelet packet energy spectrum are used in supervised learning to generate feature vectors. The results show that the proposed algorithm is effective in classifying foreign particles and reducing false positive rates. The automated inspection system inspects over 150 ampoule injections per minute (versus by technologist) with higher accuracy and repeatability. In addition, the automated system is capable of diagnosing impurity types while existing inspection systems are not able to classify detected particles. Note to Practitioners-Present quality assessment of ampoule injections in pharmaceutical manufacturing relies on manual operation by certified technologists or machine-assisted detection systems. Existing technologies are not able to effectively distinguish symbols/dirt on the surface of an ampoule, air bubbles, and random noise from foreign particles inside the ampoule. This paper reports an automated ampoule inspection system consisting of two working stations (high-speed revolving station and abruptly stopping station). The system agitates particles and rotates them spirally along the axis of the ampoule container. Based on image processing and trajectories construction, foreign particles are effectively detected and distinguished from air bubbles and random noise.