Electricity theft is one of the main nontechnical losses (NTLs) in distributed networks which cause significant harm to the power grids. As power grids provide the centralized power to all the connected consumers, therefore, any fraudulent consumption can cause harm to the power grids which can damage the whole electric power supply and can influence its quality. The detection of such fraudulent consumers becomes difficult when there is a large amount of data. Smart grids can be used to solve this problem as it provides a two-way electricity flow which allows someone to detect, reenact and apply new changes to the electric data flow. The existing systems for electricity theft detection, works on the principle of one dimensional (1-D) electric data, which provides poor accuracy in theft detection. Therefore, an ensemble model based on convolutional neural network and extreme gradient boosting (CNN-XGB) model is presented in this paper. In this model both one dimensional (1-D) and two-dimensional (2-D) electricity consumption data are used to pass to the CNN model. Proposed model achieved the accuracy of 92% for electricity theft detection, which is better than existing models.