Method, apparatus, and electronic device for training place recognition model
AssigneeTencent Technology (Shenzhen) Company Limited
InventorsDongdong Bai, Yonggen Ling, Wei Liu
Life of this patent
Estimating the term…
Abstract
A computer device extracts local features of sample images based on a first part of a convolutional neural network (CNN) model. The sample images comprise a plurality of images taken at the same place. The device; aggregates the local features into feature vectors having a first dimensionality based on a second part of the CNN model. The device obtains compressed representation vectors of the feature vectors based on a third part of the CNN model. The compressed representation vectors have a second dimensionality less than the first dimensionality. The device trains the CNN model, and obtains a trained CNN mode satisfying a preset condition in accordance with the training.
Claims18
A method for training neural networks, performed by a computer device, the method comprising:
- extracting local features of sample images based on a first part of a convolutional neural network (CNN) model, the sample images comprising a first image, a plurality of second images taken at the same place as the first image, and a plurality of third images taken at a different place from the first image;
- aggregating the local features into feature vectors having a first dimensionality based on a second part of the CNN model, the feature vectors including a first feature vector corresponding to the first image, second feature vectors corresponding to the second images, and third feature vectors corresponding to the third images;
- obtaining compressed representation vectors of the feature vectors based on a third part of the CNN model, the compressed representation vectors having a second dimensionality less than the first dimensionality;
- and
- training the CNN model, including adjusting model parameters of the first, second, and third parts of the CNN model based on the compressed representation vectors, the adjusting including:
- constructing a loss function of the CNN model based on first distances and second distances, the first distances being distances between the first feature vector and the second feature vectors, and the second distances being distances between the first feature vector and the third feature vectors;
- and
- back propagating the loss function through the CNN model to update the model parameters until the updated CNN model satisfies a preset convergence condition.
A computer device, comprising:
- one or more processors;
- and
- memory storing one or more programs, that, when executed by the one or more processors, cause the one or more processors to perform operations comprising:
- extracting local features of sample images based on a first part of a convolutional neural network (CNN) model, the sample images comprising a first image, a plurality of second images taken at the same place as the first image, and a plurality of third images taken at a different place from the first image;
- aggregating the local features into feature vectors having a first dimensionality based on a second part of the CNN model, the feature vectors including a first feature vector corresponding to the first image, second feature vectors corresponding to the second images, and third feature vectors corresponding to the third images;
- obtaining compressed representation vectors of the feature vectors based on a third part of the CNN model, the compressed representation vectors having a second dimensionality less than the first dimensionality;
- training the CNN model, including adjusting model parameters of the first, second, and third parts of the CNN model based on the compressed representation vectors, the adjusting including:
- constructing a loss function of the CNN model based on first distances and second distances, the first distances being distances between the first feature vector and the second feature vectors, and the second distances being distances between the first feature vector and the third feature vectors;
- and
- back propagating the loss function through the CNN model to update the model parameters until the updated CNN model satisfies a preset convergence condition.
A non-transitory computer readable storage medium storing instructions that, when executed by one or more processors of a computer device, cause the one or more processors to perform operations comprising:
- extracting local features of sample images based on a first part of a convolutional neural network (CNN) model, the sample images comprising a first image, a plurality of second images taken at the same place as the first image, and a plurality of third images taken at a different place from the first image;
- aggregating the local features into feature vectors having a first dimensionality based on a second part of the CNN model, the feature vectors including a first feature vector corresponding to the first image, second feature vectors corresponding to the second images, and third feature vectors corresponding to the third images;
- obtaining compressed representation vectors of the feature vectors based on a third part of the CNN model, the compressed representation vectors having a second dimensionality less than the first dimensionality;
- training the CNN model, including adjusting model parameters of the first, second, and third parts of the CNN model based on the compressed representation vectors, the adjusting including:
- constructing a loss function of the CNN model based on first distances and second distances, the first distances being distances between the first feature vector and the second feature vectors, and the second distances being distances between the first feature vector and the third feature vectors;
- and
- back propagating the loss function through the CNN model to update the model parameters until the updated CNN model satisfies a preset convergence condition.
Dependencies are inferred from the claim text.