This study presents a novel optimization-based algorithm to minimize tracking accuracy during ultrasound navigation with augmented reality. We developed a real-time, wireless navigation system for ultrasound probe tracking and image visualization. The pose of each ultrasound image frame was optimized with a first-order gradient descent method accelerated by a GPU. Our novel approach reduced the average reprojection error from 2.337 mm to 1.035 mm. The presented device and associated improvements are promising for applications requiring high spatial precision and adaptability.