Published June 13, 2023 | Version v1
Dataset Open

Data and code for: Why are biting flies attracted to blue objects?

  • 1. Aberystwyth University
  • 2. Deakin University
  • 3. Museo Nacional de Ciencias Naturales
  • 4. International Centre of Insect Physiology and Ecology


Diurnal biting flies are strongly attracted to blue objects. This behaviour is widely exploited for fly control, but its functional significance is debated. It is hypothesised that: blue objects resemble animal hosts; blue surfaces resemble shaded resting places; and blue attraction is a by-product of attraction to polarised light. We computed the fly photoreceptor signals elicited by a large sample of leaf and animal integument reflectance spectra, viewed under open/cloudy illumination and under woodland shade. We then trained artificial neural networks (ANNs) to distinguish animals from leaf backgrounds, and shaded from unshaded surfaces, in order to find the optimal means of doing so based upon the sensory information available to a fly. After training, we challenged ANNs to classify blue objects used in fly control. Trained ANNs could make both discriminations with high accuracy. They discriminated animals from leaves based upon blue-green photoreceptor opponency, and commonly misclassified blue objects as animals. Meanwhile, they discriminated shaded from unshaded stimuli using achromatic cues and never misclassified blue objects as shaded. We conclude that blue-green opponency is the most effective means of discriminating animals from leaf backgrounds using a fly's sensory information and that blue objects resemble animal hosts through such mechanisms.


The datasheet is provided in .xls format and can be opened in a standard spreadsheet program.

R code is provided as a .R file.

Funding provided by: Centre for International Development Research at Aberystwyth (CIDRA), Aberystwyth University*
Crossref Funder Registry ID:
Award Number:

Funding provided by: European Commission
Crossref Funder Registry ID:
Award Number: 873178, H2020-MSCA-RISE-2019


Files (181.1 kB)

Name Size Download all
3.2 kB Preview Download
178.0 kB Download

Additional details

Related works

Is derived from
10.5281/zenodo.7963026 (DOI)