Ocean bottom seismometer data usually contain a large amount of random noise, which seriously reduces the signal‐to‐noise ratio of the data and affects subsequent imaging. Hence, random noise attenuation is one of the most essential steps in ocean bottom seismometer data processing. In this paper, a novel approach is proposed to attenuate the marine seismic random noise of ocean bottom seismometers based on a six‐dense‐layer denoising autoencoder. We input the domain data into the denoising autoencoder, the encoder compresses the signal and noise and extracts the main features and the decoder finally reconstructs the denoised data with the same dimension as the input. In this approach, because few raw labelled examples are available, we first constructed the pretraining, training and test data sets by patch processing. Then, we pretrained the encoder based on clean synthetic seismic data through unsupervised learning and pretrained the decoder based on noisy synthetic seismic data through supervised learning. Next, the pretrained model was fine‐tuned with the encoder–decoder on a raw seismic data set in an unsupervised manner. Finally, we used the model to attenuate the random noise in raw ocean bottom seismometer data for testing. Synthetic and raw examples are used to compare the deconvolution, multichannel singular spectrum analysis, deep denoising autoencoder and substep deep denoising autoencoder approaches. Experimental tests demonstrate that the proposed method has higher processing efficiency and precision.