We investigate dust obscuration as parameterised by the infrared excess IRX \equiv L _ { IR } / L _ { UV } in relation to global galaxy properties , using a sample of \sim 32 000 local star-forming galaxies ( SFGs ) selected from SDSS , GALEX and WISE . We show that IRX generally correlates with stellar mass ( M _ { \ast } ) , star formation rate ( SFR ) , gas-phase metallicity ( Z ) , infrared luminosity ( L _ { IR } ) and the half-light radius ( R _ { e } ) . A weak correlation of IRX with axial ratio ( b/a ) is driven by the inclination and thus seen as a projection effect . By examining the tightness and the scatter of these correlations , we find that SFGs obey an empirical relation of the form IRX = 10 ^ { \alpha } ( L _ { IR } ) ^ { \beta } R _ { e } ^ { - \gamma } ( b / a ) ^ { - \delta } where the power-law indices all increase with metallicity . The best-fitting relation yields a scatter of \sim 0.17 dex and no dependence on stellar mass . Moreover , this empirical relation also holds for distant SFGs out to z = 3 in a population-averaged sense , suggesting it to be universal over cosmic time . Our findings reveal that IRX approximately increases with L _ { IR } / R _ { e } ^ { [ 1.3 - 1.5 ] } instead of L _ { IR } / R _ { e } ^ { 2 } ( i.e. , surface density ) . We speculate this may be due to differences in the spatial extent of stars versus star formation and/or complex star-dust geometries . We conclude that not stellar mass but IR luminosity , metallicity and galaxy size are the key parameters jointly determining dust obscuration in SFGs .