Feature extraction method and electronic device
Patent Information
- Application Number
- TW114114892
- Authority / Receiving Office
- TW · TW
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2026-09-21
- Estimated Expiration
- 2045-04-20
Smart Images

Figure TWG2TB001912185_001 
Figure TWG2TB001912185_002 
Figure TWG2TB001912185_003
Abstract
Claims
1. A feature extraction method comprising: performing a first transformation on input data to obtain a first feature map, the first feature map comprising a plurality of first feature vectors; for each of the first feature vectors, calculating a similarity between the first feature vector and each of a plurality of first codes in a first codebook, and setting the index of the most similar first code among the first codes as a first index, the first index indicating the position of the most similar first code in the first codebook; obtaining a second code from a second codebook according to the first index, wherein the first index indicates the position of the second code in the second codebook, the first codebook being different from the second codebook, the second codebook containing the same number of multiple codes as the number of first codes; calculating an excitation quantity based on a similarity degree of the first feature vectors; adjusting the value of the second code according to the excitation quantity; and generating an output feature map based on the adjusted second code.
2. The feature extraction method as described in claim 1, wherein the input data comprises multiple input vectors, the first feature vector is converted into a convolution operation, and the length of the input vectors is the same as the length of the first feature vectors.
3. The feature extraction method as described in claim 2, wherein the step of calculating the excitation quantity based on the similarity of the first feature vectors includes: A second transformation is performed on the first feature map to obtain a second feature vector; for each of the first feature vectors, a first similarity is calculated between the first feature vector and the second feature vector; a third transformation is performed on the first feature map to obtain a third feature map; and the values of the third feature maps are adjusted according to the first similarity to obtain the excitation amount.
4. The feature extraction method as described in claim 3, wherein the step of adjusting the values of the third feature maps according to the first similarity to obtain the excitation amount includes: Substitute the third feature map and the first similarity into a generalized Rogers function to obtain the excitation quantity.
5. The feature extraction method as described in claim 4, wherein the step of adjusting the values of the second code according to the stimulus amount includes: The step of multiplying the excitation quantity element by element by the second code to obtain a product vector, wherein the step of generating the output feature map according to the adjusted second code includes: adding the product vector to one of the corresponding input vectors to obtain an output feature vector in the output feature map.
6. The feature extraction method as described in claim 1 further includes: For multiple samples in a batch, calculate the number of matches for each of the first codes; And a learning rate is determined based on the number of matches.
7. The feature extraction method as described in claim 6, wherein the step of determining the learning rate based on the number of matches includes: The similarity between each pair of these first codes is summed to obtain a total similarity. The learning rate is obtained by multiplying the summed similarity by the number of matches of those first codes and then dividing by the largest of those match counts.
8. The feature extraction method as described in claim 1 further includes: During a training phase, the error between each of the first feature vectors and its corresponding one in the first codes is calculated as part of the loss.
9. An electronic device comprising: A memory module that stores multiple instructions; and a processor, electrically connected to the memory, for executing the instructions to perform multiple steps: performing a first transformation on input data to obtain a first feature map, the first feature map containing a plurality of first feature vectors; for each of the first feature vectors, calculating the similarity between the first feature vector and each of a plurality of first codes in a first codebook, and setting the index of the most similar first code among the first codes as a first index, the first index indicating the position of the most similar first code in the first codebook; retrieving a second code from a second codebook according to the first index, wherein the first index indicates the position of the second code in the second codebook, the first codebook being different from the second codebook, the second codebook containing the same number of multiple codes as the number of first codes; calculating an excitation quantity based on a similarity degree of the first feature vectors; adjusting the value of the second code according to the excitation quantity; and generating an output feature map based on the adjusted second code.
10. The electronic device of claim 9, wherein the input data comprises a plurality of input vectors, the first being converted into a convolution operation, and the length of the input vectors being the same as the length of the first feature vectors.
11. The electronic device of claim 10, wherein the step of calculating the excitation amount based on the similarity of the first feature vectors includes: A second transformation is performed on the first feature map to obtain a second feature vector; for each of the first feature vectors, a first similarity is calculated between the first feature vector and the second feature vector; a third transformation is performed on the first feature map to obtain a third feature map; and the values of the third feature maps are adjusted according to the first similarity to obtain the excitation amount.
12. The electronic device of claim 11, wherein the step of adjusting the values of the third feature maps according to the first similarity to obtain the excitation amount includes: Substitute the third feature map and the first similarity into a generalized Rogers function to obtain the excitation quantity.
13. The electronic device of claim 12, wherein the step of adjusting the values of the second code according to the excitation amount includes: The step of multiplying the excitation quantity element by element by the second code to obtain a product vector, wherein the step of generating the output feature map according to the adjusted second code includes: adding the product vector to one of the corresponding input vectors to obtain an output feature vector in the output feature map.
14. The electronic device as claimed in claim 9, wherein the steps further include: For multiple samples in a batch, calculate the number of matches for each of the first codes; And a learning rate is determined based on the number of matches.
15. The electronic device as claimed in claim 14, wherein the step of determining the learning rate based on the number of matches includes: The similarity between each pair of these first codes is summed to obtain a total similarity. The learning rate is obtained by multiplying the summed similarity by the number of matches of those first codes and then dividing by the largest of those match counts.
16. The electronic device as claimed in claim 9, wherein the steps further include: During a training phase, the error between each of the first feature vectors and its corresponding one in the first codes is calculated as part of the loss.
Citation Information
Patent Citations
Image feature extraction model training method, image search method and computer device
CN110866140A
Neural network device for retrieving image and operating method thereof
CN113496277A
Image deduplication method and device based on deep residual network in combination with perceptual hash algorithm, electronic equipment and storage medium
CN118606507A
Methods for complexity reduction of neural network based video coding tools
TW202441958A
Authenticating physical objects using machine learning from microscopic variations
US20170032285A1
