BJJ Drills Helper

by Kate57 in Circuits > Raspberry Pi

17 Views, 1 Favorites, 0 Comments

BJJ Drills Helper

main_cover.jpg

Hello everyone!

This project is for anyone who wants to get better at the foundations of Brazilian Jiu-Jitsu—beginners, solo-drillers, or anyone stuck practicing at home with only a yoga mat and dreams of greatness.

The BJJ Tutorials Helper lets you practice single-person BJJ drills (like the technical standup, shin rock, and S-turn) and gives you a real, objective score for each rep. Why? Because when you’re one of twenty students in a group warmup, nobody’s got time to check if you’re actually doing your drills right—unless you’re spectacularly wrong!

BJJ drills are short, standardized warmup movements—think technical standup, hip escapes, etc.—and are done at speed, on both sides. They build muscle memory, reflexes, and good habits you’ll use in actual sparring

That’s why I focused on drills you can do alone, with no fancy equipment. Practicing the “pattern” (angles, timing, control) is what builds real skill, and this system is designed to see that pattern, not just pose at a static position.

Drills = basics. Basics = everything.

P.S. This project is part of Project One for the Creative Tech & AI course at Howest University.

Supplies

You can run the whole project on just a laptop and a webcam. However, since “maker skill” was a requirement for the course, I built a full electronics enclosure, keeping the total cost around 251 euro (it’s actually cheaper if you reuse some component). Check the BOM for details!

Main parts:

  1. 1x Logitech C270 (or similar USB webcam)
  2. 1x Raspberry Pi (or a regular laptop)
  3. 1x Multiplex 4mm plywood (for the box, laser cut)
  4. 1x RGB LED module (status indicator)
  5. 1x Push button (drill selection/start/stop)
  6. 1x LCD display (to show feedback and scores)
  7. 1x Tripod (for webcam positioning)
  8. 1x GPIO expansion board
  9. Jumper wires, breadboard or soldering tools
  10. Silver tape, double-sided tape (handy, but not counted in cost)

Pro tip: Always leave space for cables and ports in your design, and keep extra tape around for quick fixes!

Collecting & Annotating the Data

key_points.jpg
annotation_example.jpg
Capture d'écran 2025-06-20 075818.png

For annotation, I used the free version of Roboflow. Since the AI part that is trained on my own data is simplified to a binary classifier running on top of the output of another "ready model" (MediaPipe, specifically BlazePose), a simple image classification pipeline can be adopted.

The annotation process started with filming lots of different videos: some were focused on specific drills (which naturally provide plenty of starting position frames), and others captured random movements as negative examples.

First, I labelled all images with two classes: “starting position” and “other.” This clear distinction set up the problem as binary classification right from the start.

Once labelling was complete, I exported the annotated images and their class labels from Roboflow. Next, I passed these images through MediaPipe to extract pose key points. However, for my task, I only needed a subset of key points—specifically those involved in angle calculations. This allowed me to reduce the 33 default key points down to just 14, focusing on the essential joints for each movement.

When labelling, I prioritized leg-related key points over arm ones—partly personal preference, partly to reduce noise. For all key points involved in angle calculations, I required a high level of visibility; if even one was missing, I filtered that annotation out, which shrank the dataset quite a bit.

The resulting data is naturally unbalanced, but I tried to include enough “edge cases”—for example, frames where the starting position is just beginning to transition into movement—so the model would handle real-life variety.

Finally, I calculated joint angles from the selected key points for each frame and compiled these into a CSV file. This angles-based CSV became the dataset for training my binary classifier.

Coding and Training the Model

Capture d'écran 2025-06-20 075917.png
Capture d'écran 2025-06-20 022640.png
Capture d'écran 2025-06-20 022717.png
model_matrix.png

What’s happening under the hood?

Pose Detection: Every frame is run through MediaPipe Pose, which detects 33 landmarks on the body.

Filtering: Only frames with all necessary key points (for angle calculation) are kept; others are discarded.

Angles, not raw key points: Instead of feeding raw positions, I calculate joint angles in 3D (elbows, knees, hips, etc). Why? Because the “pattern” of movement matters more than your exact body shape or camera angle.

Derivatives of angles: To judge not just where you are but how you’re moving, I analyse the rate of angle change (so the system focuses on “doing the thing right”—form and coordination).

Dynamic Time Warping (DTW): People move at different speeds. DTW lets me compare your drill to a tutorial example—even if you’re a bit slower or faster—by aligning the sequences.

Classification Model: The main AI model is a binary classifier (Random Forest, with SMOTE to handle class imbalance), trained to spot when you’re in the correct starting position. For this first version, I picked three drills with the same starting position (for simplicity), but you can expand to more in the future!

Typical pipeline:

  1. User selects a drill from the menu.
  2. Live camera feed starts; data collection begins when you press the button (LED turns yellow).
  3. Stand in the reference starting position. When detected, LED turns green, and reps are counted/synced with tutorial video.
  4. Finish the drill, press the button again, and check your score on the display (max 100%!).

Interested in details? - Check out BDH GitHub!

Maker Part: Things Get Physical!

20250619_152112.jpg
20250619_152016.jpg
20250619_151736.jpg

Maker Part: Design & Assembly

  1. The box holds all electronics (LED, button, LCD) and hides the cable mess.
  2. Make sure to leave space for folding cables and all supply/USB ports. Add 0.2mm “margin” to all holes you design for LEDs, buttons, and especially the LCD—trust me, it saves frustration later. For the button, +0.1mm is enough.
  3. I used 4mm multiplex plywood and laser cutting, then smoothed and glued the details. The top stays openable for easy access.
  4. The Raspberry Pi isn’t glued down—it sits on four screw holes so you can mount/dismount its case as needed.

Electronics: Tips & Lessons Learned

  1. To save space (and nerves), I used a T-shaped GPIO extension for the Pi, soldering wires for the LED, LCD, and button directly to it.
  2. This was honestly the scariest part for me—I’d never soldered before. I fried one GPIO expansion board (RIP, clock line) and nearly lost a pin on the next, but with help, I managed to salvage things and rewire the button.
  3. Don’t stress if you’re not a hardware expert—just go slow, double-check each connection, and ask for help if you get stuck.

Master the Drills!

testing_model.jpg
working_assembly.jpg

This system won’t make you a world champion overnight, but it will help you drill the basics right, every single time.