Time-frequency analysis plays a vital role in fault diagnosis of nonstationary vibration signals acquired from mechanical systems. However, the practical applications face the challenges of continuous variation in speed and load. Apart from this, the disturbances introduced by noise are inevitable. This paper aims to develop a robust method for fault identification in bearings under varying speed, load and noisy conditions. An Optimal Wavelet Subband Deep Neural Network (OWS-DNN) technique is proposed that automatically extracts features from an optimal wavelet subband selected on the basis of Shannon entropy. After denoising the optimal subband, the optimal subbands are dimensionally reduced by the encoder section of an autoencoder. The output of the encoder can be considered as data features. Finally, softmax classifier is employed to classify the encoder output. The vibration signals were recorded on a machinery fault simulator setup for various combinations of speed and load for healthy and faulty bearings. The signals were subjected to various noise levels and the deep neural network was trained. The achieved experimental results reveal high accuracy in fault classification as compared to other techniques under comparison.