In-situ defect detection of metal Additive Manufacturing: an integrated framework