This paper describes the application of unsupervised learning techniques to improve ego-motion estimation for a low-cost freehand ultrasound probe. Echo decorrelation measurements, which are used to estimate the lateral velocity of a scanning probe as it is passed over the skin, are found to be sensitive to varying tissue types and echogenicity in the imaged scene, and this can impact the geometric accuracy of the generated images. Here, we investigate algorithms to cluster the collated 1D echo data into regions of different echogenicity by applying a Gaussian mixture model (GMM), spatial fuzzy c-means (SFCM) or k-means clustering techniques, after which the decorrelation measurements can focus on the regions that yield the most accurate velocity estimates. A specially designed mechanical rig is used to provide the ground truth for the quantitative analysis of probe position estimation on phantom and in vivo data using different clustering techniques. It is concluded that the GMM is the most effective in classifying regions of echo data, leading to the reconstruction of the most geometrically correct 2D B-mode ultrasound image.