With the ever increasing usage of IoT applications in every aspects of our life, protecting IoT network from security threats has become an important but challenging issue. Deep learning technique could be an effective solution for detection of anomalous behaviour in the network. However, designing and training a deep learning architecture for anomaly detection is a challenging task. Moreover, class imbalance issue makes it difficult to classify minority classes successfully. To address these challenges, we propose a deep learning model and evaluate the performance of five different Deep Neural Network (DNN) architectures. To address class imbalance problem we have used an oversampling technique named Synthetic Minority Over-sampling Technique (SMOTE) in our work. We used two IoT datasets - DS2OS and Contiki datasets to evaluate the performance of our proposed model. Accuracy, precision, recall and F-measure were used as performance metrics in our experiments. The experimental results show that our proposed DNN model has an accuracy above 98% for all cases evaluated. Our experimental results also confirms that the proposed model can detect anomaly successfully even in the presence of imbalanced classes.