The invention discloses a
software vulnerability detection method based on multi-
modal feature adaptive fusion. The method comprises the following steps: preprocessing a code sample; extracting multi-
modal feature information from the sample, integrating front-end information of a
compiler to enhance code sequence representation, and applying an enhanced graph representation learning method to improve code graph structure representation capability; a
loss function in the samples is constructed, shared features and specific features of the two
modes are fully mined, and a contrast learning
loss function is adopted to enhance the distinction degree between the samples;
modal sharing features are used as a bridge, specific features of all modals are fused in a self-adaptive mode, and efficient comprehensive code representation is generated; and inputting the code comprehensive representation into the classifier, and judging whether the code sample has vulnerabilities or not according to the
prediction score. According to the method, a multi-modal
vulnerability detection model is designed, so that the integrity of
feature extraction and the accuracy of
vulnerability detection are effectively improved.