AI-based defect and irregular pattern detection, classification and retrieval models enhanced with morphological feature engineering for enabling AI reasoning capability