WO2023134064A1 - 图片特征提取方法、装置、存储介质及计算机设备 - Google Patents

图片特征提取方法、装置、存储介质及计算机设备 Download PDF

Info

Publication number
WO2023134064A1
WO2023134064A1 PCT/CN2022/089692 CN2022089692W WO2023134064A1 WO 2023134064 A1 WO2023134064 A1 WO 2023134064A1 CN 2022089692 W CN2022089692 W CN 2022089692W WO 2023134064 A1 WO2023134064 A1 WO 2023134064A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
feature vector
sub
pictures
sample
Prior art date
Application number
PCT/CN2022/089692
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 WO2023134064A1 publication Critical patent/WO2023134064A1/zh

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection

Definitions

  • the present application relates to the field of information technology, and in particular to a picture feature extraction method, device, storage medium and computer equipment.
  • Image feature extraction is a basic task in natural language processing. Image feature extraction provides the basis for subsequent natural language processing. Therefore, efficient and accurate image feature extraction is of great significance to natural language processing.
  • a feature extraction model is usually constructed using a clear and complete image, and image feature extraction is performed based on the constructed feature extraction model.
  • pictures are often incomplete or unclear, for example, cropped pictures or mosaiced pictures, which will lead to feature extraction models constructed with clear and complete pictures , it is difficult to support the feature extraction of unclear or incomplete pictures, and the extraction accuracy of picture features cannot be guaranteed.
  • the present application provides a picture feature extraction method, device, storage medium and computer equipment, mainly for improving the precision of picture feature extraction.
  • a method for extracting image features including:
  • an image feature extraction device including:
  • the acquisition unit is set to acquire the pictures to be processed in the actual business scene
  • a segmentation unit configured to segment the picture to be processed into multiple sub-pictures, and determine a clear target sub-picture from the multiple sub-pictures, wherein the clear target sub-picture is not damaged, not mosaic, An image with a pixel value greater than the preset pixel value;
  • the extraction unit is configured to input the target sub-picture into a preset picture feature extraction model for feature extraction, and obtain a first picture feature vector corresponding to the target sub-picture;
  • the first determining unit is configured to determine the remaining sub-pictures among the multiple sub-pictures after removing the target sub-picture based on the feature vector of the first picture and the position information of the multiple sub-pictures in the picture to be processed respectively The second picture feature vector corresponding to the picture;
  • the second determining unit is configured to determine a third picture feature vector corresponding to the picture to be processed based on the first picture feature vector and the second picture feature vector.
  • a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the following steps are implemented:
  • a computer device including a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the following steps when executing the program:
  • This application obtains the picture to be processed in the actual business scene; divides the picture to be processed into multiple sub-pictures, and determines a clear target sub-picture from the multiple sub-pictures, wherein the clear target sub-picture is A picture that is not damaged, not mosaic, and whose pixel value is greater than a preset pixel value; input the target sub-picture into a preset picture feature extraction model for feature extraction, and obtain the first picture feature vector corresponding to the target sub-picture ; Based on the feature vector of the first picture and the position information of the multiple sub-pictures in the picture to be processed, determine the second picture corresponding to the remaining sub-pictures after removing the target sub-picture among the multiple sub-pictures A feature vector; based on the first picture feature vector and the second picture feature vector, determine
  • Fig. 1 shows a flow chart of a picture feature extraction method provided by the embodiment of the present application
  • FIG. 2 shows a flowchart of another image feature extraction method provided by the embodiment of the present application
  • FIG. 3 shows a schematic structural diagram of a picture feature extraction device provided by an embodiment of the present application
  • FIG. 4 shows a schematic structural diagram of another image feature extraction device provided by an embodiment of the present application.
  • FIG. 5 shows a schematic diagram of a physical structure of a computer device provided by an embodiment of the present application.
  • the feature extraction model is constructed by using clear and complete images, and image features are extracted based on the constructed feature extraction model. Since the images in actual business scenarios are often incomplete or unclear, the use of clear and complete The feature extraction model built from the picture is difficult to support the feature extraction of unclear or incomplete pictures, and the extraction accuracy of picture features cannot be guaranteed.
  • the embodiment of the present application provides a picture feature extraction method, as shown in Figure 1, the method includes:
  • the pictures to be processed in the actual business scenario include mosaiced pictures, cropped pictures, and the like.
  • the embodiment of the present application divides the picture to be processed into multiple sub-pictures, and determines a clear target sub-picture from the multiple sub-pictures , at the same time, using the picture feature extraction model to extract the first picture feature vector corresponding to the target sub-picture, and based on the first picture feature vector and the position information corresponding to the multiple sub-pictures, determine the position corresponding to the remaining sub-pictures in the multiple sub-pictures.
  • the second picture feature vector and finally based on the first picture feature vector and the second picture feature vector, determine the third picture feature vector corresponding to the picture to be processed, thereby avoiding feature extraction using a clear and complete picture construction Model, it is difficult to support the feature extraction of unclear or incomplete pictures, which improves the accuracy of picture feature extraction.
  • the embodiment of the present application should mainly be set as a scene for extracting image features, and the execution subject of the embodiment of the present application is a device or device capable of extract
  • the pictures to be processed can also be obtained in the picture database.
  • the The picture to be processed is divided into multiple sub-pictures, and a clear target sub-picture is determined from the multiple sub-pictures.
  • the target sub-picture is input into a preset picture feature extraction model for feature extraction, and the target sub-picture is obtained.
  • the first picture feature vector corresponding to the picture and then based on the first picture feature vector and the position information of the multiple sub-pictures in the picture to be processed, determine the second corresponding to the remaining sub-pictures in the multiple sub-pictures.
  • the picture feature vector and finally based on the first picture feature vector and the second picture feature vector, determine the third picture feature vector corresponding to the picture to be processed, thereby improving the accuracy of picture feature extraction, which is in the field of artificial intelligence lays the foundation for natural language processing.
  • the sizes of the multiple sub-pictures may be the same or different.
  • the picture to be processed is divided into multiple sub-pictures.
  • the number of subimages is as follows:
  • N is the number of sub-pictures
  • a is the length corresponding to the sub-picture
  • b is the width corresponding to the sub-picture
  • H is the length corresponding to the picture to be processed
  • W is the width corresponding to the picture to be processed
  • the picture to be processed is divided
  • determine a clear target sub-picture in the multiple sub-pictures the target sub-picture is a picture that has not been mosaiced or not damaged
  • the number of the clear target sub-pictures can be 1 , can also be multiple, and this application does not specifically limit it.
  • the target sub-picture After determining a clear target sub-picture, input the target sub-picture into the preset picture feature extraction model for feature extraction, and obtain the target sub-picture corresponding to A feature vector of the first picture, and based on the feature vector of the first picture and position information of the plurality of sub-pictures in the picture to be processed, determine a second picture corresponding to the remaining sub-pictures in the plurality of sub-pictures feature vectors, and finally determine a third picture feature vector corresponding to the picture to be processed based on the first picture feature vector and the second picture feature vector, which ensures the accuracy of picture feature extraction.
  • the preset image feature extraction model may specifically be a preset encoder.
  • the target sub-picture is input to the preset encoder for feature extraction, and the first picture feature corresponding to the target sub-picture is obtained vector, and based on the first picture feature vector and the position information of the multiple sub-pictures in the picture to be processed, determine the second picture feature vector corresponding to the remaining sub-pictures in the multiple sub-pictures, and finally based on the
  • the feature vector of the first picture and the feature vector of the second picture are determined to determine the feature vector of the third picture corresponding to the picture to be processed, which can avoid the feature extraction of unclear pictures by using a feature extraction model constructed from a clear and complete picture. In this case, the accuracy of image feature extraction is improved.
  • the position information may specifically be the order of positions of the multiple sub-pictures in the picture to be processed, and the multiple sub-pictures are sequentially coded as 1 , 2, 3, etc., so that position information of multiple sub-pictures in the picture to be processed can be determined, wherein the position information includes position information corresponding to the target sub-picture.
  • the method is to determine the position information of multiple sub-pictures in the picture to be processed, and based on the first picture feature vector corresponding to the target sub-picture and the multiple sub-pictures Determine the second picture feature vectors corresponding to the remaining sub-pictures in the plurality of sub-pictures according to the position information of the pictures in the picture to be processed, and finally determine based on the first picture feature vector and the second picture feature vector
  • the third picture feature vector corresponding to the picture to be processed can avoid the situation that the feature extraction model constructed from a clear and complete picture is used to extract features from an unclear picture, thereby improving the accuracy of picture feature extraction.
  • the first picture feature vector and the second picture feature vector are finally The vectors are added to obtain the third picture feature vector corresponding to the picture to be processed, thus by dividing the picture to be processed, the clear target sub-picture in the picture to be processed is determined, and the corresponding eigenvector of the target sub-picture is extracted.
  • the first picture feature vector determines the remaining sub-pictures in the multiple sub-pictures after removing the target sub-picture
  • the second picture feature vector corresponding to the picture determines the third picture feature vector corresponding to the picture to be processed, which can avoid using a clear and complete picture to construct
  • the feature extraction model extracts features from unclear pictures, which improves the accuracy of picture feature extraction.
  • this application obtains the The picture to be processed; the picture to be processed is divided into a plurality of sub-pictures, and a clear target sub-picture is determined from the multiple sub-pictures, wherein the clear target sub-picture is not damaged, not mosaic, A picture whose pixel value is greater than a preset pixel value; input the target sub-picture into a preset picture feature extraction model for feature extraction, and obtain a first picture feature vector corresponding to the target sub-picture; based on the first picture feature The vector and the location information of the plurality of sub-pictures in the picture to be processed respectively, and determining the second picture feature vector corresponding to the remaining sub-picture after removing the target sub-picture among the multiple sub-pictures; based on the first The picture feature vector and the second picture feature vector determine a third picture feature vector corresponding to
  • the embodiment of the present application provides another picture feature extraction method, as shown in FIG. 2 , the Methods include:
  • the picture database contains a large number of mosaiced or damaged pictures in actual business scenarios.
  • the picture to be processed can be obtained in the picture database, and the The image to be processed is segmented to obtain a plurality of sub-images corresponding to the image to be processed, and a clear target sub-image is determined among the plurality of sub-images, and then the target sub-image is input into a preset image feature extraction model for Feature extraction, obtaining the first picture feature vector corresponding to the target sub-picture, and based on the first picture feature vector and the corresponding position information of the multiple sub-pictures in the picture to be processed, determining the plurality of sub-pictures The second picture feature vector corresponding to the remaining sub-pictures in the picture, and finally determine the third picture feature vector corresponding to the picture to be processed based on the first picture feature vector and the second picture feature vector.
  • the number of divisions is determined first, and then the picture to be processed is divided based on the number of divisions. For example, if the number of divisions is determined to be 25, the picture to be processed can be divided horizontally into 5 parts, and then the picture to be processed can be divided vertically. Divide into 5 parts.
  • multiple sub-pictures can be obtained, and a fresh target sub-picture is determined in the multiple sub-pictures, and then the target sub-picture is input to the preset Feature extraction is performed in the picture feature extraction model to obtain the first picture feature vector corresponding to the target sub-picture, and at the same time, based on the first picture feature vector and the positions of the multiple sub-pictures in the picture to be processed information, determine the second picture feature vector corresponding to the remaining sub-pictures in the plurality of sub-pictures, and finally determine the third picture feature corresponding to the picture to be processed based on the first picture feature vector and the second picture feature vector vector.
  • the target sub-picture is converted into a pixel matrix, and if the picture to be processed is a color picture, the target sub-picture is converted into a RGB pixel matrix of a ⁇ b ⁇ c, where a is the pixel matrix of the matrix length, b is the width of the matrix, and c is the number of channels of the matrix.
  • the pixel value at each position in the pixel matrix is a value between 0 and 255.
  • each pixel value needs to be divided by With 255, the pixel matrix is normalized so that the size of each pixel value is between 0-1, so that the normalized pixel matrix corresponding to the target sub-picture can be obtained, and based on the The normalized pixel matrix is used to determine the fourth picture feature vector corresponding to the target sub-picture, and then input the fourth picture feature vector into a preset picture feature extraction model for feature extraction to obtain the target sub-picture corresponding to the first picture feature vector, and at the same time, based on the first picture feature vector and the position information of the multiple sub-pictures in the picture to be processed, determine the first corresponding to the remaining sub-pictures in the multiple sub-pictures second picture feature vector, and finally determine a third picture feature vector corresponding to the picture to be processed based on the first picture feature vector and the second picture feature vector.
  • each row of pixels in the pixel matrix is spliced horizontally using a reshape function to obtain a feature vector of the first preset dimension corresponding to the target sub-picture, for example, if The dimension of the normalized pixel matrix is P ⁇ P ⁇ C, where C represents the number of channels of the pixel matrix corresponding to the target sub-picture, then use the reshape function to convert the matrix with dimension P ⁇ P ⁇ C into a matrix with dimension P2C vector, using this method, the feature vector of the first preset dimension corresponding to the target sub-picture can be obtained.
  • the feature vector of the first preset dimension needs to be Convert it into the feature vector of the second preset dimension, that is, the feature vector of the fourth image.
  • the specific conversion formula is as follows:
  • X is the eigenvector of the first preset dimension
  • W is the matrix of [c,X]
  • c represents the value of the second preset dimension
  • the first preset Suppose that the feature vector of the dimension is converted into the feature vector of the second preset dimension, that is, the fourth picture feature vector.
  • the preset picture feature extraction model may specifically be a preset encoder, the preset encoder includes an attention layer and a feedforward neural network layer, the output of the attention layer is used as the input of the feedforward neural network layer, and the The attention layer includes multiple attention subspaces, that is, the attention layer in this application adopts a multi-head attention mechanism.
  • 24 series-connected preset encoder pairs are used in this application The features of the target sub-picture are extracted, each encoder is connected end-to-end, and the output of the previous encoder is used as the input of the next encoder, so as to extract the feature vector in the target sub-picture.
  • the method includes: obtaining a sample picture in an actual business scene, and an actual sample picture feature vector corresponding to the sample picture; dividing the sample picture into a plurality of sample sub-pictures, and obtaining Determine a clear target sample sub-picture; input the target sample sub-picture into the initial picture feature extraction model for feature extraction, and obtain the first sample picture feature vector corresponding to the target sample sub-picture; based on the first Determine the second sample picture feature vector corresponding to the sample picture based on the feature vector of the sample picture and the position information of the plurality of sample sub-pictures in the sample picture; based on the actual sample picture feature vector corresponding to the sample picture Constructing a loss function corresponding to the initial image feature extraction model with the second sample image feature vector; training the initial image feature extraction model based on the loss
  • the specific method of constructing the loss function includes: calculating the respective vector differences at the same position in the feature vector of
  • Z represents the root mean square error
  • u1, u2....ur represent each vector in the feature vector of the second sample picture
  • vr represent each vector in the feature vector of the actual sample picture
  • r represents The number of vectors corresponding to the actual sample picture feature vectors, after constructing the loss function corresponding to the initial picture feature extraction model according to the above formula, the initial picture feature extraction model is trained based on the loss function until the minimum loss function appears after training value, and based on the model parameters corresponding to the minimum loss function value, construct the preset image feature extraction model, that is, the preset encoder in the embodiment of the present application.
  • step 205 specifically includes: converting the fourth The picture feature vector is input to the different attention subspaces in the attention layer for feature extraction, to obtain the fifth picture feature vector of the target sub-picture under the different attention subspaces;
  • the fifth picture feature vector under the different attention subspaces is multiplied and summed with the weights corresponding to the different attention subspaces to obtain the attention layer output vector corresponding to the target sub-picture; the attention Adding the layer output vector and the fourth picture feature vector to obtain the sixth picture feature vector corresponding to the target sub-picture; inputting the sixth picture feature vector into the feedforward neural network layer for feature extraction, A first picture feature vector corresponding to the target sub-picture is obtained.
  • the feature vector of the fourth picture is input to different attention subspaces in the attention layer of the first encoder for feature extraction, to obtain the first Five picture feature vectors
  • the specific process of obtaining the fifth picture feature vectors of the target sub-picture in the different attention subspaces is: according to the fourth picture feature vector, determine the target sub-picture in the The query vector, key vector and value vector under the different attention subspaces, and the query vector of the first target sub-picture in the target sub-picture under the different attention subspaces and the target sub-picture in
  • the key vectors under the different attention subspaces are multiplied to obtain the attention score of the target subpicture for the first target subpicture under the different attention subspaces, and at the same time, the The attention scores of the target sub-picture in different attention subspaces are multiplied by the key vector and summed to obtain the fifth picture feature vector of the first target sub-picture in the different attention spaces, wherein , the first target sub-picture may be any picture in the target
  • the fifth picture feature vector of the target sub-picture under the different attention subspaces is multiplied and summed with the weights under the different attention subspaces to obtain the attention in the first encoder
  • add the output vector of the attention layer and the residual of the feature vector of the fourth picture to obtain the feature vector of the sixth picture corresponding to the target sub-picture
  • the image feature vector is input into the feedforward neural network layer to obtain the output vector of the feedforward neural network layer, and then the output vector of the feedforward neural network layer and the input vector of the feedforward neural network layer are the sixth image feature vector residual
  • the difference is added to obtain the output vector of the first encoder, because the 24 encoders in the embodiment of the application are connected in series, so the output vector of the first encoder is input to the second encoder Perform feature extraction to obtain the output vector of the second encoder, so that the output vector of the previous encoder is used as the input vector of the next encoder, and finally the output vector of the last encoder is determined as
  • step 206 specifically includes: inputting the first picture feature vector and the position information of the multiple sub-pictures in the picture to be processed Extract the feature vector in the preset decoder to obtain the second picture feature vector corresponding to the remaining sub-picture after removing the target sub-picture among the plurality of sub-pictures.
  • the preset decoder has the same structure as the preset encoder.
  • six preset decoders are connected end to end in series, and the feature vector of the first picture and the plurality of sub-pictures are respectively placed in the
  • the position information in the picture to be processed is input to the first preset decoder for feature extraction, the output vector of the first preset decoder is obtained, and the output vector of the first preset decoder is input to Feature extraction is performed in the second preset decoder, so that the output vector of the previous decoder is used as the input vector of the next decoder, and the output vector of the last decoder is determined as the input vector of the plurality of sub-pictures
  • the second picture feature vectors corresponding to the remaining sub-pictures are finally determined based on the first picture feature vector and the second picture feature vector to determine a third picture special diagnosis vector corresponding to the picture to be processed.
  • step 207 specifically includes: determining the first weight coefficient corresponding to the first picture feature vector and the second weight coefficient corresponding to the second picture feature vector Weight coefficient; based on the first weight coefficient and the second weight coefficient, add the first picture feature vector to the second picture feature vector to obtain a third picture feature vector corresponding to the picture to be processed .
  • this application obtains actual business scenarios
  • the picture to be processed; the picture to be processed is divided into a plurality of sub-pictures, and a clear target sub-picture is determined from the multiple sub-pictures, wherein the clear target sub-picture is not damaged or mosaic , a picture with a pixel value greater than a preset pixel value; input the target sub-picture into a preset picture feature extraction model for feature extraction, and obtain a first picture feature vector corresponding to the target sub-picture; based on the first picture Determining a second picture feature vector corresponding to the remaining sub-picture after removing the target sub-picture among the multiple sub-pictures based on the feature vector and the position information of the plurality of sub-pictures respectively in the picture to be processed; A picture feature vector and the second picture feature vector, determining a third picture feature vector
  • the embodiment of the present application provides a picture feature extraction device, as shown in FIG. 3, the device includes: an acquisition unit 31, a segmentation unit 32, an extraction unit 33, a first determination unit 34 and the second determination unit 35.
  • the acquisition unit 31 is configured as an acquisition unit, configured to acquire pictures to be processed in actual business scenarios.
  • the segmentation unit 32 is configured to divide the picture to be processed into multiple sub-pictures, and determine a clear target sub-picture from the multiple sub-pictures, wherein the clear target sub-picture is undamaged, undamaged Images that are mosaiced and whose pixel value is greater than the preset pixel value.
  • the extraction unit 33 is configured to input the target sub-picture into a preset picture feature extraction model for feature extraction, and obtain a first picture feature vector corresponding to the target sub-picture.
  • the first determining unit 34 is configured to determine, based on the feature vector of the first picture and the position information of the multiple sub-pictures in the picture to be processed, after removing the target sub-picture from the multiple sub-pictures The second picture feature vector corresponding to the remaining sub-pictures of .
  • the second determining unit 35 is configured to determine a third picture feature vector corresponding to the picture to be processed based on the first picture feature vector and the second picture feature vector.
  • the extraction unit 33 in order to input the target sub-picture into the preset picture feature extraction model for feature extraction, obtain the first picture feature vector corresponding to the target sub-picture, as shown in Figure 4, the extraction unit 33, including a determination module 331, a splicing module 332 and an extraction module 333.
  • the determination module 331 is configured to determine a pixel matrix corresponding to the target sub-picture.
  • the splicing module 332 is configured to horizontally splice each row of pixels in the pixel matrix to obtain a fourth picture feature vector corresponding to the target sub-picture.
  • the extraction module 333 is configured to input the fourth picture feature vector into the preset picture feature extraction model for feature extraction, and obtain the first picture feature vector corresponding to the target sub-picture.
  • the extraction module 333 in order to input the fourth picture feature vector into the preset picture feature extraction model for feature extraction and obtain the first picture feature vector corresponding to the target sub-picture, the extraction module 333, Including extraction sub-module, summation sub-module, addition sub-module.
  • the extraction sub-module is configured to input the feature vector of the fourth picture into different attention subspaces in the attention layer for feature extraction, and obtain the target sub-picture under the different attention subspaces The fifth image feature vector.
  • the summation submodule is configured to multiply and sum the fifth image feature vector of the target sub-picture under the different attention subspaces and the weights corresponding to the different attention subspaces to obtain the target The attention layer output vector corresponding to the sub-picture.
  • the adding sub-module is configured to add the output vector of the attention layer and the feature vector of the fourth picture to obtain the feature vector of the sixth picture corresponding to the target sub-picture.
  • the extraction sub-module is specifically configured to input the feature vector of the sixth picture into the feedforward neural network layer for feature extraction, and obtain the feature vector of the first picture corresponding to the target sub-picture.
  • the device in order to train and construct the preset image feature extraction model, the device further includes a construction unit 36 .
  • the acquiring unit 31 is further configured to acquire sample pictures in actual business scenarios, and actual sample picture feature vectors corresponding to the sample pictures.
  • the segmenting unit 32 is further configured to segment the sample picture into a plurality of sample sub-pictures, and determine a clear target sample sub-picture from the plurality of sample sub-pictures.
  • the extraction unit 33 is further configured to input the target sample sub-picture into an initial picture feature extraction model for feature extraction, and obtain a first sample picture feature vector corresponding to the target sample sub-picture.
  • the second determining unit 35 is further configured to determine the second sample corresponding to the sample picture based on the feature vector of the first sample picture and the position information of the plurality of sample sub-pictures in the sample picture, respectively. Image feature vector.
  • the construction unit 36 is configured to construct a loss function corresponding to the initial picture feature extraction model based on the actual sample picture feature vector corresponding to the sample picture and the second sample picture feature vector.
  • the construction unit 36 is specifically configured to train the initial image feature extraction model based on the loss function, and construct the preset image feature extraction model.
  • the construction unit 36 in order to construct a loss function corresponding to the initial image feature extraction model, includes a calculation module 361 and a construction module 362 .
  • the calculation module 361 is configured to calculate vector differences at the same positions in the feature vector of the actual sample picture and the feature vector of the second sample picture.
  • the construction module 362 is configured to construct a loss function corresponding to the initial picture feature extraction model by calculating the sum of squares of the respective vector differences.
  • the first determination unit 34 is specifically configured to input the feature vector of the first picture and the position information of the plurality of sub-pictures in the picture to be processed into a preset decoder to extract the feature vector, and obtain Second picture feature vectors corresponding to the remaining sub-pictures in the plurality of sub-pictures.
  • the second determination unit 35 is specifically configured to determine the The first weight coefficient corresponding to the first picture feature vector and the second weight coefficient corresponding to the second picture feature vector; based on the first weight coefficient and the second weight coefficient, the first picture feature vector Adding it to the second picture feature vector to obtain a third picture feature vector corresponding to the picture to be processed.
  • the embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored.
  • the program is executed by a processor, the following steps are implemented: obtain the The picture to be processed; the picture to be processed is divided into a plurality of sub-pictures, and a clear target sub-picture is determined from the multiple sub-pictures, wherein the clear target sub-picture is not damaged, not mosaic, A picture whose pixel value is greater than a preset pixel value; input the target sub-picture into a preset picture feature extraction model for feature extraction, and obtain a first picture feature vector corresponding to the target sub-picture; based on the first picture feature The vector and the location information of the plurality of sub-pictures in the picture to be processed respectively, and determining the second picture feature vector corresponding to the remaining sub-picture after removing the target sub-picture among the multiple sub-pictures; based on the first The picture feature vector and the second picture feature vector determine a third picture
  • the embodiment of the present application also provides a physical structure diagram of a computer device, as shown in FIG. 5 , the computer device includes: a processor 41, Memory 42 and a computer program stored on the memory 42 and operable on the processor, wherein the memory 42 and the processor 41 are all set on the bus 43 and the processor 41 implements the following steps when executing the program: obtaining the actual business A picture to be processed in the scene; dividing the picture to be processed into a plurality of sub-pictures, and determining a clear target sub-picture from the multiple sub-pictures, wherein the clear target sub-picture is not damaged, not A mosaic, a picture whose pixel value is greater than a preset pixel value; input the target sub-picture into a preset picture feature extraction model for feature extraction, and obtain a first picture feature vector corresponding to the target sub-picture; based on the first The picture feature vector and the position information of the
  • the application obtains the picture to be processed in the actual business scene; divides the picture to be processed into multiple sub-pictures, and determines a clear target sub-picture from the multiple sub-pictures, wherein the The clear target sub-picture is a picture that is not damaged, not mosaiced, and whose pixel value is greater than a preset pixel value; the target sub-picture is input into a preset picture feature extraction model for feature extraction, and the target sub-picture is obtained A corresponding first picture feature vector; based on the first picture feature vector and the position information of the plurality of sub-pictures in the picture to be processed, determine the second picture features corresponding to the remaining sub-pictures in the plurality of sub-pictures vector; based on the first picture feature vector and the second picture feature vector, determine the third picture feature vector corresponding to the picture to be processed, thereby by dividing the picture to be processed, determine the picture to be processed clear target sub-picture, and extract the first picture feature vector corresponding to the target sub
  • each module or each step of the above-mentioned application can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network composed of multiple computing devices Alternatively, they may be implemented in program code executable by a computing device so that they may be stored in a storage device to be executed by a computing device, and in some cases in an order different from that shown here
  • the steps shown or described are carried out, or they are separately fabricated into individual integrated circuit modules, or multiple modules or steps among them are fabricated into a single integrated circuit module for implementation.
  • the application is not limited to any specific combination of hardware and software.

Landscapes

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

Abstract

本申请公开了一种图片特征提取方法、装置、存储介质及计算机设备,涉及信息技术领域,主要在于能够提高图片特征提取的精度。其中方法包括:获取实际业务场景中的待处理图片;将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片;将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量;基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。本申请适用于对图片特征进行提取。

Description

图片特征提取方法、装置、存储介质及计算机设备
本申请要求与2022年01月11日提交中国专利局、申请号为202210026806.2,申请名称为“图片特征提取方法、装置、存储介质及计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及信息技术领域,尤其是涉及一种图片特征提取方法、装置、存储介质及计算机设备。
背景技术
图片特征提取是自然语言处理中的一项基本任务,通过图片特征提取为后续自然语言处理提供基础,因此,高效准确地进行图片特征提取对自然语言处理有着重要的意义。
目前,通常利用清晰且完整的图片构建特征提取模型,并基于构建好的特征提取模型进行图片特征提取。然而,发明人发现,在实际业务场景中,图片往往是不完整或者不清晰的,例如,裁剪过的图片或者打过马赛克的图片,由此会导致利用清晰且完整的图片构建的特征提取模型,很难支持对不清晰或者不完整的图片的特征提取,无法保证图片特征的提取精度。
发明内容
本申请提供了一种图片特征提取方法、装置、存储介质及计算机设备,主要在于能够提高图片特征提取的精度。
根据本申请的第一个方面,提供一种图片特征提取方法,包括:
获取实际业务场景中的待处理图片;
将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;
将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;
基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;
基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
根据本申请的第二个方面,提供一种图片特征提取装置,包括:
获取单元,设置为获取实际业务场景中的待处理图片;
分割单元,设置为将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;
提取单元,设置为将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;
第一确定单元,设置为基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;
第二确定单元,设置为基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
根据本申请的第三个方面,提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现以下步骤:
获取实际业务场景中的待处理图片;
将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;
将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;
基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;
基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
根据本申请的第四个方面,提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现以下步骤:
获取实际业务场景中的待处理图片;
将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;
将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;
基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;
基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
根据本申请提供的一种图片特征提取方法、装置、存储介质及计算机设备,与目前利用清晰且完整的图片构建特征提取模型,并基于构建好的特征提取模型进行图片特征提取的方式相比,本申请通过获取实际业务场景中的待处理图片;将所述待处理图片分割成多 个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,由此通过将待处理图片进行分割,确定所述待处理图片中清晰的目标子图片,并提取所述目标子图片对应的第一图片特征向量,同时基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,能够避免利用清晰且完整的图片构建的特征提取模型对不清晰图片进行特征提取的情况,提高了图片特征提取的精度。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明设置为解释本申请,并不构成对本申请的不当限定。在附图中:
图1示出了本申请实施例提供的一种图片特征提取方法流程图;
图2示出了本申请实施例提供的另一种图片特征提取方法流程图;
图3示出了本申请实施例提供的一种图片特征提取装置的结构示意图;
图4示出了本申请实施例提供的另一种图片特征提取装置的结构示意图;
图5示出了本申请实施例提供的一种计算机设备的实体结构示意图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
目前,利用清晰且完整的图片构建特征提取模型,并基于构建好的特征提取模型对图片特征进行提取的方式,由于实际业务场景中的图片往往是不完整或者不清晰的,导致利用清晰且完整的图片构建的特征提取模型,很难支持对不清晰或者不完整的图片的特征提取,无法保证图片特征的提取精度。
为了解决上述问题,本申请实施例提供了一种图片特征提取方法,如图1所示,所述方法包括:
101、获取实际业务场景中的待处理图片。
其中,实际业务场景中的待处理图片包括打过马赛克的图片、裁剪过的图片等。
对于本申请实施例,为了克服现有技术中图片特征提取的精度较低的缺陷,本申请实施例将待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,与此同时,利用图片特征提取模型提取目标子图片对应的第一图片特征向量,并基于第一图片特征向量和多个子图片对应的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,从而避免利用清晰且完整的图片构建的特征提取模型,很难支持对不清晰或者不完整图片进行特征提取的情况,提高了图片特征提取的精度。本申请实施例主要应设置为对图片特征进行提取的场景,本申请实施例的执行主体为能够对图片特征进行提取的装置或者设备,具体可以设置在客户端或者服务器一侧。
具体地,实际业务场景中存在大量待处理图片,通过在网络上下载裁剪过的图片或者打过马赛克的图片,也可以在图片数据库中获取待处理图片,获取到待处理图片后,将所述待处理图片分割成多个子图片,并从多个子图片中确定清晰的目标子图片,与此同时,将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,之后基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,进而提高了图片特征提取的精度,为人工智能领域中的自然语言处理奠定基础。
102、将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片。
其中,所述多个子图片的大小可以是相同的,也可是不相同的,对于本申请实施例,若所述多个子图片的大小是相同的,将所述待处理图片分成多个子图片,多个子图片的数量如下:
Figure PCTCN2022089692-appb-000001
其中,N为子图片的数量,a为子图片对应的长,b为子图片对应的宽,H为待处理图片对应的长,W为待处理图片对应的宽,将所述待处理图片分割成为多个子图片后,在所述多个子图片中确定清晰的目标子图片,所述目标子图片为没有打过马赛克或者没有被损坏的图片,所述清晰的目标子图片的数量可以是1个,也可以是多个,本申请不做具体限定,确定清晰的目标图子片后,将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,并基于所述第一图片特征向量和所述所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,保证了图片特征提取的精度。
103、将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量。
其中,预设图片特征提取模型具体可以为预设编码器。
对于本申请实施例,在确定所述待处理图片中清晰的目标子图片之后,将所述目标子图片输入至预设编码器中进行特征提取,得到所述目标子图片对应的第一图片特征向量,并基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,能够避免利用清晰且完整的图片构建的特征提取模型对不清晰图片进行特征提取的情况,提高了图片特征提取的精度。
104、基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量。
其中,位置信息具体可以为多个子图片在所述待处理图片中的位置顺序,按照多个子图片在待处理图片中从左至右,从上至下的顺序,依次将多个子图片编码为1、2、3等,由此能够确定多个子图片在待处理图片中的位置信息,其中,所述位置信息中包括目标子图片对应的位置信息。
对于本申请实施例,在确定目标子图片对应的第一图片特征向量之后,为了确定待处理图片对应的第三图片特征向量,首先需要确定多个子图片中除了目标子图片外的剩余子图片对应的第二图片特征向量,基于此,所述方法为,确定多个子图片分别在所述待处理图片中的位置信息,并基于所述目标子图片对应的第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,能够避免利用清晰且完整的图片构建的特征提取模型对不清晰图片进行特征提取的情况,提高了图片特征提取的精度。
105、基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
对于本申请实施例,获取待处理图片中目标子图片对应的第一图片特征向量和剩余子图片对应的第二图片特征向量后,最终将所述第一图片特征向量和所述第二图片特征向量相加,得到所述待处理图片对应的第三图片特征向量,由此通过将待处理图片进行分割,确定所述待处理图片中清晰的目标子图片,并提取所述目标子图片对应的第一图片特征向量,同时基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图 片特征向量,能够避免利用清晰且完整的图片构建的特征提取模型对不清晰图片进行特征提取的情况,提高了图片特征提取的精度。
根据本申请提供的一种图片特征提取方法,与目前利用清晰且完整的图片构建特征提取模型,并基于构建好的特征提取模型进行图片特征提取的方式相比,本申请通过获取实际业务场景中的待处理图片;将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,由此通过将待处理图片进行分割,确定所述待处理图片中清晰的目标子图片,并提取所述目标子图片对应的第一图片特征向量,同时基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,能够避免利用清晰且完整的图片构建的特征提取模型对不清晰图片进行特征提取的情况,提高了图片特征提取的精度。
进一步的,为了更好的说明上述对图片特征进行提取的过程,作为对上述实施例的细化和扩展,本申请实施例提供了另一种图片特征提取方法,如图2所示,所述方法包括:
201、获取实际业务场景中的待处理图片。
具体地,图片数据库中包含大量的实际业务场景中打过马赛克或者损坏的图片,为了获取待处理图片对应的图片特征向量,可以在所述图片数据库中获取所述待处理图片,并对所述待处理图片进分割,得到所述待处理图片对应的多个子图片,并在所述多个子图片中确定清晰的目标子图片,之后将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,并基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中对应的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
202、将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片。
具体地,首先确定分割数量,之后基于所述分割数量对所述待处理图片进行分割,例如,若确定分割数量为25个,则可以将所述待处理图片横向切分成5份,之后纵向再切分成5份,对所述待处理图片按照分割数量进行切割后,可以得到多个子图片,并在所述多个子图片中确定清新的目标子图片,之后将所述目标子图片输入至预设图片特征提取模 型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,与此同时,基于所述第一图片特征向量和所述多个子图片在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
203、确定所述目标子图片对应的像素矩阵。
具体地,将所述目标子图片转换成为像素矩阵,若所述待处理图片为彩色图片,则将所述目标子图片转换为a×b×c的RGB的像素矩阵,其中,a为矩阵的长,b为矩阵的宽,c为矩阵的通道数,所述像素矩阵中每个位置处的像素值为0-255之间的数值,为了减轻模型的计算量,需要将各个像素值均除以255,即对所述像素矩阵进行归一化处理,使各个像素值的大小均在0-1之间,以此能够得到目标子图片对应的归一化后的像素矩阵,并基于所述归一化后的像素矩阵,确定所述目标子图片对应的第四图片特征向量,之后将所述第四图片特征向量输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,与此同时,基于所述第一图片特征向量和所述多个子图片在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
204、将所述像素矩阵中的各行像素进行横向拼接,得到所述目标子图片对应的第四图片特征向量。
具体地,在确定目标子图片对应的像素矩阵后,将所述像素矩阵中各行像素利用reshape函数进行横向拼接,得到所述目标子图片对应的第一预设维度的特征向量,例如,若归一化后的像素矩阵的维度是P×P×C,其中,C代表目标子图片对应的像素矩阵的通道数,则利用reshape函数将维度为P×P×C的矩阵转换成为维度是P2C的向量,利用此方法可以得到目标子图片对应的第一预设维度的特征向量,进一步地,为了满足预设特征提取模型进行特征提取的精度,还需要将所述第一预设维度的特征向量转换成为第二预设维度的特征向量,即第四图片特征向量,具体转换公式如下:
Y=WX
其中,X为第一预设维度的特征向量,W为[c,X]的矩阵,c表示第二预设维度的数值,通过上述矩阵与向量之间的相乘运算,可以将第一预设维度的特征向量转换为第二预设维度的特征向量,即第四图片特征向量,本申请中为了利用预设图片特征提取模型提取目标子图片对应的第一图片特征向量,可以将第二预维度设置为1024,则最终将所述目标子图片对应的第一预设维度的特征向量转换为1024维度的第四图片特征向量,并将所述目标子图片对应的第四图片特征向量输入至所述预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,并基于所述第一图片特征向量和所述多个子图片在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特 征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
205、将所述第四图片特征向量输入至所述预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量。
其中,预设图片特征提取模型具体可以为预设编码器,所述预设编码器包括包括注意力层和前馈神经网络层,注意力层的输出作为前馈神经网络层的输入,所述注意力层中包括多个注意力子空间,即本申请中的注意力层采用多头注意力机制,进一步地,为了提高图片特征提取的精度,本申请中利用24个串联的预设编码器对目标子图片的特征进行提取,每个编码器之间首尾连接,上一个编码器的输出作为下一个编码器的输入,以此来对目标子图片中的特征向量进行提取。
对于本申请实施例,在将所述目标子图片输入至预设编码器之前,为了提高所述预设编码器对特征向量提取的精度,需要预先对所述预设编码器进行训练,基于此,所述方法包括:获取实际业务场景中的样本图片,以及所述样本图片对应的实际样本图片特征向量;将所述样本图片分割成多个样本子图片,并从所述多个样本子图片中确定清晰的目标样本子图片;将所述目标样本子图片输入至初始图片特征提取模型中进行特征提取,得到所述目标样本子图片对应的第一样本图片特征向量;基于所述第一样本图片特征向量和所述多个样本子图片分别在所述样本图片中的位置信息,确定所述样本图片对应的第二样本图片特征向量;基于所述样本图片对应的实际样本图片特征向量和所述第二样本图片特征向量,构建所述初始图片特征提取模型对应的损失函数;基于所述损失函数对所述初始图片特征提取模型进行训练,构建所述预设图片特征提取模型。
具体地,首先获取实际业务场景中的样本图片,对所述样本图片进行分割处理,得到多个样本子图片,在所述多个样本子图片中确定清晰的目标样本子图片,并将清晰的目标样本子图片输入至初始图片特征提取模型中进行特征提取,得到所述目标样本子图片对应的第一样本图片特征向量,之后基于所述第一样本图片特征向量和多个样本子图片在所述样本图片中的位置信息,确定所述多个样本子图片中剩余样本子图片对应的第三样本图片特征向量,最终基于所述第一样本图片特征向量和所述第三样本图片特征向量,确定所述样本图片对应的第二样本图片特征向量,并基于所述样本图片对应的实际样本图片特征向量和所述第二样本图片特征向量,构建所述初始图片特征提取模型对应的损失函数,具体构建所述损失函数的方法包括:计算所述实际样本图片特征向量和所述第二样本图片特征向量中相同位置处的各个向量差;通过计算所述各个向量差的平方和,构建所述初始图片特征提取模型对应的损失函数。
具体地,在确定所述样本图片对应的实际样本图片特征向量和第二样本图片特征向量之后,计算所述实际样本图片特征向量和所述第二样本图片特征向量中相同位置处的各个向量差,之后将所述各个向量差进行平方并求和,得到,即计算所述初始图片特征提取模 型对应的均方根误差,通过计算所述均方根误差,构建所述初始图片特征提取模型对应的损失函数,具体计算均方根误差的公式如下:
Figure PCTCN2022089692-appb-000002
其中,Z表示均方根误差,u1、u2....ur表示第二样本图片特征向量中的各个向量,v1、v2....vr表示实际样本图片特征向量中的各个向量,r表示实际样本图片特征向量对应的向量数量,按照上述公式构建所述初始图片特征提取模型对应的损失函数后,基于所述损失函数对所述初始图片特征提取模型进行训练,直至训练到出现最小损失函数值为止,并基于所述最小损失函数值对应的模型参数,构建所述预设图片特征提取模型,即本申请实施例中的预设编码器。
进一步地,通过训练得到性能较好的预设编码器后,需要基于所述编码器,提取所述目标子图片对应的第一图片特征向量,基于此,步骤205具体包括:将所述第四图片特征向量输入至所述注意力层中的不同注意力子空间进行特征提取,得到所述目标子图片在所述不同注意力子空间下的第五图片特征向量;将所述目标子图片在所述不同注意力子空间下的第五图片特征向量与所述不同注意力子空间对应的权重相乘并求和,得到所述目标子图片对应的注意力层输出向量;将所述注意力层输出向量和所述第四图片特征向量相加,得到所述目标子图片对应的第六图片特征向量;将所述第六图片特征向量输入至所述前馈神经网络层中进行特征提取,得到所述目标子图片对应的第一图片特征向量。
具体地,将所述第四图片特征向量输入至第一个编码器的注意力层中的不同注意力子空间进行特征提取,得到所述目标子图片在所述不同注意力子空间下的第五图片特征向量,其中,具体获得所述目标子图片在所述不同注意力子空间下的第五图片特征向量的过程为,根据所述第四图片特征向量,确定所述目标子图片在所述不同注意力子空间下的查询向量、键向量和值向量,并将所述目标子图片中的第一目标子图片在所述不同注意力子空间下的查询向量与所述目标子图片在所述不同注意力子空间下的键向量相乘,得到所述目标子图片在所述不同注意力子空间下针对所述第一目标子图片的注意力分值,与此同时,将所述目标子图片在不同注意力子空间下的注意力分值和所述键向量相乘并求和,得到所述第一目标子图片在所述不同注意力空间下的第五图片特征向量,其中,第一目标子图片可以为目标子图片中的任意图片,由此能够得到目标子图片对应的第五图片特征向量。
进一步地,将所述目标子图片在所述不同注意力子空间下的第五图片特征向量与所述不同注意力子空间下的权重相乘并求和,得到第一个编码器中注意力层的输出向量,与此同时,将所述注意力层输出向量和所述第四图片特征向量残差相加,得到所述目标子图片对应的第六图片特征向量,之后将所述第六图片特征向量输入至所述前馈神经网络层中,得到前馈神经网络层的输出向量,再将前馈神经网络层的输出向量与前馈神经网络层的输入向量即第六图片特征向量残差相加,得到第一个编码器的输出向量,因为本申请实施例中的24个编码器之间采用串联的方式,因此将第一个编码器的输出向量输入至第二个编 码器中进行特征提取,得到第二个编码器的输出向量,以此将前一个编码器的输出向量作为下一个编码器的输入向量,最终将最后一个编码器的输出向量确定为所述目标子图片对应的第一图片特征向量,并基于所述第一图片特征向量和多个子图片在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
206、基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量。
对于本申请实施例,在确定所述目标子图片对应的第一图片特征向量后,需要基于所述第一图片特征向量和所述多个子图片在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,基于此,步骤206具体包括:将所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息输入至预设解码器中进行特征向量的提取,得到所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量。
具体地,预设解码器与所述预设编码器的结构相同,本申请实施例采用6个预设解码器首尾串联,将所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息输入至第一个预设解码器中进行特征提取,得到所述第一个预设解码器的输出向量,并将所述第一预设解码器的输出向量输入至第二个预设解码器中进行特征提取,以此将上一个解码器的输出向量作为下一个解码器的输入向量,并将所述最后一个解码器的输出向量确定为所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特诊向量。
207、基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
对于本申请实施例,为了确定待处理图片对应的第三图片特征向量,步骤207具体包括:确定所述第一图片特征向量对应的第一权重系数和所述第二图片特征向量对应的第二权重系数;基于所述第一权重系数和所述第二权重系数,将所述第一图片特征向量与所述第二图片特征向量相加,得到所述待处理图片对应的第三图片特征向量。
具体地,首先分别确定所述第一图片特征向量对应的第一权重系数,以及所述第二图片特征向量对应的第二权重系数,并将所述第一权重系数和所述第一图片特征向量相乘,得到第一乘积,与此同时,将所述第二权重系数与所述第二图片特征向量相乘,得到第二乘积,最终将所述第一乘积与所述第二乘积相加,得到所述待处理图片对应的第三图片特征向量。
根据本申请提供的另一种图片特征提取方法,与目前利用清晰且完整的图片构建特征提取模型,并基于构建好的特征提取模型进行图片特征提取的方式相比,本申请通过获取 实际业务场景中的待处理图片;将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,由此通过将待处理图片进行分割,确定所述待处理图片中清晰的目标子图片,并提取所述目标子图片对应的第一图片特征向量,同时基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,能够避免利用清晰且完整的图片构建的特征提取模型对不清晰图片进行特征提取的情况,提高了图片特征提取的精度。
进一步地,作为图1的具体实现,本申请实施例提供了一种图片特征提取装置,如图3所示,所述装置包括:获取单元31、分割单元32、提取单元33、第一确定单元34和第二确定单元35。
所述获取单元31,设置为获取单元,设置为获取实际业务场景中的待处理图片。
所述分割单元32,设置为将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片。
所述提取单元33,设置为将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量。
所述第一确定单元34,设置为基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量。
所述第二确定单元35,设置为基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
在具体应用场景中,为了将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,如图4所示,所述提取单元33,包括确定模块331、拼接模块332和提取模块333。
所述确定模块331,设置为确定所述目标子图片对应的像素矩阵。
所述拼接模块332,设置为将所述像素矩阵中的各行像素进行横向拼接,得到所述目标子图片对应的第四图片特征向量。
所述提取模块333,设置为将所述第四图片特征向量输入至所述预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量。
在具体应用场景中,为了将所述第四图片特征向量输入至所述预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,所述提取模块333,包括提取子模块、求和子模块、相加子模块。
所述提取子模块,设置为将所述第四图片特征向量输入至所述注意力层中的不同注意力子空间进行特征提取,得到所述目标子图片在所述不同注意力子空间下的第五图片特征向量。
所述求和子模块,设置为将所述目标子图片在所述不同注意力子空间下的第五图片特征向量与所述不同注意力子空间对应的权重相乘并求和,得到所述目标子图片对应的注意力层输出向量。
所述相加子模块,设置为将所述注意力层输出向量和所述第四图片特征向量相加,得到所述目标子图片对应的第六图片特征向量。
所述提取子模块,具体设置为将所述第六图片特征向量输入至所述前馈神经网络层中进行特征提取,得到所述目标子图片对应的第一图片特征向量。
在具体应用场景中,为了训练并构建所述预设图片特征提取模型,所述装置还包括构建单元36。
所述获取单元31,还设置为获取实际业务场景中的样本图片,以及所述样本图片对应的实际样本图片特征向量。
所述分割单元32,还设置为将所述样本图片分割成多个样本子图片,并从所述多个样本子图片中确定清晰的目标样本子图片。
所述提取单元33,还设置为将所述目标样本子图片输入至初始图片特征提取模型中进行特征提取,得到所述目标样本子图片对应的第一样本图片特征向量。
所述第二确定单元35,还设置为基于所述第一样本图片特征向量和所述多个样本子图片分别在所述样本图片中的位置信息,确定所述样本图片对应的第二样本图片特征向量。
所述构建单元36,设置为基于所述样本图片对应的实际样本图片特征向量和所述第二样本图片特征向量,构建所述初始图片特征提取模型对应的损失函数。
所述构建单元36,具体设置为基于所述损失函数对所述初始图片特征提取模型进行训练,构建所述预设图片特征提取模型。
在具体应用场景中,为了构建所述初始图片特征提取模型对应的损失函数,所述构建单元36,包括计算模块361和构建模块362。
所述计算模块361,设置为计算所述实际样本图片特征向量和所述第二样本图片特征向量中相同位置处的各个向量差。
所述构建模块362,设置为通过计算所述各个向量差的平方和,构建所述初始图片特征提取模型对应的损失函数。
在具体应用场景中,为了基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量,所 述第一确定单元34具体设置为将所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息输入至预设解码器中进行特征向量的提取,得到所述多个子图片中剩余子图片对应的第二图片特征向量。
在具体应用场景中,为了基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,所述第二确定单元35具体设置为确定所述第一图片特征向量对应的第一权重系数和所述第二图片特征向量对应的第二权重系数;基于所述第一权重系数和所述第二权重系数,将所述第一图片特征向量与所述第二图片特征向量相加,得到所述待处理图片对应的第三图片特征向量。
需要说明的是,本申请实施例提供的一种图片特征提取装置所涉及各功能模块的其他相应描述,可以参考图1所示方法的对应描述,在此不再赘述。
基于上述如图1所示方法,相应的,本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现以下步骤:获取实际业务场景中的待处理图片;将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。其中,所述计算机可读存储介质可以是非易失性,也可以是易失性。
基于上述如图1所示方法和如图3所示装置的实施例,本申请实施例还提供了一种计算机设备的实体结构图,如图5所示,该计算机设备包括:处理器41、存储器42、及存储在存储器42上并可在处理器上运行的计算机程序,其中存储器42和处理器41均设置在总线43上所述处理器41执行所述程序时实现以下步骤:获取实际业务场景中的待处理图片;将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
通过本申请的技术方案,本申请通过获取实际业务场景中的待处理图片;将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片 特征向量;基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中剩余子图片对应的第二图片特征向量;基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,由此通过将待处理图片进行分割,确定所述待处理图片中清晰的目标子图片,并提取所述目标子图片对应的第一图片特征向量,同时基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量,最终基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,能够避免利用清晰且完整的图片构建的特征提取模型对不清晰图片进行特征提取的情况,提高了图片特征提取的精度。
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。
以上所述仅为本申请的优选实施例而已,并不设置为限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。

Claims (20)

  1. 一种图片特征提取方法,其中,包括:
    获取实际业务场景中的待处理图片;
    将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;
    将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;
    基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;
    基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
  2. 根据权利要求1所述的方法,其中,所述将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,包括:
    确定所述目标子图片对应的像素矩阵;
    将所述像素矩阵中的各行像素进行横向拼接,得到所述目标子图片对应的第四图片特征向量;
    将所述第四图片特征向量输入至所述预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量。
  3. 根据权利要求2所述的方法,其中,所述预设图片特征提取模型为预设编码器,所述预设编码器包括注意力层和前馈神经网络层,所述将所述第四图片特征向量输入至所述预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,包括:
    将所述第四图片特征向量输入至所述注意力层中的不同注意力子空间进行特征提取,得到所述目标子图片在所述不同注意力子空间下的第五图片特征向量;
    将所述目标子图片在所述不同注意力子空间下的第五图片特征向量与所述不同注意力子空间对应的权重相乘并求和,得到所述目标子图片对应的注意力层输出向量;
    将所述注意力层输出向量和所述第四图片特征向量相加,得到所述目标子图片对应的第六图片特征向量;
    将所述第六图片特征向量输入至所述前馈神经网络层中进行特征提取,得到所述目标子图片对应的第一图片特征向量。
  4. 根据权利要求1所述的方法,其中,在所述将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量之前,所述方法还包括:
    获取实际业务场景中的样本图片,以及所述样本图片对应的实际样本图片特征向量;
    将所述样本图片分割成多个样本子图片,并从所述多个样本子图片中确定清晰的目标样本子图片;
    将所述目标样本子图片输入至初始图片特征提取模型中进行特征提取,得到所述目标样本子图片对应的第一样本图片特征向量;
    基于所述第一样本图片特征向量和所述多个样本子图片分别在所述样本图片中的位置信息,确定所述样本图片对应的第二样本图片特征向量;
    基于所述样本图片对应的实际样本图片特征向量和所述第二样本图片特征向量,构建所述初始图片特征提取模型对应的损失函数;
    基于所述损失函数对所述初始图片特征提取模型进行训练,构建所述预设图片特征提取模型。
  5. 根据权利要求4所述的方法,其中,所述基于所述样本图片对应的实际样本图片特征向量和所述第二样本图片特征向量,构建所述初始图片特征提取模型对应的损失函数,包括:
    计算所述实际样本图片特征向量和所述第二样本图片特征向量中相同位置处的各个向量差;
    通过计算所述各个向量差的平方和,构建所述初始图片特征提取模型对应的损失函数。
  6. 根据权利要求1所述的方法,其中,所述基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量,包括:
    将所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息输入至预设解码器中进行特征向量的提取,得到所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量。
  7. 根据权利要求1所述的方法,其中,所述基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量,包括:
    确定所述第一图片特征向量对应的第一权重系数和所述第二图片特征向量对应的第二权重系数;
    基于所述第一权重系数和所述第二权重系数,将所述第一图片特征向量与所述第二图片特征向量相加,得到所述待处理图片对应的第三图片特征向量。
  8. 一种图片特征提取装置,其中,包括:
    获取单元,设置为获取实际业务场景中的待处理图片;
    分割单元,设置为将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;
    提取单元,设置为将所述目标子图片输入至预设图片特征提取模型中进行特征提取, 得到所述目标子图片对应的第一图片特征向量;
    第一确定单元,设置为基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;
    第二确定单元,设置为基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
  9. 一种计算机可读存储介质,其上存储有计算机可读指令,其中,所述计算机可读指令被处理器执行时实现图片特征提取方法,包括:
    获取实际业务场景中的待处理图片;
    将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片,其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;
    将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;
    基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;
    基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
  10. 根据权利要求9所述的计算机可读存储介质,其中,所述计算机可读指令被处理器执行时实现所述将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,包括:
    确定所述目标子图片对应的像素矩阵;
    将所述像素矩阵中的各行像素进行横向拼接,得到所述目标子图片对应的第四图片特征向量;
    将所述第四图片特征向量输入至所述预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量。
  11. 根据权利要求10所述的计算机可读存储介质,其中,所述计算机可读指令被处理器执行时实现所述预设图片特征提取模型为预设编码器,所述预设编码器包括注意力层和前馈神经网络层,所述将所述第四图片特征向量输入至所述预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,包括:
    将所述第四图片特征向量输入至所述注意力层中的不同注意力子空间进行特征提取,得到所述目标子图片在所述不同注意力子空间下的第五图片特征向量;
    将所述目标子图片在所述不同注意力子空间下的第五图片特征向量与所述不同注意力子空间对应的权重相乘并求和,得到所述目标子图片对应的注意力层输出向量;
    将所述注意力层输出向量和所述第四图片特征向量相加,得到所述目标子图片对应的第六图片特征向量;
    将所述第六图片特征向量输入至所述前馈神经网络层中进行特征提取,得到所述目标子图片对应的第一图片特征向量。
  12. 根据权利要求9所述的计算机可读存储介质,其中,所述计算机可读指令被处理器执行时实现在所述将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量之前,所述方法还包括:
    获取实际业务场景中的样本图片,以及所述样本图片对应的实际样本图片特征向量;
    将所述样本图片分割成多个样本子图片,并从所述多个样本子图片中确定清晰的目标样本子图片;
    将所述目标样本子图片输入至初始图片特征提取模型中进行特征提取,得到所述目标样本子图片对应的第一样本图片特征向量;
    基于所述第一样本图片特征向量和所述多个样本子图片分别在所述样本图片中的位置信息,确定所述样本图片对应的第二样本图片特征向量;
    基于所述样本图片对应的实际样本图片特征向量和所述第二样本图片特征向量,构建所述初始图片特征提取模型对应的损失函数;
    基于所述损失函数对所述初始图片特征提取模型进行训练,构建所述预设图片特征提取模型。
  13. 根据权利要求12所述的计算机可读存储介质,其中,所述计算机可读指令被处理器执行时实现所述基于所述样本图片对应的实际样本图片特征向量和所述第二样本图片特征向量,构建所述初始图片特征提取模型对应的损失函数,包括:
    计算所述实际样本图片特征向量和所述第二样本图片特征向量中相同位置处的各个向量差;
    通过计算所述各个向量差的平方和,构建所述初始图片特征提取模型对应的损失函数。
  14. 根据权利要求9所述的计算机可读存储介质,其中,所述计算机可读指令被处理器执行时实现所述基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量,包括:
    将所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息输入至预设解码器中进行特征向量的提取,得到所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量。
  15. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,其中,所述计算机可读指令被处理器执行时实现图片特征提取方法,包括:
    获取实际业务场景中的待处理图片;
    将所述待处理图片分割成多个子图片,并从所述多个子图片中确定清晰的目标子图片, 其中,所述清晰的目标子图片是未被损坏、未被马赛克、像素值大于预设像素值的图片;
    将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量;
    基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量;
    基于所述第一图片特征向量和所述第二图片特征向量,确定所述待处理图片对应的第三图片特征向量。
  16. 根据权利要求15所述的计算机设备,其中,所述计算机可读指令被处理器执行时实现所述将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,包括:
    确定所述目标子图片对应的像素矩阵;
    将所述像素矩阵中的各行像素进行横向拼接,得到所述目标子图片对应的第四图片特征向量;
    将所述第四图片特征向量输入至所述预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量。
  17. 根据权利要求16所述的计算机设备,其中,所述计算机可读指令被处理器执行时实现所述预设图片特征提取模型为预设编码器,所述预设编码器包括注意力层和前馈神经网络层,所述将所述第四图片特征向量输入至所述预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量,包括:
    将所述第四图片特征向量输入至所述注意力层中的不同注意力子空间进行特征提取,得到所述目标子图片在所述不同注意力子空间下的第五图片特征向量;
    将所述目标子图片在所述不同注意力子空间下的第五图片特征向量与所述不同注意力子空间对应的权重相乘并求和,得到所述目标子图片对应的注意力层输出向量;
    将所述注意力层输出向量和所述第四图片特征向量相加,得到所述目标子图片对应的第六图片特征向量;
    将所述第六图片特征向量输入至所述前馈神经网络层中进行特征提取,得到所述目标子图片对应的第一图片特征向量。
  18. 根据权利要求15所述的计算机设备,其中,所述计算机可读指令被处理器执行时实现在所述将所述目标子图片输入至预设图片特征提取模型中进行特征提取,得到所述目标子图片对应的第一图片特征向量之前,所述方法还包括:
    获取实际业务场景中的样本图片,以及所述样本图片对应的实际样本图片特征向量;
    将所述样本图片分割成多个样本子图片,并从所述多个样本子图片中确定清晰的目标样本子图片;
    将所述目标样本子图片输入至初始图片特征提取模型中进行特征提取,得到所述目标样本子图片对应的第一样本图片特征向量;
    基于所述第一样本图片特征向量和所述多个样本子图片分别在所述样本图片中的位置信息,确定所述样本图片对应的第二样本图片特征向量;
    基于所述样本图片对应的实际样本图片特征向量和所述第二样本图片特征向量,构建所述初始图片特征提取模型对应的损失函数;
    基于所述损失函数对所述初始图片特征提取模型进行训练,构建所述预设图片特征提取模型。
  19. 根据权利要求18所述的计算机设备,其中,所述计算机可读指令被处理器执行时实现所述基于所述样本图片对应的实际样本图片特征向量和所述第二样本图片特征向量,构建所述初始图片特征提取模型对应的损失函数,包括:
    计算所述实际样本图片特征向量和所述第二样本图片特征向量中相同位置处的各个向量差;
    通过计算所述各个向量差的平方和,构建所述初始图片特征提取模型对应的损失函数。
  20. 根据权利要求15所述的计算机设备,其中,所述计算机可读指令被处理器执行时实现所述基于所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息,确定所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量,包括:
    将所述第一图片特征向量和所述多个子图片分别在所述待处理图片中的位置信息输入至预设解码器中进行特征向量的提取,得到所述多个子图片中去除所述目标子图片后的剩余子图片对应的第二图片特征向量。
PCT/CN2022/089692 2022-01-11 2022-04-27 图片特征提取方法、装置、存储介质及计算机设备 WO2023134064A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210026806.2A CN114387450A (zh) 2022-01-11 2022-01-11 图片特征提取方法、装置、存储介质及计算机设备
CN202210026806.2 2022-01-11

Publications (1)

Publication Number Publication Date
WO2023134064A1 true WO2023134064A1 (zh) 2023-07-20

Family

ID=81201321

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/089692 WO2023134064A1 (zh) 2022-01-11 2022-04-27 图片特征提取方法、装置、存储介质及计算机设备

Country Status (2)

Country Link
CN (1) CN114387450A (zh)
WO (1) WO2023134064A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114387450A (zh) * 2022-01-11 2022-04-22 平安科技(深圳)有限公司 图片特征提取方法、装置、存储介质及计算机设备
CN115278293A (zh) * 2022-06-15 2022-11-01 平安科技(深圳)有限公司 虚拟主播生成方法、装置、存储介质及计算机设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609690A (zh) * 2012-02-09 2012-07-25 北京海和鑫生信息科学研究所有限公司 活体采集下半掌纹质量评估方法
CN112101395A (zh) * 2019-06-18 2020-12-18 上海高德威智能交通系统有限公司 一种图像的识别方法及装置
CN113626444A (zh) * 2021-08-26 2021-11-09 平安国际智慧城市科技股份有限公司 基于位图算法的表格查询方法、装置、设备及介质
CN113869048A (zh) * 2021-09-30 2021-12-31 广州华多网络科技有限公司 商品对象搜索方法及其装置、设备、介质、产品
CN114387450A (zh) * 2022-01-11 2022-04-22 平安科技(深圳)有限公司 图片特征提取方法、装置、存储介质及计算机设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005346287A (ja) * 2004-06-01 2005-12-15 Denso Corp 画像認識方法および装置
US8306366B2 (en) * 2007-08-23 2012-11-06 Samsung Electronics Co., Ltd. Method and apparatus for extracting feature points from digital image
CN102521592B (zh) * 2011-11-30 2013-06-12 苏州大学 基于非清晰区域抑制的多特征融合显著区域提取方法
CN107451454B (zh) * 2017-07-29 2020-03-24 Oppo广东移动通信有限公司 解锁控制方法及相关产品
CN110598717B (zh) * 2019-09-12 2022-06-21 北京迈格威科技有限公司 图像特征的提取方法、装置及电子设备
CN113223009B (zh) * 2021-04-16 2023-10-17 北京戴纳实验科技有限公司 一种衣着检测系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609690A (zh) * 2012-02-09 2012-07-25 北京海和鑫生信息科学研究所有限公司 活体采集下半掌纹质量评估方法
CN112101395A (zh) * 2019-06-18 2020-12-18 上海高德威智能交通系统有限公司 一种图像的识别方法及装置
CN113626444A (zh) * 2021-08-26 2021-11-09 平安国际智慧城市科技股份有限公司 基于位图算法的表格查询方法、装置、设备及介质
CN113869048A (zh) * 2021-09-30 2021-12-31 广州华多网络科技有限公司 商品对象搜索方法及其装置、设备、介质、产品
CN114387450A (zh) * 2022-01-11 2022-04-22 平安科技(深圳)有限公司 图片特征提取方法、装置、存储介质及计算机设备

Also Published As

Publication number Publication date
CN114387450A (zh) 2022-04-22

Similar Documents

Publication Publication Date Title
CN109509226B (zh) 三维点云数据配准方法、装置、设备及可读存储介质
WO2023134064A1 (zh) 图片特征提取方法、装置、存储介质及计算机设备
CN109389555B (zh) 一种全景图像拼接方法及装置
WO2019184657A1 (zh) 图像识别方法、装置、电子设备及存储介质
CN109948441B (zh) 模型训练、图像处理方法、装置、电子设备及计算机可读存储介质
CN112088393B (zh) 图像处理方法、装置及设备
CN109635714B (zh) 文档扫描图像的矫正方法及装置
CN110009573B (zh) 模型训练、图像处理方法、装置、电子设备及存储介质
CN113052868A (zh) 一种抠图模型训练、图像抠图的方法及装置
CN111223065A (zh) 图像矫正方法、不规则文本识别方法、装置、存储介质和设备
CN112598587A (zh) 一种联合人脸去口罩和超分辨率的图像处理系统和方法
CN117876608B (zh) 三维图像重建方法、装置、计算机设备及存储介质
CN113628134B (zh) 图像降噪方法及装置、电子设备及存储介质
CN116092178A (zh) 一种面向移动端的手势识别和跟踪方法及系统
US20240202886A1 (en) Video processing method and apparatus, device, storage medium, and program product
CN117542045B (zh) 一种基于空间引导自注意力的食品识别方法及系统
CN115272691A (zh) 一种钢筋绑扎状态检测模型的训练方法、识别方法及设备
CN112396558A (zh) 图像处理方法、装置及计算机可读存储介质
CN112070181B (zh) 一种基于图像流的协同检测方法及装置、存储介质
CN112329649A (zh) 一种城市植被种类识别方法、系统、设备以及介质
CN110427820B (zh) 一种基于神经网络的ppt边框识别方法及相关设备
CN112990076A (zh) 一种基于人工智能的数据整理方法和装置
CN110111371B (zh) 一种基于卷积神经网络的斑点图图像配准方法
CN114283066A (zh) 影像处理设备以及超解析处理方法
CN113240589A (zh) 一种多尺度特征融合的图像去雾方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22919705

Country of ref document: EP

Kind code of ref document: A1