Detection of small objects, those that lie on the bottom or stick to the wall of containers, constitutes a challenging issue for ultrasonic detection techniques. This is because echo signals from the object are fused with that of the inner surface of the container when subjected to ultrasound scanning. This study proposes a maximum component integration method based on the short‐time Fourier transform algorithm to detect these objects. Experiments were conducted using glass fragments of about 2 × 2 × 2 mm3 to test the proposed method. Compared with other signal‐processing methods (statistical calculations, backscattered amplitude integral and maximum frequency calculation), this method is able to make selective and full use of multiecho information, and hence demonstrated to have improved detection ability to the extent that it can detect small glass fragments contained inside glass containers. Principles are introduced for choosing the optimized WINDOW size and signal size to be processed when applying this method.