Page 126 - 《软件学报》2025年第12期
P. 126

吴月明 等: VulFewShot: 利用对比学习改进少样本漏洞分类                                              5507



                                                         CE     CE+SupCon
                  100                   100                    100                   100
                   95                    95                    95                     95
                  M_F1 (%)  90          M_F1 (%)  90          M_F1 (%)  90           M_F1 (%)  90

                   85
                                                                                      85
                                         85
                                                               85
                   80                    80                    80                     80
                      Large Medium Small    Large Medium Small     Large Medium Small    Large Medium Small
                           样本规模                  样本规模                  样本规模                  样本规模
                        (a) MVD vs. CNN       (b) MVD vs. BiGRU    (c) MVD vs. BiLSTM  (d) MVD vs. Atten-BiLSTM
                  100                   100                    100                   100
                   95                    95                    95                     95
                  M_F1 (%)  90          M_F1 (%)  90          M_F1 (%)  90           M_F1 (%)  90

                                                               85
                                                                                      85
                   85
                                         85
                   80                    80                    80                     80
                      Large Medium Small    Large Medium Small     Large Medium Small    Large Medium Small
                           样本规模                  样本规模                  样本规模                  样本规模
                       (e) MVD-part vs. CNN  (f) MVD-part vs. BiGRU  (g) MVD-part vs. BiLSTM  (h) MVD-part vs. Atten-BiLSTM
                         图 8 MVD   和  MVD-part 数据集中, 传统深度学习模型和使用          VulFewShot 框架训练的模型
                                                 在不同漏洞类型规模上的性能



                                                         CE   CE+SupCon
                                                    8
                       20                                                       4
                                                    6
                    MVD  STD_S  15                STD_M  4                    STD_L  3 2
                       10
                                                    2
                        5                                                       1
                        0                           0                           0
                           CNN BiGRU BiLSTM Atten-BiLSTM  CNN  BiGRU BiLSTM Atten-BiLSTM  CNN  BiGRU BiLSTM Atten-BiLSTM
                                 模型                          模型                          模型
                                                    8
                       20                                                       4
                                                    6                           3
                    MVD-part  STD_S  10           STD_M  4                    STD_L  2
                       15
                        5                           2                           1
                        0                           0                           0
                           CNN BiGRU BiLSTM Atten-BiLSTM  CNN  BiGRU BiLSTM Atten-BiLSTM  CNN  BiGRU BiLSTM Atten-BiLSTM
                                 模型                          模型                          模型
                     图 9 MVD   和  MVD-part 数据集上传统深度学习模型和使用          VulFewShot 框架训练的模型的      STD  性能

                    综上所述, VulFewShot 可以显著提高传统深度学习模型在中小规模漏洞类型上的性能, 从而缓解了在少数漏
                 洞类型上的性能下降. 这种改进从大尺度到小尺度依次增加, 在                   MVD-part 数据集上尤为明显.

                  5   对有效性的威胁

                    本文的实验方法和结论可能在内部和外部有效性方面受到以下描述的某些方面的潜在威胁.
   121   122   123   124   125   126   127   128   129   130   131