Method and electronic device for retrieving an image and computer readable storage medium
AssigneeBoe Technology Group Co., Ltd.
InventorTingting Wang
Life of this patent
Estimating the term…
Abstract
According to the embodiments of the present application, there are proposed a method and electronic device for retrieving an image, and computer readable storage medium. The method includes: processing an image to be retrieved using a first neural network to determine a local feature vector of the image to be retrieved; processing the image to be retrieved using a second neural network to determine a global feature vector of the image to be retrieved; and determining, based on the local feature vector and the global feature vector, an image having a similarity to the image to be retrieved which is higher than a similarity threshold.
Claims18
A method for retrieving an image, comprising:
- processing an image to be retrieved using a first neural network to determine a local feature vector of the image to be retrieved;
- processing the image to be retrieved using a second neural network to determine a global feature vector of the image to be retrieved;
- and
- determining, based on the local feature vector and the global feature vector, an image having a similarity to the image to be retrieved which is higher than a similarity threshold;
- wherein the first neural network is trained by using a loss function as follows:
- Lt(ya,yp,yn)=max(∥ya−yp∥22−∥ya−yn∥22+α,0),
- where Lt represents a loss function for the first neural network, ya is a feature vector of a standard image, yp is a feature vector of a positive sample, yn is a feature vector of a negative sample, ∥⋅∥22 represents a square of 2-norm of a vector, max( ) represents a maximum value solving function, and α is margin value.
An electronic device for retrieving an image, comprising:
- a processor;
- and
- a memory having stored thereon instructions which, when executed by the processor, cause the processor to perform the following steps:
- processing an image to be retrieved using a first neural network to determine a local feature vector of the image to be retrieved;
- processing the image to be retrieved using a second neural network to determine a global feature vector of the image to be retrieved;
- and
- determining, based on the local feature vector and the global feature vector, an image having a similarity to the image to be retrieved which is higher than a similarity threshold;
- and
- the method further comprises training the first neural network by using a loss function as follows:
- Lt(ya,yp,yn)=max(∥ya−yp∥22−∥ya−yn∥22+α,0),
- where Lt represents a loss function for the first neural network, ya is a feature vector of a standard image, yp is a feature vector of a positive sample, yn is a feature vector of a negative sample, ∥⋅∥22 represents a square of 2-norm of a vector, max( ) represents a maximum value solving function, and α is margin value.
A non-transitory computer readable storage medium having stored thereon instructions which, when executed by one or more processors, cause the one or more processors to perform the following steps:
- processing an image to be retrieved using a first neural network to determine a local feature vector of the image to be retrieved;
- processing the image to be retrieved using a second neural network to determine a global feature vector of the image to be retrieved;
- and
- determining, based on the local feature vector and the global feature vector, an image having a similarity to the image to be retrieved which is higher than a similarity threshold;
- and
- training the first neural network by using a loss function as follows:
- Lt(ya,yp,yn)=max(∥ya−yp∥22−∥ya−yn∥22+α,0),
- where Lt represents a loss function for the first neural network, ta is a feature vector of a standard image, yp is a feature vector of a positive sample, yn is a feature vector of a negative sample, ∥⋅∥22 represents a square of 2-norm of a vector, max( ) represents a maximum value solving function, and α is margin value.
Dependencies are inferred from the claim text.