3.2. Problem Formulation and Optical Challenges
The objective of this study is to perform high-speed and accurate localization of the four image-plane corners of a heliostat mirror from a monocular RGB image. Treating the four corners as the primary observable is deliberate: a rectangular facet is fully determined, up to a rigid-body pose with respect to the camera, by the projected positions of its four corners, and four 2D–3D correspondences are sufficient for a downstream PnP-style pose estimator [
13,
34]. Compared with detecting the full facet contour, four-corner detection is also markedly more robust under partial occlusion because losing one corner still leaves enough geometric information to flag the frame as degenerate and skip it.
Under a standard pinhole camera model, a 3D point
residing on the heliostat surface is mapped to the 2D image coordinate
via the perspective projection matrix:
where
is the camera intrinsic matrix,
denotes the extrinsic pose parameters relative to the mirror, and
is the depth of the 3D point in the camera frame (the homogeneous-coordinate scale factor). The symbol
is reserved for this geometric depth and is distinct from the scalar loss weights
and
introduced later. Because
varies continuously across the tilted mirror plane, affine properties—such as the parallelism between opposite edges of the rectangular mirror—are violated in the perspective image plane. Any structural regularization applied to the detection network therefore cannot rely on simplistic parallel-line assumptions, and must instead invoke projective invariants such as cross-ratios and line incidences [
13].
Given an input image tensor , the detection framework predicts, per visible facet, a set of four corner keypoints , where denotes the predicted image coordinate of the k-th corner. The corresponding ground-truth set annotated by domain experts is denoted by . We adopt a fixed corner ordering—top-left (TL), top-right (TR), bottom-left (BL), and bottom-right (BR)—during both annotation and prediction, so that diagonal correspondences (TL↔BR and TR↔BL) are well defined and can be used inside the geometric loss without combinatorial ambiguity.
The YOLOv8-Pose architecture is adopted as the baseline detector due to its highly efficient Cross Stage Partial (CSP) backbone, which is well-suited for industrial edge-computing deployments [
30,
35]. However, its default feature pyramid (relying heavily on P3 to P6 layers) entails excessive spatial downsampling, which over-smooths the high-frequency geometric discontinuities essential for precision metrology. Pixel-accurate corner localization in this regime is fundamentally limited by the receptive-field stride at the level from which the keypoint head reads its features; a pose head attached to P3–P6 only sees an effective stride of at least eight pixels relative to the input resolution, which is insufficient when the facet edge spans only a few tens of pixels in the captured image.
3.3. Resolution-Preserving Feature Fusion and Energy Analysis
To address the critical attenuation of micro-structures at mirror boundaries, a high-resolution P2 feature level is integrated into the network’s neck (
Figure 2). In the standard YOLOv8-Pose-P6 stack, the keypoint head receives features from levels P3 through P6, whose spatial strides relative to the input range from 8 to 64. We extend the multi-scale fusion path so that the keypoint head additionally reads a P2 feature with an effective stride of 4, which approximately doubles the spatial precision available at the head input without altering the backbone’s semantic depth or the pretrained weight initialization for the deeper levels [
31,
32]. To empirically validate this architectural intervention, we extract and quantify the feature response intensity across all pyramid levels. For a given feature tensor
at pyramid level
l, the channel-wise activation is aggregated using root-mean-square (RMS) energy:
Following a robust quantile normalization process to suppress background sensor noise, the resulting pseudo-color energy maps (
Figure 2a–e) reveal a critical phenomenon: the P2 feature exhibits profound spatial convergence, tightly anchoring to the mirror’s physical boundaries. In contrast, deeper semantic levels (P5, P6) respond broadly to the global scene context, losing the localized precision needed for accurate few-pixel-level corner measurement. From the perspective of measurement, this is the expected behavior: deeper levels integrate large receptive fields that are useful for object presence but have already discarded the boundary location information by spatial pooling, whereas P2 retains short-range gradient cues that are co-located with the actual facet corners. Adding P2 into the head input therefore restores the high-frequency information that subsequent loss minimization can exploit; the deeper levels continue to contribute by gating the per-anchor visibility classification and confidence estimation.
3.4. Geometry Consistency Regularization Under Perspective Projection
The standard keypoint regression head in generic pose estimation architectures optimizes spatial coordinates by minimizing a visibility-masked distance metric:
where
indicates keypoint visibility, and
typically represents the Object Keypoint Similarity (OKS) metric [
36]. This point-wise, independent optimization carries no signal about the
relative geometry of the four corners: it treats each corner in isolation and is indifferent to whether their joint configuration is consistent with a projected quadrilateral. Supplying this relative-geometry signal as an auxiliary supervision term is the role of
. In principle, such a term also guards against degenerate, self-intersecting configurations that a downstream geometric estimator could not interpret; in practice, these degeneracies do not arise on the present regular dataset (
Section 4.1), and the measurable effect of
is improved keypoint accuracy and robustness.
A naive remedy would be to penalize departures from a rigid rectangular shape, e.g., by enforcing parallel opposite edges or right angles. As discussed in
Section 3, a rectangular facet projects to a non-rectangular quadrilateral under an off-axis pinhole projection, so such a penalty would push the network toward physically wrong predictions. The remedy must therefore be expressed in quantities that are invariant under the perspective projection. We choose two such invariants and combine them.
Without violating perspective geometry, the geometry-consistency loss (
) is therefore formulated from perspective-compatible geometric quantities, i.e., quantities whose target values are read from the ground-truth projection rather than from a planar-rectangle prior. The first component evaluates the scale-invariant geometric edge-ratio (
):
where
denotes the Euclidean distance. The use of the logarithm has two pragmatic effects. First, it converts a multiplicative ratio mismatch into an additive scale-symmetric penalty, so that a 10% error on a small edge contributes the same loss magnitude as a 10% error on a large edge. Second, it removes the numerical asymmetry that a raw ratio would introduce when an edge is short. To prevent log singularities for very small edges, the implementation clamps both numerator and denominator to a small positive lower bound before taking the logarithm.
The second component enforces diagonal-intersection consistency (
). Let
and
denote the two diagonal lengths, and let
denote the corresponding unit-norm direction vectors (
). The two ground-truth diagonals are then parameterized by arc length as
and
, where
and
are measured directly in image-plane pixels. Their intersection
must satisfy
Taking the 2D cross product of both sides with
eliminates
t and yields the closed-form solution
where
is the angle between
and
, and
is a small positive constant that prevents division by zero when the two diagonals become nearly collinear (
). Because
and
are unit-norm,
is exactly
, so
acquires the clear physical meaning of a lower bound on the admissible angular separation of the two diagonals rather than the role of a purely numerical safeguard.
The ground-truth intersection follows from Equation (
7) in one line as
. The predicted intersection
is computed by the same closed form applied to the predicted corner set
—i.e., by substituting
for
throughout Equations (
5)–(
7)—and the Euclidean distance between the two intersection points serves as the structural penalty
The intersection points are expressed in normalized image coordinates (pixel coordinates divided by the input image size) before this distance is evaluated, so
is dimensionless and is directly comparable in magnitude with
.
Geometrically,
penalizes configurations in which the two predicted diagonals fail to meet at the same projected point as the ground-truth diagonals. Because the cross-ratio along each diagonal is preserved by the perspective projection [
13], requiring the two predicted diagonals to intersect at the correct projected point is equivalent to requiring the projected facet to have the correct internal cross-ratio structure—without imposing parallelism, right angles, or rectangularity in the image plane.
is therefore a perspective-invariant geometric regularizer, complementary to the image-plane edge-length-ratio regularizer
of Equation (
4), which constrains scale consistency along the facet sides rather than the projective incidence of the diagonals.
The complete training objective combines this geometric regularizer with the standard YOLO bounding-box, classification and keypoint terms:
In our reference implementation, the geometric weight
is held at a small value so that
behaves as an auxiliary regularizer rather than as a primary objective: it injects a relative-geometry signal that shapes the search space while leaving the bulk of the gradient to the standard keypoint and bounding-box terms. The loss is clipped to a finite range so that the gradient remains bounded when degenerate, near-parallel-diagonal configurations briefly appear early in training—that is, when
in Equation (
7) and the closed-form
s would otherwise dominate the optimization step.
3.5. Dataset and Annotation
The proposed framework was evaluated on an industrial heliostat image dataset. The dataset comprises 300 high-resolution images of operating heliostats captured at various times of day. The four corner points of each facet of the heliostat in the image are labeled in a fixed TL/TR/BL/BR order, together with a visibility flag, so that the geometric loss in
Section 3 can be computed only over fully visible facets. The dataset is treated as a self-contained engineering benchmark rather than a public competition task. It serves as a testbed for evaluating deep learning methods for the detection and control of heliostats in a CSP plant [
11].
Each image contains a single heliostat composed of an
grid of sub-mirror facets, yielding
corner annotations per fully visible image. Corners that fall inside saturated (over-exposed) or shadowed (under-exposed) regions are intentionally not annotated and are excluded from the loss by the per-keypoint visibility flag
(see Equation (
3)); this convention propagates the optical-degradation statistics of the deployment scene into the supervision signal rather than into the labelling protocol. The 300 images are split at the image level into train, validation and test partitions in an 8:1:1 ratio (240/30/30 images), corresponding to up to 61,440/7680/7680 annotated corners under the fully visible upper bound.