LEVIATHAN SYSTEMS

Buyer's Guide

The Same Convolution Weights Can Produce Different Boundary Features

Technical contentPublished Updated

Matching convolution weights do not establish matching spatial features. CV25 uses one input and one output channel, a 5×5 all-ones input and a 3×3 all-ones kernel, with no bias and stride, dilation and groups each 1. No padding gives a 3×3 output of 9s; one zero on each side gives a 5×5 output with corners of 4, other edges of 6 and an interior of 9. Compare the boundary definition, each output's input location and the downstream features required.

Weights describe the filter; the boundary defines where it applies

A coefficient file describes only part of a convolution layer. PyTorch 2.14 defines the core Conv2d operation as two-dimensional cross-correlation: the kernel is applied without reversing its spatial order. Its output shape also depends on padding, stride and dilation.

Padding amount and padding mode answer different questions: how far the input is extended and what values that extension supplies. The padding option named valid means no padding. The padding option named same preserves spatial dimensions but supports only stride 1 in this API. This article uses explicit zero padding; reflect, replicate and circular modes are different boundary definitions.

The distinction matters when a buyer receives matching weights with a changed implementation. The software owner still needs to explain which spatial features the supplied operation produces and how the next stage interprets them. A shared file alone cannot answer that question.

References: [P1]

CV25: one input and nine unchanged coefficients

CV25 is an original exact arithmetic example. It contains one sample, one input channel and one output channel. The input is a 5×5 grid whose 25 dimensionless values are all 1. The kernel is a 3×3 grid whose nine coefficients are all 1. There is no bias; stride, dilation and groups are each 1. No activation, pooling or quantization is included.

Definition A adds no padding. The kernel fits at three horizontal positions and three vertical positions. At every position, it multiplies nine input values of 1 by nine coefficients of 1 and sums the contributions. All nine output values are therefore 9.

For these stipulated dimensions, the documented shape relation reduces to 5 + 2p − 3 + 1 = 3 + 2p along either axis, where p is the padding amount on each side. With p equal to zero, A has a 3×3 output. The coefficient population remains nine: the same kernel is reused across output positions.

References: [P1]

One zero on each side adds positions with different support

Definition B keeps every CV25 assumption and coefficient unchanged, adding one row of zeros above and below the input and one column on its left and right. Its conceptual extended grid is 7×7. The 3×3 kernel fits at five positions along each axis, giving a 5×5 output.

At the top-left output position, the kernel covers four original input values and five added zeros. Its value is 4. Each of the four corners has this same overlap.

At an edge position away from a corner, the kernel covers six original values and three added zeros, giving 6. There are 12 such positions: three along each of the four edges. The nine interior positions cover nine original values and give 9.

B's top and bottom rows each read 4, 6, 6, 6, 4. Each of its three middle rows reads 6, 9, 9, 9, 6. The populations reconcile: four corners + 12 other edge positions + nine interior positions = 25 output positions.

Both A and B apply the same nine coefficients at each mathematical output position. B has neither 25 learned coefficients nor fewer coefficients at a corner; some of its input contributions are zero. These counts establish no instruction count, FLOP total or runtime.

Align features to input centers before comparing array indices

Number the original input rows and columns from 0 through 4. A's kernel centers lie at rows 1 through 3 and columns 1 through 3. B's centers lie at rows 0 through 4 and columns 0 through 4.

A's top-left output, at output row 0 and column 0, represents the neighborhood centered on original input row 1 and column 1. Its value is 9. B's top-left output uses that same output index but represents the neighborhood centered on original input row 0 and column 0. Its value is 4.

To compare the same center, A's output at row 0, column 0 corresponds to B's output at row 1, column 1, which is also 9. All of A aligns with B's central 3×3, not B's top-left 3×3. That central region contains exactly the same values for this layer and input.

This gives a useful positive finding: the two definitions preserve the same nine interior features when compared at their corresponding input centers. Their full output arrays still describe different spatial populations. A consumer that associates feature locations with image locations needs that correspondence, rather than an assumption that identical array indices mean identical centers.

A downstream summary can change even when the interior agrees

Suppose a hypothetical downstream consumer takes the arithmetic mean of every value supplied by this one layer. A supplies nine values of 9: their sum is 81 and their mean is 9.

B supplies four values of 4, 12 of 6 and nine of 9. Its sum is 4×4 + 12×6 + 9×9 = 169. Dividing by its 25 positions gives a mean of 6.76. The lower mean follows from including the boundary features with partial original-input overlap. It establishes no loss of image quality or task accuracy.

If the stipulated consumer instead uses only B's aligned central 3×3, its mean is 9, matching A's. The consumer's selected region is therefore part of the comparison. Equality of an interior region cannot establish equality of an all-position summary.

The added zeros are numerical assumptions outside the supplied grid. In a camera application, they are not measurements of what exists beyond the captured image. CV25 is a mathematical explanation, with no model execution or observed application outcome.

Ask the software owner to reconcile the required outputs

Consider two fictional offers that deliver CV25's same nine coefficients. Offer A describes the unpadded 3×3 feature grid. Offer B describes the zero-padded 5×5 grid. The appropriate finding depends on the required spatial population.

If the requirement is the nine interior centers, B's central 3×3 provides an exact corresponding region in this example. B's software owner must identify how the offered consumer retains and locates that region. If the requirement instead calls for all 25 centers under B's explicit zero-boundary definition, A omits 16 required positions. Merely keeping the coefficient file cannot fill them in.

For an actual system, ask the appointed model or software owner to connect the identified input and coefficient representation to the actual operator semantics, padding amount and mode, stride, dilation, groups and bias. The explanation should identify output dimensions, the mapping to input coordinates, any retained region, and what subsequent processing consumes. Evidence for the supplied implementation must then address the required outputs and the application's acceptance criteria.

The all-ones kernel does not expose a kernel reversal, because reversing it leaves it unchanged. Its simplicity isolates the boundary question; agreement on CV25 alone cannot establish equivalence for arbitrary weights, inputs or a complete network. The example supports review of an offered computation, not a change to a deployed model.

The related ONNX and TensorRT guide addresses artifact reuse and implementation coverage. The ViT guide addresses pixels becoming nonoverlapping patch sequences. Here the decision is whether overlapping, shared-weight features preserve the required boundary values and spatial meaning. A defensible comparison identifies the agreed region and its interpretation, as the central 3×3 correspondence does in CV25.

References: [P1]

Scope a separate physical installation for selected equipment

If the selected vision system also needs equipment receiving, rack integration, onsite installation or IT cabling, Leviathan's Complete Physical Infrastructure Deployment service is the relevant scope discussion. Use the related service and project inquiry with a nonconfidential equipment list, site, required IT connections and physical handoff needs. Scope, requirements and availability are confirmed for the engagement.

Model implementation, vision integration and application acceptance remain with the appointed software owner. The installation inquiry concerns the selected equipment's physical delivery.

References: [L1]

Primary sources

  1. [P1] PyTorch 2.14 — Conv2dChecked 2026-10-21. Defines cross-correlation, padding, output dimensions and weight shape. CV25 applies those definitions to an original finite arithmetic example; no implementation performance is inferred.
  2. [L1] Leviathan Systems — Complete Physical Infrastructure DeploymentChecked 2026-10-21. Defines the physical receiving, rack integration, installation, cabling and handoff scope, subject to confirmed project requirements and availability.

Does the selected equipment need physical installation?

Share a nonconfidential equipment, site, IT connection and handoff outline to discuss physical installation scope, requirements and availability.

Discuss a ProjectEmail Project Scope