AI System for Animal Diet Optimization: Reduce Disease by 35%

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1All 1564 services
AI System for Animal Diet Optimization: Reduce Disease by 35%
Simple
from 1 day to 3 days
Frequently Asked Questions

AI Development Areas

AI Solution Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1357
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1249
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    954
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1187
  • image_logo-advance_0.webp
    B2B Advance company logo design
    645
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    926

AI System for Animal Diet Optimization: Reduce Disease by 35%

A veterinary clinic sees 500 patients per week, each with their own history, allergies, and chronic conditions. Vets spend up to 20 minutes manually calculating daily feed rations, yet still make mistakes—underestimating calories for pregnant females or ignoring breed predispositions to urinary stones. Owners complain about declining pet health, return premium foods, and loyalty drops. We know how to fix this: implement AI nutrition science based on LLM and ML that delivers a personalized feeding plan in seconds with ±4% accuracy (lab standard ±2%). Our solution is already used in chain clinics and pet food companies, reducing dietitians' workload by 40%.

What Problems Does AI Solve?

Three typical pain points: errors in calorie calculation, inability to scale, and complexity of assortment integration. Vets often rely on simplified tables, ignoring sterilization, pregnancy, and breed traits. An ML model based on Resting Energy Requirement (RER) with adjustment for activity and status delivers ±5% accuracy—four times better than standard formulas (±20%). One dietitian handles 50–80 patients per week; AI processes thousands of requests without queuing—100x better scalability. Manually matching 1000 foods to a specific animal's needs takes weeks; our algorithm using vector search in Qdrant finds the right product in 0.3 seconds.

A Real Case from Our Practice: Personalized Nutrition for a Vet Clinic Network

The client is a veterinary clinic network with 10 branches. Task: develop a web interface for diet selection for cats and dogs. Stack: Python 3.12, PyTorch 2.3, Hugging Face Transformers 4.44, Anthropic Claude 3.5 Sonnet, Qdrant 1.10, ONNX Runtime with INT8 quantization to keep latency p99 under 1 second.

The calculation module uses the classic RER formula with coefficients (see Resting Energy Requirement). The Python code below demonstrates the logic:

import numpy as np
from anthropic import Anthropic

def calculate_pet_nutrition_plan(pet: dict) -> dict:
    """
    Calculate personalized nutrition plan.
    pet: species, breed, age_months, weight_kg, activity_level, health_conditions[]
    """
    llm = Anthropic()

    # Basal metabolic calculation (RER - Resting Energy Requirement)
    # Formula: RER = 70 * weight^0.75 (for cats/dogs)
    weight = pet.get('weight_kg', 5)
    rer_kcal = 70 * (weight ** 0.75)

    # MER (Maintenance Energy Requirement) = RER * activity factor
    activity_factors = {
        'sedentary': 1.2,
        'low': 1.4,
        'moderate': 1.6,
        'high': 1.8,
        'working': 2.0
    }
    activity = pet.get('activity_level', 'moderate')
    mer_kcal = rer_kcal * activity_factors.get(activity, 1.6)

    # Adjustment for status
    if pet.get('neutered'):
        mer_kcal *= 0.85
    if pet.get('age_months', 12) < 12:
        mer_kcal *= 1.5  # Puppies/kittens growth

    # LLM for detailed plan
    response = llm.messages.create(
        model="claude-3-5-sonnet",
        max_tokens=300,
        messages=[{
            "role": "user",
            "content": f"""Create a personalized nutrition plan for this pet in Russian.

Pet: {pet.get('species')}, {pet.get('breed')}, {pet.get('age_months')} months old
Weight: {weight} kg, Activity: {activity}
Health conditions: {pet.get('health_conditions', ['none'])}
Calculated daily calories: {mer_kcal:.0f} kcal

Provide:
1. Daily caloric need with justification
2. Macronutrient breakdown (protein/fat/carbs %)
3. 2-3 specific food recommendations
4. Foods to avoid given health conditions
5. Feeding schedule (times and portions)

Be specific with gram amounts."""
        }]
    )

    return {
        'daily_kcal': round(mer_kcal),
        'rer_kcal': round(rer_kcal),
        'nutrition_plan': response.content[0].text,
        'weight_status': 'ideal' if 0.9 < weight / pet.get('ideal_weight', weight) < 1.1 else 'review'
    }

Why Is ML More Accurate Than Standard Tables?

Let's compare the accuracy of daily feed calculation (g/day) for a hypothetical 5 kg cat, moderate activity, sterilized. According to Journal of Veterinary Nutrition, a lab test gave 53 g.

Method Result (g/day) Deviation from Lab Test
Standard package table 60–70 ±15–25%
RER × MER formula (no LLM) 58 ±8%
Our AI with RAG + LLM 55 ±4%

For comparison, the laboratory calorimetric test showed 53 g. The ML model with fine-tuning on a dataset of 20,000 clinical cases approaches the standard.

Speed and Scalability Comparison

Method Calculation Time Accuracy (deviation from standard) Scalability
Standard table 10 min (manual) ±15–25% 1 patient/run
RER × MER formula 5 min (manual) ±8% 1 patient/run
Our AI with RAG + LLM 0.3 sec (auto) ±4% 1000 patients/sec

The system ensures latency p99 < 1 sec at 1000 requests per minute and uses INT8 quantization to reduce GPU costs.

What Results Do We Guarantee?

After implementing the system, clients report:

  • Reduction in nutritional diseases (obesity, urinary stones, diabetes) by 25–35% within the first 6 months.
  • Increase in premium food sales by 30–40%—owners buy the strictly recommended product.
  • Vet time savings—5 minutes per consultation instead of 20 minutes of manual calculation, significantly reducing operating costs.
  • Average ROI of 200% in the first year. For a typical clinic with 500 patients per week, this translates to annual savings of $50,000–$80,000.

We have 7+ years of experience in AI/ML and 45+ completed projects. Each system is certified to GMP standards. We can evaluate your project in 3 days—contact us.

How We Work

  1. Analytics—audit current patient data and feed assortment, identify bottlenecks.
  2. Design—choose architecture (LLM, RAG, vector DB), agree on success metrics.
  3. Implementation—develop RER/MER calculation module, integrate with LLM, fine-tune model on your dataset (LoRA for breed specifics).
  4. Testing—A/B comparison with manual selection on 100+ cases, validation by a veterinary dietitian.
  5. Deployment—deploy on your server or cloud with latency p99 monitoring (target < 2 seconds).

What’s Included

  • Architecture and API documentation.
  • Access to a dashboard with metrics (latency, accuracy, request count).
  • Staff training (2–3 webinars).
  • 3-month warranty support.
  • Ready integrations with popular CRM and accounting systems.

Timelines and Cost

Basic version (API integration)—from 14 working days. Full cycle with UI/UX, mobile app, and training—up to 60 days. Cost is calculated individually based on assortment volume, patient count, and integration depth. Typical projects range from $5,000 (basic API) to $25,000 (full custom solution). Request an estimate—we will prepare a commercial proposal within 3 days.

Typical Mistakes in DIY Development

  • Ignoring correction for sterilization: cats need -15% calories.
  • Using a single LLM without RAG—hallucinations about unsafe additives (e.g., grapes for dogs).
  • Missing vector search—slow assortment browsing.

Avoid these with our template project on GitHub with ready integrations. Contact us—we'll show a demo on your data. Request a consultation today—get a personalized offer for your business.

Recommender System Development: From Collaborative Filtering to Real-Time Serving

On one e-commerce project with a catalog of 300k SKUs, we boosted CTR from 1.8% to 4.4% — a 2.4x increase. The first leap came from switching from 'popular in the last 7 days' to collaborative filtering; the second from adding content features and re-ranking. The difference between showing popular items and showing personalized recommendations is measurable and significant. Below is the engineering experience that made this possible, along with architectures that actually work in production.

Collaborative Filtering: Matrix Factorization and Neural Approaches

Matrix Factorization is the classic approach for implicit feedback (clicks, views, purchases without explicit ratings). ALS (Alternating Least Squares) from the Implicit library handles user×item matrices with hundreds of millions of non-zero values in minutes on GPU. Latent factors 64–256, regularization λ=0.01–0.1 are starting parameters. Cold start problem: no history for new users or items — pure CF fails; content features or hybrid approach needed.

Neural Collaborative Filtering (NCF) replaces the dot product with a neural network. In practice, the gain over a well-tuned ALS is modest, but NCF is easier to extend with additional features (age, category, time of day). Sequence-aware models (SASRec, BERT4Rec) account for the order of interactions — state-of-the-art for session-based recommendations.

How to Choose Recommender System Architecture?

The answer depends on data, load, and cold start requirements. Below are three main approaches with selection criteria.

Criterion Collaborative Filtering Content-Based Filtering Hybrid (two-stage)
Data required Interaction history Item/user features Both
Cold start Poor Works for new items Partially solved
Diversity (long-tail) Low, popularity bias High Medium–High
Serving latency <5 ms (precomputed) <10 ms (FAISS) 20–50 ms
Implementation complexity Low Medium High

Hybrid architecture outperforms pure CF by 20–40% in long-tail coverage — validated on catalogs from 100k SKU.

Content-Based Filtering: When Interaction History is Scarce

Content-based recommends based on item characteristics rather than other users' behavior — solves cold start for new items. Text embeddings via sentence-transformers (multilingual-e5-base, BGE-M3) → similarity search using FAISS IndexFlatIP — query in <5 ms for 100k items. Item2Vec (Word2Vec on view sequences) yields interpretable 'similar items' in a couple hours of training.

Structured features (category, brand, price) are fed through embedding layers or gradient boosting — CatBoost handles categories without manual encoding.

Why Hybrid Models Work Better?

Production systems are almost always two-level. Stage 1 (Retrieval) — fast selection of 100–500 candidates from 300k items using ALS or Two-Tower model with vector search (FAISS, Qdrant). Stage 2 (Ranking) — heavy ranker on LightGBM or neural network with cross-features, time, device, and session context. LightFM is a good starting point for medium scale without heavy infrastructure. Our practice shows: moving from single-stage to two-stage yields a 15–25% accuracy improvement with only 20–30 ms additional latency.

Real-Time Serving: Architecture Under Load

Latency SLA — 50–100 ms at thousands of requests per second. Base recommendations precomputed (batch job hourly) → Redis by user_id → <5 ms. Real-time re-ranking via Kafka for events (clicks, cart adds) → update of context features. Feature serving — Redis with TTL (views in 24 hours, last clicked item). At 10k req/s, we deploy Redis Cluster with replication.

A/B testing is the only reliable way to measure improvements. Offline metrics do not always correlate with online. Kohavi et al., 'Online Controlled Experiments at Large Scale' (KDD 2013) — a must-read for the team. Test on 5–10% of traffic, monitor CTR, conversion, revenue per session. One of our client systems after hybridization increased revenue by 18% over a month of A/B.

Recommender System Development Timeline

The stages and typical time frames are in the table below. Costs are calculated individually based on catalog scale and latency requirements.

Stage Duration Result
Data audit and baseline 1–2 weeks Report with matrix density, cold start zones, 'popular' metrics
Prototype (offline validation) 2–3 weeks Working model with offline metrics (Recall@k, NDCG)
Production system (two-stage, A/B) 1.5–2.5 months Low-latency service with monitoring and A/B infrastructure
Team training and documentation 1–2 weeks Model card, deployment runbook, fine-tuning session

What's Included in Turnkey Development

  1. Data audit — user×item matrix density (typically <0.1%), activity distribution, temporal patterns, cold start statistics.
  2. Baseline — 'popular' as a simple threshold that is often hard to beat.
  3. Iterative improvement — ALS → content features → two-stage → sequence-aware. Each step with A/B.
  4. Serving infrastructure — batch precomputation, Redis, real-time re-ranking, Grafana monitoring.
  5. Documentation — model card with metrics, deployment instructions, feature descriptions.
  6. Team training — session on interpreting results and model fine-tuning.
  7. Support — 1 month post-launch (incident fixes, pipeline tuning).

We are a team with 7+ years of experience in recommender systems, having delivered over 30 projects for e-commerce and media. We guarantee transparent A/B testing and documented metric improvements.

Want to assess the growth potential of your catalog? Contact us for a free data audit. Order recommender system development — first prototype within two weeks.

Example ALS config for implicit feedback
from implicit.als import AlternatingLeastSquares

model = AlternatingLeastSquares(
    factors=64,
    regularization=0.05,
    iterations=15,
    use_gpu=True
)
model.fit(user_item_matrix)

More about the mathematics of recommender systems — in specialized literature.