Spiking neural network (SNN) has an important application in the field of brain-inspired computing. Compared with the traditional neural network, the SNN has the advantages of low power consumption, strong parallel ability and fast operation speed. In the context-dependent learning task, the simulated neurons in SNN can realize different firing modes in different context, thus improving the specificity of context. In this paper, a self-adaptive dynamic model based on threshold potential of spiking neurons is proposed. We compare the results of single operation and multiple operations of the network before and after adding the adaptive model, i.e., the threshold adaptive model. The experiments show that the network has higher average accuracy and better behavior performance under some adaptive parameters after adding the threshold adaptive model. In this context-dependent learning task the threshold adaptive model further improves the selectivity of the model to items in different context. It can be seen that the threshold adaptive model can improve the effect of context-dependent learning based on SNN, and has high application value in intelligent transportation, intelligent health-care and other fields.