Automatic artifact detection and quantification