A learning framework for medical image-based intelligent diagnosis from imbalanced datasets