The study constructs a three-dimensional model by using finite element software to optimize the hull compartment structure. The optimized design variables are obtained through sensitivity analysis. At the same time, the study uses particle swarm optimization algorithm to improve the back-propagation neural network. The improved algorithm is optimized by using the staged mutation strategy and chaotic search to realize the optimization calculation of the hull compartment structure. Real sample data are obtained through orthogonal tests and relevant validation is carried out. The experimental validation showed that the minimum optimal equivalent stress solution of the proposed method was 0.167, which was 1.7041 less than the back propagation neural network algorithm based on particle swarm optimization. The maximum optimal shear stress solution of the proposed method was 0.0640, which was 0.9761 less than the comparison algorithm. The equivalent stresses of the inner sole plate before and after optimization were 140N/mm2 and 160N/mm2, respectively. Compared with the other methods, the accuracy of the proposed method was increased by 19.31%, 3.75%, and 2.96% over the three compared methods, respectively. As a result, the algorithmic computational efficiency and the ability to find the optimum can be improved by combining the staged mutation strategy with the particle swarm optimization algorithm to improve the back propagation neural network. The proposed method can effectively improve the stress of the cockpit components and realize the structural optimization. This method has positive application significance in the optimal design of ship cabin structure. © 2024 Slovene Society Informatika. All rights reserved.