In this research, X-ray and MRI images of patients suffering from cervical hyperextension injury are investigated. Also, radiographic images are collected from patients who suffered from trauma but without cervical hyperextension injury. The core engine algorithm of the optimized prediction model is kernel extreme learning machine (KELM), and the input data is 17 factors that may cause cervical hyperextension injury. As the optimization core, we utilized the Butterfly optimization algorithm (BOA). Up to now, few improved variants of BOA have been reported. The original BOA converges slowly and quickly falls into a locally optimal solution. An enhanced BOA based on orthogonal learning, Levy flight, and an exploitation engine is proposed in this paper to relieve these two shortcomings, which is called LBOLBOA. Orthogonal learning is utilized to construct guidance vectors for guiding agents toward the global optimum solution aiming to increase the accuracy of the solutions. Also, Levy flight and Broyden-Fletcher-Goldfarb-Shanno mechanisms are utilized to enrich the intensification propensities of BOA and stagnation avoidance. The proposed LBOLBOA is used to deal with continuous function optimization and machine learning problems, including parameter optimization of KELM. We rigorously verified this variant using a comprehensive set of the benchmark test suite and real-world dataset on cervical hyperextension injury. The results indicate that LBOLBOA can achieve improved performance in dealing with the function optimization and machine learning problems, especially the capability for prediction of cervical hyperextension injury.