SafetyNets: Verifiable Execution of Deep Neural Networks on an Untrusted Cloud