AI & Data Project Management

How to scope, execute, and deliver AI/ML projects. The discipline that bridges data science and production systems. Directly applicable to IEIA, SijiLab Assistant, Idarati RAG, and all NOTQIN Research papers.


Why AI Projects Fail Differently

Traditional software projects fail primarily due to scope creep, technical complexity, and schedule pressure. AI projects fail for additional structural reasons:

Failure ModeDescriptionFrequency
Wrong problem framingSolving an ML problem when a rule-based system would workVery common
Data doesn’t existAssuming data is available and cleanCommon
Training/serving skewModel trained on data that doesn’t match production dataCommon
No clear success metricCan’t tell if the model is “good enough”Common
Accuracy ≠ business value95% accurate model that isn’t useful in practiceCommon
Overfit to training dataWorks in lab, fails in prod (SijilPharma ML: R²=0.98 train / 0.31 test)Very common
Concept driftWorld changes, model degrades silently over timeCommon post-deployment
Ethical/legal issuesBias, privacy, regulatory compliance discovered lateIncreasing

Andrew Ng’s AI Project Lifecycle

Andrew Ng (DeepLearning.AI, Coursera “AI for Everyone”) provides the most practical framework for non-researchers managing AI projects:

1. SCOPING
   → Define the project
   → What is X? What is Y?
   → Is it feasible? Is it valuable?
   → Key metrics to optimize
   ↓
2. DATA
   → Define data and establish baseline
   → Label and organize data
   → Is data clean? Consistent? Sufficient?
   → Edge cases, ambiguous labels
   ↓
3. MODELING
   → Select and train model
   → Perform error analysis
   → Improve model and data
   ↓
4. DEPLOYMENT
   → Deploy in production
   → Monitor system
   → Maintain and retrain

Key insight: Steps 1–2 are 80% of the work but get 20% of the attention.


The ML Project Scoping Canvas

Before starting any ML project, answer:

QuestionWhy it matters
What is the input X?Defines data requirements
What is the output Y?Defines the target metric
What does “good enough” mean? (metrics)Prevents infinite tuning
What is the business value of getting Y right?Justifies investment
What is the cost of being wrong? (types of errors)Determines acceptable error rate
Does useful data exist? How much?Feasibility check
What is the baseline performance?Reference point (human-level, rule-based)
How often does the world change? (drift)Determines retraining frequency
What are the ethical risks?Legal and reputational

Applied to NOTQIN IEIA anomaly detection:

  • X: energy consumption + maintenance logs + shift schedule time series
  • Y: anomaly label (is this hour anomalous? what’s the root cause?)
  • Good enough: precision ≥ 80%, recall ≥ 70% (higher recall preferred — missing anomaly is worse than false alarm)
  • Business value: MAD 15,000/month energy waste identified per factory
  • Cost of error: false alarm → operator annoyance; missed anomaly → equipment failure → MAD 50,000 downtime
  • Baseline: current human review catches ~40% of anomalies
  • Ethical risks: none critical, but wrong CBAM data could cause legal issues

CRISP-DM — Cross-Industry Standard Process for Data Mining (1999)

Still the most widely used ML project process model:

                ┌──────────────┐
                │   BUSINESS   │
            ┌──▶│ UNDERSTANDING│◀──┐
            │   └──────┬───────┘   │
            │          ↓           │
            │   ┌──────────────┐   │
            │   │     DATA     │   │
            │   │ UNDERSTANDING│   │
            │   └──────┬───────┘   │
            │          ↓           │
            │   ┌──────────────┐   │
            │   │     DATA     │   │
            │   │ PREPARATION  │   │
            │   └──────┬───────┘   │
            │          ↓           │
            │   ┌──────────────┐   │
            │   │   MODELING   │──▶│
            │   └──────┬───────┘   │
            │          ↓           │
            │   ┌──────────────┐   │
            │   │  EVALUATION  │───┘
            │   └──────┬───────┘
            │          ↓
            │   ┌──────────────┐
            └──▶│  DEPLOYMENT  │
                └──────────────┘
                (feedback loop)

Note the arrows going backward — CRISP-DM is iterative. You often need to go back to data preparation after modeling reveals issues.


MLOps — Machine Learning Operations

MLOps applies DevOps principles to ML systems. The goal: reliable, scalable, reproducible ML in production.

The MLOps Maturity Levels

LevelDescriptionCharacteristics
0Manual processAd hoc, Jupyter notebooks, manual deployment
1ML pipeline automationAutomated training, feature store, model registry
2CI/CD for MLAutomated testing, deployment, monitoring pipelines

NOTQIN Research current state: Level 0 (Jupyter notebooks, manual validation). NOTQIN IEIA: closer to Level 1 (FastAPI serving, structured training). Target: Level 1 for IEIA, Level 0→1 for research papers before submission.

MLOps Components

ComponentPurposeTools
Feature StoreCentral repository of reusable featuresFeast, Hopsworks, Tecton
Model RegistryVersioned model storage + metadataMLflow, Weights & Biases, DVC
Model ServingDeploy models as APIsFastAPI, BentoML, TorchServe, Triton
MonitoringTrack data drift, model drift, performanceEvidently, WhyLabs, Prometheus
Experiment TrackingTrack hyperparameters, metrics across runsMLflow, W&B, Comet
Pipeline OrchestrationAutomate data + training pipelinesApache Airflow, Prefect, Dagster
Data VersioningTrack changes to datasetsDVC, LakeFS
CI/CD for MLAutomated testing and deploymentGitHub Actions + custom

Your Current Stack (IEIA)

  • Model serving: FastAPI ✅
  • Monitoring: Prometheus + OpenTelemetry ✅
  • Model registry: None (add MLflow)
  • Experiment tracking: None (add MLflow or W&B)
  • Feature store: None (PostgreSQL acts as de facto store)
  • Data versioning: None (add DVC)

AI Project Types & Their Management Approaches

Type 1: Rule-Based AI (Expert Systems)

No learning, explicit logic. When to use: known rules, high interpretability needed, small dataset.

  • Example: Anomaly detection rules in NOTQIN Core (22 machine types × 74 rules)
  • Management: traditional software development (tests, versioning, code review)
  • Key risk: rule maintenance as edge cases multiply

Type 2: Classical ML (Supervised/Unsupervised)

Learn patterns from labeled data. When to use: labeled data available, interpretable results needed, structured tabular data.

  • Example: SijilPharma demand forecasting (XGBoost), IEIA anomaly classification
  • Management: CRISP-DM, MLflow, train/val/test split discipline
  • Key risk: overfitting (your SijilPharma issue: R²=0.98 train, 0.31 test)

Type 3: Deep Learning / Neural Networks

Large datasets, complex patterns. When to use: unstructured data (images, text, audio), very large datasets.

  • Example: NOTQIN Research NILM (Non-Intrusive Load Monitoring)
  • Management: more compute, longer training, W&B for experiment tracking
  • Key risk: interpretability (black box), data hungry, expensive

Type 4: LLM Integration / Agentic AI

Use pre-trained LLMs (Claude, GPT-4) via API. When to use: natural language tasks, code generation, reasoning, document analysis.

  • Example: SijiLab Assistant (Claude API), NOTQIN IEIA analyst tool, Idarati RAG
  • Management: prompt engineering, eval frameworks, token cost management, latency
  • Key risk: hallucination, cost overrun, prompt injection (security)

Type 5: RAG Systems (Retrieval-Augmented Generation)

LLM + vector search over proprietary documents. When to use: domain-specific Q&A, document analysis, factual queries over your data.

  • Example: Idarati RAG (Moroccan administrative documents)
  • Management: chunking strategy, embedding model choice, retrieval evaluation, generation evaluation
  • Key risk: retrieval quality (garbage in → garbage out), latency, document freshness

Evaluating AI Systems — Metrics by Type

Problem TypePrimary MetricsSecondary Metrics
Binary ClassificationPrecision, Recall, F1, AUC-ROCConfusion matrix, calibration
RegressionR², MAE, RMSE, MAPEResidual analysis
Anomaly DetectionPrecision, Recall, F1 (per class)False alarm rate, detection latency
RAG / LLMFaithfulness, Answer Relevance, Context PrecisionLatency, token cost, hallucination rate
LLM AgentsTask success rate, tool call accuracyNumber of turns, cost per task

The Confusion Matrix (for classification)

                    PREDICTED
                Positive  │  Negative
ACTUAL Positive    TP     │    FN     → Recall = TP/(TP+FN)
       Negative    FP     │    TN     → Specificity = TN/(TN+FP)
                          │
                          ↓ Precision = TP/(TP+FP)

F1 Score = 2 × (Precision × Recall) / (Precision + Recall)

When to optimize for Recall: missing anomaly is worse than false alarm (IEIA anomaly detection, medical diagnosis) When to optimize for Precision: false alarm is costly (CBAM compliance report should not overstate emissions)


Responsible AI — The Management Dimension

The AI Ethics Principles (EU AI Act, 2024 — context)

PrincipleDefinitionYour Projects
FairnessModel should not discriminate against protected groupsSijiLab: lab results not influenced by patient demographics
TransparencyUsers should understand how AI makes decisionsIEIA: explainable anomaly reasoning (Claude provides it)
AccountabilityClear ownership of AI decisionsAll projects: Ahmed is accountable
PrivacyPersonal data protectedSijiLab: CNSS/CNOPS data under Loi 09-08 (CNDP Maroc)
RobustnessModel performs reliably under distribution shiftIEIA: tested on multiple machine types
Human oversightHumans can override and audit AI decisionsIEIA: operator dashboard, Claude explains recommendations

EU AI Act Risk Categories (applies if selling to EU clients)

Risk LevelExamplesRequirements
UnacceptableSocial scoring, real-time facial recognitionBanned
HighMedical devices, critical infrastructure, employmentConformity assessment, documentation, human oversight
LimitedChatbots, deepfakesTransparency requirements
MinimalSpam filters, recommendationsNo specific requirements

IEIA anomaly detection for industrial safety = potentially High Risk under EU AI Act if sold to EU clients.

Data Privacy in Morocco — CNDP Loi 09-08

  • SijiLab processes patient data (health) → requires CNDP authorization
  • Health data is “sensitive” category under Loi 09-08
  • Must have explicit patient consent, data minimization, right to access/delete
  • CNDP registration required before processing

LLM Cost Management

For Claude API and similar:

OptimizationImpactHow
Prompt caching90% cost reduction for repeated prefixesAnthropic prompt caching
Model selectionUse smaller model when capability is sufficientClaude Haiku for simple extraction, Sonnet for complex reasoning
Output length controlToken cost = input + outputSet max_tokens, instruct to be concise
Batch processingReduce API callsBatch multiple analyses in one call
Caching responsesCache deterministic outputsRedis cache for stable queries
StreamingImproves perceived latency (not cost)Use for user-facing features

Token cost estimate (Claude Sonnet 3.5 as reference):

  • IEIA energy report: ~2,000 tokens input + ~1,000 output ≈ $0.01 per report
  • At 1,000 reports/month/factory: $10/month/factory in Claude API cost
  • Factor into pricing: if customer pays MAD 5,000/month (€450), Claude API = 2% of revenue ✅

AI Project Timeline Reality

Common timeline underestimation in AI projects:

PhaseExpectedReality
Data collection + cleaning2 weeks6–12 weeks (data doesn’t exist, is dirty, requires labeling)
First model1 week2–4 weeks (features not obvious, baseline needed)
Improving model2 weeks4–8 weeks (each improvement brings new failure modes)
Production deployment1 week4–8 weeks (serving infrastructure, monitoring, security)
Monitoring + maintenanceOngoingPlan for 20% ongoing effort forever

Rule of thumb: multiply your AI project estimate by 3–4×.


Agile for AI/ML — Sprints with ML Nuance

Regular Agile sprints work but need adaptations:

  • AI spike sprint: 1 sprint dedicated to feasibility/prototyping (no guaranteed deliverable)
  • DoD for ML: model achieves target metric on test set + deployed to staging + monitored
  • Data sprint: separate sprint for data pipeline and labeling
  • Model sprint: train/evaluate/select
  • Deployment sprint: serving, monitoring, rollout
  • Maintenance sprint: retraining, drift handling

Applied to Your Projects

ProjectKey Management GapsRecommended Action
SijilPharma MLOverfitting (train R²=0.98, test R²=0.31)Regularization, cross-validation, feature selection. Add MLflow to track experiments.
NOTQIN IEIANo model registry, no drift monitoringAdd MLflow for model versioning. Add Evidently for drift detection.
NOTQIN ResearchPapers need real data validation (Paper 4)Source real industrial dataset (ENGIE, UCI ML repository, or factory pilot)
Idarati RAGRetrieval quality unknownImplement RAGAS evaluation framework (faithfulness, relevance metrics)
SijiLab AssistantNo eval framework for ClaudeBuild a golden test set (20 Q&A pairs), run eval before each new prompt version

See Also