Smart Meters (SMs) are able to share the power consumption of users with
utility providers almost in real-time. These fine-grained signals carry
sensitive information about users, which has raised serious concerns from the
privacy viewpoint. In this paper, we focus on real-time privacy threats, i.e.,
potential attackers that try to infer sensitive information from SMs data in an
online fashion. We adopt an information-theoretic privacy measure and show that
it effectively limits the performance of any attacker. Then, we propose a
general formulation to design a privatization mechanism that can provide a
target level of privacy by adding a minimal amount of distortion to the SMs
measurements. On the other hand, to cope with different applications, a
flexible distortion measure is considered. This formulation leads to a general
loss function, which is optimized using a deep learning adversarial framework,
where two neural networks -- referred to as the releaser and the adversary --
are trained with opposite goals. An exhaustive empirical study is then
performed to validate the performance of the proposed approach and compare it
with state-of-the-art methods for the occupancy detection privacy problem.
Finally, we also investigate the impact of data mismatch between the releaser
and the attacker.