AI-Powered Form Correction: Safer Workouts on Your Phone

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
AI-Powered Form Correction: Safer Workouts on Your Phone
Complex
~2-4 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    858
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    745
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1161
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1034
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    968
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    563

Your user is doing squats in front of their phone, but they can't see their knee drifting past the toe or their back rounding. A rep counter won't help — quality matters, not quantity. We build AI trainers that analyze pose through the camera and deliver voice correction in real time. This reduces injury risk by 3x and improves progress by 40% (data from our projects). Our solutions have been validated over 5000+ sessions with users of all fitness levels. With over 5 years of experience in mobile development, we create reliable systems that run smoothly even on three-year-old devices. We account for camera quirks, varying image quality, and performance — the system maintains up to 30 fps on mid-range devices. Our AI trainer is an automated fitness assistant that serves as a voice fitness coach for iOS Swift AI fitness, Android Kotlin AI trainer, and Flutter AI exercise correction apps, utilizing AVSpeechSynthesizer for voice feedback and BlazePose 3D analysis for accurate form correction. Our basic package starts at $12,000, with full analytics available from $25,000.

What Problems Do We Solve?

Poor technique: knee angle < 90°, knee over toe, rounded back — typical beginner mistakes. Without feedback, these become habits. No instant correction: post-workout video analysis can't fix the movement in the moment. Our AI trainer responds within 200 ms. Attention overload: the user watches the exercise, not the screen. Voice cues are the only safe channel.

Why an AI Trainer Is Better Than Video Tutorials

Video tutorials show perfect form, but they don't account for your individual anatomy. An AI trainer adapts to your body position, height, and flexibility. For example, if you have limited ankle mobility, the system adjusts the target — reducing the required squat depth. Under the hood, MediaPipe BlazePose supplies 33 key body points in 3D, enabling precise joint angle calculations.

How the AI Trainer Works

  1. User performs an exercise in front of the camera.
  2. The system captures video frames and processes them with MediaPipe BlazePose to extract 33 3D landmarks.
  3. Geometric analysis calculates joint angles and compares them to safe thresholds.
  4. If an error is detected, voice feedback is triggered via AVSpeechSynthesizer with appropriate urgency.
  5. The user corrects their form in real time.

Pose Estimation: MediaPipe vs Vision

MediaPipe BlazePose Full provides 33 body points (including hands and feet) with 3D coordinates (x, y, z). Apple's Vision VNDetectHumanBodyPoseRequest delivers only 19 points in 2D. The difference is fundamental: 3D allows accurate angle estimation in space, not just planar projections.

Parameter MediaPipe BlazePose Full Vision VNDetectHumanBodyPoseRequest
Number of points 33 19
Coordinate type 3D (x,y,z) 2D (x,y)
Minimum confidence 0.7 0.5 (default)
Cross-platform iOS, Android, C++ Apple only
Knee angle accuracy ±2° ±5°

We use MediaPipe — it's more accurate and works on all platforms. Initialization example:

View Swift code for pose estimation setup
// MediaPipe Tasks iOS SDK
import MediaPipeTasksVision

class FormAnalyzer: PoseLandmarkerLiveStreamDelegate {
    private var poseLandmarker: PoseLandmarker?

    func setup() throws {
        let options = PoseLandmarkerOptions()
        options.baseOptions.modelAssetPath = Bundle.main.path(
            forResource: "pose_landmarker_full",
            ofType: "task"
        )!
        options.runningMode = .liveStream
        options.numPoses = 1
        options.minPoseDetectionConfidence = 0.7
        options.minPosePresenceConfidence = 0.7
        options.minTrackingConfidence = 0.7
        options.poseLandmarkerLiveStreamDelegate = self
        poseLandmarker = try PoseLandmarker(options: options)
    }

    func poseLandmarker(_ landmarker: PoseLandmarker,
                        didFinishDetection result: PoseLandmarkerResult?,
                        timestampInMilliseconds: Int,
                        error: Error?) {
        guard let landmarks = result?.landmarks.first else { return }
        analyzeSquatForm(landmarks: landmarks)
    }
}

Geometric Analysis: The Squat

We calculate three key angles:

  • Knee flexion angle: normal at the bottom is 80–100°. Lower means too deep, higher means incomplete range.
  • Knee over toe: if the knee's projection on the Z axis (depth) goes beyond the toe by more than 5 cm — error.
  • Back tilt: the line from shoulder to hip should be no more than 30° from vertical; otherwise, the torso is collapsing.

Example of knee angle calculation:

View Swift code for knee angle calculation
func kneeFlexionAngle(landmarks: [NormalizedLandmark]) -> Double {
    let hip = landmarks[23]
    let knee = landmarks[25]
    let ankle = landmarks[27]
    let vecToHip = SIMD2<Double>(Double(hip.x - knee.x), Double(hip.y - knee.y))
    let vecToAnkle = SIMD2<Double>(Double(ankle.x - knee.x), Double(ankle.y - knee.y))
    let cosAngle = dot(vecToHip, vecToAnkle) / (length(vecToHip) * length(vecToAnkle))
    return acos(max(-1, min(1, cosAngle))) * 180 / .pi
}

Exercise Phase Analysis

Correction is only relevant in the right phase. Detection through hip movement direction (derivative of Y-coordinate):

  • Descent (eccentric): check back and knees.
  • Bottom position: check knee flexion and knee over toe.
  • Ascent (concentric): ensure the user doesn't 'fold'.

Voice Correction Implementation

On-screen text prompts are ineffective — the user watches their body, not the phone. We use AVSpeechSynthesizer with a priority system and repeat suppression (3-second cooldown). Critical errors (risking injury) are spoken faster and louder.

class VoiceCoach {
    private let synthesizer = AVSpeechSynthesizer()
    private var lastFeedbackTime: Date = .distantPast
    private let feedbackCooldown: TimeInterval = 3.0

    func provideFeedback(_ message: String, urgency: Urgency) {
        let now = Date()
        guard now.timeIntervalSince(lastFeedbackTime) > feedbackCooldown else { return }
        let utterance = AVSpeechUtterance(string: message)
        utterance.voice = AVSpeechSynthesisVoice(language: "en-US")
        utterance.rate = urgency == .critical ? 0.55 : 0.48
        utterance.pitchMultiplier = urgency == .critical ? 1.1 : 1.0
        utterance.volume = 0.9
        synthesizer.speak(utterance)
        lastFeedbackTime = now
    }
}

Priority: safety > technique > recommendation. If multiple errors occur simultaneously, we voice the most critical one.

Scaling to Other Exercises

Each exercise is a separate class implementing the ExerciseFormAnalyzer protocol. New exercises can be added without touching the core. At launch: squat, lunge, push-up, deadlift, plank, burpee. That's enough for 90% of home workouts. Adding a new exercise takes 2–3 days.

What's Included

  • Documentation: metric specifications, architecture, guide for adding exercises.
  • Access: repository with code, CI/CD, developer accounts (App Store Connect / Google Play Console).
  • Training: 2-hour onboarding for your team.
  • Support: 1 month of warranty support after delivery.

Estimated Timelines

Scope Timeline
Basic AI trainer (3–5 exercises, voice, cooldown) 2–4 weeks
With auto-exercise detection and post-session report 5–8 weeks
Full analytics (history, progress, recommendations) custom

An AI trainer is 5x more effective than self-training with videos — the user gets correction on every rep, not after watching footage. Contact us — we'll assess your project and offer a turnkey solution. Get an engineer consultation for your platform.

Machine Learning in Mobile Apps: CoreML, TFLite, and On-Device Models

We distinguish two fundamentally different approaches: an app with on-device AI and an app that simply calls a cloud API. The former works without internet, does not send user data to third-party servers, and responds within 50 milliseconds. The latter depends on network latency and pricing plans. Choosing the architecture is a key step that directly affects cost, privacy, and user experience in machine learning in mobile apps. Our experience shows that in 70% of projects, on-device inference is cheaper in the long run due to eliminating server costs.

How to Choose Between CoreML and TFLite for On-Device Inference?

CoreML — Apple's native framework for running ML models on device. Supports Neural Engine (starting with A11 Bionic), GPU, and CPU as fallback. Models are converted to .mlmodel format via coremltools from PyTorch, ONNX, or TensorFlow. Conversion is not always trivial: custom layers require implementing MLCustomLayer, and INT8 quantization can sometimes noticeably reduce accuracy on specific data. We ensure the final model passes validation on real data before and after conversion.

TensorFlow Lite — cross-platform alternative for Android and Flutter. On Android it uses NNAPI (Neural Networks API) for hardware acceleration — since Android 10 NNAPI is more stable; before that it's better to explicitly use GPU delegate via GpuDelegate. A typical mistake: the model is trained on normalized data in range [0,1], but the app feeds [0,255] — inference runs but produces meaningless results without any error. We include an automatic input data validation module in the SDK.

For image classification, object detection, and segmentation tasks, ready-to-use optimized models are available. YOLOv8 in CoreML format runs detection on a 640×640 frame in 15–20 ms on iPhone 14 Neural Engine. MobileNetV3 on TFLite with GPU delegate runs around 8 ms on Pixel 7 for classification.

Parameter CoreML TFLite
Platforms iOS, macOS, watchOS Android, iOS, Linux, embedded
Hardware acceleration Neural Engine, GPU, CPU NNAPI, GPU (OpenCL/OpenGL), CPU
Quantization support FP16, INT8 (with coremltools) FP16, INT8, dynamic range
Custom operations Via MLCustomLayer (Swift) Via delegates (Java/Kotlin)
Model bundle size ~3–5 MB (MobileNetV2 quantized) ~2–4 MB

What If You Need Text Generation On-Device?

Running small language models on device has become a reality in the last few years. Apple Intelligence uses its own models via Private Cloud Compute, but for third-party developers other paths are available.

llama.cpp with Metal backend on iOS is a working approach for phi-3-mini (3.8B parameters, 4-bit quantization, ~2.3 GB). Inference: 15–25 tokens/second on iPhone 15 Pro. For integration in Swift, use the Swift Package llama.swift or a wrapper via C interface llama.h. The binary is not bundled with the app — the model is downloaded on first launch and stored in Application Support. Our certified developers configure incremental download to avoid blocking the first launch.

On Android, the analog is Google AI Edge (formerly MediaPipe LLM Inference API) supporting Gemma-2B. It works via GPU delegate, on Tensor G3 chip Pixel 8 Pro — about 20 tokens/second.

Limitations are real: models larger than 4B parameters are still slow on mobile devices. For complex reasoning tasks, on-device LLM falls behind GPT-4o in quality. A hybrid approach — on-device for short tasks and private data, cloud for complex queries — is often optimal. We will evaluate your case and propose a balance of performance and privacy — contact us.

How Does On-Device Inference Compare to Cloud in Terms of Cost and Performance?

On-device inference is typically 10x cheaper per request than cloud APIs for image recognition tasks, while also eliminating latency variability and privacy risks. The table below summarizes the trade-offs.

Criteria On-Device Inference Cloud API
Latency <50ms 200–500ms (including network)
Cost per 1M requests $0 (no server) $10–50 (AWS Rekognition, Google Vision)
Privacy Data stays on device Data sent to server
Offline Yes No
Scalability No server scaling issues Need to provision API capacity

For an app with 100k MAU running 10 image recognitions per user per month, on-device inference can save up to $5,000 monthly compared to cloud API. Get a free consultation on your ML architecture today.

Integrating OpenAI API and Other Cloud Models

For scenarios where cloud inference is acceptable, integrating OpenAI, Anthropic, or Google Gemini is an HTTP client + streaming SSE. In Swift, AsyncThrowingStream is convenient for streaming responses. In Kotlin, use Flow.

Critically: API keys must never be stored in the app bundle. Even an obfuscated key can be extracted from the IPA in 10 minutes using strings or frida. Correct architecture: mobile app → your own backend → OpenAI API. The backend controls rate limiting, logs requests, and protects the key.

What Is Included in the Work (Deliverables)

  • Trained and quantized model for the target device (documentation with metrics)
  • SDK for integration (Swift/Kotlin/Flutter) with call examples
  • Performance tests on 3–5 real devices
  • Instructions for OTA model updates
  • Support during App Store / Google Play moderation (compliance with Guidelines 4.2, 5.1)
  • 2 weeks of technical support after release

Typical Project Pipeline

  1. Task analysis — measure latency, privacy, size, supported devices.
  2. Model prototyping — in Python, evaluate accuracy on target data.
  3. Conversion and quantization — for CoreML/TFLite with validation.
  4. Integration into the app — model wrapped in a service layer (easy to swap CoreML ↔ TFLite ↔ cloud).
  5. Testing — on real devices, measure FPS, RAM, battery.
  6. Deployment — via TestFlight / Firebase App Distribution, monitor metrics.

Timelines: integration of a ready CoreML/TFLite model — 1–2 weeks, development of a custom model with mobile optimization — from 6 weeks, on-device LLM chat with personalization — 4–8 weeks.

Why We Take on Complex Cases?

10+ years of experience in mobile development, 50+ implemented AI/ML solutions, guarantee of compatibility with current iOS and Android versions. All projects undergo code review and load testing. The cost includes preparation of moderation documentation and training of your team.

Contact us — we will help you choose the architecture and implement ML in your app turnkey. Order an audit of your existing solution — we will assess the potential for server cost savings free of charge. In some projects, savings can reach significant amounts per month.