The precise detection of stratum interfaces holds significant importance in geological discontinuity recognition and roadway support optimization. In this study, the model for locating rock interfaces through change point detection was proposed, and a drilling test on composite strength mortar specimens was conducted. With the logistic function and the particle swarm optimization algorithm, the drilling specific energy was modulated to detect the stratum interface. The results indicate that the drilling specific energy after the modulation of the logistic function showed a good anti-interference quality under stable drilling and sensitivity under interface drilling, and its average recognition error was 2.83 mm, which was lower than the error of 6.56 mm before modulation. The particle swarm optimization algorithm facilitated the adaptive matching of drive parameters to drilling data features, yielding a substantial 50.88% decrease in the recognition error rate. This study contributes to enhancing the perception accuracy of stratum interfaces and eliminating the potential danger of roof collapse.