The occurrence of accidents at container ports results in damages and economic losses in the terminal operation. Therefore, it is necessary to accurately predict accidents at container ports. Several machine learning models have been applied to predict accidents at a container port under various time intervals, and the optimal model was selected by comparing the results of different models in terms of their accuracy, precision, recall, and F1 score. The results show that a deep neural network model and gradient boosting model with an interval of 6 h exhibits the highest performance in terms of all the performance metrics. The applied methods can be used in the predicting of accidents at container ports in the future.