Introduction Computer vision analytics that supports a decision — a quality gate, a routing call, a clinical observation — requires more than a model. It requires a modular pipeline where pre-processing, inference, and post-processing live as separately deployable, separately observable stages. When that modularity is missing, the pipeline breaks at integration boundaries, retraining a single model triggers cascading rewrites, and operators cannot tell which stage caused a bad output. See computer vision for the broader landing this article serves. The honest 2026 picture: most production CV pipelines that ran into reliability trouble had monolithic architecture; the teams that recovered were the ones that broke the pipeline into stages that could fail, scale, and be replaced independently. What this means in practice Pipeline stages should be independently deployable, observable, and replaceable. Pre-processing, inference, and post-processing are usually different scaling profiles. Vision-system integration differs between custom CV and off-the-shelf machine vision in ways that affect modularity. Retraining or swapping a model should not require re-deploying upstream/downstream stages. How do I architect a modular computer vision pipeline for production reliability? Start with stage boundaries. The minimum useful decomposition: capture (sensor/file ingest), pre-processing (decode, resize, normalise, augment), inference (model serving), post-processing (NMS, thresholding, format conversion, business logic), and output (sink to API, queue, database). Each stage runs as a separate service (containerised microservice, function, or pod) with a typed contract on inputs and outputs. The contract is enforced — schema-validated payloads, versioned protobuf or pydantic models, not implicit dictionary shapes. Add observability at every stage boundary. Latency, throughput, error rate, and a sample of inputs/outputs per stage. When a downstream stage produces unexpected results, the operator can localise the fault by walking the per-stage metrics rather than logging into the pipeline as a whole. Add backpressure between stages — usually a bounded queue — so that a slow downstream does not exhaust upstream memory or block ingest. The architecture pattern that scales is event-driven: stages communicate via a queue or stream (Kafka, NATS, Redis Streams) rather than direct calls. This decouples scaling, lets you replay failed inputs from the queue, and isolates each stage’s failure mode. The pattern that does not scale: a single Python process that does capture-to-output inline, with a Flask wrapper for HTTP. What are the stages of a production CV pipeline, and which ones break first? Capture and ingest. Breaks first when sensor formats, camera firmware, or file conventions change. The decode step (e.g., NV12 vs RGB, HEVC vs H.264) is the most common silent failure mode — the pipeline runs but inputs are corrupt. Mitigation: schema validation on input format, alerting on decode failure rate. Pre-processing. Breaks when image dimensions, colour spaces, or normalisation parameters drift away from training distribution. Often the source of “model degraded” complaints that are actually pre-processing bugs. Mitigation: pin pre-processing version to model version; validate distribution of normalised inputs in production. Inference. Breaks when GPU/driver/CUDA stack updates change kernel behaviour, when model file is corrupted or wrong version, or when batching parameters mismatch the deployed model. Mitigation: model file checksum on load; pinned framework/CUDA version; canary inference with known-good test inputs. Post-processing. Breaks when thresholds drift relative to model distribution after retraining, when business rules change but post-processing code does not. Mitigation: thresholds versioned with models; post-processing tests with model-specific golden outputs. Output and integration. Breaks when downstream APIs change schema or rate limits, when database schemas migrate, or when consumer expectations diverge. Mitigation: contract testing with downstream consumers; versioned output schemas. The pattern: most production CV pipelines break in pre-processing and post-processing, not in the model itself, because those stages are usually the least tested and the most coupled to assumptions that drift silently. How does vision-system integration differ between custom CV and off-the-shelf machine vision (Keyence-style)? Off-the-shelf machine vision (Keyence, Cognex, Basler-based systems) packages camera, lighting, inference, and I/O into a closed system. Integration is via fieldbus (EtherNet/IP, PROFINET, IO-Link) or simple TCP/IP — pass/fail signals, measurement values, region-of-interest crops. Modularity is internal to the appliance, not exposed to the integrator. The vendor controls the model, the runtime, and the update path. Strength: turnkey for standard inspection tasks. Weakness: custom logic, new defect classes, or integration with modern ML stacks require working around the appliance. Custom CV (TensorRT, ONNX Runtime, PyTorch serving on a GPU server or edge box) gives the integrator full control over every stage. Modularity is explicit — each stage is a service the integrator owns. Integration is via standard APIs (REST, gRPC, MQTT) and message buses. Strength: any model, any post-processing, any integration. Weakness: the integrator owns reliability, observability, and the update path; the engineering cost is higher. Hybrid is increasingly common in 2026. Off-the-shelf appliances for standard inspection plus a custom CV stage that ingests appliance outputs and adds ML-based defect classification, anomaly detection, or trend analysis. The boundary is the appliance’s output API. The modular pipeline pattern applies on the custom side; the appliance is treated as an opaque first stage with a typed contract. Where should pre-processing, inference, and post-processing live — same service or separate stages? Separate stages when: pre-processing and inference scale differently (pre-processing CPU-bound, inference GPU-bound — separate so you can scale CPU pods independently of GPU pods); pre-processing is reused across models (one decode/normalise stage feeds multiple downstream inference services); post-processing has heavier business logic (database lookups, rule engines) that does not belong in the inference service; retraining cadence differs across components. Same service when: latency budget is tight (microsecond budgets where IPC overhead matters); the deployment is edge with constrained resources (single-process is simpler than orchestrating multiple containers); the team is small and the operational overhead of multiple services exceeds the modularity benefit. The default in production at scale is separation. Latency overhead between stages is usually 1-5ms per hop via in-memory queues or shared memory, which is acceptable for most inspection, surveillance, and retail-analytics workloads. The exceptions are real-time control (robotic vision with sub-10ms budgets) and edge devices where a single binary is operationally simpler. How do I make each pipeline stage independently observable and replaceable? Observable: per-stage metrics (latency p50/p95/p99, throughput, error rate, queue depth), structured logs with correlation IDs that flow through every stage, distributed tracing (OpenTelemetry) so a single input can be traced end-to-end, and sample-based input/output capture so operators can inspect what each stage actually saw and produced. Dashboards with one panel per stage; alerts that fire on per-stage SLO breaches, not just end-to-end. Replaceable: typed contracts on stage boundaries that are versioned independently of the stage implementation; deployment that supports canary or blue-green for any stage without touching others; backwards-compatible contract evolution (additive fields, never removed) so a new stage version coexists with old neighbours; integration tests that exercise each stage against contract mocks of its neighbours. The cultural prerequisite: the team thinks of each stage as a service with its own SLO, owner (even if the same person owns several), and lifecycle. Pipelines that drift into “the inference service does everything” lose modularity within a few releases because the path of least resistance is to add code to whichever stage is currently being changed. What does a modular architecture buy me when a model needs to be retrained or swapped? Retraining without rewriting upstream/downstream. A new model version is deployed to the inference stage; pre-processing and post-processing remain unchanged because the contract did not change. The inference stage is canary’d against a percentage of production traffic; metrics show whether the new model performs as expected before full rollout. Multiple models served simultaneously. A/B testing or shadow inference (run the new model on production inputs without acting on its outputs) is straightforward when the inference stage is a service. The post-processing or output stage routes between models based on a configuration value. Model architecture changes without pipeline rewrites. Replacing a CNN with a transformer-based detector, or moving from FP32 to INT8 quantisation, affects the inference stage and possibly pre-processing normalisation, but does not require changes to capture, post-processing, or output stages. Without modularity, every model change is a pipeline change. Vendor or framework changes. Migrating from PyTorch serving to TensorRT, or from custom inference to Triton Inference Server, is a stage replacement, not a pipeline rewrite. The capture, pre-processing, and post-processing stages do not know which inference framework runs behind the contract. The summary: modularity converts model-lifecycle work from re-engineering the pipeline into deploying a new version of one stage. That is the difference between a CV pipeline that ships monthly model updates routinely and one where every retraining is a project. How TechnoLynx Can Help TechnoLynx works on production computer vision pipeline engineering — stage decomposition with typed contracts, per-stage observability, event-driven architecture for reliability, and the integration patterns (off-the-shelf appliances plus custom CV, hybrid edge/cloud) that make CV analytics actually usable for decisions. If your team is architecting or recovering a CV pipeline for production reliability, contact us. Image credits: Freepik