WO2021051764A1 - 一种邮件分类方法、装置、设备及计算机可读存储介质 - Google Patents

一种邮件分类方法、装置、设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2021051764A1
WO2021051764A1 PCT/CN2020/079825 CN2020079825W WO2021051764A1 WO 2021051764 A1 WO2021051764 A1 WO 2021051764A1 CN 2020079825 W CN2020079825 W CN 2020079825W WO 2021051764 A1 WO2021051764 A1 WO 2021051764A1
Authority
WO
WIPO (PCT)
Prior art keywords
mail
discriminant function
data
classification
spam
Prior art date
Application number
PCT/CN2020/079825
Other languages
English (en)
French (fr)
Inventor
张莉
郑晓晗
周伟达
王邦军
闫磊磊
屈蕴茜
赵雷
章晓芳
Original Assignee
苏州大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州大学 filed Critical 苏州大学
Publication of WO2021051764A1 publication Critical patent/WO2021051764A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines

Definitions

  • the present invention relates to the technical field of data processing, and more specifically, to a mail classification method, device, equipment, and computer-readable storage medium.
  • Spam is very harmful, it will take up network bandwidth and reduce the operating efficiency of the entire network; it is easy to be used by hackers, causing network congestion or even paralysis; spam is also easy to be used by criminals to spread bad information and so on.
  • relatively safe and effective spam filtering technologies are urgently needed.
  • the purpose of the present invention is to provide a mail classification method, device, equipment and computer readable storage medium to realize accurate identification of spam.
  • the present invention provides a mail classification method, including:
  • the mail data is processed using a predetermined linear discriminant function to obtain the discriminant function value; wherein, the discriminant parameter in the linear discriminant function is: the training set is processed in advance by the twin support vector machine classification algorithm based on the L1 norm Obtained by analysis; the training data includes different types of email training data;
  • the mail data is classified by using a preset classification rule and the discriminant function value.
  • the method for generating discriminant parameters in the linear discriminant function includes:
  • the preset conditions include:
  • w 1 is the first weight vector in the discrimination parameter
  • w 2 is the second weight vector in the discrimination parameter
  • b 1 is the first function deviation coefficient in the discrimination parameter
  • b 2 is the The second function deviation coefficient in the discrimination parameter
  • ⁇ 1 is the first slack variable
  • ⁇ 2 is the second slack variable
  • X 1 is the feature matrix of the non-spam data in the training set
  • X 2 is the spam in the training set
  • 1 is the L1 norm
  • C 1 is the predetermined first auxiliary variable
  • C 2 is The predetermined second auxiliary variable
  • C 3 is the predetermined third auxiliary variable
  • C 4 is the predetermined fourth auxiliary variable.
  • the processing the mail data by using a predetermined linear discriminant function to obtain the discriminant function value includes:
  • the using a preset classification rule and the discriminant function value to classify the mail data includes:
  • the first discriminant function value f 1 (x), and the second discriminant function value f 2 (x) to obtain the classification result of the mail data
  • the classification rules are:
  • the classification result Is 1 it is determined that the mail is not spam, if the classification result If it is -1, it is determined that the mail is spam.
  • the present invention further provides a mail classification device, including:
  • the data receiving module is used to receive the mail data to be classified
  • the data processing module is used to process the mail data by using a predetermined linear discriminant function to obtain the discriminant function value; wherein, the discriminant parameter in the linear discriminant function is: a twin support vector machine based on the L1 norm is passed in advance
  • the classification algorithm analyzes the training set to obtain; the training data includes different types of email training data;
  • the data classification device is used to classify the mail data by using a preset classification rule and the discriminant function value.
  • the device further includes a discrimination parameter generation module; wherein, the discrimination parameter generation module includes:
  • the training set acquisition unit is used to acquire the training set
  • the discriminant parameter determination unit is configured to use the training set and preset conditions to determine the discriminant parameters in the linear discriminant function; the preset conditions include:
  • w 1 is the first weight vector in the discrimination parameter
  • w 2 is the second weight vector in the discrimination parameter
  • b 1 is the first function deviation coefficient in the discrimination parameter
  • b 2 is the The second function deviation coefficient in the discrimination parameter
  • ⁇ 1 is the first slack variable
  • ⁇ 2 is the second slack variable
  • X 1 is the feature matrix of the non-spam data in the training set
  • X 2 is the spam in the training set
  • 1 is the L1 norm
  • C 1 is the predetermined first auxiliary variable
  • C 2 is The predetermined second auxiliary variable
  • C 3 is the predetermined third auxiliary variable
  • C 4 is the predetermined fourth auxiliary variable.
  • the data processing module includes:
  • the first processing unit is configured to use the first linear discriminant function and the mail data x to obtain the first discriminant function value f 1 (x);
  • the data classification device is specifically configured to: use a preset classification rule, the first discriminant function value f 1 (x), and the second discriminant function value f 2 (x) to obtain the Classification results of mail data;
  • the classification rules are:
  • the classification result Is 1 it is determined that the mail is not spam, if the classification result If it is -1, it is determined that the mail is spam.
  • the present invention further provides a mail classification device, including:
  • Memory used to store computer programs
  • the processor is used to implement the steps of the above-mentioned mail classification method when the computer program is executed.
  • the present invention further provides a computer-readable storage medium having a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned mail classification method are implemented.
  • a mail classification method includes: receiving mail data to be classified; processing the mail data using a predetermined linear discriminant function to obtain a discriminant function value;
  • the discriminant parameters in the linear discriminant function are: the training set is obtained by analyzing the training set in advance through the twin support vector machine classification algorithm based on the L1 norm; the training data includes different types of mail training data;
  • the discriminant function value is used to classify the mail data.
  • the discriminant parameters in the linear discriminant function need to be obtained by analyzing the training set in advance through the twin support vector machine classification algorithm based on the L1 norm, and the discriminant parameter , It can reduce the impact of features with small contribution on the classification results, thereby improving classification efficiency and generalization performance, thereby improving the accuracy of spam filtering; the present invention also discloses a mail classification device, equipment and computer readable The storage medium can also achieve the above technical effects.
  • FIG. 1 is a schematic flowchart of a mail classification method disclosed in an embodiment of the present invention
  • Figure 2 is a schematic structural diagram of a mail classification device disclosed in an embodiment of the present invention.
  • Fig. 3 is a schematic structural diagram of a mail classification device disclosed in an embodiment of the present invention.
  • the embodiment of the present invention discloses a mail classification method, device, equipment and computer readable storage medium to realize accurate identification of spam.
  • a mail classification method provided by an embodiment of the present invention includes:
  • the classification of mails in this application can also be understood as the identification of spam.
  • S102 Use a predetermined linear discriminant function to process the mail data to obtain a discriminant function value; wherein, the discriminant parameter in the linear discriminant function is: training is performed in advance by a twin support vector machine classification algorithm based on the L1 norm
  • the training data includes different types of email training data;
  • the method for generating discriminant parameters in the linear discriminant function includes:
  • the preset conditions include:
  • w 1 is the first weight vector in the discrimination parameter
  • w 2 is the second weight vector in the discrimination parameter
  • b 1 is the first function deviation coefficient in the discrimination parameter
  • b 2 is the The second function deviation coefficient in the discrimination parameter
  • ⁇ 1 is the first slack variable
  • ⁇ 2 is the second slack variable
  • X 1 is the feature matrix of the non-spam data in the training set
  • X 2 is the spam in the training set
  • 1 is the L1 norm
  • C 1 is the predetermined first auxiliary variable
  • C 2 is The predetermined second auxiliary variable
  • C 3 is the predetermined third auxiliary variable
  • C 4 is the predetermined fourth auxiliary variable.
  • x 1i is the i-th non-spam email data
  • y 1i 1
  • the classification result is mainly obtained through the following two linear discriminant functions:
  • w 1 and w 2 are the first weight vector and the second weight vector of the two functions, respectively, and b 1 and b 2 are the deviation coefficients of the first function and the second function of the two functions, respectively. Therefore, in order to obtain the function weight vector and deviation, the following two optimization problems need to be solved separately:
  • C 1 , C 2 , C 3 , C 4 are four auxiliary variables that need to be determined in advance; with Are the characteristic matrices of non-spam and spam data, respectively, with Represents the slack variable, with Is a vector of all 1,
  • 1 is the L1 norm.
  • the discriminant parameters of the linear discriminant function: w 1 , w 2 , b 1 and b 2 are obtained by the above method, and then the mail data can be processed using the predetermined linear discriminant function to obtain the discriminant function value.
  • the predicted mail data needs to be normalized so that its characteristics are in the interval [0,1], and then the value of the discriminant function is calculated separately to obtain the first discriminant
  • the function value f 1 (x) and the second discriminant function value f 2 (x) are used to classify the type of mail by these two discriminant function values.
  • S103 Classify the mail data by using preset classification rules and discriminant function values.
  • using a preset classification rule and the discriminant function value to classify the mail data includes:
  • the first discriminant function value f 1 (x), and the second discriminant function value f 2 (x) to obtain the classification result of the mail data
  • the classification rules are:
  • the classification result Is 1 it is determined that the mail is not spam, if the classification result If it is -1, it is determined that the mail is spam.
  • the type of mail data can be determined according to the predetermined classification rules, that is, whether the mail data is junk mail.
  • a test is performed on the Spambase data set from UCI, which classifies emails according to whether they are spam emails.
  • the data set contains a total of 4601 training samples, and each sample contains 57 features. Most features indicate whether specific words or characters often appear in emails. See Table 1 for details. Among them, the feature of type "word_freq_WORD" represents the percentage of matching words in the email, namely:
  • WORD can be any string composed of alphanumeric characters
  • word_freq_CHAR represents the percentage of matching characters in the email, namely:
  • Capital_run_length_average represents the average length of an uninterrupted sequence of capital letters
  • Capital_run_length_longest represents the length of the longest sequence of consecutive capital letters
  • Capital_run_length_total represents the total number of capital letters in the email.
  • word_freq_internet 37 word_freq_1999 9 word_freq_order 38 word_freq_parts 10 word_freq_mail 39 word_freq_pm 11 word_freq_receive 40 word_freq_direct 12 word_freq_will 41 word_freq_cs 13 word_freq_people 42 word_freq_meeting 14 word_freq_report 43 word_freq_original 15 word_freq_addresses 44 word_freq_project 16 word_freq_free 45 word_freq_re 17 word_freq_business 46 word_freq_edu 18 word_freq_email 47 word_freq_table 19 word_freq_you 48 word_freq_conference 20 word_freq_credit 49 char_freq_; twenty one word_freq_your 50 char_freq_( twenty two word_freq_font 51 char
  • word_freq_money 53 char_freq_$ 25 word_freq_hp 54 char_freq_# 26 word_freq_hpl 55 capital_run_length_average 27 word_freq_george 56 capital_run_length_longest 28 word_freq_650 57 capital_run_length_total 29 word_freq_lab To To To
  • w 1 and w 2 are the weight vectors of the function
  • b 1 and b 2 are the deviations of the function.
  • C 1 , C 2 , C 3 , C 4 are auxiliary variables that need to be determined in advance; with Are the characteristic matrices of non-spam and spam data, respectively, with Represents the slack variable, with Is a vector of all ones.
  • w 1 , w 2 , b 1 and b 2 are obtained , so that two linear discriminant functions can be determined.
  • the features corresponding to the elements with smaller values in w 1 and w 2 are removed to improve the classification efficiency and the generalization performance of the model, thereby improving the accuracy of spam filtering.
  • Table 2 shows the values of w 1 and w 2 in this example, and their corresponding characteristics.
  • word_freq_remove 0.599947602 0.180805937 8 word_freq_internet 0.054684776 0.067555331 9 word_freq_order 0.095058275 3.96E-07 10 word_freq_mail 0.010267208 0.030398109 11 word_freq_receive -0.004534669 0.059964939 12 word_freq_will 0.011358662 -0.051631205 13 word_freq_people 0.039094907 -0.024013264 14 word_freq_report 0.016927219 4.51E-06 15 word_freq_addresses 0.133218855 3.16E-07 16 word_freq_free 0.157490196 0.294902091 17 word_freq_business 0.140433387 0.040446458 18 word_freq_email 2.13E-07 0.03694443 19 word_freq_you 0.022747439 0.
  • word_freq_85 3.01E-08 -0.139268027 36 word_freq_technology -1.91E-07 0.036651113 37 word_freq_1999 -0.198426922 -0.009083012 38 word_freq_parts -0.000370605 -5.48E-08 39 word_freq_pm -5.31E-08 -0.328220523 40 word_freq_direct 1.57E-06 -2.47E-07 41 word_freq_cs -2.45E-07 -0.445715068 42 word_freq_meeting -0.115106071 -0.894433161 43 word_freq_original -1.43E-06 -0.276856116 44 word_freq_project -1.76E-07 -0.686037299 45 word_freq_re -0.012982052 -0.515878396 46 word_freq_edu -0.06531
  • the present invention is divided into two types, one is to directly set the smaller value of w 1 and w 2 to zero; the other is to keep w 1 and w 2 .
  • the experimental results are shown in Table 3.
  • the present invention reduces the impact of those features with low contribution on the classification results, improves the generalization performance of the classification, and further improves the accuracy of mail filtering.
  • the discriminant parameters in the linear discriminant function need to be obtained by analyzing the training set in advance through the twin support vector machine classification algorithm based on the L1 norm.
  • the discriminant parameters It can reduce the impact of features with small contributions on the classification results, thereby improving classification efficiency and generalization performance; moreover, this solution can also directly remove the contribution by setting the smaller value of w 1 and w 2 to zero. The impact of small features on the classification results, thereby further improving the accuracy of spam filtering.
  • the following describes the mail sorting device provided by the embodiment of the present invention.
  • the mail sorting device described below and the mail sorting method described above can be cross-referenced.
  • a mail classification device provided by an embodiment of the present invention includes:
  • the data receiving module 100 is used to receive mail data to be classified
  • the data processing module 200 is configured to process the mail data by using a predetermined linear discriminant function to obtain a discriminant function value; wherein, the discriminant parameter in the linear discriminant function is: a twin support vector based on the L1 norm is passed in advance
  • the machine classification algorithm analyzes the training set to obtain; the training data includes different types of mail training data;
  • the data classification device 300 is configured to classify the mail data by using a preset classification rule and the discriminant function value.
  • the device further includes a discriminant parameter generation module; wherein, the discriminant parameter generation module includes:
  • the training set acquisition unit is used to acquire the training set
  • the discriminant parameter determination unit is configured to use the training set and preset conditions to determine the discriminant parameters in the linear discriminant function; the preset conditions include:
  • w 1 is the first weight vector in the discrimination parameter
  • w 2 is the second weight vector in the discrimination parameter
  • b 1 is the first function deviation coefficient in the discrimination parameter
  • b 2 is the The second function deviation coefficient in the discrimination parameter
  • ⁇ 1 is the first slack variable
  • ⁇ 2 is the second slack variable
  • X 1 is the feature matrix of the non-spam data in the training set
  • X 2 is the spam in the training set
  • 1 is the L1 norm
  • C 1 is the predetermined first auxiliary variable
  • C 2 is The predetermined second auxiliary variable
  • C 3 is the predetermined third auxiliary variable
  • C 4 is the predetermined fourth auxiliary variable.
  • the data processing module includes:
  • the first processing unit is configured to use the first linear discriminant function and the mail data x to obtain the first discriminant function value f 1 (x);
  • the data classification device is specifically configured to: use a preset classification rule, the first discriminant function value f 1 (x), and the second discriminant function value f 2 (x) to obtain the mail data The classification results;
  • the classification rules are:
  • the classification result Is 1 it is determined that the mail is not spam, if the classification result If it is -1, it is determined that the mail is spam.
  • the device may include:
  • the memory 11 is used to store computer programs
  • the processor 12 is configured to implement the steps of the mail classification method described in any of the foregoing method embodiments when executing the computer program.
  • the device 1 may be a PC (Personal Computer, personal computer), or a terminal device such as a smart phone, a tablet computer, a palmtop computer, and a portable computer.
  • PC Personal Computer
  • terminal device such as a smart phone, a tablet computer, a palmtop computer, and a portable computer.
  • the device 1 may include a memory 11, a processor 12, and a bus 13.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, and the like.
  • the memory 11 may be an internal storage unit of the device 1 in some embodiments, for example, the hard disk of the device 1. In other embodiments, the memory 11 may also be an external storage device of the device 1, such as a plug-in hard disk, a smart media card (SMC), or a secure digital (SD) card equipped on the device 1. Flash Card, etc. Further, the memory 11 may also include both an internal storage unit of the device 1 and an external storage device.
  • the memory 11 can be used not only to store application software installed in the device 1 and various types of data, such as codes for executing mail classification methods, etc., but also to temporarily store data that has been output or will be output.
  • the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments, and is used to run the program code or processing stored in the memory 11 Data, such as the code that executes the mail classification method, etc.
  • CPU central processing unit
  • controller microcontroller
  • microprocessor or other data processing chip in some embodiments, and is used to run the program code or processing stored in the memory 11 Data, such as the code that executes the mail classification method, etc.
  • the bus 13 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 3 to represent, but it does not mean that there is only one bus or one type of bus.
  • the device may also include a network interface 14.
  • the network interface 14 may optionally include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to connect the device 1 with other electronic devices. Establish a communication connection between.
  • the device 1 may also include a user interface.
  • the user interface may include a display (Display) and an input unit such as a keyboard (Keyboard).
  • the optional user interface may also include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the device 1 and to display a visualized user interface.
  • FIG. 3 only shows the device 1 with components 11-14. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
  • the embodiment of the present invention also discloses a computer-readable storage medium having a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the mail classification method as described in any of the above method embodiments is implemented A step of.
  • the storage medium may include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc., which can store program code medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种邮件分类方法、装置、设备及计算机可读存储介质,包括:接收待分类的邮件数据(S101);利用预先确定的线性判别函数对邮件数据进行处理,得到判别函数值(S102);线性判别函数中的判别参数为:预先通过基于L1范数的孪生支持向量机分类算法对训练集进行分析获得;利用预先设定的分类规则及判别函数值对邮件数据进行分类(S103)。上述方法通过线性判别函数对邮件数据进行分类时,线性判别函数中的判别参数需要预先通过基于L1范数的孪生支持向量机分类算法对训练集进行分析获得,通过该判别参数,可以减小贡献度小的特征对分类结果的影响,从而提高分类效率和泛化性能,进而提高对垃圾邮件过滤的准确度。

Description

一种邮件分类方法、装置、设备及计算机可读存储介质
本申请要求于2019年09月20日提交中国专利局、申请号为201910893789.0、发明名称为“一种邮件分类方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及数据处理技术领域,更具体地说,涉及一种邮件分类方法、装置、设备及计算机可读存储介质。
背景技术
垃圾邮件的危害性非常大,会占用网络带宽,降低整个网络的运行效率;易被黑客利用,造成网路拥堵,甚至瘫痪;垃圾邮件还易被不法分子利用,传播不良信息等等。为了维护互联网的健康安全发展,亟需较为安全、有效的垃圾邮件过滤技术。
目前Jayadeva等人提出了通过孪生支持向量机(Twin support vector machine,TSVM)来处理垃圾邮件的过滤。对于两分类问题,TSVM通过寻求两个不平行的平面,使得两类样本尽可能靠近其中一个平面而远离另一个平面。但是该算法构造的模型不一定具有稀疏性,也就是说通过该模型进行邮件分类时,会关注邮件样本中不重要的特征,从而会导致分类器的泛化性能降低,降低了对垃圾邮件过滤的准确性。因此,如何提高对垃圾邮件过滤的准确性,是本领域的技术人员需要解决的问题。
发明内容
本发明的目的在于提供一种邮件分类方法、装置、设备及计算机可读存储介质,以实现对垃圾邮件的准确识别。
为实现上述目的,本发明提供一种邮件分类方法,包括:
接收待分类的邮件数据;
利用预先确定的线性判别函数对所述邮件数据进行处理,得到判别函数值;其中,所述线性判别函数中的判别参数为:预先通过基于L1范数的孪生支持向量机分类算法对训练集进行分析获得;所述训练数据包括不同类别的邮件训练数据;
利用预先设定的分类规则及所述判别函数值,对所述邮件数据进行分类。
可选的,所述线性判别函数中的判别参数生成方法,包括:
获取训练集;利用所述训练集及预设条件,确定所述线性判别函数中的判别参数;
所述预设条件包括:
Figure PCTCN2020079825-appb-000001
s.t.-(X 2w 1+e 2b 1)+ξ 2≥e 22≥0
Figure PCTCN2020079825-appb-000002
s.t.(X 1w 2+e 1b 2)+ξ 1≥e 11≥0
其中,w 1为所述判别参数中的第一权重向量,w 2为所述判别参数中的第二权重向量,b 1为所述判别参数中的第一函数偏差系数,b 2为所述判别参数中的第二函数偏差系数,ξ 1为第一松弛变量,ξ 2为第二松弛变量,X 1为所述训练集中非垃圾邮件数据的特征矩阵,X 2为所述训练集中垃圾邮件数据的特征矩阵,e 1为全1的第一向量,e 2为全1的第二向量,||.|| 1为L1范数,C 1为预先确定的第一辅助变量,C 2为预先确定的第二辅助变量,C 3为预先确定的第三辅助变量,C 4为预先确定的第四辅助变量。
可选的,所述利用预先确定的线性判别函数对所述邮件数据进行处理,得到判别函数值,包括:
利用第一线性判别函数及所述邮件数据x,得到第一判别函数值f 1(x);
利用第二线性判别函数及所述邮件数据x,得到第二判别函数值f 2(x);
其中,所述第一线性判别函数为:f 1(x)=x Tw 1+b 1,所述第二线性判别函数为:f 2(x)=x Tw 2+b 2
可选的,所述利用预先设定的分类规则及所述判别函数值,对所述邮件数据进行分类,包括:
利用预先设定的分类规则、所述第一判别函数值f 1(x)、所述第二判别函数值f 2(x),得到所述邮件数据的分类结果;
所述分类规则为:
Figure PCTCN2020079825-appb-000003
其中,若分类结果
Figure PCTCN2020079825-appb-000004
为1,则判定所述邮件为非垃圾邮件,若分类结果
Figure PCTCN2020079825-appb-000005
为-1,则判定所述邮件为垃圾邮件。
为实现上述目的,本发明进一步提供一种邮件分类装置,包括:
数据接收模块,用于接收待分类的邮件数据;
数据处理模块,用于利用预先确定的线性判别函数对所述邮件数据进行处理,得到判别函数值;其中,所述线性判别函数中的判别参数为:预先通过基于L1范数的孪生支持向量机分类算法对训练集进行分析获得;所述训练数据包括不同类别的邮件训练数据;
数据分类装置,用于利用预先设定的分类规则及所述判别函数值,对所述邮件数据进行分类。
可选的,本装置还包括判别参数生成模块;其中,别参数生成模块包括:
训练集获取单元,用于获取训练集;
判别参数确定单元,用于利用所述训练集及预设条件,确定所述线性判别函数中的判别参数;所述预设条件包括:
Figure PCTCN2020079825-appb-000006
s.t.-(X 2w 1+e 2b 1)+ξ 2≥e 22≥0
Figure PCTCN2020079825-appb-000007
s.t.(X 1w 2+e 1b 2)+ξ 1≥e 11≥0
其中,w 1为所述判别参数中的第一权重向量,w 2为所述判别参数中的第二权重向量,b 1为所述判别参数中的第一函数偏差系数,b 2为所述判别参数中的第二函数偏差系数,ξ 1为第一松弛变量,ξ 2为第二松弛变量,X 1为所述训练集中非垃圾邮件数据的特征矩阵,X 2为所述训练集中垃圾邮件数据的特征矩阵,e 1为全1的第一向量,e 2为全1的第二向量,||.|| 1为L1范数,C 1为预先确定的第一辅助变量,C 2为预先确定的第二辅助变量,C 3为预先确定的第三辅助变量,C 4为预先确定的第四辅助变量。
可选的,所述数据处理模块包括:
第一处理单元,用于利用第一线性判别函数及所述邮件数据x,得到第一判别函数值f 1(x);
第二处理单元,用于利用第二线性判别函数及所述邮件数据x,得到第二判别函数值f 2(x);其中,所述第一线性判别函数为:f 1(x)=x Tw 1+b 1,所述第二线性判别函数为:f 2(x)=x Tw 2+b 2
可选的,所述数据分类装置具体用于:利用预先设定的分类规则、所述第一判别函数值f 1(x)、所述第二判别函数值f 2(x),得到所述邮件数据的分类结果;
所述分类规则为:
Figure PCTCN2020079825-appb-000008
其中,若分类结果
Figure PCTCN2020079825-appb-000009
为1,则判定所述邮件为非垃圾邮件,若分类结果
Figure PCTCN2020079825-appb-000010
为-1,则判定所述邮件为垃圾邮件。
为实现上述目的,本发明进一步提供一种邮件分类装置,包括:
存储器,用于存储计算机程序;
处理器,用于执行所述计算机程序时实现上述的邮件分类方法的步骤。
为实现上述目的,本发明进一步提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述的邮件分类方法的步骤。
通过以上方案可知,本发明实施例提供的一种邮件分类方法,包括:接收待分类的邮件数据;利用预先确定的线性判别函数对所述邮件数据进 行处理,得到判别函数值;其中,所述线性判别函数中的判别参数为:预先通过基于L1范数的孪生支持向量机分类算法对训练集进行分析获得;所述训练数据包括不同类别的邮件训练数据;利用预先设定的分类规则及所述判别函数值,对所述邮件数据进行分类。
可见,在本方案中,通过线性判别函数对邮件数据进行分类时,线性判别函数中的判别参数需要预先通过基于L1范数的孪生支持向量机分类算法对训练集进行分析获得,通过该判别参数,可以减小贡献度小的特征对分类结果的影响,从而提高分类效率和泛化性能,进而提高对垃圾邮件过滤的准确度;本发明还公开了一种邮件分类装置、设备及计算机可读存储介质,同样能实现上述技术效果。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例公开的一种邮件分类方法流程示意图;
图2为本发明实施例公开的一种邮件分类装置结构示意图;
图3为本发明实施例公开的一种邮件分类设备结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例公开了一种邮件分类方法、装置、设备及计算机可读存储介质,以实现对垃圾邮件的准确识别。
参见图1,本发明实施例提供的一种邮件分类方法,包括:
S101、接收待分类的邮件数据;
在本实施例中,对于进行分类的邮件数据,首先需要对输入的邮件数据x进行归一化处理,将邮件数据x的特征归一化在区间[0,1]中。在本实施例中,对于邮件数据的类别,可以分为垃圾邮件及非垃圾邮件,因此本申请对邮件的分类,也可以理解为对垃圾邮件的识别。
S102、利用预先确定的线性判别函数对所述邮件数据进行处理,得到判别函数值;其中,所述线性判别函数中的判别参数为:预先通过基于L1范数的孪生支持向量机分类算法对训练集进行分析获得;所述训练数据包括不同类别的邮件训练数据;
其中,所述线性判别函数中的判别参数生成方法,包括:
获取训练集;利用所述训练集及预设条件,确定所述线性判别函数中的判别参数;
所述预设条件包括:
Figure PCTCN2020079825-appb-000011
s.t.-(X 2w 1+e 2b 1)+ξ 2≥e 22≥0
Figure PCTCN2020079825-appb-000012
s.t.(X 1w 2+e 1b 2)+ξ 1≥e 11≥0
其中,w 1为所述判别参数中的第一权重向量,w 2为所述判别参数中的第二权重向量,b 1为所述判别参数中的第一函数偏差系数,b 2为所述判别参数中的第二函数偏差系数,ξ 1为第一松弛变量,ξ 2为第二松弛变量,X 1为所述训练集中非垃圾邮件数据的特征矩阵,X 2为所述训练集中垃圾邮件数据的特征矩阵,e 1为全1的第一向量,e 2为全1的第二向量,||.|| 1为L1范数,C 1为预先确定的第一辅助变量,C 2为预先确定的第二辅助变量,C 3为预先确定的第三辅助变量,C 4为预先确定的第四辅助变量。
在本实施例中,需要将样本归一化,得到训练集,并利用训练集对模型进行训练,再使用已训练好的模型在测试集上进行预测,得到最终的预测结果。具体来说,首先需要统计收集到的垃圾邮件相关资料,作为本系统的训练集,该训练集D为D=X 1∪X 2,其中X 1={x 1i|x 1i∈R m,y 1i=1,i=1,...,n 1}是非垃圾邮件数据集合,X 2={x 2i|x 2i∈R m,y 2i=-1,i=1,...,n 2}是垃圾邮件数据集合,每个样本的特征数为m,n 1是非垃圾邮件数据个数,n 2是垃圾邮件数据个数,n=n 1+n 2为训练集样本总数,R m为具有m个特征的实数集,X 1为非垃圾邮件数据的特征矩阵,X 2为垃圾邮件数据的特征矩阵,x 1i为第i个非垃圾邮件的邮件数据,y 1i为第i个非垃圾邮件的分类结果,由于x 1i为第i个非垃圾邮件,因此y 1i=1,x 2i为第i个垃圾邮件的邮件数据,y 2i为第i个垃圾邮件的分类结果,由于x 2i为第i个垃圾邮件,因此y 2i=-1。
在本实施例中,主要通过如下两个线性判别函数得到分类结果:
f 1(x)=x Tw 1+b 1
f 2(x)=x Tw 2+b 2
其中,w 1和w 2分别为两个函数的第一权重向量和第二权重向量,b 1和b 2分别为两个函数的第一函数偏差系数和第二函数偏差系数。因此,为获得函数权重向量和偏差,需要分别求解如下的两个优化问题:
Figure PCTCN2020079825-appb-000013
s.t.-(X 2w 1+e 2b 1)+ξ 2≥e 22≥0
Figure PCTCN2020079825-appb-000014
s.t.(X 1w 2+e 1b 2)+ξ 1≥e 11≥0
其中,C 1,C 2,C 3,C 4是需要事先确定的四个辅助变量;
Figure PCTCN2020079825-appb-000015
Figure PCTCN2020079825-appb-000016
分别是非垃圾邮件和垃圾邮件数据的特征矩阵,
Figure PCTCN2020079825-appb-000017
Figure PCTCN2020079825-appb-000018
表示松弛变量,
Figure PCTCN2020079825-appb-000019
Figure PCTCN2020079825-appb-000020
是全1的向量,||.|| 1为L1范数。
求解上述两个优化问题后,得到w 1,w 2,b 1和b 2,从而可以确定两个线性判别函数。需要说明的是,w 1和w 2中元素数值越小,说明该元素对应的特征对模型训练的贡献越小。去除w 1和w 2中值较小的元素所对应 的特征,以此提高分类效率和模型的泛化性能,进而提高对垃圾邮件过滤的准确度;因此在本申请中,得到线性判别函数中的判别参数之后,可以将判断判别参数中的第一权重向量和第二权重向量中,是否存在小于预定阈值的特征值,如果存在,则将第一权重向量和第二权重向量中小于预定阈值的特征值置零,从而提高分类效果和模型的泛化能力。
可以理解的是,通过上述方式得到线性判别函数的判别参数:w 1,w 2,b 1和b 2之后,便可利用预先确定的线性判别函数对邮件数据进行处理,得到判别函数值,该过程具体包括:利用第一线性判别函数及所述邮件数据x,得到第一判别函数值f 1(x);利用第二线性判别函数及所述邮件数据x,得到第二判别函数值f 2(x);其中,所述第一线性判别函数为:f 1(x)=x Tw 1+b 1,所述第二线性判别函数为:f 2(x)=x Tw 2+b 2
也就是说,获取到输入的待预测邮件数据x后,需要将预测邮件数据进行归一化处理,使其特征在区间[0,1]中,然后分别计算判别函数的值,得到第一判别函数值f 1(x)和第二判别函数值f 2(x),以通过这两个判别函数值对邮件的类型进行分类。
S103、利用预先设定的分类规则及判别函数值,对邮件数据进行分类。
其中,利用预先设定的分类规则及所述判别函数值,对所述邮件数据进行分类,包括:
利用预先设定的分类规则、所述第一判别函数值f 1(x)、所述第二判别函数值f 2(x),得到所述邮件数据的分类结果;
所述分类规则为:
Figure PCTCN2020079825-appb-000021
其中,若分类结果
Figure PCTCN2020079825-appb-000022
为1,则判定所述邮件为非垃圾邮件,若分类结果
Figure PCTCN2020079825-appb-000023
为-1,则判定所述邮件为垃圾邮件。
可以看出,得到两个判别函数值之后,便可依据预先确定的分类规则来判别邮件数据的类型,即:判别邮件数据是否为垃圾邮件。
下面通过一具体实施例来对本发明进行详细说明,需要说明的是,本实施例是以本发明技术方案为前提下进行实施,给出了详细的实施方式和过程,但本发明的适用范围并不局限于以下实施例。
在本实施例中,对来自UCI的Spambase数据集上进行测试,该数据集根据是否是垃圾邮件,对邮件进行分类。数据集共包含4601个训练样本,每个样本包含57个特征,大多数特征表示邮件中是否经常出现特定的单词或字符,具体见表1。其中,类型为“word_freq_WORD”的特征表示电子邮件中匹配单词出现的百分比,即:
Figure PCTCN2020079825-appb-000024
这里的“WORD”可以是任何由字母数字字符组成的字符串;
类型为“word_freq_CHAR”的特征表示电子邮件中匹配字符出现的百分比,即:
Figure PCTCN2020079825-appb-000025
“capital_run_length_average”表示不间断大写字母序列的平均长度;
“capital_run_length_longest”表示最长的连续大写字母序列的长度;
“capital_run_length_total”表示电子邮件中大写字母的总数。
在该训练样本中,非垃圾邮件有1813个,将其标记为+1;垃圾邮件有2788个,将其标记为-1。
表1 Spambase数据集的特征描述
序号 特征名称 序号 特征名称
1 word_freq_make 30 word_freq_labs
2 word_freq_address 31 word_freq_telnet
3 word_freq_all 32 word_freq_857
4 word_freq_3d 33 word_freq_data
5 word_freq_our 34 word_freq_415
6 word_freq_over 35 word_freq_85
7 word_freq_remove 36 word_freq_technology
8 word_freq_internet 37 word_freq_1999
9 word_freq_order 38 word_freq_parts
10 word_freq_mail 39 word_freq_pm
11 word_freq_receive 40 word_freq_direct
12 word_freq_will 41 word_freq_cs
13 word_freq_people 42 word_freq_meeting
14 word_freq_report 43 word_freq_original
15 word_freq_addresses 44 word_freq_project
16 word_freq_free 45 word_freq_re
17 word_freq_business 46 word_freq_edu
18 word_freq_email 47 word_freq_table
19 word_freq_you 48 word_freq_conference
20 word_freq_credit 49 char_freq_;
21 word_freq_your 50 char_freq_(
22 word_freq_font 51 char_freq_[
23 word_freq_000 52 char_freq_!
24 word_freq_money 53 char_freq_$
25 word_freq_hp 54 char_freq_#
26 word_freq_hpl 55 capital_run_length_average
27 word_freq_george 56 capital_run_length_longest
28 word_freq_650 57 capital_run_length_total
29 word_freq_lab    
具体实施步骤如下:
一、数据预处理模块
(1)统计收集到的垃圾邮件相关资料,作为本系统的训练集。本实例中用了Spambase数据集。
(2)输入训练集D=X 1∪X 2,其中X 1={x 1i|x 1i∈R m,y 1i=1,i=1,...,n 1}是非垃圾邮件数据集合,X 2={x 2i|x 2i∈R m,y 2i=-1,i=1,...,n 2}是垃圾邮件数据集合,每个样本的特征数为m,n 1是非垃圾邮件数据个数,n 2是垃圾邮件数据个数,n=n 1+n 2为训练集样本总数。在本实例中,特征数m=57,训练集样本总数n=4601。随机取样本集中3680个样本作为训练集,剩余921个样本作为测试集。
二、数据训练模块
使用本发明确定两个线性判别函数:
f 1(x)=x Tw 1+b 1
f 2(x)=x Tw 2+b 2
其中w 1和w 2为函数的权重向量,b 1和b 2为函数的偏差。为获得函数权重向量和偏差,分别求解如下的两个优化问题:
Figure PCTCN2020079825-appb-000026
s.t.-(X 2w 1+e 2b 1)+ξ 2≥e 22≥0
Figure PCTCN2020079825-appb-000027
s.t.(X 1w 2+e 1b 2)+ξ 1≥e 11≥0
其中,C 1,C 2,C 3,C 4是需要事先确定的辅助变量;
Figure PCTCN2020079825-appb-000028
Figure PCTCN2020079825-appb-000029
分别是非垃圾邮件和垃圾邮件数据的特征矩阵,
Figure PCTCN2020079825-appb-000030
Figure PCTCN2020079825-appb-000031
表示松弛变量,
Figure PCTCN2020079825-appb-000032
Figure PCTCN2020079825-appb-000033
是全1的向量。
求解上述两个优化问题后,得到w 1,w 2,b 1和b 2,从而可以确定两个线性判别函数。w 1和w 2中元素数值越小,说明该元素对应的特征对模型训练的贡献越小。去除w 1和w 2中值较小的元素所对应的特征,以此提高分类效率和模型的泛化性能,进而提高对垃圾邮件过滤的准确度。
表2显示了本例中w 1和w 2的值,及其对应的特征。
表2 Spambase数据集训练的w 1,w 2值,及其对应的特征
序号 特征名称 对应w 1中的值 对应w 2中的值
1 word_freq_make 0.018006256 -0.008663684
2 word_freq_address 0.028125314 -0.17641398
3 word_freq_all 0.026372495 2.97E-06
4 word_freq_3d 0.08009944 0.049373478
5 word_freq_our 0.046413904 0.085781046
6 word_freq_over 0.050890197 0.042514217
7 word_freq_remove 0.599947602 0.180805937
8 word_freq_internet 0.054684776 0.067555331
9 word_freq_order 0.095058275 3.96E-07
10 word_freq_mail 0.010267208 0.030398109
11 word_freq_receive -0.004534669 0.059964939
12 word_freq_will 0.011358662 -0.051631205
13 word_freq_people 0.039094907 -0.024013264
14 word_freq_report 0.016927219 4.51E-06
15 word_freq_addresses 0.133218855 3.16E-07
16 word_freq_free 0.157490196 0.294902091
17 word_freq_business 0.140433387 0.040446458
18 word_freq_email 2.13E-07 0.03694443
19 word_freq_you 0.022747439 0.022010931
20 word_freq_credit 0.372689184 0.009016062
21 word_freq_your 0.024970787 0.042237689
22 word_freq_font 0.18827001 0.005959774
23 word_freq_000 0.964512373 0.054296881
24 word_freq_money 0.039205594 8.59E-07
25 word_freq_hp -0.407015476 -1.085866011
26 word_freq_hpl -6.05E-07 -0.65578134
27 word_freq_george -0.214082329 -0.840605473
28 word_freq_650 3.42E-07 0.009571422
29 word_freq_lab -2.24E-07 -7.12E-07
30 word_freq_labs -0.248743778 -0.010527139
31 word_freq_telnet -6.58E-09 -1.66E-07
32 word_freq_857 -1.30E-07 1.28E-07
33 word_freq_data -5.40E-07 -0.522033234
34 word_freq_415 -1.17E-07 -2.81E-08
35 word_freq_85 3.01E-08 -0.139268027
36 word_freq_technology -1.91E-07 0.036651113
37 word_freq_1999 -0.198426922 -0.009083012
38 word_freq_parts -0.000370605 -5.48E-08
39 word_freq_pm -5.31E-08 -0.328220523
40 word_freq_direct 1.57E-06 -2.47E-07
41 word_freq_cs -2.45E-07 -0.445715068
42 word_freq_meeting -0.115106071 -0.894433161
43 word_freq_original -1.43E-06 -0.276856116
44 word_freq_project -1.76E-07 -0.686037299
45 word_freq_re -0.012982052 -0.515878396
46 word_freq_edu -0.065312769 -0.825170081
47 word_freq_table -2.26E-07 -0.039009213
48 word_freq_conference -6.69E-08 -0.291443912
49 char_freq_; -0.130036846 -3.47E-05
50 char_freq_( -5.22E-07 -1.61E-07
51 char_freq_[ -1.09E-07 -7.06E-07
52 char_freq_! 0.096944256 0.275567848
53 char_freq_$ 0.49974777 0.473990268
54 char_freq_# 1.08E-06 1.33E-07
55 capital_run_length_average 2.08E-06 1.70E-07
56 capital_run_length_longest 0.396973725 1.87E-07
57 capital_run_length_total 0.226919633 0.125010667
从表2可以看出,一些由数字组成的字符串和一些诸如“(”、“[”的符号等所代表的特征对模型训练的贡献度较小,而w 1和w 2中较大的元素值所对应的特征词汇,诸如“meeting”、“business”、“edu”等特 征对模型贡献度较大。将本例中w 1和w 2中值在[-e -4,e -4]之间的元素(即表中加粗的数据)置为0。
三、数据预测模块
输入待预测邮件数据x,分别计算判别函数的值
f 1(x)=x Tw 1+b 1
f 2(x)=x Tw 2+b 2
然后按照下述规则对邮件的类别进行判断:
Figure PCTCN2020079825-appb-000034
Figure PCTCN2020079825-appb-000035
为1,则该邮件为非垃圾邮件;否则为垃圾邮件。
对TSVM、本发明进行了对比。本发明分为两种,一种是进行对w 1和w 2中较小值直接置零;另外一种是保留w 1和w 2。实验结果如表3所示,本发明减轻了那些贡献度较低的特征对分类结果的影响,提高了分类的泛化性能,进而提高了邮件过滤的准确度。
表3 Spambase数据集测试结果准确率的对比
方法 精度
本发明(小权重剔除) 94.14%
本发明(所有权重) 94.03%
TSVM 92.31%
可以看出,本申请通过线性判别函数对邮件数据进行分类时,线性判别函数中的判别参数需要预先通过基于L1范数的孪生支持向量机分类算法对训练集进行分析获得,通过该判别参数,可以减小贡献度小的特征对分类结果的影响,从而提高分类效率和泛化性能;并且,本方案还可以通过将w 1和w 2中较小值直接置零的方式,直接去除贡献度小的特征对分类结果的影响,从而进一步提高对垃圾邮件过滤的准确度。
下面对本发明实施例提供的邮件分类装置进行介绍,下文描述的邮件分类装置与上文描述的邮件分类方法可以相互参照。
参见图2,本发明实施例提供的一种邮件分类装置,包括:
数据接收模块100,用于接收待分类的邮件数据;
数据处理模块200,用于利用预先确定的线性判别函数对所述邮件数据进行处理,得到判别函数值;其中,所述线性判别函数中的判别参数为:预先通过基于L1范数的孪生支持向量机分类算法对训练集进行分析获得;所述训练数据包括不同类别的邮件训练数据;
数据分类装置300,用于利用预先设定的分类规则及所述判别函数值,对所述邮件数据进行分类。
其中,该装置还包括判别参数生成模块;其中,所述判别参数生成模块包括:
训练集获取单元,用于获取训练集;
判别参数确定单元,用于利用所述训练集及预设条件,确定所述线性判别函数中的判别参数;所述预设条件包括:
Figure PCTCN2020079825-appb-000036
s.t.-(X 2w 1+e 2b 1)+ξ 2≥e 22≥0
Figure PCTCN2020079825-appb-000037
s.t.(X 1w 2+e 1b 2)+ξ 1≥e 11≥0
其中,w 1为所述判别参数中的第一权重向量,w 2为所述判别参数中的第二权重向量,b 1为所述判别参数中的第一函数偏差系数,b 2为所述判别参数中的第二函数偏差系数,ξ 1为第一松弛变量,ξ 2为第二松弛变量,X 1为所述训练集中非垃圾邮件数据的特征矩阵,X 2为所述训练集中垃圾邮件数据的特征矩阵,e 1为全1的第一向量,e 2为全1的第二向量,||.|| 1为L1范数,C 1为预先确定的第一辅助变量,C 2为预先确定的第二辅助变量,C 3为预先确定的第三辅助变量,C 4为预先确定的第四辅助变量。
其中,所述数据处理模块包括:
第一处理单元,用于利用第一线性判别函数及所述邮件数据x,得到第一判别函数值f 1(x);
第二处理单元,用于利用第二线性判别函数及所述邮件数据x,得到第二判别函数值f 2(x);其中,所述第一线性判别函数为:f 1(x)=x Tw 1+b 1,所述第二线性判别函数为:f 2(x)=x Tw 2+b 2
其中,所述数据分类装置具体用于:利用预先设定的分类规则、所述第一判别函数值f 1(x)、所述第二判别函数值f 2(x),得到所述邮件数据的分类结果;
所述分类规则为:
Figure PCTCN2020079825-appb-000038
其中,若分类结果
Figure PCTCN2020079825-appb-000039
为1,则判定所述邮件为非垃圾邮件,若分类结果
Figure PCTCN2020079825-appb-000040
为-1,则判定所述邮件为垃圾邮件。
参见图3,为本发明实施例还公开了一种邮件分类装置结构示意图;该装置可以包括:
存储器11,用于存储计算机程序;
处理器12,用于执行所述计算机程序时实现如上述任意方法实施例所述的邮件分类方法的步骤。
在本实施例中,设备1可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、掌上电脑、便携计算机等终端设备。
该设备1可以包括存储器11、处理器12和总线13。
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是设备1的内部存储单元,例如该设备1的硬盘。存储器11在另一些实施例中也可以是设备1的外部存储设备,例如设备1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括设备1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于设备1的应用软件及各类数据,例如执行邮件分类方法的代码等,还可以用于暂时地存储已经 输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行邮件分类方法的代码等。
该总线13可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图3中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
进一步地,设备还可以包括网络接口14,网络接口14可选的可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该设备1与其他电子设备之间建立通信连接。
可选地,该设备1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在设备1中处理的信息以及用于显示可视化的用户界面。
图3仅示出了具有组件11-14的设备1,本领域技术人员可以理解的是,图3示出的结构并不构成对设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
本发明实施例还公开了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上述任意方法实施例所述的邮件分类方法的步骤。
其中,该存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (10)

  1. 一种邮件分类方法,其特征在于,包括:
    接收待分类的邮件数据;
    利用预先确定的线性判别函数对所述邮件数据进行处理,得到判别函数值;其中,所述线性判别函数中的判别参数为:预先通过基于L1范数的孪生支持向量机分类算法对训练集进行分析获得;所述训练数据包括不同类别的邮件训练数据;
    利用预先设定的分类规则及所述判别函数值,对所述邮件数据进行分类。
  2. 根据权利要求1所述的邮件分类方法,其特征在于,所述线性判别函数中的判别参数生成方法,包括:
    获取训练集;利用所述训练集及预设条件,确定所述线性判别函数中的判别参数;
    所述预设条件包括:
    Figure PCTCN2020079825-appb-100001
    s.t. -(X 2w 1+e 2b 1)+ξ 2≥e 22≥0
    Figure PCTCN2020079825-appb-100002
    s.t. (X 1w 2+e 1b 2)+ξ 1≥e 11≥0
    其中,w 1为所述判别参数中的第一权重向量,w 2为所述判别参数中的第二权重向量,b 1为所述判别参数中的第一函数偏差系数,b 2为所述判别参数中的第二函数偏差系数,ξ 1为第一松弛变量,ξ 2为第二松弛变量,X 1为所述训练集中非垃圾邮件数据的特征矩阵,X 2为所述训练集中垃圾邮件数据的特征矩阵,e 1为全1的第一向量,e 2为全1的第二向量,||.|| 1为L1范数,C 1为预先确定的第一辅助变量,C 2为预先确定的第二辅助变量,C 3为预先确定的第三辅助变量,C 4为预先确定的第四辅助变量。
  3. 根据权利要求2所述的邮件分类方法,其特征在于,所述利用预先确定的线性判别函数对所述邮件数据进行处理,得到判别函数值,包括:
    利用第一线性判别函数及所述邮件数据x,得到第一判别函数值f 1(x);
    利用第二线性判别函数及所述邮件数据x,得到第二判别函数值f 2(x);
    其中,所述第一线性判别函数为:f 1(x)=x Tw 1+b 1,所述第二线性判别函数为:f 2(x)=x Tw 2+b 2
  4. 根据权利要求3所述的邮件分类方法,其特征在于,所述利用预先设定的分类规则及所述判别函数值,对所述邮件数据进行分类,包括:
    利用预先设定的分类规则、所述第一判别函数值f 1(x)、所述第二判别函数值f 2(x),得到所述邮件数据的分类结果;
    所述分类规则为:
    Figure PCTCN2020079825-appb-100003
    其中,若分类结果
    Figure PCTCN2020079825-appb-100004
    为1,则判定所述邮件为非垃圾邮件,若分类结果
    Figure PCTCN2020079825-appb-100005
    为-1,则判定所述邮件为垃圾邮件。
  5. 一种邮件分类装置,其特征在于,包括:
    数据接收模块,用于接收待分类的邮件数据;
    数据处理模块,用于利用预先确定的线性判别函数对所述邮件数据进行处理,得到判别函数值;其中,所述线性判别函数中的判别参数为:预先通过基于L1范数的孪生支持向量机分类算法对训练集进行分析获得;所述训练数据包括不同类别的邮件训练数据;
    数据分类装置,用于利用预先设定的分类规则及所述判别函数值,对所述邮件数据进行分类。
  6. 根据权利要求5所述的邮件分类装置,其特征在于,还包括判别参数生成模块;其中,所述判别参数生成模块包括:
    训练集获取单元,用于获取训练集;
    判别参数确定单元,用于利用所述训练集及预设条件,确定所述线性判别函数中的判别参数;所述预设条件包括:
    Figure PCTCN2020079825-appb-100006
    s.t. -(X 2w 1+e 2b 1)+ξ 2≥e 22≥0
    Figure PCTCN2020079825-appb-100007
    s.t. (X 1w 2+e 1b 2)+ξ 1≥e 11≥0
    其中,w 1为所述判别参数中的第一权重向量,w 2为所述判别参数中的第二权重向量,b 1为所述判别参数中的第一函数偏差系数,b 2为所述判别参数中的第二函数偏差系数,ξ 1为第一松弛变量,ξ 2为第二松弛变量,X 1为所述训练集中非垃圾邮件数据的特征矩阵,X 2为所述训练集中垃圾邮件数据的特征矩阵,e 1为全1的第一向量,e 2为全1的第二向量,||.|| 1为L1范数,C 1为预先确定的第一辅助变量,C 2为预先确定的第二辅助变量,C 3为预先确定的第三辅助变量,C 4为预先确定的第四辅助变量。
  7. 根据权利要求6所述的邮件分类装置,其特征在于,所述数据处理模块包括:
    第一处理单元,用于利用第一线性判别函数及所述邮件数据x,得到第一判别函数值f 1(x);
    第二处理单元,用于利用第二线性判别函数及所述邮件数据x,得到第二判别函数值f 2(x);其中,所述第一线性判别函数为:f 1(x)=x Tw 1+b 1,所述第二线性判别函数为:f 2(x)=x Tw 2+b 2
  8. 根据权利要求7所述的邮件分类装置,其特征在于,所述数据分类装置具体用于:利用预先设定的分类规则、所述第一判别函数值f 1(x)、所述第二判别函数值f 2(x),得到所述邮件数据的分类结果;
    所述分类规则为:
    Figure PCTCN2020079825-appb-100008
    其中,若分类结果
    Figure PCTCN2020079825-appb-100009
    为1,则判定所述邮件为非垃圾邮件,若分类结果
    Figure PCTCN2020079825-appb-100010
    为-1,则判定所述邮件为垃圾邮件。
  9. 一种邮件分类装置,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于执行所述计算机程序时实现如权利要求1至4任一项所述的邮件分类方法的步骤。
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至4任一项所述的邮件分类方法的步骤。
PCT/CN2020/079825 2019-09-20 2020-03-18 一种邮件分类方法、装置、设备及计算机可读存储介质 WO2021051764A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910893789.0 2019-09-20
CN201910893789.0A CN110610213A (zh) 2019-09-20 2019-09-20 一种邮件分类方法、装置、设备及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2021051764A1 true WO2021051764A1 (zh) 2021-03-25

Family

ID=68891665

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/079825 WO2021051764A1 (zh) 2019-09-20 2020-03-18 一种邮件分类方法、装置、设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN110610213A (zh)
WO (1) WO2021051764A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110610213A (zh) * 2019-09-20 2019-12-24 苏州大学 一种邮件分类方法、装置、设备及计算机可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080101689A1 (en) * 2006-10-25 2008-05-01 George Henry Forman Classification using feature scaling
CN104967558A (zh) * 2015-06-10 2015-10-07 东软集团股份有限公司 一种垃圾邮件的检测方法及装置
CN109919202A (zh) * 2019-02-18 2019-06-21 新华三技术有限公司合肥分公司 分类模型训练方法及装置
CN110505144A (zh) * 2019-08-09 2019-11-26 世纪龙信息网络有限责任公司 邮件分类方法、装置、设备及存储介质
CN110610213A (zh) * 2019-09-20 2019-12-24 苏州大学 一种邮件分类方法、装置、设备及计算机可读存储介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079851B (zh) * 2007-07-09 2011-01-05 华为技术有限公司 邮件类型判断方法、装置及系统
CN103186845B (zh) * 2011-12-29 2016-06-08 盈世信息科技(北京)有限公司 一种垃圾邮件过滤方法
CN102984176B (zh) * 2012-12-24 2016-07-27 重庆大学 一种垃圾邮件的识别方法及系统
CN103020645A (zh) * 2013-01-06 2013-04-03 深圳市彩讯科技有限公司 一种垃圾图片识别方法和系统
CN104573630B (zh) * 2014-12-05 2017-09-19 杭州电子科技大学 基于双支持向量机概率输出的多类脑电模式在线识别方法
CN106779755A (zh) * 2016-12-31 2017-05-31 湖南文沥征信数据服务有限公司 一种网络电商借贷风险评估方法及模型
CN107844801B (zh) * 2017-10-19 2021-04-06 苏翀 一种垃圾邮件的分类方法
CN108876001B (zh) * 2018-05-03 2021-09-24 东北大学 一种基于孪生支持向量机的短期电力负荷预测方法
CN110048936B (zh) * 2019-04-18 2021-09-10 宁波青年优品信息科技有限公司 一种语义关联词判断垃圾邮件的方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080101689A1 (en) * 2006-10-25 2008-05-01 George Henry Forman Classification using feature scaling
CN104967558A (zh) * 2015-06-10 2015-10-07 东软集团股份有限公司 一种垃圾邮件的检测方法及装置
CN109919202A (zh) * 2019-02-18 2019-06-21 新华三技术有限公司合肥分公司 分类模型训练方法及装置
CN110505144A (zh) * 2019-08-09 2019-11-26 世纪龙信息网络有限责任公司 邮件分类方法、装置、设备及存储介质
CN110610213A (zh) * 2019-09-20 2019-12-24 苏州大学 一种邮件分类方法、装置、设备及计算机可读存储介质

Also Published As

Publication number Publication date
CN110610213A (zh) 2019-12-24

Similar Documents

Publication Publication Date Title
CN108804512B (zh) 文本分类模型的生成装置、方法及计算机可读存储介质
CN103336766B (zh) 短文本垃圾识别以及建模方法和装置
WO2021012570A1 (zh) 数据录入方法、装置、设备及存储介质
US9286380B2 (en) Social media data analysis system and method
WO2021174693A1 (zh) 一种数据分析方法、装置、计算机系统及可读存储介质
WO2020087774A1 (zh) 基于概念树的意图识别方法、装置及计算机设备
CN108416375B (zh) 工单分类方法及装置
CN112560453B (zh) 语音信息校验方法、装置、电子设备及介质
CN108491866B (zh) 色情图片鉴定方法、电子装置及可读存储介质
WO2020147409A1 (zh) 一种文本分类方法、装置、计算机设备及存储介质
US10956522B1 (en) Regular expression generation and screening of textual items
WO2020048056A1 (zh) 一种风险决策方法和装置
CN107797982A (zh) 用于识别文本类型的方法、装置和设备
WO2019085332A1 (zh) 金融数据分析方法、应用服务器及计算机可读存储介质
CN111984792A (zh) 网站分类方法、装置、计算机设备及存储介质
CN112995414B (zh) 基于语音通话的行为质检方法、装置、设备及存储介质
WO2018028065A1 (zh) 一种短信息分类方法、装置及计算机存储介质
US11687647B2 (en) Method and electronic device for generating semantic representation of document to determine data security risk
US20170011480A1 (en) Data analysis system, data analysis method, and data analysis program
WO2021169499A1 (zh) 网络不良数据监控方法、装置、系统及存储介质
WO2019041528A1 (zh) 新闻情感方向判断方法、电子设备及计算机可读存储介质
WO2021051764A1 (zh) 一种邮件分类方法、装置、设备及计算机可读存储介质
CN116089732B (zh) 基于广告点击数据的用户偏好识别方法及系统
CN112579781A (zh) 文本归类方法、装置、电子设备及介质
CN110704611B (zh) 基于特征解交织的非法文本识别方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20865314

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20865314

Country of ref document: EP

Kind code of ref document: A1