Vehicle accident image processing method and apparatus
N vehicle accident images are obtained, where N is a natural number greater than or equal to 2. N feature vectors are obtained by inputting the vehicle accident images into a trained convolutional neural network, where the N feature vectors respectively correspond to the vehicle accident images. A distance is calculated between any two feature vectors of the N feature vectors. A determination is made that two vehicle accident images of the N vehicle accident images corresponding to the distance are abnormal when the distance is greater than a first predetermined threshold.
1. A computer-implemented method for vehicle accident image processing, comprising:
obtaining a group of N vehicle accident images, wherein N is a natural number greater than or equal to 2;
obtaining N feature vectors respectively corresponding to the vehicle accident images by inputting the vehicle accident images into a trained convolutional neural network;
calculating respective distances between pairs of feature vectors among the N feature vectors, the pairs of feature vectors corresponding respectively to pairs of images among the N vehicle accident images;
determining that a pair of images of the N vehicle accident images corresponding to the distance are abnormal when the distance is greater than a first predetermined threshold;
determining a number of the vehicle accident images that are abnormal, wherein the number of the vehicle accident images that are abnormal is equal to M;
calculating a first probability based on M and N;
determining that the first probability is greater than a second predetermined threshold; and
in response, classifying the group of the N vehicle accident images as abnormal.
2. The computer-implemented method of claim 1 , wherein the trained convolutional neural network is trained using at least one positive sample pair, wherein the training comprises:
obtaining at least one positive sample pair, wherein each positive sample pair comprises a first image and a second image, and the first image and the second image correspond to the same vehicle accident scene; and
training the convolutional neural network by using the at least one positive sample pair, to decrease a sum of at least one first distance respectively corresponding to the positive sample pair, wherein the at least one first distance is a distance between a feature vector of the first image that is obtained by using the convolutional neural network and a feature vector of the second image that is obtained by using the convolutional neural network.
3. The computer-implemented method of claim 1 , wherein the trained convolutional neural network is trained by at least one negative sample pair, wherein the training comprises:
obtaining at least one negative sample pair, wherein each negative sample pair comprises a third image and a fourth image, and the third image and the fourth image correspond to different vehicle accident scenes; and
training the convolutional neural network by using the at least one negative sample pair, to increase a sum of at least one second distance respectively corresponding to the negative sample pair, wherein the at least one second distance is a distance between a feature vector of the third image that is obtained by using the convolutional neural network and a feature vector of the fourth image that is obtained by using the convolutional neural network.
4. The computer-implemented method of claim 1 , wherein the trained convolutional neural network is trained by at least one positive sample pair and at least one negative sample pair, wherein the training comprises:
obtaining at least one positive sample pair and at least one negative sample pair, wherein each positive sample pair comprises a first image and a second image, the first image and the second image correspond to the same vehicle accident scene, each negative sample pair comprises a third image and a fourth image, and the third image and the fourth image correspond to different vehicle accident scenes; and
training the convolutional neural network by using the at least one positive sample pair and the at least one negative sample pair, to decrease a value obtained by subtracting a sum of at least one second distance corresponding to the negative sample pair from a sum of at least one first distance corresponding to the positive sample pair, wherein the at least one first distance is a distance between a feature vector of the first image that is obtained by using the convolutional neural network and a feature vector of the second image that is obtained by using the convolutional neural network, and the at least one second distance is a distance between a feature vector of the third image that is obtained by using the convolutional neural network and a feature vector of the fourth image that is obtained by using the convolutional neural network.
5. The computer-implemented method of claim 1 , wherein the distance is a Euclidean distance.
6. A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:
obtaining a group of N vehicle accident images, wherein N is a natural number greater than or equal to 2;
obtaining N feature vectors respectively corresponding to the vehicle accident images by inputting the vehicle accident images into a trained convolutional neural network;
calculating respective distances between pairs of feature vectors among the N feature vectors, the pairs of feature vectors corresponding respectively to pairs of images among the N vehicle accident images;
determining that a pair of images of the N vehicle accident images corresponding to the distance are abnormal when the distance is greater than a first predetermined threshold;
determining a number of the vehicle accident images that are abnormal, wherein the number of the vehicle accident images that are abnormal is equal to M;
calculating a first probability based on M and N;
determining that the first probability is greater than a second predetermined threshold; and
in response, classifying the group of the N vehicle accident images as abnormal.
7. The non-transitory, computer-readable medium of claim 6 , wherein the trained convolutional neural network is trained using at least one positive sample pair, wherein the training comprises:
obtaining at least one positive sample pair, wherein each positive sample pair comprises a first image and a second image, and the first image and the second image correspond to the same vehicle accident scene; and
training the convolutional neural network by using the at least one positive sample pair, to decrease a sum of at least one first distance respectively corresponding to the positive sample pair, wherein the at least one first distance is a distance between a feature vector of the first image that is obtained by using the convolutional neural network and a feature vector of the second image that is obtained by using the convolutional neural network.
8. The non-transitory, computer-readable medium of claim 6 , wherein the trained convolutional neural network is trained by at least one negative sample pair, wherein the training comprises:
obtaining at least one negative sample pair, wherein each negative sample pair comprises a third image and a fourth image, and the third image and the fourth image correspond to different vehicle accident scenes; and
training the convolutional neural network by using the at least one negative sample pair, to increase a sum of at least one second distance respectively corresponding to the negative sample pair, wherein the at least one second distance is a distance between a feature vector of the third image that is obtained by using the convolutional neural network and a feature vector of the fourth image that is obtained by using the convolutional neural network.
9. The non-transitory, computer-readable medium of claim 6 , wherein the trained convolutional neural network is trained by at least one positive sample pair and at least one negative sample pair, wherein the training comprises:
obtaining at least one positive sample pair and at least one negative sample pair, wherein each positive sample pair comprises a first image and a second image, the first image and the second image correspond to the same vehicle accident scene, each negative sample pair comprises a third image and a fourth image, and the third image and the fourth image correspond to different vehicle accident scenes; and
training the convolutional neural network by using the at least one positive sample pair and the at least one negative sample pair, to decrease a value obtained by subtracting a sum of at least one second distance corresponding to the negative sample pair from a sum of at least one first distance corresponding to the positive sample pair, wherein the at least one first distance is a distance between a feature vector of the first image that is obtained by using the convolutional neural network and a feature vector of the second image that is obtained by using the convolutional neural network, and the at least one second distance is a distance between a feature vector of the third image that is obtained by using the convolutional neural network and a feature vector of the fourth image that is obtained by using the convolutional neural network.
10. The non-transitory, computer-readable medium of claim 6 , wherein the distance is a Euclidean distance.
11. A computer-implemented system, comprising:
one or more computers; and
one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations comprising:
obtaining a group of N vehicle accident images, wherein N is a natural number greater than or equal to 2;
obtaining N feature vectors respectively corresponding to the vehicle accident images by inputting the vehicle accident images into a trained convolutional neural network;
calculating respective distances between pairs of feature vectors among the N feature vectors, the pairs of feature vectors corresponding respectively to pairs of images among the N vehicle accident images;
determining that a pair of images of the N vehicle accident images corresponding to the distance are abnormal when the distance is greater than a first predetermined threshold;
determining a number of the vehicle accident images that are abnormal, wherein the number of the vehicle accident images that are abnormal is equal to M;
calculating a first probability based on M and N;
determining that the first probability is greater than a second predetermined threshold; and
in response, classifying the group of the N vehicle accident images as abnormal.
12. The computer-implemented system of claim 11 , wherein the trained convolutional neural network is trained using at least one positive sample pair, wherein the training comprises:
obtaining at least one positive sample pair, wherein each positive sample pair comprises a first image and a second image, and the first image and the second image correspond to the same vehicle accident scene; and
training the convolutional neural network by using the at least one positive sample pair, to decrease a sum of at least one first distance respectively corresponding to the positive sample pair, wherein the at least one first distance is a distance between a feature vector of the first image that is obtained by using the convolutional neural network and a feature vector of the second image that is obtained by using the convolutional neural network.
13. The computer-implemented system of claim 11 , wherein the trained convolutional neural network is trained by at least one negative sample pair, wherein the training comprises:
obtaining at least one negative sample pair, wherein each negative sample pair comprises a third image and a fourth image, and the third image and the fourth image correspond to different vehicle accident scenes; and
training the convolutional neural network by using the at least one negative sample pair, to increase a sum of at least one second distance respectively corresponding to the negative sample pair, wherein the at least one second distance is a distance between a feature vector of the third image that is obtained by using the convolutional neural network and a feature vector of the fourth image that is obtained by using the convolutional neural network.
14. The computer-implemented system of claim 11 , wherein the trained convolutional neural network is trained by at least one positive sample pair and at least one negative sample pair, wherein the training comprises:
obtaining at least one positive sample pair and at least one negative sample pair, wherein each positive sample pair comprises a first image and a second image, the first image and the second image correspond to the same vehicle accident scene, each negative sample pair comprises a third image and a fourth image, and the third image and the fourth image correspond to different vehicle accident scenes; and
training the convolutional neural network by using the at least one positive sample pair and the at least one negative sample pair, to decrease a value obtained by subtracting a sum of at least one second distance corresponding to the negative sample pair from a sum of at least one first distance corresponding to the positive sample pair, wherein the at least one first distance is a distance between a feature vector of the first image that is obtained by using the convolutional neural network and a feature vector of the second image that is obtained by using the convolutional neural network, and the at least one second distance is a distance between a feature vector of the third image that is obtained by using the convolutional neural network and a feature vector of the fourth image that is obtained by using the convolutional neural network.
15. The computer-implemented system of claim 11 , wherein the distance is a Euclidean distance.