Machine Learning Algorithms and Architectures for SEM Based Defect Inspection and Metrology Challenges in Semiconductor Manufacturing