Detection of spam images
View Patent ↗A method, system, and computer program product for analyzing image attachments to email messages and reliably determines whether the image includes spam, so that the message can be blocked. A method for processing email messages comprises processing an image included in or attached to an email message to determine whether the image includes features that indicate whether the image is spam and determining whether the image is spam based on the included features that indicate whether the image is spam.
1. A method comprising:
detecting horizontal and vertical edges of contiguous regions in an image; and
determining a probability that the image contains spam, based at least in part on a ratio of a number of the horizontal edges to a number of the vertical edges.
2. The method of claim 1 , wherein detecting horizontal and vertical edges comprises:
converting the image to a black and white image having luminance information only; and
detecting contiguous horizontal regions with similar luminance.
3. The method of claim 1 , wherein the probability is based at least in part on the ratio exceeding a threshold value.
4. The method of claim 1 , wherein the probability is based at least in part on the ratio exceeding a threshold value in a range of 10 to 15.
5. The method of claim 1 , wherein detecting horizontal and vertical edges comprises:
converting the image to a black and white image having luminance information only;
smoothening the black and white image horizontally; and
segmenting the smoothened image to isolate foreground from background.
6. The method of claim 5 , wherein the segmenting comprises:
dividing each horizontal region in the image into segments; and
determining if each segment is foreground based on an average and minimum luminance value of the segment.
7. The method of claim 1 , wherein the ratio excludes contiguous regions having a thickness of one pixel.
8. Logic encoded in one or more non-transitory media that includes code for execution and when executed by one or more processors is operable to perform operations comprising:
detecting horizontal and vertical edges of contiguous regions in an image; and
determining a probability that the image contains spam, based at least in part on a ratio between an amount of horizontal edges and vertical edges.
9. The encoded logic of claim 8 , wherein detecting horizontal and vertical edges comprises:
converting the image to a black and white image having luminance information only; and
detecting contiguous horizontal regions with similar luminance.
10. The encoded logic of claim 8 , wherein the probability is based at least in part on the ratio exceeding a threshold value.
11. The encoded logic of claim 8 , wherein the probability is based at least in part on the ratio exceeding a threshold value in a range of 10 to 15.
12. The encoded logic of claim 8 , wherein detecting horizontal and vertical edges comprises:
converting the image to a black and white image having luminance information only;
smoothening the black and white image horizontally; and
segmenting the smoothened image to isolate foreground from background.
13. The encoded logic of claim 12 , wherein the segmenting comprises:
dividing each horizontal region in the image into segments; and
determining if each segment is foreground based on an average and minimum luminance value of the segment.
14. The encoded logic of claim 8 , wherein the ratio excludes contiguous regions having a thickness of one pixel.
15. A system, comprising:
one or more processors operable to execute instructions such that the system is configured for:
detecting horizontal and vertical edges of contiguous regions in an image; and
determining a probability that the image contains spam, based at least in part on a ratio of a number of the horizontal edges to a number of the vertical edges.
16. The system of claim 15 , wherein detecting horizontal and vertical edges comprises:
converting the image to a black and white image having luminance information only; and
detecting contiguous horizontal regions with similar luminance.
17. The system of claim 15 , wherein the probability is based at least in part on the ratio exceeding a threshold value.
18. The system of claim 15 , wherein the probability is based at least in part on the ratio exceeding a threshold value in a range of 10 to 15.
19. The system of claim 15 , wherein detecting horizontal and vertical edges comprises:
converting the image to a black and white image having luminance information only;
smoothening the black and white image horizontally; and
segmenting the smoothened image to isolate foreground from background.
20. The system of claim 15 , wherein the ratio excludes contiguous regions having a thickness of one pixel.