//Karthik Srinivasan

Product Engineer, CTO & a Beer Enthusiast
Experiments, thoughts and scripts documented for posterity.

Quirky Personal Projects

LinkedIn

Email me

Image Ranking by global feature estimation

Feb, 2015

Having an automated image ranking process would be very beneficial to companies such as 500px or Gettyimages where 1000's of images are ingested/uploaded every day and are traditionally ranked manually by an editor or by crowdsourcing. This human intervention can be temporarily avoided if images can be ranked by estimating it's quality.

To build an image quality estimator, following image quality properties were used for this proof-of-concept: In this following examples, I have 3 ranks. Rank 1 = Good quality, Rank 2 = Medium and Rank 3 = Bad Quality images. Following is a snippet of my rank calculation.

//Blur range: 0 to 1, where higher the value less blur the image is
//Sharpness range: 0 to 1, higher the better
//Color range: 0 to 0.5
//Naturalness range:0 to 1
val imageRank = (blurValue.get.value + sharpnessValue.get.value + colorValue.get.value + naturalnessValue.get.value) match {
    case t if t >= 2 => 1
    case t if t >= 1 && t < 2 => 2
    case _ => 3
}
            

Image Rank 1 Examples
"blur":0.9660969387755102
"sharpness":0.5067756918923018
"color":0.1462474560577043
"quality":0.8798513615119794
"contrast":0.08234799394638759
"colorContrast":8.328080618896797
"brightness":0.14739056340426107
"blur":0.966530612244898
"sharpness":0.49986904977578045
"color":0.19059606130699966
"quality":0.8476687344507642
"contrast":0.08834899629937157
"colorContrast":25.384664271394108
"brightness":0.24995158193079098
"blur":0.7220025510204081
"sharpness":0.15089643141301262
"color":0.4003952223119604
"quality":0.9609951671164367
"contrast":0.2292792429036637
"colorContrast":32.053295457355276
"brightness":0.4115245849574555
Image Rank 2 Examples
"blur":0.8221428571428572
"sharpness":0.15935783910386503
"color":0.04443692154503701
"quality":0.5085070823398357
"contrast":0.14823618660855284
"colorContrast":26.781796490365295
"brightness":0.27380289202677777
"blur":0.9705484693877551
"sharpness":0.41994123003434913
"color":0.19996393727671855
"quality":0.3153617863913573
"contrast":0.10908353919667178
"colorContrast":43.63807505087183
"brightness":0.18082135350839887
"blur":0.8633290816326531
"sharpness":0.2271008743069167
"color":0.12817043260208896
"quality":0.6680113666484762
"contrast":0.05242860949574584
"colorContrast":44.47249174965709
"brightness":0.222476585047196

From the above results, an simple image ranking system can be automatically performed by estimating the global image features values. More complex algorithms can be used to further improve the image quality estimation process such as Bokeh Estimator which can be used to detect background blur and camera focus[link].
Note: source code to follow soon at my github