{
  "id": 372969,
  "title": "Tricks used by the winners of the previous NFL competitions",
  "url": "/competitions/nfl-player-contact-detection/discussion/372969",
  "author_name": "The Devastator",
  "post_date": "2022-12-19T00:03:16.177000",
  "votes": 30,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Hi, How are you all doing? <br>\nThe following are short summaries of the tricks used by the winners of all the previous NFL competitions on Kaggle.<br>\nUse this as a short index to browse the previous solutions.<br>\nEnjoy! </p>\n<hr>\n<h2><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment\" target=\"_blank\">NFL Health &amp; Safety - Helmet Assignment</a></h2>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/284975#1878883\" target=\"_blank\">1st place solution</a> - Written by <a href=\"https://www.kaggle.com/kmat2019\" target=\"_blank\">kmat2019</a></h4>\n<ul>\n<li>The solution consists of a helmet detector, image to map converter, points to points registration, team classifier, tracker, and ensemble</li>\n<li>The helmet detector is a 2-stage detector that finds helmets bounding boxes in images</li>\n<li>The image to map converter is a CNN that converts helmet bounding boxes in images to a 2D map</li>\n<li>The points to points registration uses ICP to match predicted players on the 2D map to the provided tracking data</li>\n<li>The team classifier is a CNN that predicts the similarity matrix to show if pairs of players belong to the same team</li>\n<li>The tracker accumulates player assignment results and re-assigns players to bounding boxes using IoU</li>\n<li>The ensemble uses WBF to average player-assignment matrices from multiple models and choose the final assignment with the Hungarian algorithm</li>\n<li>The solution uses 4 detectors in the final submission</li>\n<li>Inference code and an ablation study are available for review</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285112\" target=\"_blank\">2nd place solution</a> - Written by <a href=\"https://www.kaggle.com/its7171\" target=\"_blank\">TITO</a></h4>\n<ul>\n<li>Trained YoloV5 using supplemental photos, but had to upsample from 1280 to 1664 for improved accuracy with small helmets detection</li>\n<li>Used 2-stage K-means clustering to classify helmets images into teams, achieving 97% accuracy</li>\n<li>Improved team classification to 98% accuracy using tracking information for post-processing</li>\n<li>Extracted features such as player orientation and gap between helmet and sensor position for mapping players, using CenterNet</li>\n<li>Used CV2 to detect lines on the ground for coordinate transformation, including aspect ratio, trapezoid correction, and rotation</li>\n<li>Assigned players to video using linear assignment problem and selected candidate with smallest minimum distance</li>\n<li>Tracked players using SORT algorithm, introducing helmet image features as step-function to avoid tracking same person across different teams</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285076\" target=\"_blank\">3rd place solution</a> - Written by <a href=\"https://www.kaggle.com/hiraiitsuki\" target=\"_blank\">FANTASTIC_HIRARIN</a></h4>\n<ul>\n<li>Use Yolov5 to detect helmets</li>\n<li>Use deepsort to track the helmet</li>\n<li>Use ICP and Hungarian algorithm to assign helmet boxes to tracking data for each frame</li>\n<li>Divide helmet into two clusters using k-means based on color</li>\n<li>Use ICP and Hungarian algorithm to assign helmet boxes to tracking data again taking into account deepsort and helmet color information</li>\n<li>Use Hungarian algorithm to determine final label</li>\n<li>Remove False Positive helmet boxes and tracking data not shown in video to adjust position using ICP</li>\n<li>Divide helmet boxes into two clusters using k-means based on helmet color and features calculated by deepsort</li>\n<li>Reduce value of cost matrix based on deepsort and helmet color information to assign helmet boxes to tracking data</li>\n<li>Use Hungarian algorithm to determine final label, taking into account deepsort and helmet color information</li>\n<li>Output final result with labels for each helmet box</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285007\" target=\"_blank\">4th place solution</a> - Written by <a href=\"https://www.kaggle.com/aerdem4\" target=\"_blank\">Ahmet Erdem</a></h4>\n<ul>\n<li>Replaced baseline helmet model with a trained yolov5 model, trained on extra images and video images</li>\n<li>Tuned deepsort parameters and updated code to return unconfirmed boxes</li>\n<li>Implemented custom tracking using helmet similarity score and iou score</li>\n<li>Created jersey number training data and trained a 2 head model with resnet34 backbone and augmentations</li>\n<li>Used cluster ensembling to assign labels to helmets clusters</li>\n<li>Implemented linear regression to map helmet positions to label predictions for unassigned helmets</li>\n<li>Used greedy minimum distance assignment to assign labels to helmets based on cluster ensembling and linear regression predictions</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285286\" target=\"_blank\">5th place solution</a> - Written by <a href=\"https://www.kaggle.com/kylelee\" target=\"_blank\">Kyle Lee</a></h4>\n<ul>\n<li>Used YOLOv5 detector with standard augmentation and WBF for TTA</li>\n<li>Applied Hungarian assignment for label assignment, including sweeping rotations and outlier tracker points</li>\n<li>Added gravity features for improved label assignment, including digit matching, orientation matching, and direction matching</li>\n<li>Improved pre-tracking scores with gravity features, but had little effect on post-tracker scores</li>\n<li>Pipeline slowed down significantly with addition of gravity features</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/284940\" target=\"_blank\">9th place solution</a> - Written by <a href=\"https://www.kaggle.com/K-NKSM\" target=\"_blank\">K-NKSM</a></h4>\n<ul>\n<li>Used YOLO v5 helmet detection to improve performance</li>\n<li>Used shape context to estimate homography matrix in frame 1</li>\n<li>Used Hungarian algorithm to match sensor data with bboxes</li>\n<li>Used iterative closest point algorithm to calculate homography matrix</li>\n<li>Optimized rotation/scaling factors</li>\n<li>Used previous homography matrix to estimate current matrix</li>\n<li>Assigned helmets to player using deepsort and previously obtained homography matrices</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/284945\" target=\"_blank\">10th place solution</a> - Written by <a href=\"https://www.kaggle.com/NVNN\" target=\"_blank\">NVNN</a></h4>\n<ul>\n<li>Used Yolov5 to detect helmets in images</li>\n<li>Used regression network (EfficientnetB0 encoder with Unet decoder) to match detected helmet with tracking data</li>\n<li>Achieved CV of 0.7 (0.68 public and 0.7 private) with this approach</li>\n<li>Postprocessed output with tracking algorithm (Deepsort and SiamRPN) to boost CV to 0.9, public LB 0.85, and private LB 0.86</li>\n<li>Regression network similar to a normal segmentation network with 2-channel input and output and L1 loss function</li>\n<li>Real implementation used an extra segmentation channel for better training.</li>\n</ul>\n<hr>\n<h2><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection\" target=\"_blank\">NFL 1st and Future - Impact Detection</a></h2>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209403\" target=\"_blank\">1st place solution</a> - Written by <a href=\"https://www.kaggle.com/dmytropoplavskiy\" target=\"_blank\">Dmytro Poplavskiy</a></h4>\n<ul>\n<li>Approach used 2d detection, tracking, 3d classification, and post-processing to suppress false positives</li>\n<li>Detection used YoloV5-l trained on 10k images or EfficientDet detector trained on video frames</li>\n<li>Helmets tracked using optical flow between surrounding frames with OpenCV or RAFT</li>\n<li>2.5D classification used 16x3x128x128 crops and corrected for linear helmet movement between frames</li>\n<li>Classification models used Temporal Shift Module or MotionSqueeze</li>\n<li>Trained models used 4 folds CV and averaged predictions from all folds</li>\n<li>Post-processing selected highest impact confidence and suppressed detections for same player over surrounding frames</li>\n<li>Classification model also predicted impact type and suppressed predicted same types within 3-10 frames</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209403\" target=\"_blank\">2nd place solution</a> - Written by <a href=\"https://www.kaggle.com/fergusoci\" target=\"_blank\">FERGUSOCI</a></h4>\n<ul>\n<li>Two stage approach for helmet and impact detection</li>\n<li>Stage 1: YOLOv5 model for helmet detection</li>\n<li>Stage 2: Ensemble of 3D CNN models using cropped helmet locations and surrounding frames for impact prediction</li>\n<li>Post-processing applied to Stage 2 predictions</li>\n<li>Validation strategy using GroupKfold split</li>\n<li>Pipeline using Github, Neptune, Kaggle API, AWS, and Push Kaggle dataset action</li>\n<li>Stage 2 ensemble includes 6 efficientnets with horizontal flip TTA and 3D Resnext50/101 (not used in final submission)</li>\n<li>Stage 1 training: YOLOv5 on full data without validation set, TTA flag and img-size of 1280 for inference</li>\n<li>Stage 2 input data: 9 helmet detections with padding, original box size as context</li>\n<li>Softmax loss with class weights and sampling scheme for training</li>\n<li>Augmentations including horizontal flip, coarse dropout, grid mask, and shift scale rotate</li>\n<li>Hyperparameter optimization using Optuna and GridSearch</li>\n<li>Final submission selected through ensembling and post-processing</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208787\" target=\"_blank\">3rd place solution</a> - Written by <a href=\"https://www.kaggle.com/haqishen\" target=\"_blank\">Qishen Ha</a></h4>\n<ul>\n<li>Used EfficientDet to generate candidate impact bboxes, cropped them into small images, and used a binary image classification model to classify helmet crops through 9 frames</li>\n<li>Adjusted scores for each bbox using multi-view information in post-processing and dropped similar bboxes through 9 frames in post-processing</li>\n<li>Trained EfficientDet on 2 classes (helmet and impact) and used all positive frames and 50% of negative frames for training</li>\n<li>Used binary classification models to further predict if bbox crops are impacts or not, cropping bboxes through 9 frames and turning them into grayscale to get an input shape of (h, w, 9)</li>\n<li>Tuned thresholds for certain frames depending on predictions in other views in post-processing</li>\n<li>Designed a function to drop similar bboxes within 9 consecutive frames and kept only the one with the largest confidence</li>\n<li>Ensemble of 7 EfficientDet models and 18 Binary models achieved local score of 0.64, public LB of 0.66, and private LB of 0.69</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208947\" target=\"_blank\">4th place solution</a> - Written by <a href=\"https://www.kaggle.com/davletag\" target=\"_blank\">Azat Davletshin</a></h4>\n<ul>\n<li>Used a two-stage approach for helmet detection and ROI classification using a 3D convolutional network</li>\n<li>Extracted video frames and split data into training and validation sets</li>\n<li>Trained Faster-RCNN for helmet detection with changes to standard config, including reduced minimum anchor size and single class</li>\n<li>Used FAIR's SlowFast library to train ROI classifier with two approaches: action detection and action classification</li>\n<li>Used modifications including increased number of frames with impact, added input channels, and added horizontal flips as TTA</li>\n<li>Ensemble of action detector and action classification improved final score on private leaderboard</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209235\" target=\"_blank\">5th place solution</a> - Written by <a href=\"https://www.kaggle.com/mrnnnn\" target=\"_blank\">Ruslan Grimov</a></h4>\n<p><strong>Data preparation:</strong></p>\n<ul>\n<li>Videos were split into 8x224x224x3 fragments</li>\n<li>Positive examples were chosen as a frame with impact and four frames before and three after it, with patches of size 224x224 created using a grid</li>\n<li>Negative examples were chosen as random sequences of frames with no impacts</li>\n<li>Bounding boxes' positions and sizes were saved for each sequence of frames<br>\n<strong>Models:</strong></li>\n<li>3D CNN (I3D from SlowFast) was used with a fourth channel added in input</li>\n<li>FPN from pytorch_segmentation was appended with six output channels without upsampling<br>\n3d feature maps from second to fifth blocks of the backbone were converted to 2d feature maps and passed to FPN</li>\n<li>FPN produced a grid resembling yolo output for the fifth frame in the sequence of eight frames, predicting the presence and position of bboxes, bbox size, and impact presence<br>\n<strong>Training:</strong></li>\n<li>First stage: training on 224x224 patches with augmentations and different loss functions (HuberLoss, FocalBinaryLoss, nn.BCEWithLogitsLoss) using Adam with multistage decreasing of lr</li>\n<li>Second stage: training on whole images with frozen backbone and only FPN trained, using the same augmentations and optimizer as first stage</li>\n<li>Ensemble of four models achieved score of 0.48 on local validation<br>\n<strong>Modifications:</strong></li>\n<li>Changed bbox center predictions to circles with diameters equal to average between bbox width and height, fading towards boundaries</li>\n<li>Trained standalone FPN with resnet34 as backbone on single 224x224 patches to improve helmet center detection</li>\n<li>Trained 3D CNN on whole images with improved bbox center predictions as ground truth</li>\n<li>Ensemble of four improved models achieved score of 0.54 on local validation</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208833\" target=\"_blank\">6th place solution</a> - Written by <a href=\"https://www.kaggle.com/hiraiitsuki\" target=\"_blank\">FANTASTIC_HIRARIN</a></h4>\n<ul>\n<li>Solution consists of two stages: detecting helmets with EfficientDet-d5 and classifying impact with resnet18</li>\n<li>EfficientDet-d5 trained on 1 class of helmet using frames with and without collisions</li>\n<li>Inference performed on original and horizontally flipped images, merged using wbf</li>\n<li>Resnet18 trained on 2 classes of impact/no impact, input is cropped image around helmet and 9 images from 4 frames before and after collision</li>\n<li>Augmentation includes horizontal flip, brightness/contrast changes, blur/noise, color changes, and image transformations</li>\n<li>Two resnet18 models trained, 2d conv and 3d conv, with final output as ensemble of respective outputs</li>\n<li>Post-processing involves ignoring helmet detected in same position within 4 frames and ignoring first and last 10 frames of video</li>\n<li>Scores: cv for EfficientDet-d5 at 0.926, roc_auc for 2d/3d conv resnet18 at 0.964/0.967, cv for local at 0.53, public score at 0.56, private score at 0.59</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/c/nfl-impact-detection/discussion/208851\" target=\"_blank\">7th place solution</a> - Written by <a href=\"https://www.kaggle.com/bloodaxe\" target=\"_blank\">Eugene Khvedchenya</a></h4>\n<ul>\n<li>Used three stages: helmet detection, impact classification, and post-processing</li>\n<li>Data split into four folds to prevent data leak</li>\n<li>Used four CenterNet models for helmet detection</li>\n<li>Used one 3D CNN model for impact classification</li>\n<li>Used DenseNet-based encoders for best Helmet F1 and Impact F1 scores</li>\n<li>Used albumentations library for augmentations</li>\n<li>Tried second-level model, EfficientDet, and siamese networks for impact classification</li>\n<li>3D CNN classifier on top of 2D helmet predictions gave best results</li>\n<li>Used IoU and euclidean distance for post-processing to suppress duplicates</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209012\" target=\"_blank\">9th place solution</a> - Written by <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">Chris Deotte</a></h4>\n<ul>\n<li>The solution involves a two-step pipeline (detection and classification) with post-processing</li>\n<li>Detection model uses 2D to find possible impact boxes<br>\nClassification model uses 3D to determine which boxes are impacts</li>\n<li>Detection model is DetectoRS(ResNeXt-101-32x4d) with Helmet Detection Model for warm-up and 2-Class Detection Model using final weights of Helmet Detection Model as pretrained weights</li>\n<li>Classification model uses 2D models (Resnet-18 &amp; 34, EfficientNet b0-b3) with extended label and post-processing to improve performance</li>\n<li>3D models (Resnet-18 &amp; 34, EfficientNet b0-b3) were also developed and used in final solution</li>\n<li>Final solution involves merging detection and classification models and using ensemble techniques to improve performance</li>\n<li>Solution achieves top 10% on public leaderboard.</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208773\" target=\"_blank\">10th place solution</a> - Written by <a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">NVNN</a></h4>\n<ul>\n<li>Used a modified version of Centernet for detection model</li>\n<li>Replaced image-based feature extraction with video-based feature extraction</li>\n<li>Used multiple Centernet heads to predict helmet for each frame</li>\n<li>Calculated loss independently between 2 classes and used weighted sum</li>\n<li>Created own augmentation for video</li>\n<li>Input was a sequence of 15 consecutive frames</li>\n<li>Used EfficientB5 for video feature extraction</li>\n<li>Used IOU-Tracker to link detected impacts from nearby frames</li>\n<li>Used dynamic confidence threshold, with low threshold in range of frame 30-80 and gradually increasing to end of video<br>\nEnjoy!</li>\n</ul>",
  "messages": [
    {
      "id": 2069413,
      "postDate": "2022-12-19T00:03:16.177Z",
      "content": "<p>Hi, How are you all doing? <br>\nThe following are short summaries of the tricks used by the winners of all the previous NFL competitions on Kaggle.<br>\nUse this as a short index to browse the previous solutions.<br>\nEnjoy! </p>\n<hr>\n<h2><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment\" target=\"_blank\">NFL Health &amp; Safety - Helmet Assignment</a></h2>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/284975#1878883\" target=\"_blank\">1st place solution</a> - Written by <a href=\"https://www.kaggle.com/kmat2019\" target=\"_blank\">kmat2019</a></h4>\n<ul>\n<li>The solution consists of a helmet detector, image to map converter, points to points registration, team classifier, tracker, and ensemble</li>\n<li>The helmet detector is a 2-stage detector that finds helmets bounding boxes in images</li>\n<li>The image to map converter is a CNN that converts helmet bounding boxes in images to a 2D map</li>\n<li>The points to points registration uses ICP to match predicted players on the 2D map to the provided tracking data</li>\n<li>The team classifier is a CNN that predicts the similarity matrix to show if pairs of players belong to the same team</li>\n<li>The tracker accumulates player assignment results and re-assigns players to bounding boxes using IoU</li>\n<li>The ensemble uses WBF to average player-assignment matrices from multiple models and choose the final assignment with the Hungarian algorithm</li>\n<li>The solution uses 4 detectors in the final submission</li>\n<li>Inference code and an ablation study are available for review</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285112\" target=\"_blank\">2nd place solution</a> - Written by <a href=\"https://www.kaggle.com/its7171\" target=\"_blank\">TITO</a></h4>\n<ul>\n<li>Trained YoloV5 using supplemental photos, but had to upsample from 1280 to 1664 for improved accuracy with small helmets detection</li>\n<li>Used 2-stage K-means clustering to classify helmets images into teams, achieving 97% accuracy</li>\n<li>Improved team classification to 98% accuracy using tracking information for post-processing</li>\n<li>Extracted features such as player orientation and gap between helmet and sensor position for mapping players, using CenterNet</li>\n<li>Used CV2 to detect lines on the ground for coordinate transformation, including aspect ratio, trapezoid correction, and rotation</li>\n<li>Assigned players to video using linear assignment problem and selected candidate with smallest minimum distance</li>\n<li>Tracked players using SORT algorithm, introducing helmet image features as step-function to avoid tracking same person across different teams</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285076\" target=\"_blank\">3rd place solution</a> - Written by <a href=\"https://www.kaggle.com/hiraiitsuki\" target=\"_blank\">FANTASTIC_HIRARIN</a></h4>\n<ul>\n<li>Use Yolov5 to detect helmets</li>\n<li>Use deepsort to track the helmet</li>\n<li>Use ICP and Hungarian algorithm to assign helmet boxes to tracking data for each frame</li>\n<li>Divide helmet into two clusters using k-means based on color</li>\n<li>Use ICP and Hungarian algorithm to assign helmet boxes to tracking data again taking into account deepsort and helmet color information</li>\n<li>Use Hungarian algorithm to determine final label</li>\n<li>Remove False Positive helmet boxes and tracking data not shown in video to adjust position using ICP</li>\n<li>Divide helmet boxes into two clusters using k-means based on helmet color and features calculated by deepsort</li>\n<li>Reduce value of cost matrix based on deepsort and helmet color information to assign helmet boxes to tracking data</li>\n<li>Use Hungarian algorithm to determine final label, taking into account deepsort and helmet color information</li>\n<li>Output final result with labels for each helmet box</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285007\" target=\"_blank\">4th place solution</a> - Written by <a href=\"https://www.kaggle.com/aerdem4\" target=\"_blank\">Ahmet Erdem</a></h4>\n<ul>\n<li>Replaced baseline helmet model with a trained yolov5 model, trained on extra images and video images</li>\n<li>Tuned deepsort parameters and updated code to return unconfirmed boxes</li>\n<li>Implemented custom tracking using helmet similarity score and iou score</li>\n<li>Created jersey number training data and trained a 2 head model with resnet34 backbone and augmentations</li>\n<li>Used cluster ensembling to assign labels to helmets clusters</li>\n<li>Implemented linear regression to map helmet positions to label predictions for unassigned helmets</li>\n<li>Used greedy minimum distance assignment to assign labels to helmets based on cluster ensembling and linear regression predictions</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285286\" target=\"_blank\">5th place solution</a> - Written by <a href=\"https://www.kaggle.com/kylelee\" target=\"_blank\">Kyle Lee</a></h4>\n<ul>\n<li>Used YOLOv5 detector with standard augmentation and WBF for TTA</li>\n<li>Applied Hungarian assignment for label assignment, including sweeping rotations and outlier tracker points</li>\n<li>Added gravity features for improved label assignment, including digit matching, orientation matching, and direction matching</li>\n<li>Improved pre-tracking scores with gravity features, but had little effect on post-tracker scores</li>\n<li>Pipeline slowed down significantly with addition of gravity features</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/284940\" target=\"_blank\">9th place solution</a> - Written by <a href=\"https://www.kaggle.com/K-NKSM\" target=\"_blank\">K-NKSM</a></h4>\n<ul>\n<li>Used YOLO v5 helmet detection to improve performance</li>\n<li>Used shape context to estimate homography matrix in frame 1</li>\n<li>Used Hungarian algorithm to match sensor data with bboxes</li>\n<li>Used iterative closest point algorithm to calculate homography matrix</li>\n<li>Optimized rotation/scaling factors</li>\n<li>Used previous homography matrix to estimate current matrix</li>\n<li>Assigned helmets to player using deepsort and previously obtained homography matrices</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/284945\" target=\"_blank\">10th place solution</a> - Written by <a href=\"https://www.kaggle.com/NVNN\" target=\"_blank\">NVNN</a></h4>\n<ul>\n<li>Used Yolov5 to detect helmets in images</li>\n<li>Used regression network (EfficientnetB0 encoder with Unet decoder) to match detected helmet with tracking data</li>\n<li>Achieved CV of 0.7 (0.68 public and 0.7 private) with this approach</li>\n<li>Postprocessed output with tracking algorithm (Deepsort and SiamRPN) to boost CV to 0.9, public LB 0.85, and private LB 0.86</li>\n<li>Regression network similar to a normal segmentation network with 2-channel input and output and L1 loss function</li>\n<li>Real implementation used an extra segmentation channel for better training.</li>\n</ul>\n<hr>\n<h2><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection\" target=\"_blank\">NFL 1st and Future - Impact Detection</a></h2>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209403\" target=\"_blank\">1st place solution</a> - Written by <a href=\"https://www.kaggle.com/dmytropoplavskiy\" target=\"_blank\">Dmytro Poplavskiy</a></h4>\n<ul>\n<li>Approach used 2d detection, tracking, 3d classification, and post-processing to suppress false positives</li>\n<li>Detection used YoloV5-l trained on 10k images or EfficientDet detector trained on video frames</li>\n<li>Helmets tracked using optical flow between surrounding frames with OpenCV or RAFT</li>\n<li>2.5D classification used 16x3x128x128 crops and corrected for linear helmet movement between frames</li>\n<li>Classification models used Temporal Shift Module or MotionSqueeze</li>\n<li>Trained models used 4 folds CV and averaged predictions from all folds</li>\n<li>Post-processing selected highest impact confidence and suppressed detections for same player over surrounding frames</li>\n<li>Classification model also predicted impact type and suppressed predicted same types within 3-10 frames</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209403\" target=\"_blank\">2nd place solution</a> - Written by <a href=\"https://www.kaggle.com/fergusoci\" target=\"_blank\">FERGUSOCI</a></h4>\n<ul>\n<li>Two stage approach for helmet and impact detection</li>\n<li>Stage 1: YOLOv5 model for helmet detection</li>\n<li>Stage 2: Ensemble of 3D CNN models using cropped helmet locations and surrounding frames for impact prediction</li>\n<li>Post-processing applied to Stage 2 predictions</li>\n<li>Validation strategy using GroupKfold split</li>\n<li>Pipeline using Github, Neptune, Kaggle API, AWS, and Push Kaggle dataset action</li>\n<li>Stage 2 ensemble includes 6 efficientnets with horizontal flip TTA and 3D Resnext50/101 (not used in final submission)</li>\n<li>Stage 1 training: YOLOv5 on full data without validation set, TTA flag and img-size of 1280 for inference</li>\n<li>Stage 2 input data: 9 helmet detections with padding, original box size as context</li>\n<li>Softmax loss with class weights and sampling scheme for training</li>\n<li>Augmentations including horizontal flip, coarse dropout, grid mask, and shift scale rotate</li>\n<li>Hyperparameter optimization using Optuna and GridSearch</li>\n<li>Final submission selected through ensembling and post-processing</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208787\" target=\"_blank\">3rd place solution</a> - Written by <a href=\"https://www.kaggle.com/haqishen\" target=\"_blank\">Qishen Ha</a></h4>\n<ul>\n<li>Used EfficientDet to generate candidate impact bboxes, cropped them into small images, and used a binary image classification model to classify helmet crops through 9 frames</li>\n<li>Adjusted scores for each bbox using multi-view information in post-processing and dropped similar bboxes through 9 frames in post-processing</li>\n<li>Trained EfficientDet on 2 classes (helmet and impact) and used all positive frames and 50% of negative frames for training</li>\n<li>Used binary classification models to further predict if bbox crops are impacts or not, cropping bboxes through 9 frames and turning them into grayscale to get an input shape of (h, w, 9)</li>\n<li>Tuned thresholds for certain frames depending on predictions in other views in post-processing</li>\n<li>Designed a function to drop similar bboxes within 9 consecutive frames and kept only the one with the largest confidence</li>\n<li>Ensemble of 7 EfficientDet models and 18 Binary models achieved local score of 0.64, public LB of 0.66, and private LB of 0.69</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208947\" target=\"_blank\">4th place solution</a> - Written by <a href=\"https://www.kaggle.com/davletag\" target=\"_blank\">Azat Davletshin</a></h4>\n<ul>\n<li>Used a two-stage approach for helmet detection and ROI classification using a 3D convolutional network</li>\n<li>Extracted video frames and split data into training and validation sets</li>\n<li>Trained Faster-RCNN for helmet detection with changes to standard config, including reduced minimum anchor size and single class</li>\n<li>Used FAIR's SlowFast library to train ROI classifier with two approaches: action detection and action classification</li>\n<li>Used modifications including increased number of frames with impact, added input channels, and added horizontal flips as TTA</li>\n<li>Ensemble of action detector and action classification improved final score on private leaderboard</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209235\" target=\"_blank\">5th place solution</a> - Written by <a href=\"https://www.kaggle.com/mrnnnn\" target=\"_blank\">Ruslan Grimov</a></h4>\n<p><strong>Data preparation:</strong></p>\n<ul>\n<li>Videos were split into 8x224x224x3 fragments</li>\n<li>Positive examples were chosen as a frame with impact and four frames before and three after it, with patches of size 224x224 created using a grid</li>\n<li>Negative examples were chosen as random sequences of frames with no impacts</li>\n<li>Bounding boxes' positions and sizes were saved for each sequence of frames<br>\n<strong>Models:</strong></li>\n<li>3D CNN (I3D from SlowFast) was used with a fourth channel added in input</li>\n<li>FPN from pytorch_segmentation was appended with six output channels without upsampling<br>\n3d feature maps from second to fifth blocks of the backbone were converted to 2d feature maps and passed to FPN</li>\n<li>FPN produced a grid resembling yolo output for the fifth frame in the sequence of eight frames, predicting the presence and position of bboxes, bbox size, and impact presence<br>\n<strong>Training:</strong></li>\n<li>First stage: training on 224x224 patches with augmentations and different loss functions (HuberLoss, FocalBinaryLoss, nn.BCEWithLogitsLoss) using Adam with multistage decreasing of lr</li>\n<li>Second stage: training on whole images with frozen backbone and only FPN trained, using the same augmentations and optimizer as first stage</li>\n<li>Ensemble of four models achieved score of 0.48 on local validation<br>\n<strong>Modifications:</strong></li>\n<li>Changed bbox center predictions to circles with diameters equal to average between bbox width and height, fading towards boundaries</li>\n<li>Trained standalone FPN with resnet34 as backbone on single 224x224 patches to improve helmet center detection</li>\n<li>Trained 3D CNN on whole images with improved bbox center predictions as ground truth</li>\n<li>Ensemble of four improved models achieved score of 0.54 on local validation</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208833\" target=\"_blank\">6th place solution</a> - Written by <a href=\"https://www.kaggle.com/hiraiitsuki\" target=\"_blank\">FANTASTIC_HIRARIN</a></h4>\n<ul>\n<li>Solution consists of two stages: detecting helmets with EfficientDet-d5 and classifying impact with resnet18</li>\n<li>EfficientDet-d5 trained on 1 class of helmet using frames with and without collisions</li>\n<li>Inference performed on original and horizontally flipped images, merged using wbf</li>\n<li>Resnet18 trained on 2 classes of impact/no impact, input is cropped image around helmet and 9 images from 4 frames before and after collision</li>\n<li>Augmentation includes horizontal flip, brightness/contrast changes, blur/noise, color changes, and image transformations</li>\n<li>Two resnet18 models trained, 2d conv and 3d conv, with final output as ensemble of respective outputs</li>\n<li>Post-processing involves ignoring helmet detected in same position within 4 frames and ignoring first and last 10 frames of video</li>\n<li>Scores: cv for EfficientDet-d5 at 0.926, roc_auc for 2d/3d conv resnet18 at 0.964/0.967, cv for local at 0.53, public score at 0.56, private score at 0.59</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/c/nfl-impact-detection/discussion/208851\" target=\"_blank\">7th place solution</a> - Written by <a href=\"https://www.kaggle.com/bloodaxe\" target=\"_blank\">Eugene Khvedchenya</a></h4>\n<ul>\n<li>Used three stages: helmet detection, impact classification, and post-processing</li>\n<li>Data split into four folds to prevent data leak</li>\n<li>Used four CenterNet models for helmet detection</li>\n<li>Used one 3D CNN model for impact classification</li>\n<li>Used DenseNet-based encoders for best Helmet F1 and Impact F1 scores</li>\n<li>Used albumentations library for augmentations</li>\n<li>Tried second-level model, EfficientDet, and siamese networks for impact classification</li>\n<li>3D CNN classifier on top of 2D helmet predictions gave best results</li>\n<li>Used IoU and euclidean distance for post-processing to suppress duplicates</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209012\" target=\"_blank\">9th place solution</a> - Written by <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">Chris Deotte</a></h4>\n<ul>\n<li>The solution involves a two-step pipeline (detection and classification) with post-processing</li>\n<li>Detection model uses 2D to find possible impact boxes<br>\nClassification model uses 3D to determine which boxes are impacts</li>\n<li>Detection model is DetectoRS(ResNeXt-101-32x4d) with Helmet Detection Model for warm-up and 2-Class Detection Model using final weights of Helmet Detection Model as pretrained weights</li>\n<li>Classification model uses 2D models (Resnet-18 &amp; 34, EfficientNet b0-b3) with extended label and post-processing to improve performance</li>\n<li>3D models (Resnet-18 &amp; 34, EfficientNet b0-b3) were also developed and used in final solution</li>\n<li>Final solution involves merging detection and classification models and using ensemble techniques to improve performance</li>\n<li>Solution achieves top 10% on public leaderboard.</li>\n</ul>\n<h4><a href=\"https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208773\" target=\"_blank\">10th place solution</a> - Written by <a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">NVNN</a></h4>\n<ul>\n<li>Used a modified version of Centernet for detection model</li>\n<li>Replaced image-based feature extraction with video-based feature extraction</li>\n<li>Used multiple Centernet heads to predict helmet for each frame</li>\n<li>Calculated loss independently between 2 classes and used weighted sum</li>\n<li>Created own augmentation for video</li>\n<li>Input was a sequence of 15 consecutive frames</li>\n<li>Used EfficientB5 for video feature extraction</li>\n<li>Used IOU-Tracker to link detected impacts from nearby frames</li>\n<li>Used dynamic confidence threshold, with low threshold in range of frame 30-80 and gradually increasing to end of video<br>\nEnjoy!</li>\n</ul>",
      "rawMarkdown": "\n\nHi, How are you all doing? \n\nThe following are short summaries of the tricks used by the winners of all the previous NFL competitions on Kaggle.\nUse this as a short index to browse the previous solutions.\n\nEnjoy! \n\n\n_____\n\n\n\n\n## [NFL Health & Safety - Helmet Assignment](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment)\n\n#### [1st place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/284975#1878883) - Written by [kmat2019](https://www.kaggle.com/kmat2019)\n\n- The solution consists of a helmet detector, image to map converter, points to points registration, team classifier, tracker, and ensemble\n- The helmet detector is a 2-stage detector that finds helmets bounding boxes in images\n- The image to map converter is a CNN that converts helmet bounding boxes in images to a 2D map\n- The points to points registration uses ICP to match predicted players on the 2D map to the provided tracking data\n- The team classifier is a CNN that predicts the similarity matrix to show if pairs of players belong to the same team\n- The tracker accumulates player assignment results and re-assigns players to bounding boxes using IoU\n- The ensemble uses WBF to average player-assignment matrices from multiple models and choose the final assignment with the Hungarian algorithm\n- The solution uses 4 detectors in the final submission\n- Inference code and an ablation study are available for review\n\n\n#### [2nd place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285112) - Written by [TITO](https://www.kaggle.com/its7171)\n\n- Trained YoloV5 using supplemental photos, but had to upsample from 1280 to 1664 for improved accuracy with small helmets detection\n- Used 2-stage K-means clustering to classify helmets images into teams, achieving 97% accuracy\n- Improved team classification to 98% accuracy using tracking information for post-processing\n- Extracted features such as player orientation and gap between helmet and sensor position for mapping players, using CenterNet\n- Used CV2 to detect lines on the ground for coordinate transformation, including aspect ratio, trapezoid correction, and rotation\n- Assigned players to video using linear assignment problem and selected candidate with smallest minimum distance\n- Tracked players using SORT algorithm, introducing helmet image features as step-function to avoid tracking same person across different teams\n\n\n#### [3rd place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285076) - Written by [FANTASTIC_HIRARIN](https://www.kaggle.com/hiraiitsuki)\n\n- Use Yolov5 to detect helmets\n- Use deepsort to track the helmet\n- Use ICP and Hungarian algorithm to assign helmet boxes to tracking data for each frame\n- Divide helmet into two clusters using k-means based on color\n- Use ICP and Hungarian algorithm to assign helmet boxes to tracking data again taking into account deepsort and helmet color information\n- Use Hungarian algorithm to determine final label\n- Remove False Positive helmet boxes and tracking data not shown in video to adjust position using ICP\n- Divide helmet boxes into two clusters using k-means based on helmet color and features calculated by deepsort\n- Reduce value of cost matrix based on deepsort and helmet color information to assign helmet boxes to tracking data\n- Use Hungarian algorithm to determine final label, taking into account deepsort and helmet color information\n- Output final result with labels for each helmet box\n\n\n#### [4th place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285007) - Written by [Ahmet Erdem](https://www.kaggle.com/aerdem4)\n\n- Replaced baseline helmet model with a trained yolov5 model, trained on extra images and video images\n- Tuned deepsort parameters and updated code to return unconfirmed boxes\n- Implemented custom tracking using helmet similarity score and iou score\n- Created jersey number training data and trained a 2 head model with resnet34 backbone and augmentations\n- Used cluster ensembling to assign labels to helmets clusters\n- Implemented linear regression to map helmet positions to label predictions for unassigned helmets\n- Used greedy minimum distance assignment to assign labels to helmets based on cluster ensembling and linear regression predictions\n\n\n#### [5th place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285286) - Written by [Kyle Lee](https://www.kaggle.com/kylelee)\n\n- Used YOLOv5 detector with standard augmentation and WBF for TTA\n- Applied Hungarian assignment for label assignment, including sweeping rotations and outlier tracker points\n- Added gravity features for improved label assignment, including digit matching, orientation matching, and direction matching\n- Improved pre-tracking scores with gravity features, but had little effect on post-tracker scores\n- Pipeline slowed down significantly with addition of gravity features\n\n\n#### [9th place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/284940) - Written by [K-NKSM](https://www.kaggle.com/K-NKSM)\n\n- Used YOLO v5 helmet detection to improve performance\n- Used shape context to estimate homography matrix in frame 1\n- Used Hungarian algorithm to match sensor data with bboxes\n- Used iterative closest point algorithm to calculate homography matrix\n- Optimized rotation/scaling factors\n- Used previous homography matrix to estimate current matrix\n- Assigned helmets to player using deepsort and previously obtained homography matrices\n\n\n#### [10th place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/284945) - Written by [NVNN](https://www.kaggle.com/NVNN)\n\n- Used Yolov5 to detect helmets in images\n- Used regression network (EfficientnetB0 encoder with Unet decoder) to match detected helmet with tracking data\n- Achieved CV of 0.7 (0.68 public and 0.7 private) with this approach\n- Postprocessed output with tracking algorithm (Deepsort and SiamRPN) to boost CV to 0.9, public LB 0.85, and private LB 0.86\n- Regression network similar to a normal segmentation network with 2-channel input and output and L1 loss function\n- Real implementation used an extra segmentation channel for better training.\n\n_____\n\n## [NFL 1st and Future - Impact Detection](https://www.kaggle.com/competitions/nfl-impact-detection)\n\n#### [1st place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209403) - Written by [Dmytro Poplavskiy](https://www.kaggle.com/dmytropoplavskiy)\n\n- Approach used 2d detection, tracking, 3d classification, and post-processing to suppress false positives\n- Detection used YoloV5-l trained on 10k images or EfficientDet detector trained on video frames\n- Helmets tracked using optical flow between surrounding frames with OpenCV or RAFT\n- 2.5D classification used 16x3x128x128 crops and corrected for linear helmet movement between frames\n- Classification models used Temporal Shift Module or MotionSqueeze\n- Trained models used 4 folds CV and averaged predictions from all folds\n- Post-processing selected highest impact confidence and suppressed detections for same player over surrounding frames\n- Classification model also predicted impact type and suppressed predicted same types within 3-10 frames\n\n\n\n#### [2nd place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209403) - Written by [FERGUSOCI](https://www.kaggle.com/fergusoci)\n\n\n- Two stage approach for helmet and impact detection\n- Stage 1: YOLOv5 model for helmet detection\n- Stage 2: Ensemble of 3D CNN models using cropped helmet locations and surrounding frames for impact prediction\n- Post-processing applied to Stage 2 predictions\n- Validation strategy using GroupKfold split\n- Pipeline using Github, Neptune, Kaggle API, AWS, and Push Kaggle dataset action\n- Stage 2 ensemble includes 6 efficientnets with horizontal flip TTA and 3D Resnext50/101 (not used in final submission)\n- Stage 1 training: YOLOv5 on full data without validation set, TTA flag and img-size of 1280 for inference\n- Stage 2 input data: 9 helmet detections with padding, original box size as context\n- Softmax loss with class weights and sampling scheme for training\n- Augmentations including horizontal flip, coarse dropout, grid mask, and shift scale rotate\n- Hyperparameter optimization using Optuna and GridSearch\n- Final submission selected through ensembling and post-processing\n\n\n\n#### [3rd place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208787) - Written by [Qishen Ha](https://www.kaggle.com/haqishen)\n\n\n- Used EfficientDet to generate candidate impact bboxes, cropped them into small images, and used a binary image classification model to classify helmet crops through 9 frames\n- Adjusted scores for each bbox using multi-view information in post-processing and dropped similar bboxes through 9 frames in post-processing\n- Trained EfficientDet on 2 classes (helmet and impact) and used all positive frames and 50% of negative frames for training\n- Used binary classification models to further predict if bbox crops are impacts or not, cropping bboxes through 9 frames and turning them into grayscale to get an input shape of (h, w, 9)\n- Tuned thresholds for certain frames depending on predictions in other views in post-processing\n- Designed a function to drop similar bboxes within 9 consecutive frames and kept only the one with the largest confidence\n- Ensemble of 7 EfficientDet models and 18 Binary models achieved local score of 0.64, public LB of 0.66, and private LB of 0.69\n\n\n\n#### [4th place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208947) - Written by [Azat Davletshin](https://www.kaggle.com/davletag)\n\n\n- Used a two-stage approach for helmet detection and ROI classification using a 3D convolutional network\n- Extracted video frames and split data into training and validation sets\n- Trained Faster-RCNN for helmet detection with changes to standard config, including reduced minimum anchor size and single class\n- Used FAIR's SlowFast library to train ROI classifier with two approaches: action detection and action classification\n- Used modifications including increased number of frames with impact, added input channels, and added horizontal flips as TTA\n- Ensemble of action detector and action classification improved final score on private leaderboard\n\n\n\n#### [5th place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209235) - Written by [Ruslan Grimov](https://www.kaggle.com/mrnnnn)\n\n**Data preparation:**\n- Videos were split into 8x224x224x3 fragments\n- Positive examples were chosen as a frame with impact and four frames before and three after it, with patches of size 224x224 created using a grid\n- Negative examples were chosen as random sequences of frames with no impacts\n- Bounding boxes' positions and sizes were saved for each sequence of frames\n**Models:**\n- 3D CNN (I3D from SlowFast) was used with a fourth channel added in input\n- FPN from pytorch_segmentation was appended with six output channels without upsampling\n3d feature maps from second to fifth blocks of the backbone were converted to 2d feature maps and passed to FPN\n- FPN produced a grid resembling yolo output for the fifth frame in the sequence of eight frames, predicting the presence and position of bboxes, bbox size, and impact presence\n**Training:**\n- First stage: training on 224x224 patches with augmentations and different loss functions (HuberLoss, FocalBinaryLoss, nn.BCEWithLogitsLoss) using Adam with multistage decreasing of lr\n- Second stage: training on whole images with frozen backbone and only FPN trained, using the same augmentations and optimizer as first stage\n- Ensemble of four models achieved score of 0.48 on local validation\n**Modifications:**\n- Changed bbox center predictions to circles with diameters equal to average between bbox width and height, fading towards boundaries\n- Trained standalone FPN with resnet34 as backbone on single 224x224 patches to improve helmet center detection\n- Trained 3D CNN on whole images with improved bbox center predictions as ground truth\n- Ensemble of four improved models achieved score of 0.54 on local validation\n\n\n\n#### [6th place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208833) - Written by [FANTASTIC_HIRARIN](https://www.kaggle.com/hiraiitsuki)\n\n\n- Solution consists of two stages: detecting helmets with EfficientDet-d5 and classifying impact with resnet18\n- EfficientDet-d5 trained on 1 class of helmet using frames with and without collisions\n- Inference performed on original and horizontally flipped images, merged using wbf\n- Resnet18 trained on 2 classes of impact/no impact, input is cropped image around helmet and 9 images from 4 frames before and after collision\n- Augmentation includes horizontal flip, brightness/contrast changes, blur/noise, color changes, and image transformations\n- Two resnet18 models trained, 2d conv and 3d conv, with final output as ensemble of respective outputs\n- Post-processing involves ignoring helmet detected in same position within 4 frames and ignoring first and last 10 frames of video\n- Scores: cv for EfficientDet-d5 at 0.926, roc_auc for 2d/3d conv resnet18 at 0.964/0.967, cv for local at 0.53, public score at 0.56, private score at 0.59\n\n\n\n#### [7th place solution](https://www.kaggle.com/c/nfl-impact-detection/discussion/208851) - Written by [Eugene Khvedchenya](https://www.kaggle.com/bloodaxe)\n\n\n- Used three stages: helmet detection, impact classification, and post-processing\n- Data split into four folds to prevent data leak\n- Used four CenterNet models for helmet detection\n- Used one 3D CNN model for impact classification\n- Used DenseNet-based encoders for best Helmet F1 and Impact F1 scores\n- Used albumentations library for augmentations\n- Tried second-level model, EfficientDet, and siamese networks for impact classification\n- 3D CNN classifier on top of 2D helmet predictions gave best results\n- Used IoU and euclidean distance for post-processing to suppress duplicates\n\n\n\n#### [9th place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209012) - Written by [Chris Deotte](https://www.kaggle.com/cdeotte)\n\n\n- The solution involves a two-step pipeline (detection and classification) with post-processing\n- Detection model uses 2D to find possible impact boxes\nClassification model uses 3D to determine which boxes are impacts\n- Detection model is DetectoRS(ResNeXt-101-32x4d) with Helmet Detection Model for warm-up and 2-Class Detection Model using final weights of Helmet Detection Model as pretrained weights\n- Classification model uses 2D models (Resnet-18 & 34, EfficientNet b0-b3) with extended label and post-processing to improve performance\n- 3D models (Resnet-18 & 34, EfficientNet b0-b3) were also developed and used in final solution\n- Final solution involves merging detection and classification models and using ensemble techniques to improve performance\n- Solution achieves top 10% on public leaderboard.\n\n\n#### [10th place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208773) - Written by [NVNN](https://www.kaggle.com/nvnnghia)\n\n- Used a modified version of Centernet for detection model\n- Replaced image-based feature extraction with video-based feature extraction\n- Used multiple Centernet heads to predict helmet for each frame\n- Calculated loss independently between 2 classes and used weighted sum\n- Created own augmentation for video\n- Input was a sequence of 15 consecutive frames\n- Used EfficientB5 for video feature extraction\n- Used IOU-Tracker to link detected impacts from nearby frames\n- Used dynamic confidence threshold, with low threshold in range of frame 30-80 and gradually increasing to end of video\n\n\n\nEnjoy!\n",
      "votes": 30
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "2069413": "\n\nHi, How are you all doing? \n\nThe following are short summaries of the tricks used by the winners of all the previous NFL competitions on Kaggle.\nUse this as a short index to browse the previous solutions.\n\nEnjoy! \n\n\n_____\n\n\n\n\n## [NFL Health & Safety - Helmet Assignment](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment)\n\n#### [1st place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/284975#1878883) - Written by [kmat2019](https://www.kaggle.com/kmat2019)\n\n- The solution consists of a helmet detector, image to map converter, points to points registration, team classifier, tracker, and ensemble\n- The helmet detector is a 2-stage detector that finds helmets bounding boxes in images\n- The image to map converter is a CNN that converts helmet bounding boxes in images to a 2D map\n- The points to points registration uses ICP to match predicted players on the 2D map to the provided tracking data\n- The team classifier is a CNN that predicts the similarity matrix to show if pairs of players belong to the same team\n- The tracker accumulates player assignment results and re-assigns players to bounding boxes using IoU\n- The ensemble uses WBF to average player-assignment matrices from multiple models and choose the final assignment with the Hungarian algorithm\n- The solution uses 4 detectors in the final submission\n- Inference code and an ablation study are available for review\n\n\n#### [2nd place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285112) - Written by [TITO](https://www.kaggle.com/its7171)\n\n- Trained YoloV5 using supplemental photos, but had to upsample from 1280 to 1664 for improved accuracy with small helmets detection\n- Used 2-stage K-means clustering to classify helmets images into teams, achieving 97% accuracy\n- Improved team classification to 98% accuracy using tracking information for post-processing\n- Extracted features such as player orientation and gap between helmet and sensor position for mapping players, using CenterNet\n- Used CV2 to detect lines on the ground for coordinate transformation, including aspect ratio, trapezoid correction, and rotation\n- Assigned players to video using linear assignment problem and selected candidate with smallest minimum distance\n- Tracked players using SORT algorithm, introducing helmet image features as step-function to avoid tracking same person across different teams\n\n\n#### [3rd place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285076) - Written by [FANTASTIC_HIRARIN](https://www.kaggle.com/hiraiitsuki)\n\n- Use Yolov5 to detect helmets\n- Use deepsort to track the helmet\n- Use ICP and Hungarian algorithm to assign helmet boxes to tracking data for each frame\n- Divide helmet into two clusters using k-means based on color\n- Use ICP and Hungarian algorithm to assign helmet boxes to tracking data again taking into account deepsort and helmet color information\n- Use Hungarian algorithm to determine final label\n- Remove False Positive helmet boxes and tracking data not shown in video to adjust position using ICP\n- Divide helmet boxes into two clusters using k-means based on helmet color and features calculated by deepsort\n- Reduce value of cost matrix based on deepsort and helmet color information to assign helmet boxes to tracking data\n- Use Hungarian algorithm to determine final label, taking into account deepsort and helmet color information\n- Output final result with labels for each helmet box\n\n\n#### [4th place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285007) - Written by [Ahmet Erdem](https://www.kaggle.com/aerdem4)\n\n- Replaced baseline helmet model with a trained yolov5 model, trained on extra images and video images\n- Tuned deepsort parameters and updated code to return unconfirmed boxes\n- Implemented custom tracking using helmet similarity score and iou score\n- Created jersey number training data and trained a 2 head model with resnet34 backbone and augmentations\n- Used cluster ensembling to assign labels to helmets clusters\n- Implemented linear regression to map helmet positions to label predictions for unassigned helmets\n- Used greedy minimum distance assignment to assign labels to helmets based on cluster ensembling and linear regression predictions\n\n\n#### [5th place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/285286) - Written by [Kyle Lee](https://www.kaggle.com/kylelee)\n\n- Used YOLOv5 detector with standard augmentation and WBF for TTA\n- Applied Hungarian assignment for label assignment, including sweeping rotations and outlier tracker points\n- Added gravity features for improved label assignment, including digit matching, orientation matching, and direction matching\n- Improved pre-tracking scores with gravity features, but had little effect on post-tracker scores\n- Pipeline slowed down significantly with addition of gravity features\n\n\n#### [9th place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/284940) - Written by [K-NKSM](https://www.kaggle.com/K-NKSM)\n\n- Used YOLO v5 helmet detection to improve performance\n- Used shape context to estimate homography matrix in frame 1\n- Used Hungarian algorithm to match sensor data with bboxes\n- Used iterative closest point algorithm to calculate homography matrix\n- Optimized rotation/scaling factors\n- Used previous homography matrix to estimate current matrix\n- Assigned helmets to player using deepsort and previously obtained homography matrices\n\n\n#### [10th place solution](https://www.kaggle.com/competitions/nfl-health-and-safety-helmet-assignment/discussion/284945) - Written by [NVNN](https://www.kaggle.com/NVNN)\n\n- Used Yolov5 to detect helmets in images\n- Used regression network (EfficientnetB0 encoder with Unet decoder) to match detected helmet with tracking data\n- Achieved CV of 0.7 (0.68 public and 0.7 private) with this approach\n- Postprocessed output with tracking algorithm (Deepsort and SiamRPN) to boost CV to 0.9, public LB 0.85, and private LB 0.86\n- Regression network similar to a normal segmentation network with 2-channel input and output and L1 loss function\n- Real implementation used an extra segmentation channel for better training.\n\n_____\n\n## [NFL 1st and Future - Impact Detection](https://www.kaggle.com/competitions/nfl-impact-detection)\n\n#### [1st place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209403) - Written by [Dmytro Poplavskiy](https://www.kaggle.com/dmytropoplavskiy)\n\n- Approach used 2d detection, tracking, 3d classification, and post-processing to suppress false positives\n- Detection used YoloV5-l trained on 10k images or EfficientDet detector trained on video frames\n- Helmets tracked using optical flow between surrounding frames with OpenCV or RAFT\n- 2.5D classification used 16x3x128x128 crops and corrected for linear helmet movement between frames\n- Classification models used Temporal Shift Module or MotionSqueeze\n- Trained models used 4 folds CV and averaged predictions from all folds\n- Post-processing selected highest impact confidence and suppressed detections for same player over surrounding frames\n- Classification model also predicted impact type and suppressed predicted same types within 3-10 frames\n\n\n\n#### [2nd place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209403) - Written by [FERGUSOCI](https://www.kaggle.com/fergusoci)\n\n\n- Two stage approach for helmet and impact detection\n- Stage 1: YOLOv5 model for helmet detection\n- Stage 2: Ensemble of 3D CNN models using cropped helmet locations and surrounding frames for impact prediction\n- Post-processing applied to Stage 2 predictions\n- Validation strategy using GroupKfold split\n- Pipeline using Github, Neptune, Kaggle API, AWS, and Push Kaggle dataset action\n- Stage 2 ensemble includes 6 efficientnets with horizontal flip TTA and 3D Resnext50/101 (not used in final submission)\n- Stage 1 training: YOLOv5 on full data without validation set, TTA flag and img-size of 1280 for inference\n- Stage 2 input data: 9 helmet detections with padding, original box size as context\n- Softmax loss with class weights and sampling scheme for training\n- Augmentations including horizontal flip, coarse dropout, grid mask, and shift scale rotate\n- Hyperparameter optimization using Optuna and GridSearch\n- Final submission selected through ensembling and post-processing\n\n\n\n#### [3rd place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208787) - Written by [Qishen Ha](https://www.kaggle.com/haqishen)\n\n\n- Used EfficientDet to generate candidate impact bboxes, cropped them into small images, and used a binary image classification model to classify helmet crops through 9 frames\n- Adjusted scores for each bbox using multi-view information in post-processing and dropped similar bboxes through 9 frames in post-processing\n- Trained EfficientDet on 2 classes (helmet and impact) and used all positive frames and 50% of negative frames for training\n- Used binary classification models to further predict if bbox crops are impacts or not, cropping bboxes through 9 frames and turning them into grayscale to get an input shape of (h, w, 9)\n- Tuned thresholds for certain frames depending on predictions in other views in post-processing\n- Designed a function to drop similar bboxes within 9 consecutive frames and kept only the one with the largest confidence\n- Ensemble of 7 EfficientDet models and 18 Binary models achieved local score of 0.64, public LB of 0.66, and private LB of 0.69\n\n\n\n#### [4th place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208947) - Written by [Azat Davletshin](https://www.kaggle.com/davletag)\n\n\n- Used a two-stage approach for helmet detection and ROI classification using a 3D convolutional network\n- Extracted video frames and split data into training and validation sets\n- Trained Faster-RCNN for helmet detection with changes to standard config, including reduced minimum anchor size and single class\n- Used FAIR's SlowFast library to train ROI classifier with two approaches: action detection and action classification\n- Used modifications including increased number of frames with impact, added input channels, and added horizontal flips as TTA\n- Ensemble of action detector and action classification improved final score on private leaderboard\n\n\n\n#### [5th place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209235) - Written by [Ruslan Grimov](https://www.kaggle.com/mrnnnn)\n\n**Data preparation:**\n- Videos were split into 8x224x224x3 fragments\n- Positive examples were chosen as a frame with impact and four frames before and three after it, with patches of size 224x224 created using a grid\n- Negative examples were chosen as random sequences of frames with no impacts\n- Bounding boxes' positions and sizes were saved for each sequence of frames\n**Models:**\n- 3D CNN (I3D from SlowFast) was used with a fourth channel added in input\n- FPN from pytorch_segmentation was appended with six output channels without upsampling\n3d feature maps from second to fifth blocks of the backbone were converted to 2d feature maps and passed to FPN\n- FPN produced a grid resembling yolo output for the fifth frame in the sequence of eight frames, predicting the presence and position of bboxes, bbox size, and impact presence\n**Training:**\n- First stage: training on 224x224 patches with augmentations and different loss functions (HuberLoss, FocalBinaryLoss, nn.BCEWithLogitsLoss) using Adam with multistage decreasing of lr\n- Second stage: training on whole images with frozen backbone and only FPN trained, using the same augmentations and optimizer as first stage\n- Ensemble of four models achieved score of 0.48 on local validation\n**Modifications:**\n- Changed bbox center predictions to circles with diameters equal to average between bbox width and height, fading towards boundaries\n- Trained standalone FPN with resnet34 as backbone on single 224x224 patches to improve helmet center detection\n- Trained 3D CNN on whole images with improved bbox center predictions as ground truth\n- Ensemble of four improved models achieved score of 0.54 on local validation\n\n\n\n#### [6th place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208833) - Written by [FANTASTIC_HIRARIN](https://www.kaggle.com/hiraiitsuki)\n\n\n- Solution consists of two stages: detecting helmets with EfficientDet-d5 and classifying impact with resnet18\n- EfficientDet-d5 trained on 1 class of helmet using frames with and without collisions\n- Inference performed on original and horizontally flipped images, merged using wbf\n- Resnet18 trained on 2 classes of impact/no impact, input is cropped image around helmet and 9 images from 4 frames before and after collision\n- Augmentation includes horizontal flip, brightness/contrast changes, blur/noise, color changes, and image transformations\n- Two resnet18 models trained, 2d conv and 3d conv, with final output as ensemble of respective outputs\n- Post-processing involves ignoring helmet detected in same position within 4 frames and ignoring first and last 10 frames of video\n- Scores: cv for EfficientDet-d5 at 0.926, roc_auc for 2d/3d conv resnet18 at 0.964/0.967, cv for local at 0.53, public score at 0.56, private score at 0.59\n\n\n\n#### [7th place solution](https://www.kaggle.com/c/nfl-impact-detection/discussion/208851) - Written by [Eugene Khvedchenya](https://www.kaggle.com/bloodaxe)\n\n\n- Used three stages: helmet detection, impact classification, and post-processing\n- Data split into four folds to prevent data leak\n- Used four CenterNet models for helmet detection\n- Used one 3D CNN model for impact classification\n- Used DenseNet-based encoders for best Helmet F1 and Impact F1 scores\n- Used albumentations library for augmentations\n- Tried second-level model, EfficientDet, and siamese networks for impact classification\n- 3D CNN classifier on top of 2D helmet predictions gave best results\n- Used IoU and euclidean distance for post-processing to suppress duplicates\n\n\n\n#### [9th place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/209012) - Written by [Chris Deotte](https://www.kaggle.com/cdeotte)\n\n\n- The solution involves a two-step pipeline (detection and classification) with post-processing\n- Detection model uses 2D to find possible impact boxes\nClassification model uses 3D to determine which boxes are impacts\n- Detection model is DetectoRS(ResNeXt-101-32x4d) with Helmet Detection Model for warm-up and 2-Class Detection Model using final weights of Helmet Detection Model as pretrained weights\n- Classification model uses 2D models (Resnet-18 & 34, EfficientNet b0-b3) with extended label and post-processing to improve performance\n- 3D models (Resnet-18 & 34, EfficientNet b0-b3) were also developed and used in final solution\n- Final solution involves merging detection and classification models and using ensemble techniques to improve performance\n- Solution achieves top 10% on public leaderboard.\n\n\n#### [10th place solution](https://www.kaggle.com/competitions/nfl-impact-detection/discussion/208773) - Written by [NVNN](https://www.kaggle.com/nvnnghia)\n\n- Used a modified version of Centernet for detection model\n- Replaced image-based feature extraction with video-based feature extraction\n- Used multiple Centernet heads to predict helmet for each frame\n- Calculated loss independently between 2 classes and used weighted sum\n- Created own augmentation for video\n- Input was a sequence of 15 consecutive frames\n- Used EfficientB5 for video feature extraction\n- Used IOU-Tracker to link detected impacts from nearby frames\n- Used dynamic confidence threshold, with low threshold in range of frame 30-80 and gradually increasing to end of video\n\n\n\nEnjoy!\n"
  }
}