WO2022247103A1 - 图像处理方法及装置、电子设备和计算机可读存储介质 - Google Patents

图像处理方法及装置、电子设备和计算机可读存储介质 Download PDF

Info

Publication number
WO2022247103A1
WO2022247103A1 PCT/CN2021/123597 CN2021123597W WO2022247103A1 WO 2022247103 A1 WO2022247103 A1 WO 2022247103A1 CN 2021123597 W CN2021123597 W CN 2021123597W WO 2022247103 A1 WO2022247103 A1 WO 2022247103A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature
attention
image block
self
features
Prior art date
Application number
PCT/CN2021/123597
Other languages
English (en)
French (fr)
Inventor
陈博宇
李楚鸣
Original Assignee
上海商汤智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2022247103A1 publication Critical patent/WO2022247103A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to an image processing method and device, electronic equipment, and a computer-readable storage medium.
  • the self-attention network has been widely used in natural language processing.
  • the self-attention network strengthens the features by establishing the connection between features, thereby improving the final performance of the network.
  • the self-attention network has also been applied on a large scale in the field of computer vision, showing great potential.
  • the design of the existing visual self-attention network simply copied the design in natural language processing, and did not improve the characteristics of computer vision, making the performance of the visual self-attention network poor.
  • Embodiments of the present disclosure propose a technical solution of an image processing method and device, electronic equipment, and a storage medium.
  • an image processing method including: determining a plurality of first image block features corresponding to a target image; performing n based on a self-attention mechanism according to the plurality of first image block features Secondary feature enhancement to obtain a plurality of second image block features, wherein the number and channel number of the second image block features and the first image block features are the same, and n is an integer greater than or equal to 1; for all Feature pooling is performed on the plurality of second image block features to obtain a plurality of third image block features, wherein the number of the third image block features is smaller than the number of the second image block features, and the first The number of channels of the features of the three image blocks is greater than the number of channels of the features of the second image block; according to the features of the plurality of third image blocks, a target image processing operation is performed on the target image to obtain an image processing result.
  • the feature enhancement is performed n times based on the self-attention mechanism to obtain multiple second image block features, including: based on the self-attention mechanism, Perform feature enhancement on the input feature corresponding to the i-th feature enhancement to obtain the output feature corresponding to the i-th feature enhancement, wherein, i is an integer greater than or equal to 1 and less than or equal to n; in the case of i equal to n
  • the output features corresponding to the i-th feature enhancement are determined as the features of the multiple second image blocks; when i is equal to 1, the input features corresponding to the first feature enhancement are the multiple first image block features.
  • the self-attention mechanism is used to perform feature enhancement on the input features corresponding to the i-th feature enhancement, and to obtain the output features corresponding to the i-th feature enhancement, including: according to the i-th feature enhancement
  • the input feature corresponding to the i feature enhancement is determined to determine the first feature vector, the second feature vector and the third feature vector; according to the first feature vector and the second feature vector, determine the i feature enhancement corresponding to An attention feature map; according to the attention feature map corresponding to the i-th feature enhancement and the third feature vector, determine the output feature corresponding to the i-th feature enhancement.
  • the method when i satisfies the preset condition, the method further includes: determining the output feature corresponding to the ith feature enhancement as the input corresponding to the i+1 feature enhancement feature; the attention feature map corresponding to the ith feature enhancement is determined as the attention feature map corresponding to the i+1 feature enhancement; use the i+1 feature enhancement corresponding attention feature
  • the feature enhancement is performed on the input feature corresponding to the i+1 feature enhancement, and the output feature corresponding to the i+1 feature enhancement is obtained.
  • the feature enhancement is performed on the input feature corresponding to the i+1th feature enhancement by using the attention feature map corresponding to the i+1th feature enhancement to obtain the Strengthening the corresponding output feature of the i+1 feature, including: strengthening the corresponding input feature according to the i+1 feature, and determining the fourth feature vector; strengthening the corresponding attention feature map according to the i+1 feature and the fourth feature vector to determine an output feature corresponding to the i+1th feature enhancement.
  • the performing feature pooling on the multiple second image block features to obtain multiple third image block features includes: performing convolution on the multiple second image block features Processing to obtain a plurality of fourth image block features, wherein the number of the fourth image block features is the same as that of the second image block features, and the number of channels of the fourth image block features is greater than that of the second image The number of channels of the block feature; performing pooling processing on the plurality of fourth image block features to obtain the plurality of third image block features.
  • the image processing method is implemented by a self-attention neural network, which includes a self-attention part and a feature pooling part; Image block features, based on the self-attention mechanism for n times feature enhancement, to obtain a plurality of second image block features, including: using the self-attention part, according to the plurality of first image block features, based on the self-attention mechanism Perform n times of feature enhancement to obtain the plurality of second image block features; performing feature pooling on the plurality of second image block features to obtain a plurality of third image block features includes: using the feature pool The optimization part performs feature pooling on the plurality of second image block features to obtain the plurality of third image block features.
  • the self-attention part includes n self-attention layers, wherein each self-attention layer is used to perform feature enhancement once, and at least two adjacent self-attention layers Sharing the same attention feature map; and/or, the feature pooling part includes a convolution layer and a maximum pooling layer, wherein the convolution kernel size corresponding to the convolution layer is smaller than a threshold.
  • the method further includes: constructing a network structure search space, wherein the network structure search space includes a plurality of network hyperparameters corresponding to the self-attention neural network; according to the network Structure search space, constructing a super network, wherein, the network structure search space includes multiple optional network structures constructed according to the multiple network hyperparameters; by performing network training on the super network, from the multiple The target network structure is determined in the optional network structure; according to the target network structure, the self-attention neural network is constructed.
  • the plurality of network hyperparameters include: image block feature number parameters, image block feature channel number parameters, layer parameters corresponding to the self-attention part, and the self-attention part In need to share the position parameters of at least two adjacent self-attention layers that share the same attention feature map.
  • the respective attention layers included in the same self-attention part correspond to the same parameter value of the number of image block features and the same value of the parameter number of image block feature channels.
  • an image processing device including: a feature determination part configured to determine a plurality of first image block features corresponding to a target image; a self-attention part configured to A plurality of first image block features, based on the self-attention mechanism for n times feature enhancement, to obtain a plurality of second image block features, wherein the number and channel of the second image block features and the first image block features The numbers are all the same, and n is an integer greater than or equal to 1; the feature pooling part is configured to perform feature pooling on the features of the plurality of second image blocks to obtain a plurality of features of the third image block, wherein the first The number of features of the three image blocks is less than the number of features of the second image block, and the number of channels of the features of the third image block is greater than the number of channels of the features of the second image block; the target image processing part is configured performing a target image processing operation on the target image according to the features of the plurality of third image blocks to obtain an image
  • an electronic device including: a processor; a memory configured to store instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory, to perform the above method.
  • a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented.
  • An embodiment of the present disclosure provides a computer program.
  • the computer program product includes a computer program or an instruction.
  • the computer program or instruction When the computer program or instruction is run on a computer, the computer executes the above image processing method.
  • a plurality of first image block features corresponding to the target image are determined; according to the plurality of first image block features, n times feature enhancement is performed based on a self-attention mechanism to obtain a plurality of second image block features, where , the number and number of channels of the second image block feature and the first image block feature are the same, n is an integer greater than or equal to 1; feature pooling is performed on multiple second image block features to obtain multiple third image blocks feature, wherein the number of features of the third image block is less than the number of features of the second image block, and the number of channels of the features of the third image block is greater than the number of channels of the features of the second image block; according to a plurality of features of the third image block, A target image processing operation is performed on the target image to obtain an image processing result.
  • the number of image block features can be reduced, and the number of channels of image block features can be increased, so that the spatial redundancy features can be reduced, and the image can be improved.
  • the semantic expression ability of the block feature, and then after using the image block feature with high semantic expression ability to perform the target image processing operation, the accuracy of the image processing result can be improved.
  • FIG. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure
  • Fig. 2 shows a schematic diagram of determining features of multiple first image blocks corresponding to a target image according to an embodiment of the present disclosure
  • FIG. 3 shows a network structure diagram of a self-attention neural network according to an embodiment of the present disclosure
  • FIG. 4 shows a schematic diagram of a self-attention part in a self-attention neural network according to an embodiment of the present disclosure
  • Fig. 5 shows a block diagram of an image processing device according to an embodiment of the present disclosure
  • Fig. 6 shows a block diagram of an electronic device according to an embodiment of the present disclosure
  • Fig. 7 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • Fig. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure.
  • the image processing method can be executed by electronic devices such as terminal equipment or servers, and the terminal equipment can be user equipment (User Equipment, UE), mobile equipment, user terminal, cellular phone, cordless phone, personal digital assistant (Personal Digital Assistant, PDA) , a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc., the method may be implemented by calling a computer-readable instruction stored in a memory by a processor. Alternatively, the method may be performed by a server. As shown in Figure 1, the image processing method may include:
  • step S11 a plurality of first image block features corresponding to the target image are determined.
  • the target image here is an image to be processed that requires image processing.
  • the target image can be segmented, and the target image can be divided into multiple image blocks, and a plurality of first image blocks corresponding to the target image can be obtained by performing feature extraction on each image block feature.
  • the number of multiple image blocks may be determined according to actual conditions, which is not limited in this embodiment of the present disclosure.
  • Fig. 2 shows a schematic diagram of determining features of multiple first image blocks corresponding to a target image according to an embodiment of the present disclosure.
  • the target image is segmented, the target image is divided into L image blocks, feature extraction is performed on the L image blocks respectively, and L first image block features are obtained, and the number of channels of each first image block feature is d.
  • the number of channels of each first image block feature can be set according to actual conditions, which is not limited in the present disclosure.
  • the multiple first image block features may be converted into a first image block feature sequence.
  • the manner of converting the multiple first image block features into the first image block feature sequence may be determined according to actual conditions, which is not limited in this embodiment of the present disclosure.
  • step S12 according to a plurality of first image block features, n times feature enhancement is performed based on a self-attention mechanism to obtain a plurality of second image block features, wherein the number of second image block features and first image block features are the same as the number of channels, and n is an integer greater than or equal to 1.
  • Each feature enhancement process does not change the number of image block features and the number of channels. Therefore, according to multiple first image block features, after n times of feature enhancement based on the self-attention mechanism, the obtained second image block features and The number of features and the number of channels of the first image block before feature enhancement are the same.
  • the feature enhancement process will be described in detail later in conjunction with possible implementations of the present disclosure, and will not be repeated here.
  • L first image block features whose number of channels is d shown in Figure 2 above as an example
  • n times feature enhancement is performed based on the self-attention mechanism, and L second image blocks are obtained feature, the number of channels of each second image block feature is still d.
  • n times feature enhancement can be performed based on the self-attention mechanism according to the first image block sequence to obtain multiple second image block features The feature sequence of the second image block.
  • step S13 perform feature pooling on multiple second image block features to obtain multiple third image block features, wherein the number of third image block features is less than the number of second image block features, and the third The number of channels of the feature of the image block is greater than the number of channels of the feature of the second image block.
  • the feature enhancement process is equivalent to the further feature extraction process of the target image. Since there may be redundant features in the spatial dimension with the deep-level feature extraction, by performing feature pooling on multiple second image block features, It is possible to reduce the dimension of the image block features in the spatial dimension and increase the dimension in the channel dimension, so that while keeping the calculation amount unchanged, it can not only reduce the spatial redundant features, but also make the multiple features obtained after feature pooling
  • the feature of the third image block has higher semantic expression ability.
  • the L second image block features whose number of channels is d perform feature pooling on the L second image block features to obtain L/4 third image block features, and the channel of each third image block feature The number is 2d, so as to realize the dimensionality reduction in the spatial dimension and the dimensionality enhancement in the channel dimension for the L second image block features with the channel number d.
  • the number of features of the third image block and the value of the number of channels may be set according to actual conditions, which is not limited in this embodiment of the present disclosure.
  • feature pooling is performed on the second image block feature sequence to obtain a third image block feature sequence including a plurality of third image block features .
  • step S14 a target image processing operation is performed on the target image according to the characteristics of a plurality of third image blocks to obtain an image processing result.
  • the multiple third image block features have higher semantic expression ability, according to image processing requirements, the multiple third image block features can be used to perform target image processing operations, so that image processing results with higher precision can be obtained.
  • a plurality of first image block features corresponding to the target image are determined; according to the plurality of first image block features, n times feature enhancement is performed based on a self-attention mechanism to obtain a plurality of second image block features, where , the number and number of channels of the second image block feature and the first image block feature are the same, n is an integer greater than or equal to 1; feature pooling is performed on multiple second image block features to obtain multiple third image blocks feature, wherein the number of features of the third image block is less than the number of features of the second image block, and the number of channels of the features of the third image block is greater than the number of channels of the features of the second image block; according to a plurality of features of the third image block, A target image processing operation is performed on the target image to obtain an image processing result.
  • the number of image block features can be reduced, and the number of channels of image block features can be increased, so that the spatial redundancy features can be reduced, and the image can be improved.
  • the semantic expression ability of the block feature, and then after using the image block feature with high semantic expression ability to perform the target image processing operation, the accuracy of the image processing result can be improved.
  • feature enhancement is performed n times based on the self-attention mechanism to obtain multiple second image block features, including: based on the self-attention mechanism, the i-th
  • the input feature corresponding to feature enhancement is enhanced to obtain the output feature corresponding to the i-th feature enhancement, where i is an integer less than or equal to n; when i is equal to n, the output feature corresponding to the i-th feature enhancement is obtained.
  • the input feature corresponding to the first feature enhancement is a plurality of first image block features; when i is greater than 1, the i-th feature enhancement corresponds to The input feature of is the output feature corresponding to the i-1th feature enhancement.
  • n may be determined according to actual conditions, which is not limited in this embodiment of the present disclosure.
  • n the value of n is 6.
  • multiple first image block features are initialized as the input features corresponding to the first feature enhancement, and then based on the self-attention mechanism, feature enhancement is performed on the input features corresponding to the first feature enhancement to obtain the first The output feature corresponding to feature enhancement; the output feature corresponding to the first feature enhancement is determined as the input feature corresponding to the second feature enhancement, and then based on the self-attention mechanism, the feature enhancement is performed on the input feature corresponding to the second feature enhancement , to obtain the output features corresponding to the second feature enhancement; and so on, until the output features corresponding to the sixth feature enhancement are obtained, and the output features corresponding to the sixth feature enhancement are determined as multiple second image block features.
  • N times of feature enhancement based on the self-attention mechanism will neither change the number of image block features nor the number of channels of image block features. Therefore, still taking the above L first image block features, the number of channels of each first image block feature is d as an example, according to the L first image block features, after n times of feature enhancement based on the self-attention mechanism, it can be obtained There are L second image block features, and the number of channels of each second image block feature is still d.
  • the feature enhancement is performed on the input feature corresponding to the i-th feature enhancement, and the output feature corresponding to the i-th feature enhancement is obtained, including: according to the i-th feature enhancement corresponding to Input features, determine the first feature vector, the second feature vector, and the third feature vector; according to the first feature vector and the second feature vector, determine the attention feature map corresponding to the i-th feature enhancement; according to the i-th feature enhancement corresponding The attention feature map and the third feature vector determine the output feature corresponding to the i-th feature enhancement.
  • the attention feature map corresponding to the i-th feature enhancement By determining the attention feature map corresponding to the i-th feature enhancement, so that the attention feature map corresponding to the i-th feature enhancement can be used to perform feature enhancement on the input feature corresponding to the i-th feature enhancement, and effectively obtain the i-th feature Strengthen the corresponding output features.
  • the input feature corresponding to the i-th feature enhancement is converted into three different feature vectors: the first feature vector Q i , the second feature vector K i and the third feature vector V i , where the first feature vector Q i , the number of channels corresponding to the second eigenvector K i and the third eigenvector V i are all d.
  • the following formula (1) can be used to achieve feature enhancement:
  • Softmax( ) represents the normalization function
  • represents the vector dot product.
  • the dot product operation can be obtained by using the first eigenvector Q i and the second eigenvector K i to obtain the dot product result Q i ⁇ ((K i ) T ), using the number of channels d and normalization
  • the normalization function Softmax( ⁇ ) performs a normalization operation on the dot product result Q i ⁇ ((K i ) T ), and the attention feature map corresponding to the i-th feature enhancement can be obtained Use the i-th feature to strengthen the corresponding attention feature map Perform a dot product operation with the third feature vector V i to obtain the output feature Att(Q i , K i , V i ) corresponding to the i-th feature enhancement.
  • the image processing method when i satisfies the preset condition, further includes: determining the output feature corresponding to the i-th feature enhancement as the input feature corresponding to the i+1 feature enhancement ;Determine the attention feature map corresponding to the i-th feature enhancement as the attention feature map corresponding to the i+1 feature enhancement; The input features corresponding to the second feature enhancement are subjected to feature enhancement, and the output features corresponding to the i+1th feature enhancement are obtained.
  • the attention feature map corresponding to the i-th feature enhancement can be reused, thereby reducing the amount of calculation and effectively improving the efficiency of feature enhancement.
  • every k adjacent feature enhancements in the n feature enhancements can be divided into a group, and the k feature enhancements in the same group share the same attention feature map.
  • the preset condition may be that i is not equal to mk, k is a positive number greater than or equal to 1, and m is an integer greater than or equal to 0.
  • the 1st to 3rd feature enhancements share the same attention feature map (for example, the 2nd feature enhancement and the 3rd feature enhancement share the attention feature map corresponding to the 1st feature enhancement), the 4th to 6th feature enhancement
  • the secondary feature enhancements share the same attention feature map (for example, the 5th feature enhancement and the 6th feature enhancement share the attention feature map corresponding to the 4th feature enhancement), and the 7th to 9th feature enhancements share the same Attention feature map (for example, the 8th feature enhancement and the 9th feature enhancement, share the attention feature map corresponding to the 7th feature enhancement).
  • the i+1th feature enhancement can reuse the i The attention feature map corresponding to the secondary feature enhancement; and when i is equal to 3m (m is equal to 0, 1, 2, that is, i is equal to 0, 3, 6), the i+1th feature enhancement needs to be based on the i+1th Get the corresponding attention feature map of the input features.
  • the corresponding attention feature map; the preset condition can also be set in other forms according to the actual situation, which is not limited in this embodiment of the present disclosure.
  • the attention feature map corresponding to the i+1th feature enhancement is used to perform feature enhancement on the input feature corresponding to the i+1th feature enhancement, and the i+1th feature enhancement corresponding to Output features, including: according to the i+1th feature enhancement corresponding to the input feature, determine the fourth feature vector; according to the i+1th feature enhancement corresponding to the attention feature map and the fourth feature vector, determine the i+1th time Feature enhancements correspond to output features.
  • the output feature Att corresponding to the i-th feature enhancement (Q i , K i , V i ), determined as the input feature corresponding to the i+1th feature enhancement.
  • the i+1th feature enhancement can share the attention feature map corresponding to the i-th feature enhancement, so the attention feature map corresponding to the i-th feature enhancement It is determined as the attention feature map corresponding to the i+1th feature enhancement.
  • the input feature Att(Q i , K i , V i ) corresponding to the i+1th feature enhancement is converted into the fourth feature vector V i+1 , and then the i+1th feature can be used to enhance the corresponding attention feature map Perform a dot product operation with the fourth feature vector V i+1 to determine the output feature Att(Q i , K i , V i+1 ) corresponding to the i+1th feature enhancement.
  • the n-time feature enhancement process can reduce the amount of computation, thereby effectively improving the feature enhancement efficiency.
  • the method shown in the above formula (1) can be used to determine the attention feature map corresponding to the i+1th feature enhancement, and to achieve feature enhancement.
  • the determination process can refer to The process of the above formula (1) will not be repeated here.
  • performing feature pooling on multiple second image block features to obtain multiple third image block features includes: performing convolution processing on multiple second image block features to obtain multiple third image block features Four image block features, wherein, the fourth image block feature has the same number as the second image block feature, and the channel number of the fourth image block feature is greater than the channel number of the second image block feature; for multiple fourth image block features Perform pooling processing to obtain multiple third image block features.
  • a smaller-sized convolution kernel can be used to perform one-dimensional convolution processing on the L second image block features to obtain L feature of the fourth image block, the number of channels of each fourth image block feature is 2d, thereby increasing the number of channels of the image block feature; and then performing one-dimensional maximum pooling processing on the L fourth image block features to obtain L/4
  • the number of channels of each third image block feature is still 2d, thereby reducing the number of image block features.
  • one-dimensional average pooling process may be used for pooling processing, and other pooling processing methods may also be used, which is not limited in this embodiment of the present disclosure.
  • the above-mentioned n times of feature enhancement and feature pooling process can be iterated and repeated multiple times to obtain the finally determined number of image block features that reduce the number of channels and increase the number of channels of image block features.
  • the third image block feature, and then multiple third image block features can be used to complete the image processing operation on the target image.
  • the number of iterations of feature enhancement and feature pooling n times may be determined according to actual conditions, which is not limited in this embodiment of the present disclosure.
  • the target image processing operation includes one of the following: target detection, target tracking, image recognition, and image classification.
  • the target image processing operation is performed by using the third image block features with higher semantic expression ability, so that an image processing result with higher precision can be obtained.
  • target image processing operations may also include other image processing operations according to actual image processing requirements, which are not limited in this embodiment of the present disclosure.
  • the image processing method is implemented through a self-attention neural network, which includes a self-attention part and a feature pooling part; according to a plurality of first image block features, based on self-attention
  • the mechanism performs n times of feature enhancement to obtain multiple second image block features, including: using the self-attention part, according to multiple first image block features, and based on the self-attention mechanism to perform n times of feature enhancement to obtain multiple second images block features; performing feature pooling on multiple second image block features to obtain multiple third image block features, including: using the feature pooling part to perform feature pooling on multiple second image block features to obtain multiple first image block features Three image block features.
  • the self-attention part can be used to realize the feature enhancement of the image block features, and then the feature pooling part can be used to improve the image block features after feature enhancement.
  • Feature pooling to reduce the number of image block features and increase the number of channels of image block features, so that it can not only reduce spatial redundancy features, but also improve the semantic expression ability of image block features, thereby effectively improving the self-attention neural network. network performance.
  • Fig. 3 shows a network structure diagram of a self-attention neural network according to an embodiment of the present disclosure.
  • the self-attention neural network includes three self-attention parts (self-attention parts A, B, C) and two feature pooling parts (feature pooling parts D, E). Segment the target image, divide the target image into L image blocks, perform feature extraction on the L image blocks respectively, and obtain an image block feature sequence (dimension is L ⁇ d) including L first image block features.
  • the number of self-attention parts and feature pooling parts included in the self-attention neural network can be set according to actual conditions, which is not limited in the embodiments of the present disclosure.
  • the value of N1 and the number of image block feature sequences and the number of channels after feature pooling can be set according to the actual situation, which is not limited in this embodiment of the present disclosure.
  • N 2 Second feature enhancement to obtain the feature-enhanced L/2 ⁇ 1.5d image block feature sequence; then input the feature-enhanced L/2 ⁇ 1.5d image block feature sequence into the feature pooling part E, and use the feature pooling part E performs feature pooling on the L/2 ⁇ 1.5d image block feature sequence after feature enhancement, and obtains the L/4 ⁇ 2d image block feature sequence after feature pooling.
  • the value of N 2 and the number of image block feature sequences and the number of channels after feature pooling can be set according to actual conditions, which is not limited in this embodiment of the present disclosure.
  • the L/4 ⁇ 2d image block feature sequence is used as the feature finally obtained by the self-attention neural network and used for subsequent target image processing operations. For example, cls features for image classification.
  • the value of N 3 and the number of image block feature sequences and the number of channels after feature pooling can be set according to actual conditions, which is not limited in this embodiment of the present disclosure.
  • the self-attention part includes multiple self-attention layers, wherein each self-attention layer is used for feature enhancement, and at least two adjacent self-attention layers share the same attention Force feature map; and/or, the feature pooling part includes a convolution layer and a maximum pooling layer, wherein the convolution kernel size corresponding to the convolution layer is smaller than the threshold.
  • the self-attention part can reduce the amount of computation, thereby effectively improving the efficiency of feature enhancement.
  • the self-attention part A includes N 1 self-attention layers (using N 1 self-attention layers can perform N 1 feature enhancements)
  • the self-attention part B includes N 2 self-attention layers (using N 2 self-attention layers can perform N 2 feature enhancements)
  • the self-attention part C includes N 3 self-attention layers (using N 3 self-attention layers A layer can perform N 3 feature enhancements).
  • at least one self-attention part at least two adjacent self-attention layers in the self-attention part share the same attention feature map.
  • the N 1 self-attention layers of self-attention part A two adjacent self-attention layers are grouped, and the two self-attention layers in each group share the same attention feature map.
  • the number and location distribution of adjacent attention layers sharing the same attention feature map may be determined according to actual conditions, which is not limited in this embodiment of the present disclosure.
  • FIG. 4 shows a schematic diagram of a self-attention part in a self-attention neural network according to an embodiment of the present disclosure. As shown in Figure 4, multiple self-attention layers are included in one self-attention part. For any self-attention part, at least two adjacent self-attention layers in the self-attention part share the same attention feature map.
  • the i-th self-attention layer corresponds to the i-th feature enhancement
  • the i-th self-attention layer converts the corresponding input feature (that is, the i-th feature enhancement corresponds) to Three different eigenvectors: the first eigenvector Q i , the second eigenvector K i and the third eigenvector V i , and then according to the first eigenvector Q i and the second eigenvector K i , using the above formula (1)
  • Determine the attention feature map corresponding to the i-th self-attention layer that is, corresponding to the i-th feature enhancement
  • the attention feature map corresponding to the i-th self-attention layer Perform a dot product with the third feature vector V i to obtain the output feature Att(Q i , K i , V i ) corresponding to the i-th self-attention layer (that is, corresponding to the i-th feature enhancement
  • the i+1th self-attention layer converts the input feature Att(Q i ,K i ,V i ) into a fourth feature vector V i+1 , and then directly converts the input Attention feature map of Perform a dot product with the fourth feature vector V i+1 to obtain the output feature corresponding to the i+1th self-attention layer (that is, corresponding to the i+1th feature enhancement), so that the i+1th feature can be enhanced
  • the calculation amount is reduced, the calculation redundancy is reduced, and the network performance of the self-attention neural network is effectively improved.
  • the self-attention corresponding to the i-th self-attention layer is generated in the i-th self-attention layer Feature map
  • the i+1th self-attention layer directly shares the attention feature map corresponding to the i-th self-attention layer
  • the i+2th self-attention layer generates the i+2th self-attention layer corresponding to
  • the self-attention feature map of the i+3 self-attention layer directly shares the attention feature map corresponding to the i+2-th self-attention layer, and so on.
  • the number of self-attention layers included in the self-attention part, and the positions and numbers of self-attention layers that need to share the same attention feature map can be determined according to actual conditions, which are not limited in the embodiments of the present disclosure.
  • the self-attention part includes 6 self-attention layers, wherein every two adjacent self-attention layers form a group and share the same attention feature map. That is to say, the same attention feature map is shared between the 1st and 2nd self-attention layers (share the attention feature map generated in the 1st self-attention layer), the 3rd and 4th self-attention layers Share the same attention feature map between attention layers (share the attention feature map generated in the 3rd self-attention layer), share the same attention feature map between the 5th and 6th self-attention layers (Sharing the attention feature map generated in the 5th self-attention layer).
  • 6 self-attention layers are included in the self-attention part, wherein the same attention feature map is shared among the 3rd, 4th and 5th self-attention layers (shared 3rd Attention feature map generated in a self-attention layer), other self-attention layers are independent of each other.
  • the convolution layer whose convolution kernel size is smaller than the threshold in the feature pooling part can increase the number of channels of image block features, and then use the maximum pooling layer to reduce the number of image block features, thereby effectively reducing spatial redundancy. features to improve the semantic expression ability of image block features.
  • the value of the threshold may be determined according to actual conditions, which is not limited in this embodiment of the present disclosure.
  • a feature pooling part is set between adjacent self-attention parts, so that as the network depth of the self-attention neural network increases, the feature pooling part can be used to perform spatial dimensionality analysis on image block features. Dimensionality reduction, as well as dimensionality enhancement of the channel dimension, thereby effectively reducing spatial redundant features and improving the network performance of the self-attention neural network while maintaining the same amount of calculation.
  • the self-attention neural network may be a visual transformer (Transformer).
  • a visual transformer Transformer
  • multiple self-attention layers between the feature pooling parts are defined as a self-attention part, and between at least two adjacent self-attention layers Shared attention (share the same attention feature map), thus constituting the visual Transformer based on feature pooling and attention sharing of the embodiment of the present disclosure.
  • the number of self-attention parts, the number of self-attention layers in the self-attention part, the number of image block features and the number of channels corresponding to each attention layer need to share the same
  • the number and position distribution of the adjacent self-attention layers of the attention feature map are all network hyperparameters that need to be considered.
  • the image processing method further includes: constructing a network structure search space, wherein the network structure search space includes a plurality of network hyperparameters corresponding to the self-attention neural network; according to the network structure search space, constructing Super network, wherein the network structure search space includes multiple optional network structures constructed according to multiple network hyperparameters; by performing network training on the super network, the target network structure is determined from multiple optional network structures; according to the target network structure, constructing a self-attention neural network.
  • the network structure search space can be constructed to realize the construction of a super network by using the search space, and through the training of the super network, the search for the target network structure and the results obtained based on the search can be realized.
  • the target network structure builds a self-attention neural network, thereby avoiding the manual design of network hyperparameters and network structure, realizing automatic construction of a self-attention neural network, and effectively improving the efficiency of network construction.
  • multiple network hyperparameters include: the number of image block features, the number of image block feature channels, the number of layers corresponding to the self-attention part, and the need to share the same attention features in the self-attention part The location of at least two adjacent self-attention layers of the graph.
  • the number of image block features corresponding to each self-attention layer has S t options
  • the number of image block feature channels has S f options
  • S s options for the use of the attention feature map of the attention layer (that is, the position of the self-attention layer that needs to share the same attention feature map), and then you can construct (S t ⁇ S f ⁇ S s ) L
  • the respective attention layers included in the same self-attention part correspond to the same number of image block features and the same number of channels.
  • the construction principles of the self-attention neural network may include: 1) the number of self-attention parts is limited (for example, 3 self-attention parts); 2) the respective attention layers included in the same self-attention block correspond to the same The number of image block features and the same number of image block feature channels; 3) With the increase of network depth, the number of image block features corresponding to each attention part decreases, and the number of image block feature channels increases.
  • the optional network structure included in the super network that does not conform to the construction principle is deleted, thereby reducing the size of the network structure search space and improving the subsequent search efficiency for the target network structure.
  • the super network After narrowing the network structure search space based on the construction principle of the self-attention neural network, all the optional network structures included in the super network conform to the construction principle of the self-attention neural network.
  • the super network Based on the single path one-shot (Single path one-shot, SPOS) algorithm, the super network is trained to obtain the target network architecture for constructing the self-attention neural network.
  • the SPOS algorithm selects an optional network architecture at each training iteration, and updates the network parameters of the selected optional network architecture in the super network.
  • other optional network architectures will inherit the trained network parameters from the super network and continuously update these parameters without having to train from scratch, thus effectively improving the training of the super network Efficiency to achieve fast search to get the target network architecture for building self-attention neural network.
  • a self-attention neural network can be constructed, which includes a self-attention part and a feature pooling part.
  • the self-attention part includes multiple self-attention layers, and the respective attention layers included in the same self-attention part correspond to the same number of image block features and number of image block feature channels.
  • the self-attention part is configured to perform feature enhancement on image block features based on the self-attention mechanism.
  • the feature enhancement process of the self-attention part is similar to the above-mentioned related feature enhancement process, and will not be repeated here.
  • the same attention feature map is shared between at least two adjacent self-attention layers in the self-attention part, so as to reduce the calculation amount of the feature enhancement process and effectively improve the feature enhancement efficiency.
  • the feature pooling part is configured to reduce the dimensionality of the space dimension and increase the dimensionality of the channel dimension for the image block features after feature enhancement as the depth of the self-attention neural network increases, so as to achieve In this case, the spatial redundant features are reduced, the semantic representation ability of the image block features is improved, and the network performance of the self-attention neural network is effectively improved.
  • the self-attention neural network of the embodiments of the present disclosure can be applied to image processing tasks such as target detection, target tracking, image recognition, image classification, etc., which is not limited in the embodiments of the present disclosure.
  • embodiments of the present disclosure also provide image processing devices, electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any image processing method provided by the embodiments of the present disclosure, corresponding technical solutions and descriptions, and refer to methods Part of the corresponding records will not be repeated.
  • Fig. 5 shows a block diagram of an image processing device according to an embodiment of the present disclosure. As shown in Figure 5, the device 50 includes:
  • the feature determination part 51 is configured to determine a plurality of first image block features corresponding to the target image
  • the self-attention part 52 is configured to perform n times of feature enhancement based on the self-attention mechanism according to a plurality of first image block features, to obtain a plurality of second image block features, wherein the second image block features and the first image block
  • the number of features and the number of channels are the same, and n is an integer greater than or equal to 1;
  • the feature pooling part 53 is configured to perform feature pooling on a plurality of second image block features to obtain a plurality of third image block features, wherein the number of third image block features is less than the number of second image block features , and the number of channels of the third image block feature is greater than the number of channels of the second image block feature;
  • the target image processing part 54 is configured to perform a target image processing operation on the target image according to a plurality of third image block features to obtain an image processing result.
  • the self-attention part 52 includes:
  • the i-th self-attention sub-part is configured to perform feature enhancement on the input feature corresponding to the i-th feature enhancement based on the self-attention mechanism, and obtain the output feature corresponding to the i-th feature enhancement, where i is less than or equal to an integer of n;
  • the nth determination subpart is configured to determine the output feature corresponding to the i-th feature enhancement as a plurality of second image block features when i is equal to n;
  • the input feature corresponding to the first feature enhancement is a plurality of first image block features; when i is greater than 1, the input feature corresponding to the i-th feature enhancement is the i-1th feature Strengthen the corresponding output features.
  • the i-th self-attention subpart includes:
  • the first determination part is configured to determine the first feature vector, the second feature vector and the third feature vector according to the i-th feature enhancement corresponding to the input feature;
  • the second determination part is configured to determine the attention feature map corresponding to the i-th feature enhancement according to the first feature vector and the second feature vector;
  • the third determining part is configured to determine the output feature corresponding to the i-th feature enhancement according to the attention feature map corresponding to the i-th feature enhancement and the third feature vector.
  • the device 50 further includes: the i+1th self-attention subpart; the i+1th self-attention subpart, including:
  • the fourth determining part is configured to determine the output feature corresponding to the i-th feature enhancement as the input feature corresponding to the i+1-th feature enhancement when i satisfies the preset condition;
  • the fifth determining part is configured to determine the attention feature map corresponding to the i-th feature enhancement as the attention feature map corresponding to the i+1-th feature enhancement when i satisfies the preset condition;
  • the sixth determination part is configured to use the attention feature map corresponding to the i+1th feature enhancement to perform feature enhancement on the input feature corresponding to the i+1th feature enhancement when i satisfies the preset condition, and obtain The output feature corresponding to the i+1 feature enhancement.
  • the sixth determining part is further configured as:
  • the attention feature map corresponding to the i+1th feature enhancement and the fourth feature vector determine the output feature corresponding to the i+1th feature enhancement.
  • the feature pooling part 53 includes:
  • the convolution sub-part is configured to perform convolution processing on a plurality of second image block features to obtain a plurality of fourth image block features, wherein the number of the fourth image block features is the same as that of the second image block features, and the fourth image block features The number of channels of the feature of the four image blocks is greater than the number of channels of the feature of the second image block;
  • the pooling subpart is configured to perform pooling processing on a plurality of fourth image block features to obtain a plurality of third image block features.
  • the device 50 is implemented by a self-attention neural network, and the self-attention neural network includes a self-attention part 52 and a feature pooling part 53 .
  • the self-attention part 52 includes n self-attention layers, wherein each self-attention layer is used for feature enhancement, and at least two adjacent self-attention layers share the same Attention feature map; and/or, the feature pooling part 53 includes a convolutional layer and a maximum pooling layer, wherein the convolution kernel size corresponding to the convolutional layer is smaller than the threshold.
  • the device 50 also includes:
  • the search space construction part is configured to construct a network structure search space, wherein the network structure search space includes multiple network hyperparameters corresponding to the self-attention neural network;
  • the super network construction part is configured to construct a super network according to the network structure search space, wherein the network structure search space includes multiple optional network structures constructed according to multiple network hyperparameters;
  • the network training part is configured to determine the target network structure from multiple optional network structures by performing network training on the super network;
  • the self-attention neural network construction part is configured to construct the self-attention neural network according to the target network structure.
  • multiple network hyperparameters include: image block feature number parameters, image block feature channel number parameters, layer parameters corresponding to the self-attention part, and the self-attention part needs to share the same attention Position parameters of at least two adjacent self-attention layers of the force feature map.
  • the respective attention layers included in the same self-attention part correspond to the same image block feature number parameter value, and the same image block feature channel number parameter value.
  • the functions or parts included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the method embodiments above, and the implementation process can refer to the descriptions of the method embodiments above. For brevity, here No longer.
  • a "part" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course it may also be a unit, a module or a non-modular one.
  • Embodiments of the present disclosure also provide a computer-readable storage medium, on which computer program instructions are stored, and the above-mentioned method is implemented when the computer program instructions are executed by a processor.
  • Computer readable storage media may be volatile or nonvolatile computer readable storage media.
  • An embodiment of the present disclosure also proposes an electronic device, including: a processor; a memory configured to store instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
  • An embodiment of the present disclosure also provides a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in a processor of an electronic device When running in the electronic device, the processor in the electronic device executes the above method.
  • Electronic devices may be provided as terminals, servers, or other forms of devices.
  • Fig. 6 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device 800 may be a terminal such as a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, or a personal digital assistant.
  • electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814 , and the communication component 816.
  • the processing component 802 generally controls the overall operations of the electronic device 800, such as those associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802 .
  • the memory 804 is configured to store various types of data to support operations at the electronic device 800 . Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like.
  • the memory 804 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • the power supply component 806 provides power to various components of the electronic device 800 .
  • Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 800 .
  • the multimedia component 808 includes a screen providing an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or swipe action, but also detect duration and pressure associated with the touch or swipe action.
  • the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
  • the audio component 810 is configured to output and/or input audio signals.
  • the audio component 810 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 800 is in operation modes, such as call mode, recording mode and voice recognition mode. Received audio signals may be further stored in memory 804 or sent via communication component 816.
  • the audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.
  • Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of electronic device 800 .
  • the sensor component 814 can detect the open/closed state of the electronic device 800, the relative positioning of components, such as the display and the keypad of the electronic device 800, the sensor component 814 can also detect the electronic device 800 or a Changes in position of components, presence or absence of user contact with electronic device 800 , electronic device 800 orientation or acceleration/deceleration and temperature changes in electronic device 800 .
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 814 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications.
  • CMOS complementary metal-oxide-semiconductor
  • CCD charge-coupled device
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
  • the communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices.
  • the electronic device 800 can access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof.
  • the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID Radio Frequency Identification
  • IrDA Infrared Data Association
  • UWB Ultra Wide Band
  • Bluetooth Bluetooth
  • electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A programmable gate array
  • controller microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
  • a non-volatile computer-readable storage medium such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to implement the above method.
  • Fig. 7 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device 1900 may be provided as a server.
  • electronic device 1900 includes processing component 1922 , which further includes one or more processors, and a memory resource represented by memory 1932 for storing instructions executable by processing component 1922 , such as application programs.
  • the application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above method.
  • Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input-output (I/O) interface 1958 .
  • the electronic device 1900 can operate based on the operating system stored in the memory 1932, such as the Microsoft server operating system (Windows Server TM ), the graphical user interface-based operating system (Mac OS X TM ) introduced by Apple Inc., and the multi-user and multi-process computer operating system (Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ), or the like.
  • Microsoft server operating system Windows Server TM
  • Mac OS X TM graphical user interface-based operating system
  • Unix TM multi-user and multi-process computer operating system
  • Linux TM free and open source Unix-like operating system
  • FreeBSD TM open source Unix-like operating system
  • a non-transitory computer-readable storage medium such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to implement the above method.
  • the present disclosure can be a system, method and/or computer program product.
  • a computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present disclosure.
  • a computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device.
  • a computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Computer-readable storage media include: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory), static random access memory (SRAM), compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device, such as a printer with instructions stored thereon A hole card or a raised structure in a groove, and any suitable combination of the above.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory static random access memory
  • SRAM static random access memory
  • CD-ROM compact disc read only memory
  • DVD digital versatile disc
  • memory stick floppy disk
  • mechanically encoded device such as a printer with instructions stored thereon
  • a hole card or a raised structure in a groove and any suitable combination of the above.
  • computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
  • Computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • a network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
  • Computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or Source or object code written in any combination, including object-oriented programming languages—such as Smalltalk, C++, etc., and conventional procedural programming languages—such as the “C” language or similar programming languages.
  • Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement.
  • the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as via the Internet using an Internet service provider). connect).
  • LAN local area network
  • WAN wide area network
  • an electronic circuit such as a programmable logic circuit, field programmable gate array (FPGA), or programmable logic array (PLA)
  • FPGA field programmable gate array
  • PDA programmable logic array
  • These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that when executed by the processor of the computer or other programmable data processing apparatus , producing an apparatus for realizing the functions/actions specified in one or more blocks in the flowchart and/or block diagram.
  • These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause computers, programmable data processing devices and/or other devices to work in a specific way, so that the computer-readable medium storing instructions includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks in flowcharts and/or block diagrams.
  • each block in a flowchart or block diagram may represent a module, a portion of a program segment, or an instruction that includes one or more Executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the computer program product can be realized by hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) and the like.
  • Embodiments of the present disclosure relate to an image processing method and device, electronic equipment, and a computer-readable storage medium.
  • the method includes: determining a plurality of first image block features corresponding to a target image; , based on the self-attention mechanism, n times feature enhancement is performed to obtain a plurality of second image block features, wherein the number and channel number of the second image block features and the first image block features are the same, and n is greater than Or an integer equal to 1; feature pooling is performed on the plurality of second image block features to obtain a plurality of third image block features, wherein the number of the third image block features is less than the number of the second image block features and the number of channels of the third image block feature is greater than the number of channels of the second image block feature; according to the plurality of third image block features, perform a target image processing operation on the target image, Get the image processing result.
  • Embodiments of the present disclosure can improve the accuracy of image processing results.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Image Processing (AREA)

Abstract

一种图像处理方法及装置、电子设备和计算机可读存储介质,方法包括:确定目标图像对应的多个第一图像块特征;根据多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,其中,第二图像块特征和第一图像块特征的个数和通道数均相同,n是大于或等于1的整数;对多个第二图像块特征进行特征池化,得到多个第三图像块特征,其中,第三图像块特征的个数小于第二图像块特征的个数,且第三图像块特征的通道数大于第二图像块特征的通道数;根据多个第三图像块特征,对目标图像进行目标图像处理操作,得到图像处理结果。

Description

图像处理方法及装置、电子设备和计算机可读存储介质
相关申请的交叉引用
本公开基于申请号为202110573067.4、申请日为2021年5月25日、申请名称为“图像处理方法及装置、电子设备和存储介质”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。
技术领域
本公开涉及计算机技术领域,尤其涉及一种图像处理方法及装置、电子设备和计算机可读存储介质。
背景技术
近期,自注意力网络在自然语言处理中得到了广泛的应用,自注意力网络通过建立特征之间的联系来进行特征的强化,从而提升网络的最终性能。随着视觉自注意力网络的提出,自注意力网络在计算机视觉领域也得到了大规模应用,展现出极大的潜力。然而,现有的视觉自注意力网络的设计只是简单地照搬了自然语言处理中的设计,并没有针对计算机视觉的特征进行改进,使得视觉自注意力网络的性能较差。
发明内容
本公开实施例提出了一种图像处理方法及装置、电子设备和存储介质的技术方案。
根据本公开实施例的一方面,提供了一种图像处理方法,包括:确定目标图像对应的多个第一图像块特征;根据所述多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,其中,所述第二图像块特征和所述第一图像块特征的个数和通道数均相同,n是大于或等于1的整数;对所述多个第二图像块特征进行特征池化,得到多个第三图像块特征,其中,所述第三图像块特征的个数小于所述第二图像块特征的个数,且所述第三图像块特征的通道数数大于所述第二图像块特征的通道数;根据所述多个第三图像块特征,对所述目标图像进行目标图像处理操作,得到图像处理结果。
在一种可能的实现方式中,所述根据所述多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,包括:基于自注意力机制,对第i次特征强化对应的输入特征进行特征强化,得到所述第i次特征强化对应的输出特征,其中,i是大于或等于1,且小于或等于n的整数;在i等于n的情况下,将所述第i次特征强化对应的输出特征确定为所述多个第二图像块特征;在i等于1的情况下,第1次特征强化对应的输入特征是所述多个第一图像块特征;在i大于1的情况下,所述第i次特征强化对应的输入特征是第i-1次特征强化对应的输出特征。
在一种可能的实现方式中,所述基于自注意力机制,对第i次特征强化对应的输入特征进行特征强化,得到所述第i次特征强化对应的输出特征,包括:根据所述第i次特征强化对应的输入特征,确定第一特征向量、第二特征向量和第三特征向量;根据所述第一特征向量和所述第二特征向量,确定所述第i次特征强化对应的注意力特征图;根据所述第i次特征强化对应的注意力特征图和所述第三特征向量,确定所述第i次特征强化对应的输出特征。
在一种可能的实现方式中,在i满足预设条件的情况下,所述方法还包括:将所述第i次特征强化对应的输出特征,确定为第i+1次特征强化对应的输入特征;将所述第i次特征强化对应的注意力特征图,确定为所述第i+1次特征强化对应的注意力特征图;利用所述第i+1次特征强化对应的注意力特征图,对所述第i+1次特征强化对应的输入特征进行特征强化,得到所述第i+1次特征强化对应的输出特征。
在一种可能的实现方式中,所述利用所述第i+1次特征强化对应的注意力特征图,对所述第i+1次特征强化对应的输入特征进行特征强化,得到所述第i+1次特征强化对应的输出特征,包括:根据所述第i+1次特征强化对应的输入特征,确定第四特征向量;根据所述第i+1次特征强化对应的注意力特征图和所述第四特征向量,确定所述第i+1次特征强化对应的输出特征。
在一种可能的实现方式中,所述对所述多个第二图像块特征进行特征池化,得到多个第三图像块特征,包括:对所述多个第二图像块特征进行卷积处理,得到多个第四图像块特征,其中,所述第四图像块特征和所述第二图像块特征的个数相同,且所述第四图像块特征的通道数大于所述第二图像块特征的通道数;对所述多个第四图像块特征进行池化处理,得到所述多个第三图像块特征。
在一种可能的实现方式中,所述图像处理方法通过自注意力神经网络实现,所述自注意力神经网络中包括自注意力部分和特征池化部分;所述根据所述多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,包括:利用所述自注意力部分,根据所述多个第一图像块特征,基于自注意力机制进行n次特征强化,得到所述多个第二图像块特征;所述对所述多个第二图像块特征进行特征池化,得到多个第三图像块特征,包括:利用所述特征池化部分,对所述多个第二图像块特征进行特征池化,得到所述多个第三图像块特征。
在一种可能的实现方式中,所述自注意力部分中包括n个自注意力层,其中,每个自注意力层用于进行一次特征强化,至少两个相邻所述自注意力层共享相同的注意力特征图;和/或,所述特征池化部分中包括卷积层和最大池化层,其中,所述卷积层对应的卷积核尺寸小于阈值。
在一种可能的实现方式中,所述方法还包括:构建网络结构搜索空间,其中,所述网络结构搜索空间中包括所述自注意力神经网络对应的多个网络超参数;根据所述网络结构搜索空间,构建超级网络,其中,所述网络结构搜索空间中包括根据所述多个网络超参数构建的多个可选网络结构;通过对所述超级网络进行网络训练,从所述多个可选网络结构中确定目标网络结构;根据所述目标网络结构,构建所述自注意力神经网络。
在一种可能的实现方式中,所述多个网络超参数包括:图像块特征个数参数、图像块特征通道数参数、所述自注意力部分对应的层参数,以及所述自注意力部分中需要共享相同的注意力特征图的至少两个相邻所述自注意力层的位置参数。
在一种可能的实现方式中,相同所述自注意力部分中包括的各自注意力层对应相同的图像块特征个数参数取值,以及相同的图像块特征通道数参数取值。
根据本公开实施例的一方面,提供了一种图像处理装置,包括:特征确定部分,被配置为确定目标图像对应的多个第一图像块特征;自注意力部分,被配置为根据所述多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,其中,所述第二图像块特征和所述第一图像块特征的个数和通道数均相同,n是大于或等于1的整数;特征池化部分,被配置为对所述多个第二图像块特征进行特征池化,得到多个第三图像块特征,其中,所述第三图像块特征的个数小于所述第二图像块特征的个数,且所述第三图像块特征的通道数数大于所述第二图像块特征的通道数;目标图像处理部分,被配置为根据所述多个第三图像块特征,对所述目标图像进行目标图像处理操作,得到图像处理结果。
根据本公开实施例的一方面,提供了一种电子设备,包括:处理器;被配置为存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。
根据本公开实施例的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。
本公开实施例提供一种计算机程序,所述计算机程序产品包括计算机程序或指令,在所 述计算机程序或指令在计算机上运行的情况下,所述计算机执行上述图像处理方法。
在本公开实施例中,确定目标图像对应的多个第一图像块特征;根据多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,其中,第二图像块特征和第一图像块特征的个数和通道数均相同,n是大于或等于1的整数;对多个第二图像块特征进行特征池化,得到多个第三图像块特征,其中,第三图像块特征的个数小于第二图像块特征的个数,且第三图像块特征的通道数大于第二图像块特征的通道数;根据多个第三图像块特征,对目标图像进行目标图像处理操作,得到图像处理结果。通过对基于自注意力机制进行特征强化之后的图像块特征进行特征池化,以减少图像块特征的个数,提高图像块特征的通道数,使得既可以减少空间冗余特征,又可以提高图像块特征的语义表达能力,进而在利用具有较高语义表达能力的图像块特征进行目标图像处理操作之后,可以提高图像处理结果的精度。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。
图1示出根据本公开实施例的一种图像处理方法的流程图;
图2示出根据本公开实施例的确定目标图像对应的多个第一图像块特征的示意图;
图3示出根据本公开实施例的一种自注意力神经网络的网络结构图;
图4示出根据本公开实施例的自注意力神经网络中的自注意力部分的示意图;
图5示出根据本公开实施例的一种图像处理装置的框图;
图6示出根据本公开实施例的一种电子设备的框图;
图7示出根据本公开实施例的一种电子设备的框图。
具体实施方式
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。
图1示出根据本公开实施例的一种图像处理方法的流程图。该图像处理方法可以由终端设备或服务器等电子设备执行,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等,所述方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。或者,可通过服务器执行所述方法。如图1所示,该图像处理方法可以包括:
在步骤S11中,确定目标图像对应的多个第一图像块特征。
这里的目标图像是需要进行图像处理的待处理图像。为了更好地获取目标图像的内部相关性,可以对目标图像进行分割,将目标图像划分成多个图像块,通过对各图像块进行特征提取,可以得到目标图像对应的多个第一图像块特征。多个图像块的个数,可以根据实际情况确定,本公开实施例对此不做限定。
图2示出根据本公开实施例的确定目标图像对应的多个第一图像块特征的示意图。如图2所示,对目标图像进行分割,将目标图像划分成L个图像块,对L个图像块分别进行特征提取,得到L个第一图像块特征,各第一图像块特征的通道数是d。各第一图像块特征的通道数可以根据实际情况进行设置,本公开对此不做限定。
为了便于对多个第一图像块特征进行后续处理,可以将多个第一图像块特征转换为第一图像块特征序列。将多个第一图像块特征转换为第一图像块特征序列的方式可以根据实际情况确定,本公开实施例对此不做限定。
在步骤S12中,根据多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,其中,第二图像块特征和第一图像块特征的个数和通道数均相同,n是大于或等于1的整数。
每次特征强化的过程不会改变图像块特征的个数和通道数,因此,根据多个第一图像块特征,基于自注意力机制进行n次特征强化之后,得到的第二图像块特征和特征强化之前的第一图像块特征的个数和通道数均相同。后文会结合本公开的可能实施方式,对特征强化过程进行详细描述,此处不作赘述。
仍以上述图2所示的通道数是d的L个第一图像块特征为例,根据L个第一图像块特征,基于自注意力机制进行n次特征强化,得到L个第二图像块特征,各第二图像块特征的通道数仍然是d。
在多个第一图像块特征已经转换为第一图像块特征序列的情况下,可以根据第一图像块序列,基于自注意力机制进行n次特征强化,以得到包括多个第二图像块特征的第二图像块特征序列。
在步骤S13中,对多个第二图像块特征进行特征池化,得到多个第三图像块特征,其中,第三图像块特征的个数小于第二图像块特征的个数,且第三图像块特征的通道数大于第二图像块特征的通道数。
特征强化过程相当于对目标图像的进一步特征提取过程,由于随着深层次的特征提取,在空间维度上可能会存在冗余特征,因此,通过对多个第二图像块特征进行特征池化,可以对图像块特征在空间维度上进行降维,在通道维度上进行升维,从而在保持计算量不变的情况下,既可以减少空间冗余特征,又可以使得特征池化之后得到的多个第三图像块特征具有更高的语义表达能力。后文会结合本公开的可能实施方式,对特征池化过程进行详细描述,此处不作赘述。
仍以上述通道数是d的L个第二图像块特征为例,对L个第二图像块特征进行特征池化,得到L/4个第三图像块特征,各第三图像块特征的通道数是2d,从而实现了对通道数是d的L个第二图像块特征在空间维度上进行降维,以及在通道维度上进行升维。第三图像块特征的个数和通道数的取值可以根据实际情况进行设置,本公开实施例对此不做限定。
在多个第二图像块特征的形式是第二图像块特征序列的情况下,对第二图像块特征序列进行特征池化,以得到包括多个第三图像块特征的第三图像块特征序列。
在步骤S14中,根据多个第三图像块特征,对目标图像进行目标图像处理操作,得到图像处理结果。
由于多个第三图像块特征具有更高的语义表达能力,因此,可以根据图像处理需求,利用多个第三图像块特征进行目标图像处理操作,从而可以得到精度较高的图像处理结果。
在本公开实施例中,确定目标图像对应的多个第一图像块特征;根据多个第一图像块特 征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,其中,第二图像块特征和第一图像块特征的个数和通道数均相同,n是大于或等于1的整数;对多个第二图像块特征进行特征池化,得到多个第三图像块特征,其中,第三图像块特征的个数小于第二图像块特征的个数,且第三图像块特征的通道数大于第二图像块特征的通道数;根据多个第三图像块特征,对目标图像进行目标图像处理操作,得到图像处理结果。通过对基于自注意力机制进行特征强化之后的图像块特征进行特征池化,以减少图像块特征的个数,提高图像块特征的通道数,使得既可以减少空间冗余特征,又可以提高图像块特征的语义表达能力,进而在利用具有较高语义表达能力的图像块特征进行目标图像处理操作之后,可以提高图像处理结果的精度。
在一种可能的实现方式中,根据多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,包括:基于自注意力机制,对第i次特征强化对应的输入特征进行特征强化,得到第i次特征强化对应的输出特征,其中,i是小于或等于n的整数;在i等于n的情况下,将第i次特征强化对应的输出特征确定为多个第二图像块特征;在i等于1的情况下,第1次特征强化对应的输入特征是多个第一图像块特征;在i大于1的情况下,第i次特征强化对应的输入特征是第i-1次特征强化对应的输出特征。
将多个第一图像块特征初始化为第1次特征强化对应的输入特征,进而基于自注意力机制迭代执行后续特征强化,迭代过程中将上一次特征强化对应的输出特征,确定为下一次特征强化对应的输入特征,从而使得经过n次特征强化后,有效得到多个第二图像块特征。n的取值可以根据实际情况确定,本公开实施例对此不做限定。
例如,n取值是6。在初始化过程中,将多个第一图像块特征初始化为第1次特征强化对应的输入特征,进而基于自注意力机制,对第1次特征强化对应的输入特征进行特征强化,得到第1次特征强化对应的输出特征;将第1次特征强化对应的输出特征,确定为第2次特征强化对应的输入特征,进而基于自注意力机制,对第2次特征强化对应的输入特征进行特征强化,得到第2次特征强化对应的输出特征;以此类推,直至得到第6次特征强化对应的输出特征,以及将第6次特征强化对应的输出特征,确定为多个第二图像块特征。
基于自注意力机制进行n次特征强化既不会改变图像块特征的个数,也不会改变图像块特征的通道数。因此,仍以上述L个第一图像块特征,各第一图像块特征的通道数是d为例,根据L个第一图像块特征,基于自注意力机制进行n次特征强化之后,可以得到L个第二图像块特征,各第二图像块特征的通道数仍然是d。
在一种可能的实现方式中,基于自注意力机制,对第i次特征强化对应的输入特征进行特征强化,得到第i次特征强化对应的输出特征,包括:根据第i次特征强化对应的输入特征,确定第一特征向量、第二特征向量和第三特征向量;根据第一特征向量和第二特征向量,确定第i次特征强化对应的注意力特征图;根据第i次特征强化对应的注意力特征图和第三特征向量,确定第i次特征强化对应的输出特征。
通过确定第i次特征强化对应的注意力特征图,以使得可以根据第i次特征强化对应的注意力特征图,对第i次特征强化对应的输入特征进行特征强化,有效得到第i次特征强化对应的输出特征。
例如,将第i次特征强化对应的输入特征,转换为三个不同的特征向量:第一特征向量Q i、第二特征向量K i和第三特征向量V i,其中,第一特征向量Q i、第二特征向量K i和第三特征向量V i对应的通道数均是d。进而可以利用下述公式(1)实现特征强化:
Figure PCTCN2021123597-appb-000001
其中,Softmax(·)表示归一化函数,·表示向量点积。如上述公式(1)所示,利用第一特征 向量Q i和第二特征向量K i进行点积操作,可以得到点积结果Q i·((K i) T),利用通道数d以及归一化函数Softmax(·)对点积结果Q i·((K i) T)进行归一化操作,可以得到第i次特征强化对应的注意力特征图
Figure PCTCN2021123597-appb-000002
利用第i次特征强化对应的注意力特征图
Figure PCTCN2021123597-appb-000003
与第三特征向量V i进行点积操作,得到第i次特征强化对应的输出特征Att(Q i,K i,V i)。
在一种可能的实现方式中,在i满足预设条件的情况下,该图像处理方法还包括:将第i次特征强化对应的输出特征,确定为第i+1次特征强化对应的输入特征;将第i次特征强化对应的注意力特征图,确定为第i+1次特征强化对应的注意力特征图;利用第i+1次特征强化对应的注意力特征图,对第i+1次特征强化对应的输入特征进行特征强化,得到第i+1次特征强化对应的输出特征。
在i满足预设条件的情况下,可以在第i+1次特征强化过程中,重复利用第i次特征强化对应的注意力特征图,从而可以降低计算量,有效提高特征强化的效率。
在一示例中,可以将n次特征强化中的每相邻k次特征强化划分为一组,同一组中的k次特征强化共享相同的注意力特征图。此时,预设条件可以是i不等于mk,k是大于或等于1的正数,m是大于或等于0的整数。
例如,n取值是9,k取值是3,则在9次特征强化过程中,每3次特征强化划分为一组,同一组中的3次特征强化共享相同的注意力特征图。此时,第1至3次特征强化共享相同的注意力特征图(例如,第2次特征强化和第3次特征强化,共享第1次特征强化对应的注意力特征图)、第4至6次特征强化共享相同的注意力特征图(例如,第5次特征强化和第6次特征强化,共享第4次特征强化对应的注意力特征图)、以及第7至9次特征强化共享相同的注意力特征图(例如,第8次特征强化和第9次特征强化,共享第7次特征强化对应的注意力特征图)。因此,在i小于或等于9,且i不等于3m(m等于0、1、2,即i不等于0、3、6)的情况下,第i+1次特征强化都可以重复利用第i次特征强化对应的注意力特征图;而i等于3m(m等于0、1、2,即i等于0、3、6)的情况下,第i+1次特征强化需要根据第i+1次的输入特征获取对应的注意力特征图。
在一示例中,预设条件可以是共享相同的注意力特征图的特征强化的次数,例如,预设条件是i=2和5时,第i+1次特征强化可以共享第i次特征强化对应的注意力特征图;预设条件还可以根据实际情况设置为其它形式,本公开实施例对此不做限定。
在一种可能的实现方式中,利用第i+1次特征强化对应的注意力特征图,对第i+1次特征强化对应的输入特征进行特征强化,得到第i+1次特征强化对应的输出特征,包括:根据第i+1次特征强化对应的输入特征,确定第四特征向量;根据第i+1次特征强化对应的注意力特征图和第四特征向量,确定第i+1次特征强化对应的输出特征。
相比于相关技术中每次进行特征强化时都需要确定注意力特征图,通过重复利用上次特征强化过程中生成的注意力特征图,使得在本次特征强化过程中无需单独确定注意力特征图,从而可以降低计算量,提高特征强化效率。
仍以上述公式(1)为例,在利用公式(1)得到第i次特征强化对应的输出特征Att(Q i,K i,V i)后,将第i次特征强化对应的输出特征Att(Q i,K i,V i),确定为第i+1次特征强化对应的输入特征。在i满足预设条件的情况下,第i+1次特征强化可以共享第i次特征强化 对应的注意力特征图,因此,将第i次特征强化对应的注意力特征图
Figure PCTCN2021123597-appb-000004
确定为第i+1次特征强化对应的注意力特征图。此时,将第i+1次特征强化对应的输入特征Att(Q i,K i,V i),转换为第四特征向量V i+1,进而可以利用第i+1次特征强化对应的注意力特征图
Figure PCTCN2021123597-appb-000005
与第四特征向量V i+1进行点积操作,以确定第i+1次特征强化对应的输出特征Att(Q i,K i,V i+1)。
通过在至少两次特征强化的过程中共享相同的注意力特征图,使得n次特征强化的过程可以降低计算量,从而有效提高特征强化效率。
在一示例中,在i不满足预设条件的情况下(例如上述,i=0、3、6的情况下),第i+1次特征强化不能重复利用第i次特征强化对应的注意力特征图,此时,针对第i+1次特征强化,可以利用上述公式(1)所示的方法确定第i+1次特征强化对应的注意力特征图,以及实现特征强化,确定过程可参照上述公式(1)的过程,此处不再赘述。
在一种可能的实现方式中,对多个第二图像块特征进行特征池化,得到多个第三图像块特征,包括:对多个第二图像块特征进行卷积处理,得到多个第四图像块特征,其中,第四图像块特征和第二图像块特征的个数相同,且第四图像块特征的通道数大于第二图像块特征的通道数;对多个第四图像块特征进行池化处理,得到多个第三图像块特征。
通过特征池化,减少图像块特征的个数,以及提高图像块特征的通道数,从而既可以减少空间冗余特征,又可以提高图像块特征的语义表达能力。
仍以上述L个第二图像块特征,各第二图像块特征的通道数是d为例,可以利用较小尺寸的卷积核对L个第二图像块特征进行一维卷积处理,得到L个第四图像块特征,各第四图像块特征的通道数是2d,从而提高了图像块特征的通道数;进而对L个第四图像块特征进行一维最大池化处理,得到L/4个第三图像块特征,各第三图像块特征的通道数仍然是2d,从而减少了图像块特征的个数。
池化处理除了可以采用上述一维最大池化处理,也可以采用一维平均池化处理,还可以采用其它池化处理方式,本公开实施例对此不做限定。
本公开实施例中,可以对上述n次特征强化、特征池化过程进行多次迭代重复,以得到最终确定的减少了图像块特征的个数,以及提高了图像块特征的通道数的多个第三图像块特征,进而可以利用多个第三图像块特征,完成对目标图像的图像处理操作。n次特征强化、特征池化的迭代次数可以根据实际情况确定,本公开实施例对此不做限定。
在一种可能的实现方式中,目标图像处理操作包括下述之一:目标检测、目标跟踪、图像识别、图像分类。
利用具有更高的语义表达能力的多个第三图像块特征进行目标图像处理操作,从而可以得到精度较高的图像处理结果。
例如,根据多个第三图像块特征,对目标图像进行图像分类,得到目标图像对应的具有较高分类精度的图像分类结果。目标图像处理操作除了可以包括上述目标检测、目标跟踪、图像识别、图像分类之外,还可以根据实际图像处理需求,包括其它图像处理操作,本公开实施例对此不做限定。
在一种可能的实现方式中,图像处理方法通过自注意力神经网络实现,自注意力神经网络中包括自注意力部分和特征池化部分;根据多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,包括:利用自注意力部分,根据多个第一图像块特 征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征;对多个第二图像块特征进行特征池化,得到多个第三图像块特征,包括:利用特征池化部分,对多个第二图像块特征进行特征池化,得到多个第三图像块特征。
通过在自注意力神经网络中设置自注意力部分和特征池化部分,以使得可以利用自注意力部分实现图像块特征的特征强化,进而利用特征池化部分对特征强化之后的图像块特征进行特征池化,以减少图像块特征的个数,提高图像块特征的通道数,使得既可以减少空间冗余特征,又可以提高图像块特征的语义表达能力,从而有效提高自注意力神经网络的网络性能。
图3示出根据本公开实施例的一种自注意力神经网络的网络结构图。如图3所示,自注意力神经网络中包括三个自注意力部分(自注意力部分A、B、C)和两个特征池化部分(特征池化部分D、E)。对目标图像进行分割,将目标图像划分为L个图像块,对L个图像块分别进行特征提取,得到包括L个第一图像块特征的图像块特征序列(维度是L×d)。自注意力神经网络中包括的自注意力部分和特征池化部分的个数可以根据实际情况进行设置,本公开实施例对此不做限定。
将L×d的图像块特征序列输入自注意力部分A,利用自注意力部分A对L×d的图像块特征序列进行N 1次特征强化,得到特征强化后的L×d的图像块特征序列;进而将特征强化后的L×d的图像块特征序列输入特征池化部分D,利用特征池化部分D对特征强化后的L×d的图像块特征序列进行特征池化,得到特征池化后的L/2×1.5d的图像块特征序列。N 1的取值以及特征池化之后图像块特征序列的个数和通道数可以根据实际情况进行设置,本公开实施例对此不做限定。
将特征池化后的L/2×1.5d的图像块特征序列输入自注意力部分B,利用自注意力部分B对特征池化后的L/2×1.5d的图像块特征序列进行N 2次特征强化,得到特征强化后的L/2×1.5d的图像块特征序列;进而将特征强化后的L/2×1.5d的图像块特征序列输入特征池化部分E,利用特征池化部分E对特征强化后的L/2×1.5d的图像块特征序列进行特征池化,得到特征池化后的L/4×2d的图像块特征序列。N 2的取值以及特征池化之后图像块特征序列的个数和通道数可以根据实际情况进行设置,本公开实施例对此不做限定。
将特征池化后的L/4×2d的图像块特征序列输入自注意力部分C,利用自注意力部分C对特征池化后的L/4×2d的图像块特征序列进行N 3次特征强化,得到特征强化后的L/4×2d的图像块特征序列。将L/4×2d的图像块特征序列作为自注意力神经网络最终得到的、且用于进行后续目标图像处理操作的特征。例如,用于进行图像分类的cls特征。N 3的取值以及特征池化之后图像块特征序列的个数和通道数可以根据实际情况进行设置,本公开实施例对此不做限定。
在一种可能的实现方式中,自注意力部分中包括多个自注意力层,其中,每个自注意力层用于进行一次特征强化,至少两个相邻自注意力层共享相同的注意力特征图;和/或,特征池化部分中包括卷积层和最大池化层,其中,卷积层对应的卷积核尺寸小于阈值。
通过在至少两个相邻自注意力层中共享相同的注意力特征图,使得自注意力部分可以降低计算量,从而有效提升特征强化效率。
仍以上述图3为例,如图3所示,自注意力部分A中包括N 1个自注意力层(利用N 1个自注意力层可以进行N 1次特征强化),自注意力部分B中包括N 2个自注意力层(利用N 2个自注意 力层可以进行N 2次特征强化),自注意力部分C中包括N 3个自注意力层(利用N 3个自注意力层可以进行N 3次特征强化)。其中,针对至少一个自注意力部分,该自注意力部分中的至少两个相邻自注意力层共享相同的注意力特征图。例如,在自注意力部分A的N 1个自注意力层中,以两个相邻自注意力层为一组,每组中的两个自注意力层共享相同的注意力特征图。共享相同的注意力特征图的相邻注意力层的个数以及位置分布方式可以根据实际情况确定,本公开实施例对此不做限定。
图4示出根据本公开实施例的自注意力神经网络中的自注意力部分的示意图。如图4所示,在一个自注意力部分中包括多个自注意力层。针对任一自注意力部分,该自注意力部分中的至少两个相邻自注意力层共享相同的注意力特征图。例如,针对第i个自注意力层,第i个自注意力层对应第i次特征强化,将第i个自注意力层将对应的(即第i次特征强化对应的)输入特征转化为三个不同的特征向量:第一特征向量Q i、第二特征向量K i和第三特征向量V i,进而根据第一特征向量Q i和第二特征向量K i,利用上述公式(1)确定第i个自注意力层对应的(即第i次特征强化对应的)注意力特征图
Figure PCTCN2021123597-appb-000006
进而将第i个自注意力层对应的注意力特征图
Figure PCTCN2021123597-appb-000007
与第三特征向量V i进行点积,以得到第i个自注意力层对应的(即第i次特征强化对应的)输出特征Att(Q i,K i,V i)。
由于第i个自注意力层和第i+1个自注意力层共享相同的注意力特征图,因此,将第i个自注意力层对应的输出特征Att(Q i,K i,V i),以及第i个自注意力层对应的注意力特征图
Figure PCTCN2021123597-appb-000008
输入第i+1个自注意力层,第i+1个自注意力层将输入特征Att(Q i,K i,V i)转化为一个第四特征向量V i+1,进而直接将输入的注意力特征图
Figure PCTCN2021123597-appb-000009
和第四特征向量V i+1进行点积,以得到第i+1个自注意力层对应的(即第i+1次特征强化对应的)输出特征,从而可以在第i+1特征强化过程中降低计算量,减少计算冗余,有效提高了自注意力神经网络的网络性能。
进一步的,如果是在两个相邻自注意力层中共享相同的注意力特征图,则在上述举例中,第i个自注意力层中生成第i个自注意力层对应的自注意力特征图,第i+1个自注意力层中直接共享第i个自注意力层对应的注意力特征图;第i+2个自注意力层中生成第i+2个自注意力层对应的自注意力特征图,第i+3个自注意力层中直接共享第i+2个自注意力层对应的注意力特征图,以此类推。
自注意力部分中包括的自注意力层的层数,以及需要共享相同的注意力特征图的自注意力层的位置和个数可以根据实际情况确定,本公开实施例对此不做限定。
在一示例中,自注意力部分中包括6个自注意力层,其中,每两个相邻自注意力层为一组,共享相同的注意力特征图。也就是说,第1个和第2个自注意力层之间共享相同的注意力特征图(共享第1个自注意力层中生成的注意力特征图)、第3个和第4个自注意力层之间共享相同 的注意力特征图(共享第3个自注意力层中生成的注意力特征图)、第5个和第6个自注意力层之间共享相同的注意力特征图(共享第5个自注意力层中生成的注意力特征图)。
在另一示例中,自注意力部分中包括6个自注意力层,其中,在第3个、第4个和第5个自注意力层之间共享相同的注意力特征图(共享第3个自注意力层中生成的注意力特征图),其它自注意力层之间相互独立。
利用特征池化部分中包括的卷积核尺寸小于阈值的卷积层,可以提高图像块特征的通道数,进而利用最大池化层,可以减少图像块特征的个数,从而有效减少空间冗余特征,提高图像块特征的语义表达能力。阈值的取值可以根据实际情况确定,本公开实施例对此不做限定。
仍以上述图3为例,在相邻自注意力部分之间设置特征池化部分,使得可以随着自注意力神经网络的网络深度增加,利用特征池化部分对图像块特征进行空间维度的降维,以及通道维度的升维,从而在保持计算量不变的情况下,有效减少空间冗余特征,提高自注意力神经网络的网络性能。
在一种可能的实现方式中,自注意力神经网络可以是视觉转换器(Transformer)。通过在相关技术的视觉Transformer中,增加特征池化部分,将特征池化部分之间的多个自注意力层定义为一个自注意力部分,以及在至少两个相邻自注意力层之间共享注意力(共享相同的注意力特征图),从而构成本公开实施例的基于特征池化和注意力共享的视觉Transformer。
在构建自注意力神经网络时,自注意力部分的个数、自注意力部分中的自注意力层的层数、各自注意力层对应的图像块特征的个数和通道数、需要共享相同的注意力特征图的相邻自注意力层的个数和位置分布等,都是需要考虑的网络超参数。
在一种可能的实现方式中,该图像处理方法还包括:构建网络结构搜索空间,其中,网络结构搜索空间中包括自注意力神经网络对应的多个网络超参数;根据网络结构搜索空间,构建超级网络,其中,网络结构搜索空间中包括根据多个网络超参数构建的多个可选网络结构;通过对超级网络进行网络训练,从多个可选网络结构中确定目标网络结构;根据目标网络结构,构建自注意力神经网络。
基于自注意力神经网络对应的多个网络超参数,可以构建网络结构搜索空间,以实现利用搜索空间构建超级网络,以及通过对超级网络的训练,实现对目标网络结构的搜索以及基于搜索得到的目标网络结构构建自注意力神经网络,从而可以避免对网络超参数和网络结构的人工设计,实现自动化构建自注意力神经网络,有效提高了网络构建效率。
在一种可能的实现方式中,多个网络超参数包括:图像块特征个数、图像块特征通道数、自注意力部分对应的层数,以及自注意力部分中需要共享相同的注意力特征图的至少两个相邻自注意力层的位置。
在一示例中,每个自注意力层对应的图像块特征个数有S t个选项,图像块特征通道数有S f个选项,自注意力神经网络中共有L个自注意力层,自注意力层的注意力特征图使用方式(即需要共享相同的注意力特征图的自注意力层的位置)有S s个选项,则可以构建包含(S t×S f×S s) L个可选网络结构的网络结构搜索空间。例如,在S t=4、S f=4、S s=4以及L=36的情况下,则网络结构搜索空间将包括1.1×10 65个可选网络结构。搜索空间过大,导致搜索效率较低。
在一种可能的实现方式中,相同自注意力部分中包括的各自注意力层对应相同的图像块特征个数,以及相同的通道数。
自注意力神经网络的构建原则可以包括:1)自注意力部分的个数是有限的(例如,3个自注意力部分);2)相同自注意力块中包括的各自注意力层对应相同的图像块特征个数,以及相同的图像块特征通道数;3)随着网络深度的增加,各自注意力部分对应的图像块特征个数减小、图像块特征通道数增加。
基于自注意力神经网络的构建原则,删除超级网络中包括的不符合构建原则的可选网络结构,从而可以减小网络结构搜索空间的大小,提高后续对目标网络结构的搜索效率。
在基于自注意力神经网络的构建原则对网络结构搜索空间进行缩小之后,超级网络中包括的都是符合自注意力神经网络的构建原则的可选网络结构。基于单路径one-shot(Single path one-shot,SPOS)算法对超级网络进行训练,以得到用于构建自注意力神经网络的目标网络架构。
SPOS算法在每次训练迭代时,选择一个可选网络架构,并在超级网络中更新所选的可选网络架构的网络参数。在选择其它可选网络架构进行迭代训练时,其它可选网络架构将从超级网络中继承经过训练的网络参数,并不断更新这些参数,而无需从头开始进行训练,从而有效提高了超级网络的训练效率,以实现快速搜索得到用于构建自注意力神经网络的目标网络架构。
基于目标网络架构可以构建得到自注意力神经网络,该自注意力神经网络中包括自注意力部分和特征池化部分。
自注意力部分中包括多个自注意力层,同一自注意力部分中包括的各自注意力层对应相同的图像块特征个数和图像块特征通道数。自注意力部分被配置为基于自注意力机制,对图像块特征进行特征强化。自注意力部分的特征强化过程与上述相关特征强化过程类似,此处不再赘述。自注意力部分中的至少两个相邻自注意力层之间共享相同的注意力特征图,以实现降低特征强化过程的计算量,有效提高特征强化效率。
特征池化部分被配置为随着自注意力神经网络的深度增加,对特征强化之后的图像块特征,进行空间维度的降维,以及通道维度的升维,以实现在保持计算量不变的情况下,减少空间冗余特征,提高图像块特征的语义表征能力,进而有效提高自注意力神经网络的网络性能。
根据图像处理需要,本公开实施例的自注意力神经网络可以应用于目标检测、目标跟踪、图像识别、图像分类等图像处理任务,本公开实施例对此不做限定。
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开实施例不再赘述。本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的执行顺序应当以其功能和可能的内在逻辑确定。
此外,本公开实施例还提供了图像处理装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开实施例提供的任一种图像处理方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。
图5示出根据本公开实施例的一种图像处理装置的框图。如图5所示,装置50包括:
特征确定部分51,被配置为确定目标图像对应的多个第一图像块特征;
自注意力部分52,被配置为根据多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,其中,第二图像块特征和第一图像块特征的个数和通道数均相同,n是大于或等于1的整数;
特征池化部分53,被配置为对多个第二图像块特征进行特征池化,得到多个第三图像块特征,其中,第三图像块特征的个数小于第二图像块特征的个数,且第三图像块特征的通道数数大于第二图像块特征的通道数;
目标图像处理部分54,被配置为根据多个第三图像块特征,对目标图像进行目标图像处理操作,得到图像处理结果。
在一种可能的实现方式中,自注意力部分52,包括:
第i个自注意力子部分,被配置为基于自注意力机制,对第i次特征强化对应的输入特征进行特征强化,得到第i次特征强化对应的输出特征,其中,i是小于或等于n的整数;
第n个确定子部分,被配置为在i等于n的情况下,将第i次特征强化对应的输出特征确 定为多个第二图像块特征;
在i等于1的情况下,第1次特征强化对应的输入特征是多个第一图像块特征;在i大于1的情况下,第i次特征强化对应的输入特征是第i-1次特征强化对应的输出特征。
在一种可能的实现方式中,第i个自注意力子部分,包括:
第一确定部分,被配置为根据第i次特征强化对应的输入特征,确定第一特征向量、第二特征向量和第三特征向量;
第二确定部分,被配置为根据第一特征向量和第二特征向量,确定第i次特征强化对应的注意力特征图;
第三确定部分,被配置为根据第i次特征强化对应的注意力特征图和第三特征向量,确定第i次特征强化对应的输出特征。
在一种可能的实现方式中,装置50还包括:第i+1个自注意力子部分;第i+1个自注意力子部分,包括:
第四确定部分,被配置为在i满足预设条件的情况下,将第i次特征强化对应的输出特征,确定为第i+1次特征强化对应的输入特征;
第五确定部分,被配置为在i满足预设条件的情况下,将第i次特征强化对应的注意力特征图,确定为第i+1次特征强化对应的注意力特征图;
第六确定部分,被配置为在i满足预设条件的情况下,利用第i+1次特征强化对应的注意力特征图,对第i+1次特征强化对应的输入特征进行特征强化,得到第i+1次特征强化对应的输出特征。
在一种可能的实现方式中,第六确定部分,还被配置为:
根据第i+1次特征强化对应的输入特征,确定第四特征向量;
根据第i+1次特征强化对应的注意力特征图和第四特征向量,确定第i+1次特征强化对应的输出特征。
在一种可能的实现方式中,特征池化部分53,包括:
卷积子部分,被配置为对多个第二图像块特征进行卷积处理,得到多个第四图像块特征,其中,第四图像块特征和第二图像块特征的个数相同,且第四图像块特征的通道数大于第二图像块特征的通道数;
池化子部分,被配置为对多个第四图像块特征进行池化处理,得到多个第三图像块特征。
在一种可能的实现方式中,装置50通过自注意力神经网络实现,自注意力神经网络中包括自注意力部分52和特征池化部分53。
在一种可能的实现方式中,自注意力部分52中包括n个自注意力层,其中,每个自注意力层用于进行一次特征强化,至少两个相邻自注意力层共享相同的注意力特征图;和/或,特征池化部分53中包括卷积层和最大池化层,其中,卷积层对应的卷积核尺寸小于阈值。
在一种可能的实现方式中,装置50还包括:
搜索空间构建部分,被配置为构建网络结构搜索空间,其中,网络结构搜索空间中包括自注意力神经网络对应的多个网络超参数;
超级网络构建部分,被配置为根据网络结构搜索空间,构建超级网络,其中,网络结构搜索空间中包括根据多个网络超参数构建的多个可选网络结构;
网络训练部分,被配置为通过对超级网络进行网络训练,从多个可选网络结构中确定目标网络结构;
自注意力神经网络构建部分,被配置为根据目标网络结构,构建自注意力神经网络。
在一种可能的实现方式中,多个网络超参数包括:图像块特征个数参数、图像块特征通道数参数、自注意力部分对应的层参数,以及自注意力部分中需要共享相同的注意力特征图的至少两个相邻自注意力层的位置参数。
在一种可能的实现方式中,相同自注意力部分中包括的各自注意力层对应相同的图像块 特征个数参数取值,以及相同的图像块特征通道数参数取值。
在一些实施例中,本公开实施例提供的装置具有的功能或包含的部分可以用于执行上文方法实施例描述的方法,其实现过程可以参照上文方法实施例的描述,为了简洁,这里不再赘述。
在本申请实施例以及其他的实施例中,“部分”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是单元,还可以是模块也可以是非模块化的。
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是易失性或非易失性计算机可读存储介质。
本公开实施例还提出一种电子设备,包括:处理器;被配置为存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行上述方法。
电子设备可以被提供为终端、服务器或其它形态的设备。
图6示出根据本公开实施例的一种电子设备的框图。如图6所示,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。
参照图6,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组 件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如互补金属氧化物半导体(CMOS)或电荷耦合装置(CCD)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如无线网络(WiFi),第二代移动通信技术(2G)或第三代移动通信技术(3G),或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。
图7示出根据本公开实施例的一种电子设备的框图。如图7所示,电子设备1900可以被提供为一服务器。参照图7,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如微软服务器操作系统(Windows Server TM),苹果公司推出的基于图形用户界面操作系统(Mac OS X TM),多用户多进程的计算机操作系统(Unix TM),自由和开放原代码的类Unix操作系统(Linux TM),开放原代码的类Unix操作系统(FreeBSD TM)或类似。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是(但不限于)电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘 只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
该计算机程序产品可以通过硬件、软件或其结合的方式实现。在一个可选实施例中,所 述计算机程序产品体现为计算机存储介质,在另一个可选实施例中,计算机程序产品体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。
工业实用性
本公开实施例涉及一种图像处理方法及装置、电子设备和计算机可读存储介质,所述方法包括:确定目标图像对应的多个第一图像块特征;根据所述多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,其中,所述第二图像块特征和所述第一图像块特征的个数和通道数均相同,n是大于或等于1的整数;对所述多个第二图像块特征进行特征池化,得到多个第三图像块特征,其中,所述第三图像块特征的个数小于所述第二图像块特征的个数,且所述第三图像块特征的通道数数大于所述第二图像块特征的通道数;根据所述多个第三图像块特征,对所述目标图像进行目标图像处理操作,得到图像处理结果。本公开实施例可以提高图像处理结果的精度。

Claims (25)

  1. 一种图像处理方法,包括:
    确定目标图像对应的多个第一图像块特征;
    根据所述多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,其中,所述第二图像块特征和所述第一图像块特征的个数和通道数均相同,n是大于或等于1的整数;
    对所述多个第二图像块特征进行特征池化,得到多个第三图像块特征,其中,所述第三图像块特征的个数小于所述第二图像块特征的个数,且所述第三图像块特征的通道数数大于所述第二图像块特征的通道数;
    根据所述多个第三图像块特征,对所述目标图像进行目标图像处理操作,得到图像处理结果。
  2. 根据权利要求1所述的方法,其中,所述根据所述多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,包括:
    基于自注意力机制,对第i次特征强化对应的输入特征进行特征强化,得到所述第i次特征强化对应的输出特征,其中,i是大于或等于1,且小于或等于n的整数;
    在i等于n的情况下,将所述第i次特征强化对应的输出特征确定为所述多个第二图像块特征;
    在i等于1的情况下,第1次特征强化对应的输入特征是所述多个第一图像块特征;在i大于1的情况下,所述第i次特征强化对应的输入特征是第i-1次特征强化对应的输出特征。
  3. 根据权利要求2所述的方法,其中,所述基于自注意力机制,对第i次特征强化对应的输入特征进行特征强化,得到所述第i次特征强化对应的输出特征,包括:
    根据所述第i次特征强化对应的输入特征,确定第一特征向量、第二特征向量和第三特征向量;
    根据所述第一特征向量和所述第二特征向量,确定所述第i次特征强化对应的注意力特征图;
    根据所述第i次特征强化对应的注意力特征图和所述第三特征向量,确定所述第i次特征强化对应的输出特征。
  4. 根据权利要求3所述的方法,其中,在i满足预设条件的情况下,所述方法还包括:
    将所述第i次特征强化对应的输出特征,确定为第i+1次特征强化对应的输入特征;
    将所述第i次特征强化对应的注意力特征图,确定为所述第i+1次特征强化对应的注意力特征图;
    利用所述第i+1次特征强化对应的注意力特征图,对所述第i+1次特征强化对应的输入特征进行特征强化,得到所述第i+1次特征强化对应的输出特征。
  5. 根据权利要求4所述的方法,其中,所述利用所述第i+1次特征强化对应的注意力特征图,对所述第i+1次特征强化对应的输入特征进行特征强化,得到所述第i+1次特征强化对应的输出特征,包括:
    根据所述第i+1次特征强化对应的输入特征,确定第四特征向量;
    根据所述第i+1次特征强化对应的注意力特征图和所述第四特征向量,确定所述第i+1次特征强化对应的输出特征。
  6. 根据权利要求1至5中任意一项所述的方法,其中,所述对所述多个第二图像块特征进行特征池化,得到多个第三图像块特征,包括:
    对所述多个第二图像块特征进行卷积处理,得到多个第四图像块特征,其中,所述第四图像块特征和所述第二图像块特征的个数相同,且所述第四图像块特征的通道数大于所述第二图像块特征的通道数;
    对所述多个第四图像块特征进行池化处理,得到所述多个第三图像块特征。
  7. 根据权利要求1至6中任意一项所述的方法,其中,所述图像处理方法通过自注意力神经网络实现,所述自注意力神经网络中包括自注意力部分和特征池化部分;
    所述根据所述多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,包括:
    利用所述自注意力部分,根据所述多个第一图像块特征,基于自注意力机制进行n次特征强化,得到所述多个第二图像块特征;
    所述对所述多个第二图像块特征进行特征池化,得到多个第三图像块特征,包括:
    利用所述特征池化部分,对所述多个第二图像块特征进行特征池化,得到所述多个第三图像块特征。
  8. 根据权利要求7所述的方法,其中,所述自注意力部分中包括n个自注意力层,其中,每个自注意力层用于进行一次特征强化,至少两个相邻所述自注意力层共享相同的注意力特征图;和/或,
    所述特征池化部分中包括卷积层和最大池化层,其中,所述卷积层对应的卷积核尺寸小于阈值。
  9. 根据权利要求7或8所述的方法,其中,所述方法还包括:
    构建网络结构搜索空间,其中,所述网络结构搜索空间中包括所述自注意力神经网络对应的多个网络超参数;
    根据所述网络结构搜索空间,构建超级网络,其中,所述网络结构搜索空间中包括根据所述多个网络超参数构建的多个可选网络结构;
    通过对所述超级网络进行网络训练,从所述多个可选网络结构中确定目标网络结构;
    根据所述目标网络结构,构建所述自注意力神经网络。
  10. 根据权利要求9所述的方法,其中,所述多个网络超参数包括:图像块特征个数参数、图像块特征通道数参数、所述自注意力部分对应的层参数,以及所述自注意力部分中需要共享相同的注意力特征图的至少两个相邻所述自注意力层的位置参数。
  11. 根据权利要求10所述的方法,其中,相同所述自注意力部分中包括的各自注意力层对应相同的图像块特征个数参数取值,以及相同的图像块特征通道数参数取值。
  12. 一种图像处理装置,包括:
    特征确定部分,被配置为确定目标图像对应的多个第一图像块特征;
    自注意力部分,被配置为根据所述多个第一图像块特征,基于自注意力机制进行n次特征强化,得到多个第二图像块特征,其中,所述第二图像块特征和所述第一图像块特征的个数和通道数均相同,n是大于或等于1的整数;
    特征池化部分,被配置为对所述多个第二图像块特征进行特征池化,得到多个第三图像块特征,其中,所述第三图像块特征的个数小于所述第二图像块特征的个数,且所述第三图像块特征的通道数数大于所述第二图像块特征的通道数;
    目标图像处理部分,被配置为根据所述多个第三图像块特征,对所述目标图像进行目标图像处理操作,得到图像处理结果。
  13. 根据权利要求12所述的装置,其中,所述自注意力部分,包括:
    第i个自注意力子部分,被配置为基于自注意力机制,对第i次特征强化对应的输入特征进行特征强化,得到所述第i次特征强化对应的输出特征,其中,i是大于或等于1,且小于或等于n的整数;
    第n个确定子部分,被配置为在i等于n的情况下,将所述第i次特征强化对应的输出特征确定为所述多个第二图像块特征;在i等于1的情况下,第1次特征强化对应的输入特征是所述多个第一图像块特征;在i大于1的情况下,第i次特征强化对应的输入特征是第i-1次特征强化对应的输出特征。
  14. 根据权利要求13所述的装置,其中,所述第i个自注意力子部分,包括:
    第一确定部分,被配置为根据所述第i次特征强化对应的输入特征,确定第一特征向量、第二特征向量和第三特征向量;
    第二确定部分,被配置为根据所述第一特征向量和所述第二特征向量,确定所述第i次特征强化对应的注意力特征图;
    第三确定部分,被配置为根据所述第i次特征强化对应的注意力特征图和所述第三特征向量,确定所述第i次特征强化对应的输出特征。
  15. 根据权利要求14所述的装置,其中,所述装置还包括:第i+1个自注意力子部分;所述第i+1个自注意力子部分,包括:
    第四确定部分,被配置为在i满足预设条件的情况下,将所述第i次特征强化对应的输出特征,确定为第i+1次特征强化对应的输入特征;
    第五确定部分,被配置为在i满足预设条件的情况下,将所述第i次特征强化对应的注意力特征图,确定为所述第i+1次特征强化对应的注意力特征图;
    第六确定部分,被配置为在i满足预设条件的情况下,利用所述第i+1次特征强化对应的注意力特征图,对所述第i+1次特征强化对应的输入特征进行特征强化,得到所述第i+1次特征强化对应的输出特征。
  16. 根据权利要求15所述的装置,其中,所述第六确定部分,还被配置为:
    根据所述第i+1次特征强化对应的输入特征,确定第四特征向量;
    根据所述第i+1次特征强化对应的注意力特征图和所述第四特征向量,确定所述第i+1次特征强化对应的输出特征。
  17. 根据权利要求12-16任一项所述的装置,其中,所述特征池化部分,包括:
    卷积子部分,被配置为对所述多个第二图像块特征进行卷积处理,得到多个第四图像块特征,其中,所述第四图像块特征和所述第二图像块特征的个数相同,且所述第四图像块特征的通道数大于所述第二图像块特征的通道数;
    池化子部分,被配置为对所述多个第四图像块特征进行池化处理,得到所述多个第三图像块特征。
  18. 根据权利要求12-17任一项所述的装置,其中,所述装置通过自注意力神经网络实现,所述自注意力神经网络中包括所述自注意力部分和所述特征池化部分。
  19. 根据权利要求18所述的装置,其中,所述自注意力部分中包括n个自注意力层,其中,每个自注意力层用于进行一次特征强化,至少两个相邻自注意力层共享相同的注意力特征图;和/或,所述特征池化部分中包括卷积层和最大池化层,其中,所述卷积层对应的卷积核尺寸小于阈值。
  20. 根据权利要求18或19所述的装置,其中,所述装置还包括:
    搜索空间构建部分,被配置为构建网络结构搜索空间,其中,网络结构搜索空间中包括自注意力神经网络对应的多个网络超参数;
    超级网络构建部分,被配置为根据网络结构搜索空间,构建超级网络,其中,网络结构搜索空间中包括根据多个网络超参数构建的多个可选网络结构;
    网络训练部分,被配置为通过对超级网络进行网络训练,从多个可选网络结构中确定目标网络结构;
    自注意力神经网络构建部分,被配置为根据目标网络结构,构建自注意力神经网络。
  21. 根据权利要求20所述的装置,其中,所述多个网络超参数包括:图像块特征个数参数、图像块特征通道数参数、所述自注意力部分对应的层参数,以及所述自注意力部分中需要共享相同的注意力特征图的至少两个相邻所述自注意力层的位置参数。
  22. 根据权利要求21所述的装置,其中,相同所述自注意力部分中包括的各自注意力层对应相同的图像块特征个数参数取值,以及相同的图像块特征通道数参数取值。
  23. 一种电子设备,包括:
    处理器;
    被配置为存储处理器可执行指令的存储器;
    其中,所述处理器被配置为调用所述存储器存储的指令,以执行权利要求1至11中任意一项所述的方法。
  24. 一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现权利要求1至11中任意一项所述的方法。
  25. 一种计算机程序,所述计算机程序产品包括计算机程序或指令,在所述计算机程序或指令在计算机上运行的情况下,所述计算机执行权利要求1至11中任一项所述的方法。
PCT/CN2021/123597 2021-05-25 2021-10-13 图像处理方法及装置、电子设备和计算机可读存储介质 WO2022247103A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110573067.4 2021-05-25
CN202110573067.4A CN113361540A (zh) 2021-05-25 2021-05-25 图像处理方法及装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2022247103A1 true WO2022247103A1 (zh) 2022-12-01

Family

ID=77527512

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/123597 WO2022247103A1 (zh) 2021-05-25 2021-10-13 图像处理方法及装置、电子设备和计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN113361540A (zh)
WO (1) WO2022247103A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113361540A (zh) * 2021-05-25 2021-09-07 商汤集团有限公司 图像处理方法及装置、电子设备和存储介质
PE20230479A1 (es) * 2021-09-10 2023-03-15 Jebi S A C Metodo y sistema de vision computarizada 3d para excavadoras
CN113901904A (zh) * 2021-09-29 2022-01-07 北京百度网讯科技有限公司 图像处理方法、人脸识别模型训练方法、装置及设备
CN114092773B (zh) * 2021-10-29 2023-11-21 北京百度网讯科技有限公司 信号处理方法、信号处理装置、电子设备及存储介质
CN114445892A (zh) * 2022-01-27 2022-05-06 北京百度网讯科技有限公司 图像检测方法和装置
CN114973391B (zh) * 2022-06-30 2023-03-21 北京万里红科技有限公司 应用于元宇宙的眼球跟踪方法、装置、设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108229490A (zh) * 2017-02-23 2018-06-29 北京市商汤科技开发有限公司 关键点检测方法、神经网络训练方法、装置和电子设备
CN112598024A (zh) * 2020-12-03 2021-04-02 天津理工大学 一种基于深度多示例学习和自注意力的医学图像分类方法
CN113361540A (zh) * 2021-05-25 2021-09-07 商汤集团有限公司 图像处理方法及装置、电子设备和存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118194921A (zh) * 2017-10-27 2024-06-14 谷歌有限责任公司 基于关注的图像生成神经网络
CN109726683B (zh) * 2018-12-29 2021-06-22 北京市商汤科技开发有限公司 目标对象检测方法和装置、电子设备和存储介质
CN112598045A (zh) * 2020-12-17 2021-04-02 中国工商银行股份有限公司 训练神经网络的方法、图像识别方法及图像识别装置
CN112712048A (zh) * 2021-01-11 2021-04-27 武汉爱科森网络科技有限公司 一种对电动车进入楼宇进行监测预警的方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108229490A (zh) * 2017-02-23 2018-06-29 北京市商汤科技开发有限公司 关键点检测方法、神经网络训练方法、装置和电子设备
CN112598024A (zh) * 2020-12-03 2021-04-02 天津理工大学 一种基于深度多示例学习和自注意力的医学图像分类方法
CN113361540A (zh) * 2021-05-25 2021-09-07 商汤集团有限公司 图像处理方法及装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN113361540A (zh) 2021-09-07

Similar Documents

Publication Publication Date Title
WO2022247103A1 (zh) 图像处理方法及装置、电子设备和计算机可读存储介质
CN111310616B (zh) 图像处理方法及装置、电子设备和存储介质
CN110287874B (zh) 目标追踪方法及装置、电子设备和存储介质
CN110889469B (zh) 图像处理方法及装置、电子设备和存储介质
CN110390394B (zh) 批归一化数据的处理方法及装置、电子设备和存储介质
CN111783756B (zh) 文本识别方法及装置、电子设备和存储介质
WO2022011892A1 (zh) 网络训练方法及装置、目标检测方法及装置和电子设备
WO2022247128A1 (zh) 图像处理方法及装置、电子设备和存储介质
CN110909815B (zh) 神经网络训练、图像处理方法、装置及电子设备
CN111539410B (zh) 字符识别方法及装置、电子设备和存储介质
CN111242303B (zh) 网络训练方法及装置、图像处理方法及装置
CN110659690B (zh) 神经网络的构建方法及装置、电子设备和存储介质
CN109685041B (zh) 图像分析方法及装置、电子设备和存储介质
WO2022141969A1 (zh) 图像分割方法及装置、电子设备、存储介质和程序
CN109447258B (zh) 神经网络模型的优化方法及装置、电子设备和存储介质
CN113139484B (zh) 人群定位方法及装置、电子设备和存储介质
CN113283343A (zh) 人群定位方法及装置、电子设备和存储介质
JP2022508990A (ja) 顔認識方法及び装置、電子機器、並びに記憶媒体
WO2023024439A1 (zh) 一种行为识别方法及装置、电子设备和存储介质
CN112749709A (zh) 图像处理方法及装置、电子设备和存储介质
CN110019928B (zh) 视频标题的优化方法及装置
CN110443363B (zh) 图像特征学习方法及装置
CN113159275A (zh) 网络训练方法、图像处理方法、装置、设备及存储介质
CN112800954A (zh) 文本检测方法及装置、电子设备和存储介质
CN110765943A (zh) 网络训练、识别方法及装置、电子设备和存储介质

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2022531476

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21942668

Country of ref document: EP

Kind code of ref document: A1