Eating mussels contaminated with cadmium (Cd) can seriously harm health. In this study, a non‐destructive and rapid detection method for Cd‐contaminated mussels based on near‐infrared reflectance spectroscopy was studied. The spectral data of Cd‐contaminated and non‐contaminated mussels were collected in the range of 950–1700 nm. The model based on a robust energy‐based least squares twin support vector machine (RELS‐TSVM) was established to detect Cd‐contaminated mussels. The influence of parameters on the RELS‐TSVM model was analyzed, and the most suitable parameters were determined. The average accuracy of the proposed RELS‐TSVM model in detecting Cd‐contaminated mussels reached 99.92%, which was better than other twin support vector machine‐derived models. For test datasets with different kinds of spectral noises (Gaussian noise, baseline shift, stray light, and wavelength shift), the RELS‐TSVM model had a high robustness for noise disturbance. The results show that near‐infrared spectroscopy combined with the RELS‐TSVM model can realize the detection of Cd‐contaminated mussels, which can provide technical support for the monitoring of heavy metals in shellfish.Practical ApplicationThe method of detecting Cd‐contaminated mussels by the NIRS has important practical significance for ensuring the safety of consumers. It provides a new way for the quality assessment and safety detection of shellfish and provides a technical basis for the marine environment assessment and management.