The invention provides a semi-supervised medical image classification method based on a safety comparison self-integration framework, and the method comprises the following steps: firstly, selecting a batch of data composed of labeled and unlabeled data, adding data disturbance to the data, repeating the
processing twice to obtain two groups of data, and inputting the two groups of data into a student network and a teacher network respectively; secondly, designing
a weighting function, updating the weighting function by utilizing supervised loss, and automatically distributing a weight for each piece of unmarked data; the weight parameters and the probability output of the two networks are combined, and the consistency loss of reliable
perception is established; further, normalized low-dimensional representations output by the two networks are obtained by combining weight parameters and utilizing a projection network, and comparison loss of reliable
perception is established; and finally, respectively carrying out weighted summation on all the loss functions to form a final
loss function, and alternately updating network parameters and weighting function parameters. According to the method provided by the invention, reliable
data level and
data structure level information can be learned at the same time, and the robustness and generalization of the model are improved.