Effective skin cancer detection is crucial for early intervention and improved treatment outcomes. Previous studies have primarily focused on enhancing the performance of skin lesion classification models. However, there is a growing need to consider the practical requirements of real-world scenarios, such as portable applications that require lightweight models embedded in devices. Therefore, this study aims to propose a novel method that can address the major-type misclassification problem with a lightweight model. This study proposes an innovative Lightweight Dual Projection-Head Hierarchical contrastive learning (LightDPH) method. We introduce a dual projection-head mechanism to a contrastive learning framework. This mechanism is utilized to train a model with our proposed multi-level contrastive loss (MultiCon Loss), which can effectively learn hierarchical information from samples. Meanwhile, we present a distance-based weight (DBW) function to adjust losses based on hierarchical levels. This unique combination of MultiCon Loss and DBW function in LightDPH tackles the problem of major-type misclassification with lightweight models and enhances the model’s sensitivity in skin lesion classification. The experimental results demonstrate that LightDPH significantly reduces the number of parameters by 52.6% and computational complexity by 29.9% in GFLOPs while maintaining high classification performance comparable to state-of-the-art methods. This study also presented a novel evaluation metric, model efficiency score (MES), to evaluate the cost-effectiveness of models with scaling and classification performance. The proposed LightDPH effectively mitigates major-type misclassification and works in a resource-efficient manner, making it highly suitable for clinical applications in resource-constrained environments. To the best of our knowledge, this is the first work that develops an effective lightweight hierarchical classification model for skin lesion detection.