Robust artificial intelligence frameworks for lung cancer subtyping and malignancy detection on thoracic CT