A method for classifying sensor data which comprises providing a respective averaged feature vector for a plurality of classes, wherein the method comprises the following steps carried out by means of a classifier, wherein the classifier comprises at least one neural network trained on the basis of training data: • determining a feature vector on the basis of sensor data, wherein the sensor data is lidar data, • respective determining a cosine similarity between the feature vector and the respective averaged feature vector for the plurality of classes, • comparing the respective cosine similarity with a threshold value established for each class beforehand, and • detecting a scenario not represented by the plurality of classes if the threshold values for all classes are not reached, wherein the method further comprises training the classifier according to the training data, wherein the training data comprises first training samples and second training samples, wherein the second training samples are generated by means of a Generative Adversarial Network (GAN; 20), wherein the GAN comprises a generator and a discriminator, wherein the first training samples are based on recording scenarios by means of a sensor, wherein the threshold value is determined for each class, wherein the threshold value of a class is determined by the following steps: • determining the cosine similarity of the feature vector of each first training sample with the averaged feature vector of the class, • determining the averaged cosine similarity or the smallest cosine similarity of the first training data of the class; • establishing the averaged cosine similarity or the smallest cosine similarity as the threshold value of the class. which comprises providing a respective averaged feature vector for a plurality of classes, wherein the method comprises the following steps carried out by means of a classifier, wherein the classifier comprises at least one neural network trained on the basis of training data: • determining a feature vector on the basis of sensor data, wherein the sensor data is lidar data, • respective determining a cosine similarity between the feature vector and the respective averaged feature vector for the plurality of classes, • comparing the respective cosine similarity with a threshold value established for each class beforehand, and • detecting a scenario not represented by the plurality of classes if the threshold values for all classes are not reached, • determining a feature vector on the basis of sensor data, wherein the sensor data is lidar data, • respective determining a cosine similarity between the feature vector and the respective averaged feature vector for the plurality of classes, • comparing the respective cosine similarity with a threshold value established for each class beforehand, and • detecting a scenario not represented by the plurality of classes if the threshold values for all classes are not reached, wherein the method further comprises training the classifier according to the training data, wherein the training data comprises first training samples and second training samples, wherein the second training samples are generated by means of a Generative Adversarial Network (GAN; 20), wherein the GAN comprises a generator and a discriminator, wherein the first training samples are based on recording scenarios by means of a sensor, wherein the threshold value is determined for each class, wherein the threshold value of a class is determined by the following steps: • determining the cosine similarity of the feature vector of each first training sample with the averaged feature vector of the class, • determining the averaged cosine similarity or the smallest cosine similarity of the first training data of the class; • establishing the averaged cosine similarity or the smallest cosine similarity as the threshold value of the class. • determining the cosine similarity of the feature vector of each first training sample with the averaged feature vector of the class, • determining the averaged cosine similarity or the smallest cosine similarity of the first training data of the class; • establishing the averaged cosine similarity or the smallest cosine similarity as the threshold value of the class.