5

Consider a problem in which we have, let's say - a set of 5 cameras and 10 pictures taken from each camera (in different lighting conditions).

My question here is that, whether it's possible to have a random pic (taken from one of the cameras in the set) and determine from which camera it was taken?

Image processing, computer vision, machine learning.. are not my areas of expertise (as you may suggest) but I do know the basics of some of the machine learning concepts/algorithms and how to handle data sets etc.

I know it's a very broad question and might not have a black or white answer, but any guidance towards how I approach the problem or what should be the starting point would be highly appreciated, as I couldn't find much help regarding this specific problem online.

4
  • may be by detecting dead pixels ... Also if the image was not resized/cropped then may be obtaining the offset in Bayer filter grid at the same resolution could shine some light as each camera could have different chip resolution and lens focus arrea ...
    – Spektre
    Nov 12, 2015 at 5:29
  • Do you have internal calibration data available for the cameras? Or the cameras even externally calibrated to each other?
    – Simon
    Nov 12, 2015 at 7:50
  • Will someone try to fake the camera identity ?
    – Jiby
    Nov 12, 2015 at 14:53
  • 1
    Please clarify if you are expecting subterfuge or it is a straightforward question. Nov 13, 2015 at 8:01

2 Answers 2

8

You're stepping deep in wizard territory

I'll try to make my answer short, and accessible, but you are referring to a complete field of research with deep mathematical wizardry involved. No turning back now ...

Do read the amazing paper "Digital Image Forensics : a booklet for beginner". This answer will cover the paper (and not much more, I'm not an expert).

Digital Image Forensics 101


Image acquisition pipeline

enter image description here

Each of the steps above leave marks, such as:

  • Lens artefacts can be used to identify the same camera twice
  • The Color Filter Array (CFA) pattern depends on camera manufacturer
  • Sensor noise statistics vary across images.
  • Image compression (JPEG) uses a "compression table" that differ across manufacturers

And many more (again, read the paper for that !)

Intra Camera variation ?

The techniques above rely on artefacts that can be classified in groups :

  • Properties identical to all instances of the camera model
  • Properties varying across 2 different camera of the same model
  • Properties identical across same camera manufacturer

It raises the question of what do you want to identify :

  • Given a single camera "was this picture taken by this specific device" ?
  • Did this picture get taken by the same camera model ?

Counter-forensics, Counter-Counter-forensics ...

Focusing on a single statistical property (say CFA pattern), we compute relevant statistics for a reference camera, and for the given image, and measure the correlation.

These properties hold for any untampered image, but we have to assume that someone with bad intentions will try to tamper the image to make it look like it was the right camera all along !

If we know in advance what metric will be computed, we can easily cheat the system by tampering the image and optimizing our image statistics around similarity to the target value (remembering that optimization is dark magic that should not be trifled with ;)

For instance the JPEG compression table can be adjusted in post-processing by resampling with a given table to make my fake image pass as another camera.

This game of cat and mouse between Forensics, counter forensics, counter-counter-forensics can go quite far.

6

The easiest is probably to look at the image names since most cameras assign monotonically increasing frame numbers and the cameras are unlikely to all have taken the same number of pictures - and, if they had, you could take 100 extra pictures before you start on the first camera, 200 extra pictures on the second, 300 on the third and so on in order to offset the frame numbers.

Another option would be to use a tool such as jhead or exiftool to look at the EXIF data in the picture header, e.g.

exiftool IMG_3913.JPG

Output

ExifTool Version Number         : 10.01
File Name                       : IMG_3913.JPG
Directory                       : .
File Size                       : 1979 kB
File Modification Date/Time     : 2015:05:28 17:16:43+01:00
File Access Date/Time           : 2015:11:12 08:05:21+00:00
File Inode Change Date/Time     : 2015:11:12 07:59:13+00:00
File Permissions                : rw-------
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Make                            : Apple
Camera Model Name               : iPhone 5
Orientation                     : Rotate 90 CW
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : 8.3
Modify Date                     : 2015:05:28 17:16:43
Y Cb Cr Positioning             : Centered
Exposure Time                   : 1/120
F Number                        : 2.4
Exposure Program                : Program AE
ISO                             : 80
Exif Version                    : 0221
Date/Time Original              : 2015:05:28 17:16:43
Create Date                     : 2015:05:28 17:16:43
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/120
Aperture Value                  : 2.4
Brightness Value                : 5.308204915
Exposure Compensation           : 0
Metering Mode                   : Multi-segment
Flash                           : Auto, Did not fire
Focal Length                    : 4.1 mm
Subject Area                    : 1373 1230 998 998
Run Time Scale                  : 1000000000
Run Time Value                  : 27313980762583
Run Time Epoch                  : 0
Run Time Flags                  : Valid
Sub Sec Time Original           : 037
Sub Sec Time Digitized          : 037
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 3264
Exif Image Height               : 2448
Sensing Method                  : One-chip color area
Scene Type                      : Directly photographed
Exposure Mode                   : Auto
White Balance                   : Auto
Focal Length In 35mm Format     : 33 mm
Scene Capture Type              : Standard
Lens Info                       : 4.12mm f/2.4
Lens Make                       : Apple
Lens Model                      : iPhone 5 back camera 4.12mm f/2.4
GPS Latitude Ref                : North
GPS Longitude Ref               : West
GPS Altitude Ref                : Above Sea Level
GPS Time Stamp                  : 16:16:35.6
GPS Speed Ref                   : km/h
GPS Speed                       : 0
GPS Date Stamp                  : 2015:05:28
Compression                     : JPEG (old-style)
Thumbnail Offset                : 1328
Thumbnail Length                : 10991
XMP Toolkit                     : XMP Core 5.4.0
Region Applied To Dimensions H  : 2448
Region Applied To Dimensions W  : 3264
Region Applied To Dimensions Unit: pixel
Region Extensions Time Stamp    : -1596906250
Region Extensions Face ID       : 2
Region Extensions Confidence Level: 352
Region Extensions Angle Info Yaw: 0
Region Extensions Angle Info Roll: 270
Region Area Y                   : 0.503881
Region Area W                   : 0.306066
Region Area Unit                : normalized
Region Area X                   : 0.418658
Region Area H                   : 0.408088
Region Type                     : Face
Image Width                     : 3264
Image Height                    : 2448
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 2.4
GPS Altitude                    : 20 m Above Sea Level
GPS Date/Time                   : 2015:05:28 16:16:35.6Z
GPS Latitude                    : 51 deg 51' 3.11" N
GPS Longitude                   : 2 deg 12' 18.89" W
GPS Position                    : 51 deg 51' 3.11" N, 2 deg 12' 18.89" W
Image Size                      : 3264x2448
Megapixels                      : 8.0
Run Time Since Power Up         : 7:35:13
Scale Factor To 35 mm Equivalent: 8.0
Shutter Speed                   : 1/120
Create Date                     : 2015:05:28 17:16:43.037
Date/Time Original              : 2015:05:28 17:16:43.037
Thumbnail Image                 : (Binary data 10991 bytes, use -b option to extract)
Circle Of Confusion             : 0.004 mm
Field Of View                   : 57.2 deg
Focal Length                    : 4.1 mm (35 mm equivalent: 33.0 mm)
Hyperfocal Distance             : 1.89 m
Light Value                     : 9.8

Or with jhead like this:

jhead -v IMGxyz.jpg

Output

Exif header 12317 bytes long
Exif section in Motorola order
(dir has 11 entries)
    Make = "Apple"
    Model = "iPhone 5"
    Orientation = 6
    XResolution = 72/1
    YResolution = 72/1
    ResolutionUnit = 2
    Software = "8.3"
    DateTime = "2015:05:28 17:16:43"
    YCbCrPositioning = 1
    ExifOffset = 198
    Exif Dir:(dir has 32 entries)
        ExposureTime = 1/120
        FNumber = 12/5
        ExposureProgram = 2
        ISOSpeedRatings = 80
        ExifVersion = "0221"
        DateTimeOriginal = "2015:05:28 17:16:43"
        DateTimeDigitized = "2015:05:28 17:16:43"
        ComponentsConfiguration = "?"
        ShutterSpeedValue = 5567/806
        ApertureValue = 4845/1918
        BrightnessValue = 12745/2401
        ExposureBiasValue = 0/1
        MeteringMode = 5
        Flash = 24
        FocalLength = 103/25
        SubjectArea = 1373, 1230, 998, 998
        Maker note:  41 70 70 6c 65 20 69 4f 53 00 00... (232 bytes)
        SubSecTimeOriginal = "037"
        SubSecTimeDigitized = "037"
        FlashPixVersion = "0100"
        ColorSpace = 1
        ExifImageWidth = 3264
        ExifImageLength = 2448
        SensingMethod = 2
        SceneType = ""
        ExposureMode = 0
        WhiteBalance = 0
        FocalLengthIn35mmFilm = 33
        SceneCaptureType = 0
        Unknown Tag a432 Value = 103/25, 103/25, 12/5, 12/5
        Unknown Tag a433 Value = "Apple"
        Unknown Tag a434 Value = "iPhone 5 back camera 4.12mm f/2.4"
    GPS Dir offset = 996
    GPS info dir:(dir has 10 entries)
        GPSLatitudeRef      ="N"
        GPSLatitude         =51/1, 51/1, 311/100, 51/1, 311/100, 2/1, 311/100, 2/1, 12/1
        GPSLongitudeRef     ="W"
        GPSLongitude        =2/1, 12/1, 1889/100, 12/1, 1889/100, 17151/857, 1889/100, 17151/857, 16/1
        GPSAltitudeRef      =00
        GPSAltitude         =17151/857
        GPSTimeStamp        =16/1, 16/1, 3560/100, 16/1, 3560/100, 0/1, 3560/100, 0/1, 842019125/976237882
        GPSSpeedRef         ="K"
        GPSSpeed            =0/1
        GPSDateStamp        ="2015:05:28"
    Continued directory (dir has 6 entries)
        Compression = 6
        XResolution = 72/1
        YResolution = 72/1
        ResolutionUnit = 2
        ThumbnailOffset = 1316
        ThumbnailLength = 10991
Thumbnail size: 10991 bytes
Image cotains XMP section, 1939 bytes long
??http://ns.adobe.com/xap/1.0/?<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:mwg-rs="http://www.metadataworkinggroup.com/schemas/regions/"
            xmlns:stDim="http://ns.adobe.com/xap/1.0/sType/Dimensions#"
            xmlns:apple-fi="http://ns.apple.com/faceinfo/1.0/"
            xmlns:stArea="http://ns.adobe.com/xmp/sType/Area#">
         <mwg-rs:Regions rdf:parseType="Resource">
            <mwg-rs:AppliedToDimensions rdf:parseType="Resource">
               <stDim:h>2448</stDim:h>
               <stDim:w>3264</stDim:w>
               <stDim:unit>pixel</stDim:unit>
            </mwg-rs:AppliedToDimensions>
            <mwg-rs:RegionList>
               <rdf:Seq>
                  <rdf:li rdf:parseType="Resource">
                     <mwg-rs:Extensions rdf:parseType="Resource">
                        <apple-fi:Timestamp>-1596906250</apple-fi:Timestamp>
                        <apple-fi:FaceID>2</apple-fi:FaceID>
                        <apple-fi:ConfidenceLevel>352</apple-fi:ConfidenceLevel>
                        <apple-fi:AngleInfoYaw>0</apple-fi:AngleInfoYaw>
                        <apple-fi:AngleInfoRoll>270</apple-fi:AngleInfoRoll>
                     </mwg-rs:Extensions>
                     <mwg-rs:Area rdf:parseType="Resource">
                        <stArea:y>0.503881</stArea:y>
                        <stArea:w>0.306066</stArea:w>
                        <stArea:unit>normalized</stArea:unit>
                        <stArea:x>0.418658</stArea:x>
                        <stArea:h>0.408088</stArea:h>
                     </mwg-rs:Area>
                     <mwg-rs:Type>Face</mwg-rs:Type>
                  </rdf:li>
               </rdf:Seq>
            </mwg-rs:RegionList>
         </mwg-rs:Regions>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>
Jpeg section marker 0xdb size 132
Jpeg section marker 0xdd size 4
JPEG image is 3264w * 2448h, 3 color components, 8 bits per sample
Jpeg section marker 0xc4 size 418
File name    : IMG_3913.JPG
File size    : 2026129 bytes
File date    : 2015:05:28 17:16:43
Camera make  : Apple
Camera model : iPhone 5
Date/Time    : 2015:05:28 17:16:43
Resolution   : 3264 x 2448
Orientation  : rotate 90
Flash used   : No (auto)
Focal length :  4.1mm  (35mm equivalent: 33mm)
Exposure time: 0.0083 s  (1/120)
Aperture     : f/2.4
ISO equiv.   : 80
Whitebalance : Auto
Metering Mode: pattern
Exposure     : program (auto)
GPS Latitude : N 51d 51m  3.11s
GPS Longitude: W  2d 12m 18.89s
GPS Altitude :  20.01m

You may find a serial number in your image filename (Canon professional cameras do that) or in your EXIF data - that would be ideal.

Failing that, the easiest way may be to set the date differently on each camera, e.g. set the day and time correctly but set the year on camera 1 to 2001, and the year on camera 2 to 2002, and 2003 on camera 3.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.