用于电子邮件垃圾邮件检测的神经网络 [英] Neural networks for email spam detection

查看:30
本文介绍了用于电子邮件垃圾邮件检测的神经网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您可以访问一个电子邮件帐户,该帐户将过去几年收到的电子邮件的历史记录(约 10k 封电子邮件)分为 2 组

Let's say you have access to an email account with the history of received emails from the last years (~10k emails) classified into 2 groups

  • 真正的电子邮件
  • 垃圾邮件

您将如何完成创建可用于垃圾邮件检测的神经网络解决方案的任务 - 基本上将任何电子邮件分类为垃圾邮件或非垃圾邮件?

How would you approach the task of creating a neural network solution that could be used for spam detection - basically classifying any email either as spam or not spam?

假设电子邮件提取已经到位,我们只需要关注分类部分.

Let's assume that the email fetching is already in place and we need to focus on classification part only.

我希望得到回答的要点是:

  1. 选择哪些参数作为神经网络的输入,为什么?
  2. 哪种神经网络结构最有可能最适合此类任务?

也非常欢迎任何资源建议或现有实现(最好在 C# 中)

Also any resource recommendations, or existing implementations (preferably in C#) are more than welcome

谢谢

编辑

  • 我打算使用神经网络,因为该项目的主要方面是测试 NN 方法如何用于垃圾邮件检测
  • 这也是一个玩具问题",只是探索神经网络和垃圾邮件的主题

推荐答案

如果你坚持使用 NNs...我会为每封电子邮件计算一些特征

If you insist on NNs... I would calculate some features for every email

基于字符、基于单词和词汇的特征(我计算这些特征大约有 97 个):

Both Character-Based, Word-based, and Vocabulary features (About 97 as I count these):

  1. 字符总数 (C)
  2. alpha 字符总数/C alpha 字符比率
  3. 数字字符总数/C
  4. 空格字符总数/C
  5. 每个字母的出现频率/C(键盘的 36 个字母 - A-Z、0-9)
  6. 特殊字符的出现频率(10 个字符:*、_、+、=、%、$、@、ـ、、/)
  7. 总字数(M)
  8. 短词总数/M 两个字母或更少
  9. words/C 中的总字符数
  10. 平均字长
  11. 平均以字符为单位的句子长度
  12. 平均以单词为单位的句子长度
  13. 字长频率.分布/M 长度为n、n在1到15之间的词的比率
  14. Type Token Ratio No. of unique Words/M
  15. Hapax Legomena 频率.一次出现的词
  16. Hapax Dislegomena Freq.出现两次的词
  17. Yule 的 K 度量
  18. 辛普森的 D 度量
  19. Sichel 的 S 度量
  20. Brunet 的 W 度量
  21. Honore 的 R 度量
  22. 标点符号的频率 18 个标点符号:.匍匐?!: ( ) – "« » <> [ ] { }

您还可以根据格式添加更多功能:颜色、字体、大小、...使用.

You could also add some more features based on the formatting: colors, fonts, sizes, ... used.

大多数这些度量都可以在网上、论文甚至维基百科中找到(它们都是简单的计算,可能基于其他特征).

Most of these measures can be found online, in papers, or even Wikipedia (they're all simple calculations, probably based on the other features).

因此,对于大约 100 个特征,您需要 100 个输入、隐藏层中一定数量的节点和一个输出节点.

So with about 100 features, you need 100 inputs, some number of nodes in a hidden layer, and one output node.

需要根据您当前的预分类语料库对输入进行标准化.

The inputs would need to be normalized according to your current pre-classified corpus.

我会把它分成两组,一组作为训练组,另一组作为测试组,从不混合.也许垃圾邮件/非垃圾邮件比率相似的训练/测试组的比率为 50/50.

I'd split it into two groups, use one as a training group, and the other as a testing group, never mixing them. Maybe at a 50/50 ratio of train/test groups with similar spam/nonspam ratios.

这篇关于用于电子邮件垃圾邮件检测的神经网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆