Back to Blog

How I Used AI to Rebuild My Shoulder

David O'Regan David O'Regan
7 min read
Physical therapy session

Six months ago, I suffered a significant shoulder injury that threatened to disrupt both my career as an engineering manager and my active lifestyle. As someone deeply immersed in AI technology through my work on GitHub Copilot, I naturally turned to machine learning solutions to support my rehabilitation journey. This post details how I leveraged various AI tools to optimize my recovery process, track progress, and ultimately rebuild my shoulder faster than expected.

The Injury and Traditional Approach

My injury was a Type II SLAP tear—a labrum injury commonly seen in overhead athletes and active individuals. After consulting with orthopedic specialists, I opted for a conservative non-surgical approach focusing on physical therapy.

The traditional rehabilitation plan included:

While this protocol has proven effective for many patients, the process is often marked by plateaus, unclear progress metrics, and difficulty maintaining optimal form without supervision. This is where I saw an opportunity to enhance my recovery with AI-powered tools.

Computer Vision for Exercise Form Analysis

One of the biggest challenges in home rehabilitation is maintaining proper form during exercises. Poor technique can slow recovery or even cause additional injuries.

I implemented a custom solution using:

  1. MediaPipe’s pose estimation model - An open-source framework that accurately detects 33 body landmarks in real-time
  2. Custom Python scripts - To analyze joint angles and movement patterns specific to my exercises
  3. Real-time feedback system - Audio cues when my form deviated from proper technique

The setup was simple but effective: a laptop with a webcam positioned to capture my exercises, running locally-deployed computer vision models that could:

This system essentially brought “physical therapist eyes” into my home practice, ensuring each repetition contributed positively to my recovery.

Personalized Exercise Prescription with Machine Learning

Traditional PT often follows somewhat generic protocols. While my therapist provided excellent care, I wanted to optimize my exercise selection based on my specific response patterns.

Working with a developer friend who specializes in health applications, we created a system that:

  1. Tracked 15+ metrics for each exercise (pain levels, range of motion, perceived effort, etc.)
  2. Applied reinforcement learning algorithms to suggest optimal exercise sequences
  3. Predicted potential plateaus before they occurred to adjust training volume

This approach allowed me to create increasingly personalized training sessions that evolved with my recovery. The system learned which exercises yielded the best improvements for my specific injury pattern and adjusted recommendations accordingly.

# Simplified example of our reinforcement learning approach
# (Not the complete implementation)

class ShoulderRehabEnvironment(gym.Env):
    def __init__(self, patient_data):
        self.patient_data = patient_data
        self.current_state = self._get_current_metrics()
        self.exercise_space = spaces.Discrete(len(AVAILABLE_EXERCISES))
        self.observation_space = spaces.Box(low=0, high=10, shape=(15,))
        
    def step(self, exercise_idx):
        # Execute exercise and measure response
        exercise = AVAILABLE_EXERCISES[exercise_idx]
        new_metrics = self._perform_and_measure(exercise)
        
        # Calculate reward based on improvement
        reward = self._calculate_improvement(self.current_state, new_metrics)
        
        # Update state
        self.current_state = new_metrics
        
        # Check if we've reached end of session
        done = self._is_session_complete()
        
        return self.current_state, reward, done, {}

# Agent learns optimal exercise sequence for my specific recovery pattern

The results were remarkable: my physical therapist noted that I was progressing roughly 30% faster than the typical patient with a similar injury.

Wearable Technology for 24/7 Monitoring

Understanding that recovery doesn’t just happen during exercise sessions, I leveraged wearable technology to monitor shoulder activity throughout the day:

  1. IMU sensors - Small inertial measurement units that tracked range of motion and movement patterns
  2. Custom-designed shoulder wrap - With embedded sensors that measured muscle activation
  3. Sleep monitoring - To track nighttime positions that might aggravate the injury

The data collected allowed me to:

Perhaps most valuable was identifying that I was unconsciously maintaining a protective posture even when my shoulder wasn’t at risk, which was actually limiting my range of motion improvement.

Natural Language Processing for Research Insights

The field of shoulder rehabilitation is constantly evolving with new research. To stay current on the most effective approaches, I built a specialized NLP tool that:

  1. Scanned recently published medical literature on SLAP tear rehabilitation
  2. Extracted evidence-based protocols and success factors
  3. Compared conventional approaches with emerging techniques
  4. Generated weekly research summaries tailored to my specific injury

This system identified several newer protocols that my physical therapist wasn’t familiar with yet, including specific eccentric loading patterns that had shown promise in recent studies.

After discussing these findings with my healthcare team, we incorporated several of these techniques, which seemed to accelerate my progress through particularly difficult phases of rehabilitation.

The Results: Data-Driven Recovery

Six months into what was projected as a 9-12 month recovery journey:

The physical therapist has attributed my accelerated recovery to:

Lessons for AI-Augmented Rehabilitation

While my approach leveraged my background in technology, the core principles could benefit anyone recovering from a similar injury:

  1. Data collection is powerful - Even simple tracking of pain, motion, and exercise completion can reveal patterns
  2. Visual feedback improves form - Using even basic phone apps for movement analysis can significantly improve technique
  3. Personalization matters - Recovery isn’t one-size-fits-all; finding what works for your specific body is crucial
  4. Technology can bridge gaps - Between physical therapy sessions when you’re on your own
  5. Share insights with healthcare providers - My PT was interested in the data and adjusted treatments accordingly

What’s Next: Contributing to the Field

Inspired by this experience, I’m currently working with a team to develop a more accessible version of my shoulder rehabilitation system. We’re creating:

Our goal is to democratize some of these techniques to help others achieve similar results without requiring a background in AI or programming.

Conclusion

My shoulder injury, while challenging, became an unexpected opportunity to apply AI concepts from my professional life to a personal health journey. The combination of computer vision, machine learning, wearable technology, and natural language processing created a rehabilitation experience that was highly optimized, measurable, and ultimately more successful than I had anticipated.

For those facing similar injuries, consider how even simple applications of these technologies might enhance your recovery process. And for my fellow technologists, this experience reinforced my belief that some of our most meaningful innovations come from applying our skills to our own personal challenges.

Have you used technology in innovative ways to address health challenges? I’d love to hear about your experiences in the comments.

David O'Regan

About the Author

David O'Regan is a Senior Engineering Manager at GitHub, leading teams responsible for GitHub Copilot. With a background in frontend engineering and AI, David is passionate about the intersection of artificial intelligence and developer tooling.

Related Articles

GitHub Notifications Survival Guide: The Ultimate Cheatsheet

GitHub Notifications Survival Guide: The Ultimate Cheatsheet

Help! I’m Drowning in GitHub Notifications! 🏊‍♂️

Read more
Building an AI Navigator for GitHub's The Hub Documentation

Building an AI Navigator for GitHub's The Hub Documentation

The Challenge of Internal Documentation

Read more