Preventing collisions during automated sample exchange is critical for synchrotron beamlines, particularly for complex cryogenic in-vacuum endstations where recovery from hardware damage may take days. GoniOwl , a compact convolutional neural network (CNN) model, classifies sample-pin presence on the goniometer from a live camera feed on the long-wavelength macromolecular crystallography beamline I23 at Diamond Light Source. Trained on over 8700 manually verified images spanning two years of routine operation and augmented for robustness to illumination changes, camera shifts and occlusions, the model achieves >99% accuracy with millisecond-level inference. A confidence-gating mechanism routes uncertain predictions to a fail-safe path requiring operator confirmation, ensuring suitability for machine-protection control. Integrated via Experimental Physics and Industrial Control System ( EPICS ) process variables, GoniOwl runs in real time within the automated sample-change sequence. In shadow-mode deployment, the CNN matched or exceeded both the legacy histogram method and operator confirmations, which each achieved 96% accuracy. A closed-loop disagreement-audit workflow automatically collects divergent cases for targeted retraining and verification. The approach is readily transferable to other beamline environments where camera-based vision systems can provide an additional software machine protection layer.