Detecting the turbulent/non-turbulent interface is a challenging topic in turbulence research. In the present study, machine learning methods are used to train detectors for identifying turbulent regions in the flow past a circular cylinder. To ensure that the turbulent/non-turbulent interface is independent of the reference frame of coordinates and is physics-informed, we propose to use invariants of tensors appearing in the transport equations of velocity fluctuations, strain-rate tensor and vortical tensor as the input features to identify the flow state. The training samples are chosen from numerical simulation data at two Reynolds numbers, $Re=100$ and 3900. Extreme gradient boosting (XGBoost) is utilized to train the detector, and after training, the detector is applied to identify the flow state at each point of the flow field. The trained detector is found robust in various tests, including the applications to the entire fields at successive snapshots and at a higher Reynolds number $Re=5000$. The objectivity of the detector is verified by changing the input features and the flow region for choosing the turbulent training samples. Compared with the conventional methods, the proposed method based on machine learning shows its novelty in two aspects. First, no threshold value needs to be specified explicitly by the users. Second, machine learning can treat multiple input variables, which reflect different properties of turbulent flows, including the unsteadiness, vortex stretching and three-dimensionality. Owing to these advantages, XGBoost generates a detector that is more robust than those obtained from conventional methods.