{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/enhancing-object-detection-for-autonomous","title":"Enhancing Object Detection for Autonomous Driving by Optimizing Anchor Generation and Addressing Class Imbalance","arxiv_id":"2104.03888","date":"2021-04-08","proceeding":null,"authors":["Manuel Carranza-García","Pedro Lara-Benítez","Jorge García-Gutiérrez","José C. Riquelme"],"abstract":"Object detection has been one of the most active topics in computer vision for the past years. Recent works have mainly focused on pushing the state-of-the-art in the general-purpose COCO benchmark. However, the use of such detection frameworks in specific applications such as autonomous driving is yet an area to be addressed. This study presents an enhanced 2D object detector based on Faster R-CNN that is better suited for the context of autonomous vehicles. Two main aspects are improved: the anchor generation procedure and the performance drop in minority classes. The default uniform anchor configuration is not suitable in this scenario due to the perspective projection of the vehicle cameras. Therefore, we propose a perspective-aware methodology that divides the image into key regions via clustering and uses evolutionary algorithms to optimize the base anchors for each of them. Furthermore, we add a module that enhances the precision of the second-stage header network by including the spatial information of the candidate regions proposed in the first stage. We also explore different re-weighting strategies to address the foreground-foreground class imbalance, showing that the use of a reduced version of focal loss can significantly improve the detection of difficult and underrepresented objects in two-stage detectors. Finally, we design an ensemble model to combine the strengths of the different learning strategies. Our proposal is evaluated with the Waymo Open Dataset, which is the most extensive and diverse up to date. The results demonstrate an average accuracy improvement of 6.13% mAP when using the best single model, and of 9.69% mAP with the ensemble. The proposed modifications over the Faster R-CNN do not increase computational cost and can easily be extended to optimize other anchor-based detection frameworks.","url_abs":"https://arxiv.org/abs/2104.03888v1","url_pdf":"https://arxiv.org/pdf/2104.03888v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"enhancing-object-detection-for-autonomous","repo_url":"https://github.com/carranza96/waymo-detection-optimization","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"autonomous-driving","task_name":"Autonomous Driving"},{"task_slug":"autonomous-vehicles","task_name":"Autonomous Vehicles"},{"task_slug":"evolutionary-algorithms","task_name":"Evolutionary Algorithms"},{"task_slug":"object-detection","task_name":"Object Detection"},{"task_slug":"object-detection-1","task_name":"object-detection"}],"methods":[{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"faster-r-cnn","method_name":"Faster R-CNN"},{"method_slug":"focal-loss","method_name":"Focal Loss"},{"method_slug":"rpn","method_name":"RPN"},{"method_slug":"roipool","method_name":"RoIPool"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2104.03888","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2104.03888"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/carranza96/waymo-detection-optimization","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":7},"by_repo_kind":{"official":{"samples":7,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"014a09b5b6d17768","entry":"AvgEnsemble","repo":"carranza96/waymo-detection-optimization","repo_kind":"official","path":"src/ensemble_predictions.py","file_url":"https://github.com/carranza96/waymo-detection-optimization/blob/HEAD/src/ensemble_predictions.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"014a09b5b6d17768"}},{"code_sha256_prefix":"cb667e854454b5e6","entry":"get_frame_shared_features","repo":"carranza96/waymo-detection-optimization","repo_kind":"official","path":"src/write_predictions_file.py","file_url":"https://github.com/carranza96/waymo-detection-optimization/blob/HEAD/src/write_predictions_file.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cb667e854454b5e6"}},{"code_sha256_prefix":"d89091133611f15a","entry":"load_detection_graph","repo":"carranza96/waymo-detection-optimization","repo_kind":"official","path":"src/average_inference_time.py","file_url":"https://github.com/carranza96/waymo-detection-optimization/blob/HEAD/src/average_inference_time.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d89091133611f15a"}},{"code_sha256_prefix":"243e9afed772b17f","entry":"open_sharded_output_tfrecords","repo":"carranza96/waymo-detection-optimization","repo_kind":"official","path":"src/preprocessing/convert_waymo_tfrecord.py","file_url":"https://github.com/carranza96/waymo-detection-optimization/blob/HEAD/src/preprocessing/convert_waymo_tfrecord.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"243e9afed772b17f"}},{"code_sha256_prefix":"dc402a25d142a52a","entry":"read_encoded_image","repo":"carranza96/waymo-detection-optimization","repo_kind":"official","path":"src/average_inference_time.py","file_url":"https://github.com/carranza96/waymo-detection-optimization/blob/HEAD/src/average_inference_time.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dc402a25d142a52a"}},{"code_sha256_prefix":"0a27b291ed31fa28","entry":"run_inference_for_single_image","repo":"carranza96/waymo-detection-optimization","repo_kind":"official","path":"src/average_inference_time.py","file_url":"https://github.com/carranza96/waymo-detection-optimization/blob/HEAD/src/average_inference_time.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0a27b291ed31fa28"}},{"code_sha256_prefix":"9d5c7acb0bb7838c","entry":"to_numpy","repo":"carranza96/waymo-detection-optimization","repo_kind":"official","path":"src/ensemble_predictions.py","file_url":"https://github.com/carranza96/waymo-detection-optimization/blob/HEAD/src/ensemble_predictions.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9d5c7acb0bb7838c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}