pattern recognition for quality assurance