The number of elderly people has increased as life expectancy increases. As muscle strength decreases with aging, it is easy to feel tired while walking, which is an activity of daily living (ADL), or suffer a fall accident. To compensate the walking problems, the terrain environment must be considered, and in this study, we developed the locomotion mode recognition (LMR) algorithm based on the gaussian mixture model (GMM) using inertial measurement unit (IMU) sensors to classify the five terrains (level walking, stair ascent/descent, ramp ascent/descent). In order to meet the walking conditions of the elderly people, the walking speed index from 20 to 89 years old was used, and the beats per minute (BPM) method was adopted considering the speed range for each age groups. The experiment was conducted with the assumption that the healthy people walked according to the BPM rhythm, and to apply the algorithm to the exoskeleton robot later, a full/individual dependent model was used by selecting a data collection method. Regarding the full dependent model as the representative model, the accuracy of classifying the stair terrains and level walking/ramp terrains is BPM 90: 98.74%, 95.78%, BPM 110: 99.33%, 95.75%, and BPM 130: 98.39%, 87.54%, respectively. The consumption times were 14.5, 21.1, and 14 ms according to BPM 90/110/130, respectively. LMR algorithm that satisfies the high classification accuracy according to walking speed has been developed. In the future, the LMR algorithm will be applied to the actual hip exoskeleton robot, and the gait phase estimation algorithm that estimates the user’s gait intention is to be combined. Additionally, when a user wearing a hip exoskeleton robot walks, we will check whether the combined algorithm properly supports the muscle strength.