Smart grid is an alternative solution of the conventional power grid which harnesses the power of the information technology to save the energy and meet today's' environment requirements. Due to the inherent vulnerabilities in the information technology, the smart grid is exposed to a wide variety of threats that could be translated into cyber-attacks. In this paper, we develop a deep learning-based intrusion detection system to defend against cyber-attacks in the advanced metering infrastructure network. The proposed machine learning approach is trained and tested extensively on an empirical industrial dataset which is composed of several attack' categories including the scanning, buffer overflow, and denial of service attacks. Then, an experimental comparison in terms of detection accuracy is conducted to evaluate the performance of the proposed approach with Naïve Bayes, Support Vector Machine, and Random Forest. The obtained results suggest that the proposed approaches produce optimal results comparing to the other algorithms. Finally, we propose a network architecture to deploy the proposed anomalybased intrusion detection system across the Advanced Metering Infrastructure network. In addition, we propose a network security architecture composed of two types of Intrusion detection system types, Host and Network-based, deployed across the Advanced Metering Infrastructure network to inspect the traffic and detect the malicious one at all the levels.Despite the wide variety of industrial cyber-attacks, they usually attempt to compromise these three security parameters: confidentiality, availability, and integrity [11]. The first class of attacks which target the confidentiality includes attacks such as Traffic analysis attack [17], Modbus network scanning [2], and DNP3 network scanning [7] which target the two industrial protocol Modbus and DNP3, respectively. The second category of attacks which target the availability of the system includes attack such as Puppet attack [25], the Time delay switch attack and the Time synchronization attack [27] which are considered as a denial of service attack. The third category of attacks includes the false data injection attack, popping the Home Machine Interface (HMI) [17], Masquerade attack [17], and jamming attack [13].Defending against these various cyber-attacks in a distributed and heterogeneous system, such as smart grid, is challenging. The smart grid consists of several system and protocols including the supervisory and control and data acquisition (SCADA), the demand response system, the automation substation, and the advanced metering infrastructure (AMI). In this paper, we will focus on defending against cyber-attacks in the AMI network because it constitutes the main connection point between the Home Area Network (HAN) with the Neighborhood Area Network (NAN) and the Wide Area Network (WAN). The AMI Advanced metering infrastructure (AMI) is responsible for collecting, measuring and analyzing energy, water, and gas usage. It allows two-way communication from th...