Automated Detection of Self-Harm Wounds Using Deep Learning and Image Processing in Forensic Medicine
A Mohammadi, Mahdi Mehrabi, Seyed Mohammad Saadatneshan, Kamroz Amini, Mahdi Gheysari
Background and Objective: Self-harm is a psychologically damaging behavior, and its accurate differentiation from other wounds (violence, accidents, burns, diabetic ulcers) is critically important in forensic medicine. However, this differentiation often falls into a diagnostic "gray zone," where traditional visual inspection methods are time-consuming, require high expertise, and are prone to subjective error. In Iran, despite the high volume of self-harm cases referred to the Forensic Medicine Organization, no comprehensive automated solution has been developed to address this challenge. This study aims to design and evaluate an automated deep learning system for the detection and classification of self-harm wounds in real-world forensic images. Methods: A pre-trained ResNet18 model was fine-tuned on a dataset of 2,292 real forensic images collected from case files, categorized into six classes: Self-harm (Yes), Self-harm (No), Burn, Diabetic Ulcer, Infectious Wound, and Non-wound. All images underwent standardized preprocessing (resizing to 150×150, normalization) and augmentation (flips, color jitter, rotation) to enhance generalization. To address class imbalance, we employed a WeightedRandomSampler and Focal Loss with adjusted class weighting (1.5× for the Self-harm class). Training was conducted using the AdamW optimizer (lr=0.001) with a OneCycleLR scheduler over 30 epochs. The model's decisions were interpreted using Grad-CAM and LIME, and feature representations were analyzed using t-SNE to ensure explainability. A frozen ResNet18 baseline was compared to evaluate the effectiveness of full fine-tuning. Results: The proposed model achieved an overall accuracy of 71.0% and a weighted F1-score of 0.7158 on the validation set. For the primary target class (Self-harm), the model demonstrated strong discriminative power with a precision of 0.745, a recall of 0.767, an F1-score of 0.756, and an AUC of 0.926. The model achieved only 6 false positives and 3 false negatives for the self-harm class, confirming its reliability in critical cases. Compared to the frozen baseline, the fine-tuned model showed a significant improvement of 19.8% in overall accuracy and 36.3% in F1-score, highlighting the importance of layer-specific adaptation for forensic feature extraction. Conclusion: The proposed system demonstrates strong capability in differentiating self-harm wounds from other injuries, effectively leveraging deep learning to reduce human error and standardize forensic assessments. The interpretability tools (Grad-CAM and LIME) provide visual and spatial reasoning for model predictions, making it a trustworthy assistive tool for forensic experts. This study represents the first systematic investigation into automated self-harm detection using real forensic images in Iran, filling a critical research gap and paving the way for intelligent decision-support systems in forensic medicine.