Dual-distribution discrepancy with self-supervised refinement for anomaly detection in medical images