The programme could identify depressed people correctly 70 per cent of the time.
In comparison, previous research has shown that doctors can make a correct unassisted diagnosis of depression 42 per cent of the time.
"Our analysis of user accounts from a popular social media app revealed that photos posted by people diagnosed with depression tended to be darker in colour, received more comments from the community, were more likely to contain faces and less likely to have a filter applied," said Christopher Danforth, from the University of Vermont in the US.
"With an increasing share of our social interactions happening online, the potential for algorithmic identification of early-warning signs for a host of mental and physical illnesses is enormous," he said.
More From This Section
"Imagine an app you can install on your phone that pings your doctor for a check-up when your behaviour changes for the worse, potentially before you even realise there is a problem," he added.
The programme scoured the photos for details that were associated with healthy and depressed individuals.
This information was then used to see if the programme could predict who would go on to be diagnosed with depression by only looking at photos that were posted before their diagnosis.
"Although we had a relatively small sample size, we were able to reliably observe differences in features of social media posts between depressed and non-depressed individuals," said Andrew Reece from Harvard University in the US.
The research was published in the journal EPJ Data Science.