Microrobotic swarms offer great promise in performing targeted delivery tasks with environmental adaptability. One of the significant challenges to apply microswarm for <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">in vivo</i> applications is medical imaging-based localization. In this article, we propose an optimized actuation strategy to enhance the ultrasound imaging contrast of a reconfigurable colloidal microswarm. A dynamic ultrasound contrast of the microswarm is observed. It depends on the coordination between the frequency of applied magnetic field and the temporal resolution of ultrasound imaging. Taking advantage of the dynamic contrast, optimal driven frequency ( <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"><tex-math notation="LaTeX">$f_{\text{op}}$</tex-math></inline-formula> ) is analyzed to obtain an enhanced ultrasound contrast of microswarms at different depths, which is experimentally validated at imaging depths of 3–7 cm. Based on the modeling and experimental results, pattern transformation of the microswarm is performed to further enhance the ultrasound contrast. The change of the imaging contrast during pattern transformation is experimentally investigated and analyzed, demonstrating a good agreement with the analytical results. Moreover, the microswarm is localized <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">ex vivo</i> at depths of 3.4–6.5 cm, and the minimal dose of nanoparticles is reduced due to the pattern transformation-enhanced imaging contrast. The reversible pattern transformation also provides morphological adaptability. A microswarm can navigate and simultaneously exhibit reversible pattern transformation in a narrowed channel. The optimized strategy of enhancing the ultrasound contrast of the colloidal microswarm provides a potential approach for utilizing microrobotic swarms in medical-imaging-guided <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">in vivo</i> tasks with a real-time localization capability.