{"url":"/method/focal-loss","slug":"focal-loss","name":"Focal Loss","full_name":"Focal Loss","full_name_withheld":false,"description_markdown":"A **Focal Loss** function addresses class imbalance during training in tasks like object detection. Focal loss applies a modulating term to the cross entropy loss in order to focus learning on hard misclassified examples. It is a dynamically scaled cross entropy loss, where the scaling factor decays to zero as confidence in the correct class increases. Intuitively, this scaling factor can automatically down-weight the contribution of easy examples during training and rapidly focus the model on hard examples. \r\n\r\nFormally, the Focal Loss adds a factor $(1 - p\\_{t})^\\gamma$ to the standard cross entropy criterion. Setting $\\gamma>0$ reduces the relative loss for well-classified examples ($p\\_{t}>.5$), putting more focus on hard, misclassified examples. Here there is tunable *focusing* parameter $\\gamma \\ge 0$. \r\n\r\n$$ {\\text{FL}(p\\_{t}) = - (1 - p\\_{t})^\\gamma \\log\\left(p\\_{t}\\right)} $$","description_state":"present","introduced_year":null,"introduced_by":{"title":"Focal Loss for Dense Object Detection","paper":"/paper/focal-loss-for-dense-object-detection","first_author":"Tsung-Yi Lin","n_authors":5,"url_abs":null,"archive_paper_url":"https://paperswithcode.com/paper/focal-loss-for-dense-object-detection"},"source":{"url":"http://arxiv.org/abs/1708.02002v2","title":"Focal Loss for Dense Object Detection","url_on_a_paper_host":true},"code_snippet_url":"https://github.com/clcarwin/focal_loss_pytorch/blob/e11e75bad957aecf641db6998a1016204722c1bb/focalloss.py#L6","code_snippet_url_on_a_code_host":true,"categories":[{"area":"General","area_id":"general","collection":"Loss Functions","url":"/methods/category/loss-functions","pwc_aliases":[]}],"n_papers_tagged":461,"archive_num_papers":462,"papers_newest_first":[{"paper":null,"title":"LumiCRS: Asymmetric Contrastive Prototype Learning for Long-Tail Conversational Movie Recommendation","date":"2025-07-07","arxiv_id":"2507.04722","n_code_links":0,"syntology":null},{"paper":null,"title":"Revisiting Reweighted Risk for Calibration: AURC, Focal Loss, and Inverse Focal Loss","date":"2025-05-29","arxiv_id":"2505.23463","n_code_links":0,"syntology":null},{"paper":null,"title":"Few-Shot Class-Incremental Learning For Efficient SAR Automatic Target Recognition","date":"2025-05-26","arxiv_id":"2505.19565","n_code_links":0,"syntology":null},{"paper":null,"title":"PaniCar: Securing the Perception of Advanced Driving Assistance Systems Against Emergency Vehicle Lighting","date":"2025-05-08","arxiv_id":"2505.05183","n_code_links":0,"syntology":null},{"paper":"/paper/end-to-end-audio-deepfake-detection-from-raw","title":"End-to-end Audio Deepfake Detection from RAW Waveforms: a RawNet-Based Approach with Cross-Dataset Evaluation","date":"2025-04-29","arxiv_id":"2504.20923","n_code_links":1,"syntology":null},{"paper":null,"title":"Comprehensive Evaluation of Quantitative Measurements from Automated Deep Segmentations of PSMA PET/CT Images","date":"2025-04-22","arxiv_id":"2504.16237","n_code_links":0,"syntology":null},{"paper":null,"title":"Class Imbalance Correction for Improved Universal Lesion Detection and Tagging in CT","date":"2025-04-08","arxiv_id":"2504.05591","n_code_links":0,"syntology":null},{"paper":"/paper/uncertainty-weighted-gradients-for-model","title":"Uncertainty Weighted Gradients for Model Calibration","date":"2025-03-26","arxiv_id":"2503.22725","n_code_links":1,"syntology":{"ran":2,"of":2,"unverified":0,"pointer_only":0}},{"paper":null,"title":"Self-Adaptive Gamma Context-Aware SSM-based Model for Metal Defect Detection","date":"2025-03-03","arxiv_id":"2503.01234","n_code_links":0,"syntology":null},{"paper":"/paper/dur360bev-a-real-world-single-360-degree","title":"Dur360BEV: A Real-world 360-degree Single Camera Dataset and Benchmark for Bird-Eye View Mapping in Autonomous Driving","date":"2025-03-02","arxiv_id":"2503.00675","n_code_links":2,"syntology":{"ran":0,"of":6,"unverified":6,"pointer_only":0}},{"paper":null,"title":"Fast-COS: A Fast One-Stage Object Detector Based on Reparameterized Attention Vision Transformer for Autonomous Driving","date":"2025-02-11","arxiv_id":"2502.07417","n_code_links":0,"syntology":null},{"paper":null,"title":"Supervised contrastive learning for cell stage classification of animal embryos","date":"2025-02-11","arxiv_id":"2502.07360","n_code_links":0,"syntology":null},{"paper":"/paper/adaptive-voxel-weighted-loss-using-l1-norms","title":"Adaptive Voxel-Weighted Loss Using L1 Norms in Deep Neural Networks for Detection and Segmentation of Prostate Cancer Lesions in PET/CT Images","date":"2025-02-04","arxiv_id":"2502.02756","n_code_links":1,"syntology":null},{"paper":null,"title":"Deep Learning-Powered Classification of Thoracic Diseases in Chest X-Rays","date":"2025-01-24","arxiv_id":"2501.14279","n_code_links":0,"syntology":null},{"paper":null,"title":"Dual Scale-aware Adaptive Masked Knowledge Distillation for Object Detection","date":"2025-01-13","arxiv_id":"2501.07101","n_code_links":0,"syntology":null},{"paper":null,"title":"FocalPO: Enhancing Preference Optimizing by Focusing on Correct Preference Rankings","date":"2025-01-11","arxiv_id":"2501.06645","n_code_links":0,"syntology":null},{"paper":null,"title":"Influences on LLM Calibration: A Study of Response Agreement, Loss Functions, and Prompt Styles","date":"2025-01-07","arxiv_id":"2501.03991","n_code_links":0,"syntology":null},{"paper":"/paper/exploiting-boundary-loss-for-the-hierarchical","title":"Exploiting Boundary Loss for the Hierarchical Panoptic Segmentation of Plants and Leaves","date":"2024-12-31","arxiv_id":"2501.00527","n_code_links":1,"syntology":null},{"paper":"/paper/detection-of-body-packs-in-abdominal-ct-scans","title":"Detection of Body Packs in Abdominal CT scans Through Artificial Intelligence","date":"2024-12-26","arxiv_id":null,"n_code_links":1,"syntology":null},{"paper":"/paper/distortion-aware-adversarial-attacks-on","title":"Distortion-Aware Adversarial Attacks on Bounding Boxes of Object Detectors","date":"2024-12-25","arxiv_id":"2412.18815","n_code_links":1,"syntology":null},{"paper":"/paper/emov2-pushing-5m-vision-model-frontier","title":"EMOv2: Pushing 5M Vision Model Frontier","date":"2024-12-09","arxiv_id":"2412.06674","n_code_links":1,"syntology":null},{"paper":"/paper/psych-occlusion-using-visual-psychophysics","title":"Psych-Occlusion: Using Visual Psychophysics for Aerial Detection of Occluded Persons during Search and Rescue","date":"2024-12-07","arxiv_id":"2412.05553","n_code_links":1,"syntology":null},{"paper":"/paper/ocdet-object-center-detection-via-bounding","title":"OCDet: Object Center Detection via Bounding Box-Aware Heatmap Prediction on Edge Devices with NPUs","date":"2024-11-23","arxiv_id":"2411.15653","n_code_links":1,"syntology":null},{"paper":null,"title":"A Novel Adaptive Hybrid Focal-Entropy Loss for Enhancing Diabetic Retinopathy Detection Using Convolutional Neural Networks","date":"2024-11-16","arxiv_id":"2411.10843","n_code_links":0,"syntology":null},{"paper":"/paper/normative-modeling-for-ad-diagnosis-and","title":"Normative Modeling for AD Diagnosis and Biomarker Identification","date":"2024-11-15","arxiv_id":"2411.10570","n_code_links":1,"syntology":null},{"paper":null,"title":"1-800-SHARED-TASKS @ NLU of Devanagari Script Languages: Detection of Language, Hate Speech, and Targets using LLMs","date":"2024-11-11","arxiv_id":"2411.06850","n_code_links":0,"syntology":null},{"paper":null,"title":"One-Stage-TFS: Thai One-Stage Fingerspelling Dataset for Fingerspelling Recognition Frameworks","date":"2024-11-05","arxiv_id":"2411.02768","n_code_links":0,"syntology":null},{"paper":"/paper/divergent-domains-convergent-grading","title":"Divergent Domains, Convergent Grading: Enhancing Generalization in Diabetic Retinopathy Grading","date":"2024-11-04","arxiv_id":"2411.02614","n_code_links":1,"syntology":null},{"paper":null,"title":"BiT-MamSleep: Bidirectional Temporal Mamba for EEG Sleep Staging","date":"2024-11-03","arxiv_id":"2411.01589","n_code_links":0,"syntology":null},{"paper":null,"title":"Fast-OMRA: Fast Online Motion Resolution Adaptation for Neural B-Frame Coding","date":"2024-10-29","arxiv_id":"2410.21763","n_code_links":0,"syntology":null}],"papers_shown":30,"tasks":[{"task":"/task/object-detection","name":"Object Detection","papers":202},{"task":"/task/object-detection-1","name":"object-detection","papers":186},{"task":"/task/object","name":"Object","papers":121},{"task":"/task/semantic-segmentation","name":"Semantic Segmentation","papers":46},{"task":"/task/image-classification","name":"Image Classification","papers":33},{"task":"/task/segmentation","name":"Segmentation","papers":33},{"task":"/task/classification","name":"General Classification","papers":25},{"task":"/task/image-classification","name":"image-classification","papers":25},{"task":"/task/knowledge-distillation","name":"Knowledge Distillation","papers":23},{"task":"/task/classification-1","name":"Classification","papers":21},{"task":"/task/instance-segmentation","name":"Instance Segmentation","papers":21},{"task":"/task/data-augmentation","name":"Data Augmentation","papers":20},{"task":"/task/deep-learning","name":"Deep Learning","papers":19},{"task":"/task/decoder","name":"Decoder","papers":18},{"task":"/task/autonomous-driving","name":"Autonomous Driving","papers":16},{"task":"/task/transfer-learning","name":"Transfer Learning","papers":16},{"task":"/task/image-segmentation","name":"Image Segmentation","papers":13},{"task":"/task/pedestrian-detection","name":"Pedestrian Detection","papers":13},{"task":"/task/regression-1","name":"regression","papers":12},{"task":null,"name":"GPU","papers":11}],"tasks_shown":20,"n_tasks":341,"usage_by_year":[{"year":"2017","papers":5},{"year":"2018","papers":26},{"year":"2019","papers":68},{"year":"2020","papers":66},{"year":"2021","papers":80},{"year":"2022","papers":67},{"year":"2023","papers":84},{"year":"2024","papers":48},{"year":"2025","papers":17}],"row_source":"methods_table","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/focal-loss"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}