Disclosed in the embodiments of the present description are a method and apparatus for detecting model security and an electronic device. The method comprises: using a generative adversarial nets (GAN) frame, a model to be detected and sample training to obtain a discriminator; by means of the discriminator, making a determination for data of an intermediate result and/or output result calculated by the model to be detected for current input data so as to detect whether the model to be detected is currently secure.
展开▼