The classification of underwater objects into rocks or mines is a vital task in naval security, marine exploration, and environmental studies. The current work introduces a machine learning-based approach to distinguish between rocks and mines in sonar systems utilizing logistic regression. The novelty of this approach lies in its combination of feature extraction, selection, and a logistic regression model to create an efficient and interpretable binary classifier. The data consists of acoustic signals reflected off underwater objects, which are then processed to identify relevant features. The logistic regression model is trained on a sizeable dataset made up of both hypothetical and actual examples, enabling an objective assessment of performance. The model was refined through a number of trials, which led to an improvement in the model's ability to distinguish between rocks and mines. A comparison of the suggested method with other machine learning methods highlights its effectiveness and simplicity. The study's conclusions have important ramifications for enhancing real-time decision-making in maritime navigation and naval defense. The suggested approach not only improves the precision of separating rocks from mines, but it also paves the way for more investigation into machine learning-based intelligent sonar systems.