Abstract:
A method of processing a received image file, comprises receiving the image file; and detecting a match between the received image file and a previously received image file, if (a) the received image file differs from the previously received image file, and (b) an image represented by the received image file is visually identical to an image represented by the previously received image file.

Description:
FIELD OF THE INVENTION 
       [0001]    The present invention relates in general to the field of image recognition, and in particular to methods of identifying similar images held as computer files and identifying unwanted e-mails containing those image files. 
       BACKGROUND OF THE INVENTION 
       [0002]    E-mail is a useful tool as a way of communicating, but over the years the problem of unsolicited e-mail, or spam, has become very serious. Various mechanisms for detecting spam and throwing it away have been discovered, while those responsible for sending spam, “spammers” devise alternative approaches for defeating these mechanisms. One of the more recent spamming methods has been sending an e-mail containing an image containing both text and pictures. This sidesteps most conventional e-mail scanning techniques, which rely on reading and analysing the text of a document. 
         [0003]    Other anti-spam techniques comprise taking a digital signature of the entire e-mail and keeping a central database of such signatures where the content has been identified as spam. In response to this, the spammers have been generating compressed images that differ by a few pixels and/or use slightly different levels or methods of compression. In this case, every unwanted e-mail is slightly different and the mechanism relying on comparison of digital signatures is thwarted, even though the images are essentially identical to the human eye. 
         [0004]    What is wanted, therefore, is a mechanism for identifying images that are only very slightly different. 
         [0005]    Bayesian probability techniques have been known for some time as a way of locating similar text documents. Documents are grouped together that share the same set of words that would otherwise be relatively unusual, providing a way of locating similar documents to an initial one. Documents that have been grouped into similar sets by a human user are fed into a Bayesian engine marked with a keyword. The engine learns from this and produces a database that stores probabilistic data that allows it to make decisions about further documents being associated with a particular group. 
         [0006]    Bayesian techniques are widely used in anti-spam systems, providing a mechanism to identify text that is broadly similar. A corpus of wanted e-mail (“ham”) is fed into a Bayesian engine and marked as “ham”. A similar corpus of unwanted e-mail (“spam”) is also fed in and marked as such. The Bayesian engine learns from this and produces a database that stores probabilistic data that allows it to make decisions about further documents, identifying them either as spam or as ham. An improvement on this allows feedback from those decisions to further improve the database. A further improvement identifies word stems so that, say, “prescriptions” and “prescribing” are matched to the same stem. 
         [0007]    Myers et al disclose in US 2005/0216564 a mechanism for identifying text in images that might be spam; this application appears to use techniques disclosed in U.S. Pat. No. 7,043,080 concerning a mechanism for identifying text in images. The text so identified is then treated as normal text in an e-mail, and searched for anything that might indicate that it was unsolicited e-mail. No mention is made of handling non-text portions of an image. 
         [0008]    Savakis et al disclose in U.S. Pat. No. 6,847,733 a mechanism for assessing an image with respect to certain features, wherein the assessment is a determination of the degree of importance, interest or attractiveness of the image, initially as perceived by humans and then automatically via a Bayesian reasoning algorithm. This does not discuss identifying highly similar images. 
       BRIEF SUMMARY OF THE INVENTION 
       [0009]    According to the present invention, there is provided a method of processing a received image file, comprising: 
         [0010]    receiving the image file; and 
         [0011]    detecting a match between the received image file and a previously received image file, if (a) the received image file differs from the previously received image file, and (b) an image represented by the received image file is visually identical to an image represented by the previously received image file. 
         [0012]    According to the present invention, there is provided a method of identifying unwanted email messages, the method comprising: 
         [0013]    determining that a received email message includes an image file; 
         [0014]    detecting a match between the image file and a previously received image file, if (a) the image file differs from the previously received image file, and (b) an image represented by the image file is visually identical to an image represented by the previously received image file; and 
         [0015]    determining that the received email message is unwanted if a match is detected with a previously received image file from a previously received unwanted email message. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0016]    For a better understanding of the present invention, and to show more clearly how it may be carried into effect, reference will now be made, by way of example, to the following drawings, in which: 
           [0017]      FIG. 1  is a block schematic diagram of an anti-spam e-mail system according to the present invention. 
           [0018]      FIG. 2  is a flow chart, illustrating a first method in accordance with the invention. 
           [0019]      FIG. 3  is a flow chart, illustrating a second method in accordance with the invention. 
       
    
    
     DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS 
       [0020]      FIG. 1  is a block schematic diagram of an anti-spam e-mail system. 
         [0021]    The anti-spam e-mail system includes a filter  10  in accordance with the present invention. The filter  10  comprises a first analysis unit  20 , a second analysis unit  30 , and a comparison unit  40 . As discussed in more detail below, the comparison unit  40  includes a database, and may be a Bayesian engine. 
         [0022]    In operation, an e-mail addressed to a user  50  is sent from an external network  60 . For the purposes of the present invention, the e-mail contains one or more image files, either as an attachment or embodied in the main message. 
         [0023]    Before reaching the user  50 , the e-mail is intercepted by the filter  10 . The filter may be located in the user&#39;s computer, or in a mail server of the user&#39;s internet service provider, or in a mail server in a local area network to which the user  50  is connected. The filter  10  determines whether the received e-mail is wanted or unwanted in accordance with a method that will be described in further detail below. The filter  10  may be provided as a part of a computer software product having various functions in connection with e-mail processing. 
         [0024]    Further transmission of the e-mail from the filter  10  to the user  50  is dependent on the settings and preferences of the user. For example, the user  50  may set the system so that e-mails determined as unwanted (i.e. containing one or more unwanted images) are not forwarded, or their images deleted before forwarding. Many different possibilities will be apparent to one skilled in the art, and are to be considered as within the scope of the present invention. 
         [0025]    As mentioned above, Bayesian techniques are well known in the art as a way of locating similar text documents. According to the present invention, rather than applying Bayesian techniques to words within text documents, an “essence” of an image is defined and used to identify similar images. 
         [0026]      FIG. 2  is a flowchart of a method of identifying similar images in accordance with the present invention. 
         [0027]    In step  100 , a new image is received. As discussed with reference to  FIG. 1 , the image may be attached to or enclosed within the body of an e-mail. However, in principle the image may have been received or chosen from many different sources. For example, the image may be embodied on a CD or other medium, or it may have been chosen as a starting image, from which a search engine is to search for other similar images. 
         [0028]    In step  110 , the metadata of the image is obtained. This step is performed by the first analysis unit  20  in the e-mail filtering embodiment of  FIG. 1 . In the sense of the present invention, metadata is data about the image, but not the data which makes up the image itself. For example, metadata may include one or more of the following: the compression mechanism (i.e. jpeg, gif, etc) used to generate the image file, the image size (i.e. the x by y size of the image), the resolution (i.e. the number of pixels making up the image), the pixel depth (i.e. the number of bits of data for each pixel in the image) and the colour palette used (i.e. when the pixel depth determines that 256 colours are available, for example, the selection of those 256 colours). However, one skilled in the art may think of further file characteristics that may be termed metadata according to the present invention. 
         [0029]    In step  120 , the image file is decompressed to a bitmap. Of course, if the original image is a bitmap this step is unnecessary. Further, to the extent that it may be possible to identify structure, shapes and colour within the actual image without decompressing the image file, this step is also to be considered as unnecessary. 
         [0030]    In step  130 , the visual data of the image is obtained. This step is performed by the second analysis unit  30  in the e-mail filtering embodiment of  FIG. 1 . In the sense of the present invention, visual data is the data making up the image itself. 
         [0031]    In this illustrated embodiment of the invention, not all of the image data is used. Rather, a subset of the image data is used. 
         [0032]    More specifically, in this illustrated embodiment, the image is searched for blocks of contiguous pixels of substantially the same colour. Although in principle the blocks can be any shape, in a preferred embodiment the blocks are rectangular. This is the simplest shape and therefore reduces the complexity of the process. 
         [0033]    However, in the illustrated embodiment, it is not required that all pixels in the block be of the same colour. Specifically, some pixels of different colours are allowed within the block, although the number of allowed pixels of different colours is generally a low percentage of the total number of pixels in the block. Thus, the number of pixels, having a colour significantly different from the basic colour of the block, is compared with a threshold. This threshold is user-definable, typically less than 5%, or less than 1%, and possibly as low as 0.2% or even 0.1%, of the total number of pixels in the block. Moreover, some minor variation in the colour may be permitted over a block of contiguous pixels of substantially the same colour. 
         [0034]    The search of the image for the blocks of contiguous pixels of substantially the same colour can be configured such that it finds a predetermined number of such blocks (preferably the largest blocks meeting the specified criteria), or such that it finds all blocks meeting the specified criteria above a predetermined size, or such that it finds blocks meeting the specified criteria that make up a predetermined proportion of the total image. 
         [0035]    The visual data used in the illustrated embodiment of the invention relates to these blocks of contiguous pixels. For example, the visual data may comprise one or more of: the colour of the pixels making up each block, the sizes of the blocks, the absolute or relative positions of the blocks, and the absolute or relative orientations of the blocks. As with the metadata described above, many other characteristics may be thought of by one skilled in the art that may be termed visual data according to the above definition. 
         [0036]    In step  140 , the image is classified. In one embodiment, classification of the image is performed by human user input. 
         [0037]    This classification may take many forms. For example, where the system is part of an e-mail filtering system, as described with reference to  FIG. 1 , the user may identify the image as a particular unwanted image. 
         [0038]    However, it should be appreciated that the above-described method of classification could have many applications, not just in e-mail filtering. For example, in another embodiment of the invention, where the system is part of an image retrieval system, the filter performing the methods according to the invention could be provided as part of a computer software product having various searching functions, or as a specialized computer software product having image retrieval functions. In the case of an image retrieval system, the images in a database for a search engine could be classified according to the above method with reference to a creator, a title, or a catalogue number, for example. 
         [0039]    In such a system, there may be any number of possible classifications, which can be more or less detailed, as required. In this way, similar images could be searched for, as described in more detail below, without relying solely on the text attached to the stored images. 
         [0040]    In another embodiment, the image may be provided with the system as an example of an unwanted image, say. In this embodiment, the classification of the image is already known, and step  140  simply comprises obtaining the known classification from whichever medium it is stored on. 
         [0041]    When the classification has been input, the process then proceeds to step  150 , where the metadata, the visual data and the classification are stored in a database  40 . The stored visual data may be recompressed if desired. After storing the data, the process begins again at step  100  with a new image. 
         [0042]    By repeatedly cycling through the steps  100 - 150 , the user builds a “library” of data, with which future received images can be compared. The library consists of the signature data, or essence, of many images, plus their classification. In another embodiment, the library of data is provided with the system, so that the user does not have to spend a large amount of time classifying images manually. 
         [0043]      FIG. 3  is a flow chart showing the classification of a newly received unclassified image, according to an embodiment of the present invention. 
         [0044]    When a library of sufficient size has been built, the system can begin to automatically determine the classification of a newly received image. 
         [0045]    In step  200 , a new image is received. As discussed with reference to  FIG. 2 , the image may be attached to or enclosed within the body of an e-mail, or may have been received or chosen from many different sources. For example, the image may be embodied on a CD or other medium, or it may have been found by a search engine on a web page or elsewhere. 
         [0046]    In step  210 , the metadata of the new received image is obtained, as discussed above with reference to step  110  in the process of  FIG. 2 . 
         [0047]    In step  220 , the image file is decompressed to a bitmap, as discussed above with reference to step  120  in the process of  FIG. 2 . 
         [0048]    In step  230 , the visual data relating to the image is obtained, as discussed above with reference to step  130  in the process of  FIG. 2 . 
         [0049]    In step  240 , the system attempts to classify the image, by determining whether it matches any of the images in the library of previously classified images. 
         [0050]    In particular, it should be noted that the system does not attempt to identify images that are identical in all respects to previously classified images, that is, in which the image files are identical. This could be determined more easily by, for example, forming a hash of the image file and comparing it with a hash of the previously classified image files. Rather, the system, in the preferred embodiment, attempts to detect images which have had one or more changes introduced, such that they are no longer identical in all respects to any previously classified image, but such that they appear identical to a human viewer. They can thus be considered as visually identical. 
         [0051]    Thus, for example, in the case of images in unwanted e-mail messages, it becomes possible to detect images which are slightly varied versions of images in previously identified unwanted e-mail messages. 
         [0052]    Similarly, it becomes possible for an owner of an image to release slightly varying versions of the image file, with those slight variations serving as identifiers, and then to track those varied images by means of suitable image searches, and be able to recognize the origins of the images so found. 
         [0053]    In a first preferred embodiment, the metadata and the visual data of the received image must match exactly the metadata and the visual data of a previously classified image for the received image to be given the same classification as the previously classified image. It should be noted that, even though the metadata and the visual data of the received image may match exactly the metadata and the visual data of a previously classified image, this does not require that the two image files should be identical. 
         [0054]    As mentioned above, in the preferred embodiment of the invention, the visual data is made up of data describing blocks of contiguous pixels within the image. However, it is not required that those blocks be exactly uniform in colour, and it is not expected to be the case that the blocks will together make up all of the image. Therefore it is entirely possible that some of the pixels in the image may have been changed from a starting image, but that the visual data used in the described embodiments would be unchanged. 
         [0055]    In a second preferred embodiment, the metadata of the received image must match exactly the metadata of a previously classified image, and the corresponding visual data of each image must substantially match, for the received image to be given the same classification as the previously classified image. 
         [0056]    In a third preferred embodiment, the visual data of the received image must match exactly the visual data of a previously classified image, and the corresponding metadata of each image must substantially match, for the received image to be given the same classification as the previously classified image. 
         [0057]    In a fourth preferred embodiment, the metadata and the visual data of the received image must substantially match the metadata and the visual data of a previously classified image for the received image to be given the same classification as the previously classified image. 
         [0058]    Whether a “substantial match” has been achieved can for example be determined by comparing any differences with a threshold. For example, the blocks may vary slightly in size or position, or indeed the number of blocks found may vary slightly, while still being sufficiently similar for a substantial match to be found. This provides a second level of “fuzziness” when matching a received image to a previously received image, a first level of fuzziness being provided by allowing a small number of pixels to vary in colour within the blocks as described above. 
         [0059]    However, as mentioned above, the database  40  may be part of a Bayesian engine. In this case, the metadata and the visual data need not match exactly with those of a previously classified image. The Bayesian engine  40  instead calculates the probability that a received image is for example one of the previously identified images, by comparing the metadata and the visual data of the received image with the metadata and the visual data of the previously identified images. 
         [0060]    In step  250 , the comparison unit  40  returns its output to the user. Thus, in one embodiment, where the comparison unit  40  is a Bayesian engine, it returns the probabilities that the received image corresponds to one of the previously identified images. In other embodiments, the Bayesian engine may return only the most likely of the previously identified images, for example. The user may then have the opportunity to confirm or correct the suggestion put forward by the Bayesian engine. 
         [0061]    In this case, the metadata, the visual data and the classification may be stored in the database of the comparison unit  40 . In this way, the library of stored data is continually updated and improved. In particular, by the correction or confirmation by the user of the suggestions, the Bayesian engine will be able to improve its suggested classification of subsequent newly received images. 
         [0062]    By introducing a degree of flexibility in the requirements for a match with a previously classified image, the present method may overcome the afore-mentioned spamming techniques whereby images are changed slightly. Similarly, the present method can be used, for example, in search engines, for searching for similar images. 
         [0063]    The foregoing disclosure of the preferred embodiments of the present invention has been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Many variations and modifications of the embodiments described herein will be apparent to one of ordinary skill in the art in light of the above disclosure. The scope of the invention is to be defined only by the claims appended hereto, and by their equivalents. 
         [0064]    Further, in describing representative embodiments of the present invention, the specification may have presented the method and/or process of the present invention as a particular sequence of steps. However, to the extent that the method or process does not rely on the particular order of steps set forth herein, the method or process should not be limited to the particular sequence of steps described. As one of ordinary skill in the art would appreciate, other sequences of steps may be possible. Therefore, the particular order of the steps set forth in the specification should not be construed as limitations on the claims. In addition, the claims directed to the method and/or process of the present invention should not be limited to the performance of their steps in the order written, and one skilled in the art can readily appreciate that the sequences may be varied and still remain within the spirit and scope of the present invention.