This paper proposes a new system for the unsupervised diagnostic and monitoring of defects in waveguide imaging. The proposed method is automatic and does not require manual selection of specific frequencies for defect diagnostics. The core of the method is a computational intelligent machine learning algorithm based on sparse non-negative matrix factorization. An internal functionality is built into the machine learning algorithm to adaptively learn and control the sparsity of the factorization, and to render better accuracy in detecting defects. This is achieved by using Bayesian statistics methodology. The proposed method is demonstrated on automatic detection of defect in metals. In addition, we show that the extraction of the spectrum signature corresponding to the defect is significantly more efficient with the proposed optimal sparsity, which subsequently led to better detection performance. Experimental tests and comparisons with other sparse factorization methods have been conducted to verify the efficacy of the proposed method.