WO2021190115A1 - 检索目标的方法和装置 - Google Patents

检索目标的方法和装置 Download PDF

Info

Publication number
WO2021190115A1
WO2021190115A1 PCT/CN2021/073322 CN2021073322W WO2021190115A1 WO 2021190115 A1 WO2021190115 A1 WO 2021190115A1 CN 2021073322 W CN2021073322 W CN 2021073322W WO 2021190115 A1 WO2021190115 A1 WO 2021190115A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature
text
image
network
features
Prior art date
Application number
PCT/CN2021/073322
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 北京沃东天骏信息技术有限公司
Priority to US17/764,741 priority Critical patent/US20230005178A1/en
Priority to EP21774930.8A priority patent/EP4131030A4/en
Publication of WO2021190115A1 publication Critical patent/WO2021190115A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9532Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/5854Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using shape and object relationship
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/5866Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/78Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/783Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/7837Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using objects detected or recognised in the video content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/78Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/7867Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, title and artist information, manually generated time, location and usage information, user ratings
    • 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/042Knowledge-based neural networks; Logical representations of neural networks
    • 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/044Recurrent networks, e.g. Hopfield networks
    • G06N3/0442Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • 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
    • 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/0464Convolutional networks [CNN, ConvNet]
    • 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/0475Generative networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/094Adversarial learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation
    • G06N5/022Knowledge engineering; Knowledge acquisition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/42Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation
    • G06V10/422Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation for representing the structure of the pattern or shape of an object therefor
    • G06V10/426Graphical representations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
    • G06V10/806Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/26Techniques for post-processing, e.g. correcting the recognition result
    • G06V30/262Techniques for post-processing, e.g. correcting the recognition result using context analysis, e.g. lexical, syntactic or semantic context
    • G06V30/274Syntactic or semantic context, e.g. balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/07Target detection

Definitions

  • the embodiments of the present disclosure relate to the field of computer technology, in particular to methods and devices for retrieving targets.
  • the embodiment of the present disclosure proposes a method and device for retrieving a target.
  • the embodiments of the present disclosure provide a method for retrieving a target.
  • the method includes: obtaining at least one image and a description text of a specified object; using a pre-trained cross-media feature extraction network to extract image features and descriptions of the image The text feature of the text, where the cross-media feature extraction network projects the text feature and the image feature to the common feature space of the image text; the image feature and the text feature are matched to determine the image containing the specified object.
  • the cross-media feature extraction network is generated according to the following method: Obtain a training sample set, where the training sample set includes sample image text pairs, and the sample image text pairs include: sample images and describing objects contained in the sample images The sample text of; obtain the initial network, where the initial network includes the cross-media feature extraction network to be trained, the discriminant network used to determine the data category of the feature source, the feature conversion network, and the cross-media feature extraction network to be trained includes the image map.
  • the data category of the feature source includes text and image categories
  • the discriminant loss value represents the first feature and the second feature Feature category judgment error
  • input the first feature and the second feature into the feature conversion network to obtain the feature conversion result
  • the recognition loss function represents the first feature and The ability of the second feature to distinguish different objects contained in the common feature space of image and text
  • the paired loss function represents the semantic difference between the first feature and the second feature of the same object
  • the value of the loss function obtains the preset feature loss value
  • the discriminative loss value and the feature loss value, the cross-media feature extraction network and feature conversion network to be trained are used as the generation network, and the discriminant network is trained against the discriminant network to obtain the completed training Cross-media feature extraction network, discrimination network, feature transformation network.
  • the image graph attention network includes a residual network, an image graph attention convolutional network, and a joint embedding layer; and inputting the sample image into the image graph attention network to obtain the first feature includes: using the residual network Extract the initial image features of the sample image, input the initial image features into the image graph attention convolutional network, output the structured image features of the sample image, fuse the initial image features with the structured image features, generate image features, and input the image features To the joint embedding layer, the first feature is obtained.
  • inputting the initial image features into the image map attention convolutional network and outputting the structured image features of the sample image includes: performing target object detection on the sample image to determine the target object and the target object in the sample image According to the position of the rectangular bounding box of the target object, the relevant characteristics of the target object are extracted according to the position of the rectangular bounding box of the target object.
  • the relevant characteristics of the target object include at least one of the following: the appearance characteristic of the target object, the position characteristic of the target object, and The type characteristics of the target object; the construction of a directed graph of image features, the vertices of the directed graph of image features represent the target object, and the directed edges of the directed graph of image features represent the association relationship between the target objects.
  • the text graph attention network includes a bidirectional long-term short-term memory network, a text graph attention convolutional network, and a joint embedding layer; and the sample text is input into the text graph attention network to obtain the second feature, including: The text is segmented to determine the word vector of the sample text; the initial text feature of the word vector of the sample text is extracted using the bidirectional long-term and short-term memory network, and the initial text feature is input to the text graph attention convolution network, and the structured text of the sample text is output Feature: The initial text feature is merged with the structured text feature to generate the text feature, and the text feature is input to the joint embedding layer to obtain the second feature.
  • the initial text features are input to the text graph attention convolutional network, and the structured text features of the sample text are output, including: constructing a text feature directed graph, the vertex of the text feature directed graph indicates the word vector
  • the target object of the text feature directed graph represents the association relationship between the target objects indicated by each word vector, wherein the relevant features of the target object indicated by the word vector include at least one of the following: attributes of the target object Features and the type features of the target object; according to the text feature directed graph, the structured text features of the sample text are generated.
  • an embodiment of the present disclosure provides an apparatus for retrieving a target.
  • the apparatus includes: an acquisition unit configured to acquire at least one image and a description text of a specified object; and an extraction unit configured to use a pre-trained
  • the cross-media feature extraction network extracts the image features of the image and the text feature describing the text.
  • the cross-media feature extraction network projects the text feature and the image feature to the common feature space of the image text; the matching unit is configured to pair the image feature and the text feature Perform matching to determine the image that contains the specified object.
  • the cross-media feature extraction network is generated according to the following method: Obtain a training sample set, where the training sample set includes sample image text pairs, and the sample image text pairs include: sample images and describing objects contained in the sample images The sample text of; obtain the initial network, where the initial network includes the cross-media feature extraction network to be trained, the discriminant network used to determine the data category of the feature source, the feature conversion network, and the cross-media feature extraction network to be trained includes the image map.
  • the data category of the feature source includes text and image categories
  • the discriminant loss value represents the first feature and the second feature Feature category judgment error
  • input the first feature and the second feature into the feature conversion network to obtain the feature conversion result
  • the recognition loss function represents the first feature and The ability of the second feature to distinguish different objects contained in the common feature space of image and text
  • the paired loss function represents the semantic difference between the first feature and the second feature of the same object
  • the value of the loss function obtains the preset feature loss value
  • the discriminative loss value and the feature loss value, the cross-media feature extraction network and feature conversion network to be trained are used as the generation network, and the discriminant network is trained against the discriminant network to obtain the completed training Cross-media feature extraction network, discrimination network, feature transformation network.
  • the image graph attention network includes a residual network, an image graph attention convolutional network, and a joint embedding layer; and the first feature is obtained according to the following method: the residual network is used to extract the initial image features of the sample image , The initial image features are input to the image graph attention convolutional network, the structured image features of the sample image are output, the initial image features and the structured image features are fused to generate image features, and the image features are input to the joint embedding layer to obtain the first One feature.
  • the structured image features of the sample image are obtained according to the following method: target object detection is performed on the sample image, the target object in the sample image and the position of the rectangular bounding box of the target object are determined, and the position of the rectangular bounding box of the target object is determined according to the target object.
  • the position of the rectangular bounding box of extract the relevant characteristics of the target object, where the relevant characteristics of the target object include at least one of the following: the appearance characteristic of the target object, the position characteristic of the target object, and the type characteristic of the target object;
  • Graph the vertices of the image feature directed graph represent the target object, and the directed edges of the image feature directed graph represent the characteristics of the association relationship between the target objects.
  • the text graph attention network includes a bidirectional long and short-term memory network, a text graph attention convolutional network, and a joint embedding layer;
  • the second feature is obtained according to the following method: the sample text is subjected to word segmentation processing to determine the sample text The word vector of the sample text; the initial text feature of the word vector of the sample text is extracted using the bidirectional long and short-term memory network, the initial text feature is input to the text graph attention convolutional network, the structured text feature of the sample text is output, and the initial text feature and structure The text feature is fused to generate the text feature, and the text feature is input to the joint embedding layer to obtain the second feature.
  • the structured text features of the sample text are obtained according to the following method: construct a directed graph of text features, the vertices of the directed graph of text features represent the target object indicated by the word vector, and the directed graph of text features has The edge direction characterizes the characteristics of the association relationship between the target objects indicated by the word vectors, where the relevant characteristics of the target objects indicated by the word vectors include at least one of the following: the attribute characteristics of the target object and the type characteristics of the target object; according to the text Feature directed graphs generate structured text features of sample text.
  • the embodiments of the present disclosure provide an electronic device, which includes: one or more processors; a storage device on which one or more programs are stored; when one or more programs are Multiple processors execute, so that one or more processors implement the method described in any implementation manner of the first aspect.
  • an embodiment of the present disclosure provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method as described in any implementation manner in the first aspect is implemented.
  • the method and device for retrieving a target acquire at least one image and the description text of a specified object, and then use a pre-trained cross-media feature extraction network to extract the image features of the image and the text features of the description text, Among them, the cross-media feature extraction network projects the text features and image features into the common feature space of the image and text. Finally, the image features and text features are matched to determine the image containing the specified object, and the cross-media feature The feature and text feature are projected to the common feature space of image text for feature matching, which realizes cross-media target retrieval.
  • Fig. 1 is an exemplary system architecture diagram to which an embodiment of the present disclosure can be applied;
  • Fig. 2 is a flowchart of an embodiment of a method for retrieving a target according to the present disclosure
  • FIG. 3 is a flowchart of an implementation manner of the above-mentioned cross-media feature extraction network generation method
  • FIG. 4 is a schematic diagram of an implementation process of the method for retrieving targets of the present disclosure
  • Fig. 5 is a schematic structural diagram of an embodiment of an apparatus for retrieving targets according to the present disclosure
  • Fig. 6 is a schematic structural diagram of an electronic device suitable for implementing embodiments of the present disclosure.
  • FIG. 1 shows an exemplary architecture 100 of the method for retrieving targets or the device for retrieving targets of the present disclosure can be applied.
  • the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105.
  • the network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105.
  • the network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, and so on.
  • the terminal devices 101, 102, 103 interact with the server 105 through the network 104 to receive or send messages and so on.
  • Various communication client applications such as image editing applications, text editing applications, and browser applications, may be installed on the terminal devices 101, 102, and 103.
  • the terminal devices 101, 102, 103 may be hardware or software.
  • the terminal devices 101, 102, 103 When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices with a display screen and supporting Internet access, including but not limited to smart phones, tablet computers, notebook computers, desktop computers, and so on.
  • the terminal devices 101, 102, 103 When the terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. There is no specific limitation here.
  • the server 105 may be a server that provides various services, for example, a back-end server that matches images and texts acquired by the terminal devices 101, 102, and 103.
  • the background server can recognize and match the received images and texts.
  • the method for retrieving the target provided by the embodiment of the present disclosure is generally executed by the server 105, and accordingly, the device for retrieving the target is generally set in the server 105.
  • terminal devices, networks, and servers in FIG. 1 are merely illustrative. There can be any number of terminal devices, networks, and servers according to implementation needs.
  • a process 200 of an embodiment of the method for retrieving a target according to the present disclosure is shown.
  • the method of retrieving the target includes the following steps:
  • Step 201 Obtain at least one image and the description text of the specified object.
  • the execution subject for example, the server shown in FIG. 1
  • the execution subject of the above method for retrieving targets may obtain at least one image and the description text of the specified object from a pre-stored image library.
  • the above-mentioned image may be any image to be retrieved in a pre-stored image library.
  • the specified object refers to the entity to be retrieved.
  • the specified object can be an object with a variable location, such as pedestrians, vehicles, etc., and the specified object can also be an object with a fixed location, such as buildings, landscapes, etc.
  • the number of the above-mentioned designated objects can be one or more.
  • the image can contain designated objects or other objects.
  • the text can be a sentence or word describing the characteristics of the specified object.
  • the designated object is pedestrian A
  • the image library containing the to-be-retrieved image of the pedestrian and the description text of the features such as the appearance and actions of the pedestrian A can be obtained.
  • the image to be retrieved is matched with the description text of pedestrian A, and an image containing pedestrian A that matches the description text of pedestrian A is determined from the image to be retrieved containing pedestrians.
  • Step 202 Use a pre-trained cross-media feature extraction network to extract image features of the image and text features of the description text.
  • the above-mentioned execution subject may use a pre-trained cross-media feature extraction network to extract the image features of at least one image in step 201 and the text features of the description text of the specified object.
  • the cross-media feature extraction network can project text features and image features into the common feature space of image text.
  • the cross-media feature extraction network can extract the features of data of different media types, and can combine the features of data of different media types. Convert to the same common feature space, so that the characteristics of data of different media types can be matched in the same common feature space.
  • the cross-media feature extraction network can be an artificial neural network.
  • the above-mentioned execution subject can input one or more images and the description text into the pre-trained artificial neural network to extract the image features and text correspondence corresponding to the image.
  • Text characteristics A partial or overall image can be selected from the above one or more images to extract the image features of the selected partial or overall image.
  • a part or the whole description text can be selected from the description text of the above-mentioned designated object to extract the text characteristics of the selected part or the whole text.
  • the above features can be represented by feature vectors.
  • Step 203 Match the image feature with the text feature, and determine the image containing the specified object.
  • the above-mentioned execution subject may match the image feature extracted in step 202 with the text feature, and determine an image containing a specified object from at least one image as an image matching the text description.
  • the above-mentioned execution subject may determine whether the image feature matches the text feature by calculating the similarity between the image feature of each image and the text feature of the description text.
  • the above-mentioned similarity can be related to the distance between image features and text features. For example, Euclidean distance, Ming's distance, Manhattan distance, Chebyshev distance, Mahalanobis distance, etc. can be used to calculate the similarity between image features and text features. .
  • the method for retrieving a target obtained by the foregoing embodiment of the present disclosure obtains at least one image and a description text of a specified object, and then uses a pre-trained cross-media feature extraction network to extract the image features of the image and the text features of the description text, where ,
  • the cross-media feature extraction network projects the text features and image features to the common feature space of the image and text.
  • the image features and text features are matched to determine the image containing the specified object, so as to use the cross-media feature to extract the features and combine the image features.
  • the feature matching is carried out by projecting the text feature to the common feature space of the image text, which realizes the cross-media target retrieval.
  • FIG. 3 is a flowchart of an implementation manner of the above-mentioned cross-media feature extraction network generation method.
  • the process 300 of the method for generating a cross-media feature extraction network may include the following steps:
  • Step 301 Obtain a training sample set.
  • the above-mentioned execution subject may obtain a training sample set from a preset database.
  • the training sample set may include sample image text pairs, and the sample image text pairs may include sample images and samples describing objects contained in the sample images. text.
  • Step 302 Obtain an initial network.
  • the above-mentioned execution subject may first obtain the initial network.
  • the initial network may include a cross-media feature extraction network to be trained, a discriminant network used to determine the data category of the feature source, a feature transformation network, and a network to be trained.
  • the cross-media feature extraction network can include image graph attention network and text graph attention network.
  • the above-mentioned initial network may be an untrained neural network after initializing the parameters, or a pre-trained neural network.
  • Step 303 Select samples from the training sample set, and execute the training step.
  • the above-mentioned execution subject may select samples from the sample set obtained in step 301, and execute the training steps from step 3031 to step 3036.
  • the selection method and number of samples are not limited in this disclosure.
  • the above-mentioned execution subject may select at least one sample.
  • the training step includes the following steps:
  • Step 3031 Input the sample image in the sample image text pair into the image graph attention network to obtain the first feature.
  • the above-mentioned execution subject may input the sample image in the sample image text pair into the image graph attention network of the cross-media feature extraction network to be trained, and output the first feature, that is, the image feature of the sample image.
  • the image graph attention network includes a residual network, an image graph attention convolution network, and a joint embedding layer.
  • the first feature can be obtained through the following steps:
  • the residual network is used to extract the initial image features of the sample image.
  • the above-mentioned execution subject may use the residual network to extract the initial image features of the sample image, that is, the low-level visual features.
  • the initial image features may be global image features, such as color features, texture features, shape features, structural features, and so on.
  • the above-mentioned executive body can also use the residual network to extract the initial image features of the sample image, then use the average pooling layer to generate the global appearance visual feature vector from the initial image features, and use the average pooling layer to reduce the dimensions of the initial image features to generate The global appearance visual feature vector can retain the salient features in the original image features.
  • the initial image features are input to the image graph attention convolutional network, and the structured image features of the sample image are output.
  • the above-mentioned execution subject may input the extracted low-level visual features into a pre-trained image graph attention convolution network to obtain structured image features of the sample image.
  • structured image features can be used to characterize the structured semantic visual features of the sample image.
  • the initial image features can also be input to the image map attention convolutional network through the following steps to output the structured image features of the sample image: perform target object detection on the sample image to determine the target object and target in the sample image The position of the rectangular bounding box of the object, and according to the position of the rectangular bounding box of the target object, the relevant features of the target object are extracted; the image feature directed graph is constructed, and the vertices of the image feature directed graph represent the target object, and the image feature directed graph is Directed edges represent the relationship between the target objects; according to the directed graph of image features, the structured image features of the sample image are generated.
  • the above-mentioned execution subject may obtain the structured image feature of the sample image through the constructed image feature directed graph.
  • the above-mentioned execution subject can first help the preset target detection algorithm to identify the target object and the position of the target object's rectangular bounding box in the sample image, and then use the target detection algorithm to extract the target object's position from the target object's rectangular bounding box.
  • Appearance feature extract the relevant features of the target object according to the position of the rectangular bounding box of the target object.
  • the relevant features of the target object may include at least one of the following: the appearance feature of the target object, the location feature of the target object, and the type feature of the target object
  • the target detection algorithm R-CNN Regular-Convolutional Neural Networks, regional convolutional neural network
  • the target object can be specified in advance according to actual application requirements.
  • the position feature of the rectangular bounding box of the target object can be represented by the position coordinates of the rectangular bounding box of the target object in the sample image, for example, the abscissa of a vertex of the rectangular bounding box , The position coordinates of the multi-group representing the relationship between the ordinate of a vertex of the rectangular enclosing frame, the width of the rectangular enclosing frame, and the height of the rectangular enclosing frame.
  • the category of the target object can be identified, for example, based on its shape, color and other characteristics, and the above-mentioned executive body can use the preset entity relationship classifier to determine the association relationship between the target objects, and the preset attribute classifier to determine the attributes of the target object.
  • the appearance characteristics of the target object may include global appearance characteristics and local appearance characteristics.
  • a directed graph of image features can be constructed.
  • the vertices of the directed graph of image features represent the target object, which can be represented by O i (O 1 , O 2 , O 3 , O 4 , O 5 , O 6 ), and O i can represent three
  • the subject or object in the tuple "subject-predicate-object” the directed edge of the image feature directed graph represents the association relationship between the target objects, you can use e ij (e 15 , e 16 , e 21 , e 31 , E 41 ) means, for example, the directed edge e ij represents the relationship between the object O i and the object O j , e ij represents the predicate in the triple "subject-predicate-object", and O i can be a triple " The subject in "subject-predicate-object", O j can be the object in the triple "subject-predicate-object".
  • the vertex feature of the directed graph of image features can be represented by the related features that characterize the target object acquired above, and the related features of the target object can include at least one of the following: the appearance feature of the target object, the location feature of the target object, and the type feature of the target object .
  • the directed edge feature of the image feature directed graph can be composed of at least one of the following: the appearance feature of the target object, the location feature of the target object, and the type feature of the target object.
  • the graph attention convolution layer can be used to update the image feature directed graph constructed above, and extract the structured image feature of the sample image.
  • the graph attention convolution layer can be used to update the image feature directed graph to obtain the updated vertices, and the following update formula can be set to update the vertex features in the image feature directed graph:
  • g s, g o represents a fully connected layers
  • w ij denotes a node j to node weight i a weight
  • w ik represents the node k weights i weights node
  • O j indicates characterization node Subject
  • O j nodes representing characterizing predicate
  • Indicates node characteristics Represents the feature of directed edges between nodes.
  • w ij can be calculated by the following formula:
  • w a represents the directed edge feature
  • b a represents the bias term
  • each vertex feature of the updated image feature directed graph can be obtained.
  • a virtual vertex connecting each vertex of the image feature directed graph can be set.
  • the above virtual vertex can be obtained by the following formula Generate structured image features of sample images:
  • w i represents the weight of node i
  • g v represents the fully connected layer.
  • w c represents the virtual vertex feature
  • b c represents the bias term
  • the image feature directed graph contains the relevant features of the target object and the characteristics of the association relationship between the target objects, so the virtual vertices can be merged with the updated image feature directed graph Generates structured image features that characterize the structured semantic information of the sample image, which can contain more effective structured semantic information, characterize image features more comprehensively and accurately, and more effectively distinguish and identify the targets contained in the image Object.
  • the third step is to fuse the original image features with the structured image features to generate image features.
  • the above-mentioned execution subject may fuse the initial image feature obtained in the first step and the structured image feature obtained in the second step to obtain the image feature of the sample image.
  • the image features are input to the joint embedding layer to obtain the first feature.
  • the above-mentioned execution subject may input the image features obtained in the third step to the joint embedding layer to obtain the first feature, and the joint embedding layer may be composed of three fully connected layers.
  • Step 3032 Input the sample text in the sample image text pair into the text graph attention network to obtain the second feature.
  • the above-mentioned execution subject may input the sample text in the sample image text pair into the text graph attention network of the cross-media feature extraction network to be trained, and output the second feature, that is, the text feature of the sample text.
  • the text graph attention network includes a bidirectional long and short-term memory network, a text graph attention convolutional network, and a joint embedding layer.
  • the second feature can be obtained through the following steps:
  • Step 1 Perform word segmentation on the sample text and determine the word vector of the sample text.
  • the above-mentioned execution subject may use common word segmentation tools or manual annotation to perform word segmentation processing on the sample text, and each word in the sample text is projected into a word vector.
  • the second step is to use the bidirectional long and short-term memory network to extract the initial text features of the word vectors of the sample text.
  • the above-mentioned execution subject may use a bidirectional long-term short-term memory network to extract initial text features with contextual information in the sample text.
  • the initial text features are input to the text graph attention convolutional network, and the structured text features of the sample text are output.
  • the above-mentioned execution subject may input the extracted initial text features into the pre-trained text graph attention convolution network to obtain structured text features of the sample text.
  • structured text features can be used to characterize the structured semantic text features of the sample text.
  • the initial text features can also be input to the text graph attention convolutional network through the following steps, and the structured text features of the sample text are output: a directed graph of text features is constructed, and the vertex of the directed graph of text features is indicated by the word vector The directed edge of the text feature directed graph represents the association relationship between the target objects indicated by each word vector; according to the text feature directed graph, the structured text feature of the sample text is generated.
  • the above-mentioned execution subject may obtain the structured text features of the sample text through the constructed text feature directed graph.
  • the above-mentioned execution subject can first construct a directed graph of text features, and the vertices of the directed graph of text features represent the target object, which can be represented by O i (O 1 , O 2 , O 3 , O 4 , O 5 , O 6 ) , O i can represent the subject or object in the triple "subject-predicate-object", the directed edge of the text feature directed graph represents the association relationship between the target objects, you can use e ij (e 15 , e 16 , E 21 , e 31 , e 41 ) indicate, for example, the directed edge e ij indicates the relationship between the object O i and the object O j , and e ij indicates the predicate in the triple "subject-predicate-object", O i It can be the subject in the triple "subject-predicate-object", and O j can be the object in the triple "subject-predicate-object".
  • the vertex features of the text feature directed graph can be composed of the related features of the target object.
  • the related features of the target object include at least one of the following: the attribute feature of the target object and the type feature of the target object, and the directed edge feature of the text feature directed graph Can be composed of the type characteristics of the target object.
  • the graph attention convolutional layer can be used to update the text feature directed graph constructed above, and the above update formula (1) can be used to update the vertex features in the text feature directed graph.
  • the above-mentioned execution subject can set a virtual vertex that connects each vertices of the text feature directed graph.
  • the above-mentioned virtual vertex can generate structured text features of the sample text through formula (3), which can contain more effective structured semantic information, and more comprehensively , Characterize the text features more accurately, and more effectively distinguish and recognize the target objects contained in the text.
  • the fourth step is to fuse the original text features and structured text features to generate text features.
  • the above-mentioned execution subject may fuse the initial text features obtained in the second step with the structured text features obtained in the third step to obtain the text features of the sample text.
  • the fifth step is to input the text features into the joint embedding layer to obtain the second feature.
  • the above-mentioned execution subject may input the text feature obtained in step 4 into the joint embedding layer to obtain the second feature, and the joint embedding layer may be composed of three fully connected layers.
  • Step 3033 Input the first feature and the second feature into the discrimination network to obtain a category discrimination result, and calculate a discrimination loss value according to the category discrimination result.
  • the above-mentioned execution subject can input the first feature and the second feature into the discrimination network to obtain the category discrimination result, and calculate the discrimination loss value according to the category discrimination result.
  • the data category of the feature source includes the text category and the image category.
  • the loss value represents the judgment error of the first feature and the second feature category.
  • the above discriminant network can be composed of three fully connected layers, aiming to better judge the data type of the source of a given feature, that is, the modal category of the feature, such as text and image, and can be calculated by the following loss function Discrimination loss value L adv ( ⁇ D ):
  • v i denotes a first feature
  • t i represents a second characteristic, D (v i; ⁇ D ), D (t i; ⁇ D) wherein represents a source of data input samples i category probabilities
  • ⁇ D represents a discrimination network Network parameters.
  • Step 3034 Input the first feature and the second feature into the feature conversion network to obtain a feature conversion result, and calculate the value of the recognition loss function and the value of the paired loss function according to the feature conversion result.
  • the above-mentioned execution body may input the first feature and the second feature into the feature conversion network to obtain the feature conversion result, and calculate the value of the identification loss function and the value of the paired loss function according to the feature conversion result, where the identification loss function It characterizes the ability of the first feature and the second feature to distinguish different objects contained in the common feature space of the image and text, and the paired loss function represents the semantic difference between the first feature and the second feature of the same object.
  • the above-mentioned executive body can calculate the recognition loss value L ide ( ⁇ V , ⁇ T ) through the following loss function:
  • y i represents the number of the target object corresponding to the i-th sample (sample text or sample image)
  • x i represents the first feature or the second feature
  • ⁇ V represents the network parameter of the image graph attention convolutional network
  • ⁇ T represents the network parameters of the text graph attention convolutional network
  • W j represents the jth column of the weight matrix W
  • b represents the bias term
  • N represents the number of samples.
  • the above-mentioned executive body can calculate the paired loss value L pair ( ⁇ V , ⁇ T ) through the following loss function:
  • y i represents the two-dimensional vector of whether the sample image and the sample text input pair indicate the same target object number
  • z i represents the fusion feature of the text feature and the image feature
  • W p,j represents the jth column of the weight matrix W p
  • B p represents the bias term
  • M represents the number of sample image and sample text input pairs.
  • Step 3035 Obtain a preset feature loss value based on the value of the identification loss function and the value of the paired loss function.
  • the above-mentioned execution subject may add the identification loss value obtained in step 3034 and the paired loss value to obtain the feature loss value of the feature transformation network.
  • Step 3036 Based on the discriminative loss value and the feature loss value, the cross-media feature extraction network and feature conversion network to be trained are used as the generation network, and the discriminant network is subjected to confrontation training to obtain the trained cross-media feature extraction network, discriminant network, and feature Conversion network.
  • the above-mentioned execution subject can use the cross-media feature extraction network and feature transformation network to be trained as the generation network based on the discriminant loss value obtained in step 3033 and the feature loss value obtained in step 3035, and conduct confrontation training with the discriminant network specifically, the image may FIG attention convolutional network network parameters ⁇ V, web text of FIG attention convolutional network parameters ⁇ T, determining the network parameters of the network ⁇ D training guide optimized by setting the following loss function:
  • L fea ( ⁇ V , ⁇ T ) represents the feature loss value
  • L adv ( ⁇ D ) represents the discrimination loss value
  • the cross-media feature extraction network can extract text features and image features with structured semantics, so that it has modal invariance, semantic discrimination and cross-modal semantic similarity.
  • FIG. 4 is a schematic structural diagram of an implementation process of the method for retrieving targets of the present disclosure.
  • the system architecture can include an image graph attention network, a text graph attention network, and a confrontation learning module.
  • the image graph attention network is used to extract the image features of the image.
  • the image graph attention network can be composed of five residual network modules, a visual scene graph module and a joint embedding layer.
  • the visual scene graph module can be a directed graph of image features. It is composed of a graph attention convolutional layer.
  • the graph attention convolutional layer is used to update the directed graph of image features.
  • the joint embedding layer can be composed of three fully connected layers.
  • the above-mentioned execution subject can first use five residual network modules to extract the initial image features of the image, and then input the initial image features to the visual scene graph module to extract the structured image features of the image, and finally use the joint embedding layer to combine the structure
  • the characteristics of the transformed image are projected into the common feature space of the image text.
  • the text graph attention network is used to extract the text features of the text.
  • the text graph attention network can be composed of a two-way LSTM (Long Short-Term Memory), a text scene graph module and a joint embedding layer.
  • the text scene graph The module can be composed of a text feature directed graph and a graph attention convolution layer.
  • the graph attention convolution layer is used to update the text feature directed graph
  • the joint embedding layer can be composed of three fully connected layers.
  • the above-mentioned executive body can first use the bidirectional LSTM to extract the initial text features of the text, and then input the initial text features into the text scene graph module to extract the structured text features of the text, and finally use the joint embedding layer to project the structured text features To the common feature space of image text.
  • the confrontation learning module is used to determine the image and text common feature space of image features and text features.
  • the confrontation learning module can be composed of a feature converter and a modal discriminator.
  • the above-mentioned execution subject can first input the image features extracted by the image graph attention network and the text features extracted by the text graph attention network to the confrontation learning module, and the feature converter is used to input features of different modal types (text features or image features). Feature) is projected to the common feature space of image text to generate converted features.
  • the modal discriminator is used to distinguish the modal types (text or image) of the converted features generated by the feature converter, and then the image graph attention network , Text map attention network features and converters are used as the generation network, and the modal discriminator is used as the discriminant network for joint adversarial learning. Finally, the trained image map attention network and text map attention network features are extracted as cross-media features The internet.
  • the present disclosure provides an embodiment of a device for retrieving a target.
  • the device embodiment corresponds to the method embodiment shown in FIG. 2, and the device can be specifically applied Used in various electronic devices.
  • the device 500 for retrieving a target includes an acquiring unit 501, an extracting unit 502, and a matching unit 503.
  • the obtaining unit 501 is configured to obtain at least one image and the description text of the specified object
  • the extracting unit 502 is configured to use a pre-trained cross-media feature extraction network to extract image features of the image and text features of the description text
  • matching The unit 503 is configured to match the image feature with the text feature, and determine the image containing the specified object.
  • step 203 in the device 500 for retrieving the target: the specific processing of the acquiring unit 501, the extracting unit 502, and the matching unit 503 and the technical effects brought by them can be referred to steps 201 and 202 in the corresponding embodiment in FIG. 2 respectively.
  • the related description of step 203 will not be repeated here.
  • the cross-media feature extraction network is generated according to the following method: Obtain a training sample set, where the training sample set includes sample image text pairs, and sample image text pairs include: sample images and Sample text describing the objects contained in the sample image; obtain the initial network, where the initial network includes the cross-media feature extraction network to be trained, the discriminant network used to identify the data category of the feature source, the feature conversion network, and the cross-media to be trained
  • the feature extraction network includes image graph attention network and text graph attention network; input the sample image of the sample image text pair into the image graph attention network to obtain the first feature; input the sample text of the sample image text pair into the text graph attention Force network to obtain the second feature; input the first feature and the second feature into the discriminant network to obtain the category discrimination result, and calculate the discriminant loss value according to the category discrimination result.
  • the data category of the feature source includes text and image categories, and the discriminant loss value Characterize the judgment error of the first feature and the second feature category; input the first feature and the second feature into the feature conversion network to obtain the feature conversion result, and calculate the value of the recognition loss function and the value of the paired loss function according to the feature conversion result, where the recognition
  • the loss function represents the ability of the first feature and the second feature to distinguish different objects contained in the common feature space of the image text
  • the paired loss function represents the semantic difference between the first feature and the second feature of the same object; based on recognition
  • the value of the loss function and the value of the paired loss function are used to obtain the preset feature loss value; based on the discriminant loss value and the feature loss value, the cross-media feature extraction network and feature conversion network to be trained are used as the generating network, and the discriminant network is performed Confrontation training, the trained cross-media feature extraction network, discrimination network, and feature transformation network are obtained.
  • the image graph attention network includes a residual network, an image graph attention convolutional network, and a joint embedding layer; and the first feature is obtained as follows: using the residual network Extract the initial image features of the sample image, input the initial image features into the image graph attention convolutional network, output the structured image features of the sample image, fuse the initial image features with the structured image features, generate image features, and input the image features To the joint embedding layer, the first feature is obtained.
  • the structured image features of the sample image are obtained as follows: target object detection is performed on the sample image, and the target object and the rectangular bounding box of the target object in the sample image are determined According to the position of the rectangular bounding box of the target object, the relevant characteristics of the target object are extracted.
  • the relevant characteristics of the target object include at least one of the following: appearance characteristics of the target object, location characteristics of the target object, and attributes of the target object Features and the type characteristics of the target object; construct a directed graph of image features, the vertices of the directed graph of image features represent the target object, and the directed edges of the directed graph of image features represent the association relationship between each target object; the directed graph is directed according to the image feature Figure, generating the structured image features of the sample image.
  • the text graph attention network includes a bidirectional long and short-term memory network, a text graph attention convolutional network, and a joint embedding layer; and the second feature is obtained as follows: The text is segmented to determine the word vector of the sample text; the initial text feature of the word vector of the sample text is extracted using the bidirectional long-term and short-term memory network, and the initial text feature is input to the text graph attention convolution network, and the structured text of the sample text is output Feature: The initial text feature is merged with the structured text feature to generate the text feature, and the text feature is input to the joint embedding layer to obtain the second feature.
  • the structured text features of the sample text are obtained in the following manner: a directed graph of text features is constructed, and the vertices of the directed graph of text features represent the target object indicated by the word vector, The directed edges of the text feature directed graph represent the association relationship between the target objects indicated by each word vector, wherein the relevant features of the target object indicated by the word vector include at least one of the following: the attribute characteristics of the target object and the target object The type feature of the text; according to the text feature directed graph, the structured text feature of the sample text is generated.
  • the device provided by the above-mentioned embodiment of the present disclosure acquires at least one image and the description text of the specified object through the acquisition unit 501, and the extraction unit 502 uses the pre-trained cross-media feature extraction network to extract the image features of the image and the text features of the description text,
  • the matching unit 503 matches the image features with the text features, determines the image containing the specified object, uses the cross-media feature to extract the features, and projects the image feature and the text feature to the image and text common feature space for feature matching, thus realizing the cross-media feature.
  • Target retrieval is the image features of the image and the text features of the description text.
  • FIG. 6 shows a schematic structural diagram of an electronic device (for example, the server in FIG. 1) 600 suitable for implementing embodiments of the present disclosure.
  • the server shown in FIG. 6 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
  • the electronic device 600 may include a processing device (such as a central processing unit, a graphics processor, etc.) 601, which can be loaded into a random access device according to a program stored in a read-only memory (ROM) 602 or from a storage device 608.
  • the program in the memory (RAM) 603 executes various appropriate actions and processing.
  • the RAM 603 also stores various programs and data required for the operation of the electronic device 600.
  • the processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604.
  • An input/output (I/O) interface 605 is also connected to the bus 604.
  • the following devices can be connected to the I/O interface 605: including input devices 605 such as touch screens, touch panels, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; including, for example, liquid crystal displays (LCD, Liquid Crystal Display) Output devices 607 such as speakers, vibrators, etc.; storage devices 608 such as magnetic tapes, hard disks, etc.; and communication devices 609.
  • the communication device 609 may allow the electronic device 600 to perform wireless or wired communication with other devices to exchange data.
  • FIG. 6 shows an electronic device 600 having various devices, it should be understood that it is not required to implement or have all of the illustrated devices. It may be implemented alternatively or provided with more or fewer devices. Each block shown in FIG. 6 can represent one device, or can represent multiple devices as needed.
  • an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602.
  • the processing device 601 the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
  • the computer-readable medium of the embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable removable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • the computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable signal medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs.
  • the electronic device obtains at least one image and the description text of the specified object; uses the pre-trained cross-media
  • the feature extraction network extracts the image feature of the image and the text feature of the description text; matches the image feature with the text feature to determine the image containing the specified object.
  • the computer program code used to perform the operations of the embodiments of the present disclosure can be written in one or more programming languages or a combination thereof.
  • the programming languages include object-oriented programming languages—such as Java, Smalltalk, C++, and Conventional procedural programming language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server.
  • the remote computer can be connected to the user's 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 (for example, using an Internet service provider to pass Internet connection).
  • LAN local area network
  • WAN wide area network
  • each block in the flowchart or block diagram can represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logic function.
  • Executable instructions can also occur in a different order from the order marked in the drawings. For example, two blocks shown one after another can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure can be implemented in software or hardware.
  • the described unit can also be provided in the processor, for example, can be described as: a processor, a packet acquisition unit, an extraction unit, and a matching unit. Wherein, the names of these units do not constitute a limitation on the unit itself under certain circumstances.
  • the acquisition unit can also be described as "a unit that acquires at least one image and a description text of a specified object".

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Library & Information Science (AREA)
  • Medical Informatics (AREA)
  • Image Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本公开的实施例公开了检索目标的方法和装置。该方法的一具体实施方式包括:获取至少一幅图像以及指定对象的描述文本;利用预先训练的跨媒体特征提取网络提取图像的图像特征以及描述文本的文本特征;对图像特征与文本特征进行匹配,确定出包含指定对象的图像,从而利用跨媒体特征提取特征,将图像特征与文本特征投影至图像文本共同特征空间进行特征匹配,实现了跨媒体的目标检索。

Description

检索目标的方法和装置
本专利申请要求于2020年3月25日提交的、申请号为202010215923.4、申请人为北京沃东天骏信息技术有限公司及北京京东世纪贸易有限公司、发明名称为“检索目标的方法和装置”的中国专利申请的优先权,该申请的全文以引用的方式并入本申请中。
技术领域
本公开的实施例涉及计算机技术领域,具体涉及检索目标的方法和装置。
背景技术
随着互联网技术的快速发展,媒体数据的呈现方式也越来越丰富多样,不同类型的媒体数据从不同的角度描述同一事物。
人们期望可以实现不同类型的媒体数据之间的跨媒体检索,即通过一种类型的媒体数据,查询检索出具有相同语义的另一种媒体类型的媒体数据。
发明内容
本公开的实施例提出了检索目标的方法和装置。
第一方面,本公开的实施例提供了一种检索目标的方法,该方法包括:获取至少一幅图像以及指定对象的描述文本;利用预先训练的跨媒体特征提取网络提取图像的图像特征以及描述文本的文本特征,其中,跨媒体特征提取网络将文本特征与图像特征投影至图像文本共同特征空间;对图像特征与文本特征进行匹配,确定出包含指定对象的图像。
在一些实施例中,跨媒体特征提取网络是按照如下方法生成的:获取训练样本集,其中,训练样本集包括样本图像文本对,样本图像文本对包括:样本图像和描述样本图像中包含的对象的样本文本;获 取初始网络,其中,初始网络包括待训练的跨媒体特征提取网络、用于判别特征来源的数据类别的判别网络、特征转化网络,待训练的跨媒体特征提取网络包括图像图注意力网络、文本图注意力网络;将样本图像文本对中的样本图像输入图像图注意力网络,得到第一特征;将样本图像文本对中的样本文本输入文本图注意力网络,得到第二特征;将第一特征和第二特征输入判别网络得到类别判别结果,根据类别判别结果计算判别损失值,其中,特征来源的数据类别包括文本类和图像类,判别损失值表征第一特征和第二特征类别判定误差;将第一特征和第二特征输入特征转化网络得到特征转化结果,根据特征转化结果计算识别损失函数的值和成对损失函数的值,其中,识别损失函数表征第一特征和第二特征在图像文本共同特征空间对所包含的不同对象的区分能力,成对损失函数表征同一对象的第一特征和第二特征之间的语义差异性;基于识别损失函数的值和成对损失函数的值,得到预设的特征损失值;基于判别损失值和特征损失值,将待训练的跨媒体特征提取网络和特征转化网络作为生成网络,与判别网络进行对抗训练,得到训练完成的跨媒体特征提取网络、判别网络、特征转化网络。
在一些实施例中,图像图注意力网络包括残差网络、图像图注意力卷积网络以及联合嵌入层;以及将样本图像输入图像图注意力网络,得到第一特征,包括:利用残差网络提取样本图像的初始图像特征,将初始图像特征输入至图像图注意力卷积网络,输出样本图像的结构化图像特征,将初始图像特征与结构化图像特征融合,生成图像特征,将图像特征输入至联合嵌入层,得到第一特征。
在一些实施例中,将初始图像特征输入至图像图注意力卷积网络,输出样本图像的结构化图像特征,包括:对样本图像进行目标对象检测,确定出样本图像中的目标对象和目标对象的矩形包围盒的位置,并根据目标对象的矩形包围盒的位置,提取目标对象的相关特征,其中,目标对象的相关特征包括以下至少一项:目标对象的外观特征、目标对象的位置特征以及目标对象的类型特征;构建图像特征有向图,图像特征有向图的顶点表征目标对象,图像特征有向图的有向边表征 各目标对象之间的关联关系。
在一些实施例中,文本图注意力网络包括双向长短期记忆网络、文本图注意力卷积网络以及联合嵌入层;以及将样本文本输入文本图注意力网络,得到第二特征,包括:将样本文本进行分词处理,确定样本文本的词向量;利用双向长短期记忆网络提取样本文本的词向量的初始文本特征,将初始文本特征输入至文本图注意力卷积网络,输出样本文本的结构化文本特征,将初始文本特征与结构化文本特征融合,生成文本特征,将文本特征输入至联合嵌入层,得到第二特征。
在一些实施例中,将初始文本特征输入至文本图注意力卷积网络,输出样本文本的结构化文本特征,包括:构建文本特征有向图,文本特征有向图的顶点表征词向量所指示的目标对象,文本特征有向图的有向边表征各词向量所指示的目标对象之间的关联关系,其中,词向量所指示的目标对象的相关特征包括以下至少一项:目标对象的属性特征和目标对象的类型特征;根据文本特征有向图,生成样本文本的结构化文本特征。
第二方面,本公开的实施例提供了一种检索目标的装置,该装置包括:获取单元,被配置成获取至少一幅图像以及指定对象的描述文本;提取单元,被配置成利用预先训练的跨媒体特征提取网络提取图像的图像特征以及描述文本的文本特征,其中,跨媒体特征提取网络将文本特征与图像特征投影至图像文本共同特征空间;匹配单元,被配置成对图像特征与文本特征进行匹配,确定出包含指定对象的图像。
在一些实施例中,跨媒体特征提取网络是按照如下方法生成的:获取训练样本集,其中,训练样本集包括样本图像文本对,样本图像文本对包括:样本图像和描述样本图像中包含的对象的样本文本;获取初始网络,其中,初始网络包括待训练的跨媒体特征提取网络、用于判别特征来源的数据类别的判别网络、特征转化网络,待训练的跨媒体特征提取网络包括图像图注意力网络、文本图注意力网络;将样本图像文本对中的样本图像输入图像图注意力网络,得到第一特征;将样本图像文本对中的样本文本输入文本图注意力网络,得到第二特征;将第一特征和第二特征输入判别网络得到类别判别结果,根据类 别判别结果计算判别损失值,其中,特征来源的数据类别包括文本类和图像类,判别损失值表征第一特征和第二特征类别判定误差;将第一特征和第二特征输入特征转化网络得到特征转化结果,根据特征转化结果计算识别损失函数的值和成对损失函数的值,其中,识别损失函数表征第一特征和第二特征在图像文本共同特征空间对所包含的不同对象的区分能力,成对损失函数表征同一对象的第一特征和第二特征之间的语义差异性;基于识别损失函数的值和成对损失函数的值,得到预设的特征损失值;基于判别损失值和特征损失值,将待训练的跨媒体特征提取网络和特征转化网络作为生成网络,与判别网络进行对抗训练,得到训练完成的跨媒体特征提取网络、判别网络、特征转化网络。
在一些实施例中,图像图注意力网络包括残差网络、图像图注意力卷积网络以及联合嵌入层;以及第一特征是按照如下方法得到的:利用残差网络提取样本图像的初始图像特征,将初始图像特征输入至图像图注意力卷积网络,输出样本图像的结构化图像特征,将初始图像特征与结构化图像特征融合,生成图像特征,将图像特征输入至联合嵌入层,得到第一特征。
在一些实施例中,样本图像的结构化图像特征是按照如下方法得到的:对样本图像进行目标对象检测,确定出样本图像中的目标对象和目标对象的矩形包围盒的位置,并根据目标对象的矩形包围盒的位置,提取目标对象的相关特征,其中,目标对象的相关特征包括以下至少一项:目标对象的外观特征、目标对象的位置特征以及目标对象的类型特征;构建图像特征有向图,图像特征有向图的顶点表征目标对象,图像特征有向图的有向边表征各目标对象之间的关联关系特征。
在一些实施例中,文本图注意力网络包括双向长短期记忆网络、文本图注意力卷积网络以及联合嵌入层;第二特征是按照如下方法得到的:将样本文本进行分词处理,确定样本文本的词向量;利用双向长短期记忆网络提取样本文本的词向量的初始文本特征,将初始文本特征输入至文本图注意力卷积网络,输出样本文本的结构化文本特征,将初始文本特征与结构化文本特征融合,生成文本特征,将文本特征 输入至联合嵌入层,得到第二特征。
在一些实施例中,样本文本的结构化文本特征是按照如下方法得到的:构建文本特征有向图,文本特征有向图的顶点表征词向量所指示的目标对象,文本特征有向图的有向边表征各词向量所指示的目标对象之间的关联关系特征,其中,词向量所指示的目标对象的相关特征包括以下至少一项:目标对象的属性特征和目标对象的类型特征;根据文本特征有向图,生成样本文本的结构化文本特征。
第三方面,本公开的实施例提供了一种电子设备,该电子设备包括:一个或多个处理器;存储装置,其上存储有一个或多个程序;当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面中任一实现方式描述的方法。
第四方面,本公开的实施例提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时实现如第一方面中任一实现方式描述的方法。
本公开的实施例提供的检索目标的方法和装置,通过获取至少一幅图像以及指定对象的描述文本,而后,利用预先训练的跨媒体特征提取网络提取图像的图像特征以及描述文本的文本特征,其中,跨媒体特征提取网络将文本特征与图像特征投影至图像文本共同特征空间,最后,对图像特征与文本特征进行匹配,确定出包含指定对象的图像,从而利用跨媒体特征提取特征,将图像特征与文本特征投影至图像文本共同特征空间进行特征匹配,实现了跨媒体的目标检索。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本公开的其它特征、目的和优点将会变得更明显:
图1是本公开的一个实施例可以应用于其中的示例性系统架构图;
图2是根据本公开的检索目标的方法的一个实施例的流程图;
图3是上述跨媒体特征提取网络的生成方法的一个实现方式的流程图;
图4是本公开的检索目标的方法的一个实现流程的架构示意图;
图5是根据本公开的检索目标的装置的一个实施例的结构示意图;
图6是适于用来实现本公开的实施例的电子设备的结构示意图。
具体实施方式
下面结合附图和实施例对本公开作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。
需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本公开。
图1示出了可以应用本公开的检索目标的方法或检索目标的装置的示例性架构100。
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种通讯客户端应用,例如图像编辑类应用、文本编辑类应用、浏览器类应用等。
终端设备101、102、103可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是具有显示屏并且支持互联网访问的各种电子设备,包括但不限于智能手机、平板电脑、笔记本电脑、和台式计算机等等。当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务),也可以实现成单个软件或软件模块。在此不做具体限定。
服务器105可以是提供各种服务的服务器,例如为终端设备101、102、103获取的图像和文本进行匹配的后台服务器。后台服务器可以对接收到的图像和文本进行识别、匹配等处理。
需要说明的是,本公开的实施例所提供的检索目标的方法一般由服务器105执行,相应地,检索目标的装置一般设置于服务器105中。
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。
继续参考图2,示出了根据本公开的检索目标的方法的一个实施例的流程200。该检索目标的方法包括以下步骤:
步骤201,获取至少一幅图像以及指定对象的描述文本。
在本实施例中,上述检索目标的方法的执行主体(例如图1所示的服务器)可以从预先存储的图像库中获取至少一副图像以及指定对象的描述文本。在这里,上述图像可以是预先存储的图像库中的任意一幅待检索图像。
在这里,指定对象指待检索的实体,指定对象可以是位置可变的对象,例如行人、车辆等,指定对象也可以是位置固定的对象,例如建筑物、景观等。上述指定对象的数量可以是一个,也可以是多个。图像可以包含指定对象或其他的对象。文本可以是对指定对象的特征进行描述的句子或词语。例如指定对象是行人A,那么在步骤201中可以获取图像库中包含行人的待检索图像以及该行人A的外貌、动作等特征的描述文本。进而在后续的步骤中对待检索图像与行人A的描述文本进行匹配,从包含行人的待检索图像中确定出与行人A的描述文本相匹配的包含行人A的图像。
步骤202,利用预先训练的跨媒体特征提取网络提取图像的图像特征以及描述文本的文本特征。
在本实施例中,上述执行主体可以利用预先训练的跨媒体特征提取网络,提取步骤201中至少一副图像的图像特征以及指定对象的描述文本的文本特征。其中,跨媒体特征提取网络可以将文本特征与图像特征投影至图像文本共同特征空间,具体地,跨媒体特征提取网络可以提取不同媒体类型的数据的特征,并且可以把不同媒体类型的数据的特征转换至同一个共同特征空间,这样不同媒体类型的数据的特征在同一个共同特征空间才能进行特征匹配。
在这里,跨媒体特征提取网络可以是人工神经网络。基于步骤201 中所获取的至少一幅图像以及指定对象的描述文本,上述执行主体可以将一个或多个图像以及描述文本输入至预先训练的人工神经网络,提取出图像对应的图像特征、文本对应的文本特征。在上述一个或多个图像中可以选取局部或者整体图像,以提取所选取的局部或者整体图像的图像特征。在上述指定对象的描述文本中可以选取部分或者整体的描述文本,以提取所选取的部分或者整体的文本的文本特征。上述特征可以用特征向量表示。
步骤203,对图像特征与文本特征进行匹配,确定出包含指定对象的图像。
在本实施例中,上述执行主体可以对步骤202提取的图像特征与文本特征进行匹配,从至少一个图像中确定出包含指定对象的图像,作为与文本描述相匹配的图像。
在这里,上述执行主体可以通过计算每个图像的图像特征与描述文本的文本特征之间的相似度,确定图像特征与文本特征是否匹配。上述相似度可以与图像特征与文本特征之间的距离相关,例如可以采用欧式距离、明氏距离、曼哈顿距离、切比雪夫距离、马氏距离等,计算图像特征与文本特征之间的相似度。
在实践中,为了更加全面地匹配出与文本特征相似的图像特征,还可以先计算每个图像特征与文本特征之间的相似度,将每个图像特征与文本特征之间的相似度进行从高到低的排序,选取排序在前预设位的图像特征,将排序在前预设位的图像特征所指示的图像作为与文本描述的相匹配的图像。预设位可以是根据实际需要设定的,可以为一个或者多个。在这里,文本特征与图像特征之间的相似度越高,文本特征与图像特征所指示的对象为同一对象的可能性越大。
本公开的上述实施例提供的检索目标的方法,通过获取至少一幅图像以及指定对象的描述文本,而后,利用预先训练的跨媒体特征提取网络提取图像的图像特征以及描述文本的文本特征,其中,跨媒体特征提取网络将文本特征与图像特征投影至图像文本共同特征空间,最后,对图像特征与文本特征进行匹配,确定出包含指定对象的图像,从而利用跨媒体特征提取特征,将图像特征与文本特征投影至图像文 本共同特征空间进行特征匹配,实现了跨媒体的目标检索。
继续参考图3,图3是上述跨媒体特征提取网络的生成方法的一个实现方式的流程图。该跨媒体特征提取网络的生成方法的流程300可以包括以下步骤:
步骤301,获取训练样本集。
在本实施例中,上述执行主体可以从预设设置的数据库中获取训练样本集,训练样本集可以包括样本图像文本对,样本图像文本对可以包括样本图像和描述样本图像中包含的对象的样本文本。
步骤302,获取初始网络。
在本实施例中,上述执行主体首先可以获取初始网络,具体地,初始网络可以包括待训练的跨媒体特征提取网络、用于判别特征来源的数据类别的判别网络、特征转化网络,待训练的跨媒体特征提取网络可以包括图像图注意力网络、文本图注意力网络。上述初始网络可以是初始化参数后,未经训练的神经网络,也可以是预先训练过的神经网络。
步骤303,从训练样本集中选取样本,执行训练步骤。
在本实施例中,上述执行主体可以从步骤301中获取的样本集中选取样本,以及执行步骤3031至步骤3036的训练步骤。其中,样本的选取方式和选取数量在本公开中并不限制。例如上述执行主体可以选取至少一个样本。
更具体地,训练步骤包括如下步骤:
步骤3031,将样本图像文本对中的样本图像输入图像图注意力网络,得到第一特征。
在本实施例中,上述执行主体可以将样本图像文本对中的样本图像输入到待训练的跨媒体特征提取网络的图像图注意力网络中,输出第一特征,即样本图像的图像特征。
在本实施例的一些可选实现方式中,图像图注意力网络包括残差网络、图像图注意力卷积网络以及联合嵌入层。具体地,可以通过如下步骤得到第一特征:
第一步,利用残差网络提取样本图像的初始图像特征。
在该可选实现方式中,上述执行主体可以利用残差网络提取样本图像的初始图像特征,即低层次视觉特征。在这里,初始图像特征可以是全局图像特征,例如颜色特征、纹理特征、形状特征、结构特征等。
在这里,上述执行主体还可以残差网络提取样本图像的初始图像特征之后,采用平均池化层将初始图像特征生成全局外观视觉特征向量,利用平均池化层降低初始图像特征的维度,生成的全局外观视觉特征向量可以保留初始图像特征中的显著特征。
第二步,将初始图像特征输入至图像图注意力卷积网络,输出样本图像的结构化图像特征。
在该可选实现方式中,上述执行主体可以将提取的低层次视觉特征输入至预先训练好的图像图注意力卷积网络,得到样本图像的结构化图像特征。在这里,结构化图像特征可以用来表征样本图像的结构化的语义视觉特征。
可选地,还可以通过以下步骤将初始图像特征输入至图像图注意力卷积网络,输出样本图像的结构化图像特征:对样本图像进行目标对象检测,确定出样本图像中的目标对象和目标对象的矩形包围盒的位置,并根据目标对象的矩形包围盒的位置,提取目标对象的相关特征;构建图像特征有向图,图像特征有向图的顶点表征目标对象,图像特征有向图的有向边表征各目标对象之间的关联关系;根据图像特征有向图,生成样本图像的结构化图像特征。
在该可选实现方式中,上述执行主体可以通过构建的图像特征有向图,获取样本图像的结构化图像特征。
具体地,上述执行主体首先可以利于预先设置的目标检测算法识别出样本图像中的目标对象和目标对象的矩形包围盒的位置,然后利用目标检测算法从目标对象的矩形包围盒中提取目标对象的外观特征,根据目标对象的矩形包围盒的位置,提取目标对象的相关特征,例如目标对象的相关特征可以包括以下至少一项:目标对象的外观特征、目标对象的位置特征以及目标对象的类型特征,具体地,例如可以使用目标检测算法R-CNN(Region-Convolutional Neural Networks,区域 卷积神经网络)对样本图像进行目标对象的检测,在这里,目标对象可以是根据实际的应用需求,预先指定的任意对象,例如鞋子、眼镜等物体,目标对象的矩形包围盒的位置特征可以用目标对象在当样本图像中的矩形包围盒的位置坐标来表示,例如表示矩形包围盒的某顶点的横坐标、表示矩形包围框的某顶点的纵坐标、矩形包围框的宽度、矩形包围框的高度之间关系的多元组的位置坐标。目标对象的类别例如可以根据其形状、颜色等特征识别出来,并且上述执行主体可以利用预先设置的实体关系分类器确定目标对象之间的关联关系,利用预先设置的属性分类器确定目标对象的属性。目标对象的外观特征可以包括全局外观特征和局部外观特征。
然后可以构建图像特征有向图,图像特征有向图的顶点表征目标对象,可以用O i(O 1、O 2、O 3、O 4、O 5、O 6)表示,O i可以表示三元组“主语-谓语-宾语”中的主语或者宾语,图像特征有向图的有向边表征各目标对象之间的关联关系,可以用e ij(e 15、e 16、e 21、e 31、e 41)表示,例如有向边e ij表示对象O i与对象O j之间的关系,e ij表示三元组“主语-谓语-宾语”中的谓语,O i可以是三元组“主语-谓语-宾语”中的主语,O j可以是三元组“主语-谓语-宾语”中的宾语。图像特征有向图的顶点特征可以由上述获取的表征目标对象的相关特征表示,目标对象的相关特征可以包括以下至少一项:目标对象的外观特征、目标对象的位置特征以及目标对象的类型特征。图像特征有向图的有向边特征可以由以下至少一项组成:目标对象的外观特征、目标对象的位置特征、目标对象的类型特征。
最后可以利用图注意力卷积层对上述构建的图像特征有向图进行更新,并提取样本图像的结构化图像特征。具体地,利用图注意力卷积层可以对图像特征有向图进行更新,得到更新后的顶点,可以设置如下更新公式对图像特征有向图中的顶点特征进行更新:
Figure PCTCN2021073322-appb-000001
其中,g s,g o表示全连接层,w ij表示节点j对节点i的权重,w ik表 示节点k对节点i的权重,o j表示表征主语的节点,o j表示表征谓语的节点,
Figure PCTCN2021073322-appb-000002
表示节点特征,
Figure PCTCN2021073322-appb-000003
表示节点之间的有向边特征。
w ij可以通过如下公式计算:
Figure PCTCN2021073322-appb-000004
其中,w a表示有向边特征
Figure PCTCN2021073322-appb-000005
的权重,b a表示偏置项。
通过上述更新公式可以得到更新后的图像特征有向图的各个顶点特征,为了融合更新后的各个顶点特征,设置一个连接图像特征有向图的各个顶点的虚拟顶点,上述虚拟顶点可以通过如下公式生成样本图像的结构化图像特征:
Figure PCTCN2021073322-appb-000006
其中,
Figure PCTCN2021073322-appb-000007
表示虚拟顶点特征,w i表示节点i的权重,g v表示全连接层。
w i可以通过如下公式计算:
Figure PCTCN2021073322-appb-000008
其中,w c表示虚拟顶点特征
Figure PCTCN2021073322-appb-000009
的权重,b c表示偏置项。
由于虚拟顶点与图像特征有向图的各个顶点相连,图像特征有向图包含了目标对象的相关特征以及目标对象之间的关联关系特征,所以虚拟顶点可以融合更新后的图像特征有向图中的所有特征,生成表征样本图像的结构化语义信息的结构化图像特征,可以包含更有效的结构化语义信息,更全面地、更准确的表征图像特征,更有效地区别识别图像所包含的目标对象。
第三步,将初始图像特征与结构化图像特征融合,生成图像特征。
在该可选实现方式中,上述执行主体可以融合第一步得到的初始图像特征与第二步得到的结构化图像特征,得到样本图像的图像特征。
第四步,将图像特征输入至联合嵌入层,得到第一特征。
在该可选实现方式中,上述执行主体可以将第三步得到的图像特征输入至联合嵌入层,得到第一特征,联合嵌入层可以由三个全连接层组成。
步骤3032,将样本图像文本对中的样本文本输入文本图注意力网络,得到第二特征。
在本实施例中,上述执行主体可以将样本图像文本对中的样本文本输入到待训练的跨媒体特征提取网络的文本图注意力网络中,输出第二特征,即样本文本的文本特征。
在本实施例的一些可选实现方式中,文本图注意力网络包括双向长短期记忆网络、文本图注意力卷积网络以及联合嵌入层。具体地,可以通过如下步骤得到第二特征:
第一步:将样本文本进行分词处理,确定样本文本的词向量。
在该可选实现方式中,上述执行主体可以利用常用的分词工具或者人工标注对样本文本进行分词处理,样本文本中的每个单词都被投影成一个词向量。
第二步,利用双向长短期记忆网络提取样本文本的词向量的初始文本特征。
在该可选实现方式中,上述执行主体可以利用双向长短期记忆网络提取样本文本中具有上下文信息的初始文本特征。
第三步,将初始文本特征输入至文本图注意力卷积网络,输出样本文本的结构化文本特征。
在该可选实现方式中,上述执行主体可以将提取的初始文本特征输入至预先训练好的文本图注意力卷积网络,得到样本文本的结构化文本特征。在这里,结构化文本特征可以用来表征样本文本的结构化的语义文本特征。
可选地,还可以通过以下步骤初始文本特征输入至文本图注意力卷积网络,输出样本文本的结构化文本特征:构建文本特征有向图,文本特征有向图的顶点表征词向量所指示的目标对象,文本特征有向图的有向边表征各词向量所指示的目标对象之间的关联关系;根据文本特征有向图,生成样本文本的结构化文本特征。
在该可选实现方式中,上述执行主体可以通过构建的文本特征有向图,获取样本文本的结构化文本特征。
具体地,上述执行主体首先可以构建文本特征有向图,文本特征有向图的顶点表征目标对象,可以用O i(O 1、O 2、O 3、O 4、O 5、O 6)表示,O i可以表示三元组“主语-谓语-宾语”中的主语或者宾语,文 本特征有向图的有向边表征各目标对象之间的关联关系,可以用e ij(e 15、e 16、e 21、e 31、e 41)表示,例如有向边e ij表示对象O i与对象O j之间的关系,e ij表示三元组“主语-谓语-宾语”中的谓语,O i可以是三元组“主语-谓语-宾语”中的主语,O j可以是三元组“主语-谓语-宾语”中的宾语。文本特征有向图的顶点特征可以由目标对象的相关特征组成,目标对象的相关特征包括以下至少一项:目标对象的属性特征和目标对象的类型特征,文本特征有向图的有向边特征可以由目标对象的类型特征组成。
然后可以利用图注意力卷积层对上述构建的文本特征有向图进行更新,并可以采用上述更新公式(1)对文本特征有向图中的顶点特征进行更新。上述执行主体可以设置一个连接文本特征有向图的各个顶点的虚拟顶点,上述虚拟顶点可以通过公式(3)生成样本文本的结构化文本特征,可以包含更有效的结构化语义信息,更全面地、更准确的表征文本特征,更有效地区别识别文本所包含的目标对象。
第四步,将初始文本特征与结构化文本特征融合,生成文本特征。
在该可选实现方式中,上述执行主体可以融合第二步得到的初始文本特征与第三步得到的结构化文本特征,得到样本文本的文本特征。
第五步,将文本特征输入至联合嵌入层,得到第二特征。
在该可选实现方式中,上述执行主体可以将第四步得到的文本特征输入至联合嵌入层,得到第二特征,联合嵌入层可以由三个全连接层组成。
步骤3033,将第一特征和第二特征输入判别网络得到类别判别结果,根据类别判别结果计算判别损失值。
在本实施例中,上述执行主体可以将第一特征和第二特征输入判别网络得到类别判别结果,根据类别判别结果计算判别损失值,其中,特征来源的数据类别包括文本类和图像类,判别损失值表征第一特征和第二特征类别判定误差。上述判别网络可以由三个全连接层组成,旨在更好地判断识别给定的特征的来源的数据类型,即特征的模态类别,例如文本类、图像类,并且可以通过如下损失函数计算判别损失值L advD):
Figure PCTCN2021073322-appb-000010
其中,v i表示第一特征,t i表示第二特征,D(v i;θ D)、D(t i;θ D)表示输入样本i的特征来源的数据类别概率,θ D表示判别网络的网络参数。
步骤3034,将第一特征和第二特征输入特征转化网络得到特征转化结果,根据特征转化结果计算识别损失函数的值和成对损失函数的值。
在本实施例中,上述执行主体可以将第一特征和第二特征输入特征转化网络得到特征转化结果,根据特征转化结果计算识别损失函数的值和成对损失函数的值,其中,识别损失函数表征第一特征和第二特征在图像文本共同特征空间对所包含的不同对象的区分能力,成对损失函数表征同一对象的第一特征和第二特征之间的语义差异性。上述执行主体可以通过如下损失函数计算识别损失值L ideV,θ T):
Figure PCTCN2021073322-appb-000011
其中,y i表示第i个样本(样本文本或者样本图像)的对应的目标对象的编号,x i表示第一特征或者第二特征,θ V表示图像图注意力卷积网络的网络参数,θ T表示文本图注意力卷积网络的网络参数,W j表示权重矩阵W的第j列,b表示偏置项,N表示样本的个数。
上述执行主体可以通过如下损失函数计算成对损失值L pairV,θ T):
Figure PCTCN2021073322-appb-000012
其中,y i表示样本图像和样本文本输入对是否指示同一个目标对象的编号的二维矢量,z i表文本特征与图像特征的融合特征,W p,j表示权重矩阵W p的第j列,b p表示偏置项,M表示样本图像和样本文本输入对的个数。
步骤3035,基于识别损失函数的值和成对损失函数的值,得到预设的特征损失值。
在本实施例中,上述执行主体可以将步骤3034中得到的识别损失值和成对损失值相加,得到特征转化网络的特征损失值。
步骤3036,基于判别损失值和特征损失值,将待训练的跨媒体特征提取网络和特征转化网络作为生成网络,与判别网络进行对抗训练, 得到训练完成的跨媒体特征提取网络、判别网络、特征转化网络。
在本实施例中,上述执行主体可以基于步骤3033得到的判别损失值与步骤3035得到的特征损失值,将待训练的跨媒体特征提取网络和特征转化网络作为生成网络,与判别网络进行对抗训练,具体地,可以通过设置如下损失函数对图像图注意力卷积网络的网络参数θ V、文本图注意力卷积网络的网络参数θ T、判别网络的网络参数θ D进行指导训练优化:
Figure PCTCN2021073322-appb-000013
Figure PCTCN2021073322-appb-000014
其中,L feaVT)表示特征损失值,L advD)表示判别损失值。
当特征损失值与判别损失值的差值达到最大时,将优化后的图像图注意力卷积网络的网络参数θ V、文本图注意力卷积网络的网络参数θ T作为训练完成的跨媒体特征提取网络的网络参数。
通过上述训练步骤,可以使跨媒体特征提取网络能够提取出具有结构化语义的文本特征与图像特征,使其具有模态不变性、语义区分力以及跨模态的语义相似性。
继续参考图4,图4是本公开的检索目标的方法的一个实现流程的架构示意图。
如图4所示,系统架构可以包括图像图注意力网络、文本图注意力网络和对抗学习模块。
图像图注意力网络用于提取图像的图像特征,图像图注意力网络可以由五个残差网络模块、视觉场景图模块和联合嵌入层组成,其中,视觉场景图模块可以由图像特征有向图和图注意力卷积层组成,图注意力卷积层用于更新图像特征有向图,联合嵌入层可以由三个全连接层组成。具体地,上述执行主体首先可以利用五个残差网络模块提取图像的初始图像特征,然后将初始图像特征输入至视觉场景图模块,提取出图像的结构化图像特征,最后利用联合嵌入层将结构化图像特征投影到图像文本共同特征空间。
文本图注意力网络用于提取文本的文本特征,文本图注意力网络可以由双向LSTM(Long Short-Term Memory,长短期记忆网络)、文本场景图模块和联合嵌入层组成,其中,文本场景图模块可以由文本特征有向图和图注意力卷积层组成,图注意力卷积层用于更新文本特 征有向图,联合嵌入层可以由三个全连接层组成。具体地,上述执行主体首先可以利用双向LSTM提取文本的初始文本特征,然后将初始文本特征输入至文本场景图模块,提取出文本的结构化文本特征,最后利用联合嵌入层将结构化文本特征投影到图像文本共同特征空间。
对抗学习模块用于确定图像特征与文本特征的图像文本共同特征空间,对抗学习模块可以由特征转换器和模态鉴别器组成。具体地,上述执行主体首先可以将图像图注意力网络提取的图像特征与文本图注意力网络提取的文本特征输入至对抗学习模块,特征转换器用于将不同模态类型的特征(文本特征或者图像特征)投影至图像文本共同特征空间,生成转换后的特征,模态鉴别器用于区分特征转换器生成的转换后的特征的模态类型(文本类或者图像类),然后将图像图注意力网络、文本图注意力网络特征和转换器作为生成网络,将模态鉴别器作为判别网络,进行联合对抗学习,最后将训练完成的图像图注意力网络、文本图注意力网络特征作为跨媒体特征提取网络。
进一步参考图5,作为对上述各图所示方法的实现,本公开提供了检索目标的装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图5所示,本实施例提供的检索目标的装置500包括获取单元501、提取单元502和匹配单元503。其中,获取单元501,被配置成获取至少一幅图像以及指定对象的描述文本;提取单元502,被配置成利用预先训练的跨媒体特征提取网络提取图像的图像特征以及描述文本的文本特征;匹配单元503,被配置成对图像特征与文本特征进行匹配,确定出包含指定对象的图像。
在本实施例中,检索目标的装置500中:获取单元501、提取单元502和匹配单元503的具体处理及其所带来的技术效果可分别参考图2对应实施例中的步骤201、步骤202和步骤203的相关说明,在此不再赘述。
在本实施例的一些可选的实现方式中,跨媒体特征提取网络是按照如下方法生成的:获取训练样本集,其中,训练样本集包括样本图像文本对,样本图像文本对包括:样本图像和描述样本图像中包含的 对象的样本文本;获取初始网络,其中,初始网络包括待训练的跨媒体特征提取网络、用于判别特征来源的数据类别的判别网络、特征转化网络,待训练的跨媒体特征提取网络包括图像图注意力网络、文本图注意力网络;将样本图像文本对中的样本图像输入图像图注意力网络,得到第一特征;将样本图像文本对中的样本文本输入文本图注意力网络,得到第二特征;将第一特征和第二特征输入判别网络得到类别判别结果,根据类别判别结果计算判别损失值,其中,特征来源的数据类别包括文本类和图像类,判别损失值表征第一特征和第二特征类别判定误差;将第一特征和第二特征输入特征转化网络得到特征转化结果,根据特征转化结果计算识别损失函数的值和成对损失函数的值,其中,识别损失函数表征第一特征和第二特征在图像文本共同特征空间对所包含的不同对象的区分能力,成对损失函数表征同一对象的第一特征和第二特征之间的语义差异性;基于识别损失函数的值和成对损失函数的值,得到预设的特征损失值;基于判别损失值和特征损失值,将待训练的跨媒体特征提取网络和特征转化网络作为生成网络,与判别网络进行对抗训练,得到训练完成的跨媒体特征提取网络、判别网络、特征转化网络。
在本实施例的一些可选的实现方式中,图像图注意力网络包括残差网络、图像图注意力卷积网络以及联合嵌入层;以及第一特征是按照如下方式得到的:利用残差网络提取样本图像的初始图像特征,将初始图像特征输入至图像图注意力卷积网络,输出样本图像的结构化图像特征,将初始图像特征与结构化图像特征融合,生成图像特征,将图像特征输入至联合嵌入层,得到第一特征。
在本实施例的一些可选的实现方式中,样本图像的结构化图像特征是按照如下方式得到的:对样本图像进行目标对象检测,确定出样本图像中的目标对象和目标对象的矩形包围盒的位置,并根据目标对象的矩形包围盒的位置,提取目标对象的相关特征,其中,目标对象的相关特征包括以下至少一项:目标对象的外观特征、目标对象的位置特征、目标对象的属性特征以及目标对象的类型特征;构建图像特征有向图,图像特征有向图的顶点表征目标对象,图像特征有向图的 有向边表征各目标对象之间的关联关系;根据图像特征有向图,生成样本图像的结构化图像特征。
在本实施例的一些可选的实现方式中,文本图注意力网络包括双向长短期记忆网络、文本图注意力卷积网络以及联合嵌入层;以及第二特征是按照如下方式得到的:将样本文本进行分词处理,确定样本文本的词向量;利用双向长短期记忆网络提取样本文本的词向量的初始文本特征,将初始文本特征输入至文本图注意力卷积网络,输出样本文本的结构化文本特征,将初始文本特征与结构化文本特征融合,生成文本特征,将文本特征输入至联合嵌入层,得到第二特征。
在本实施例的一些可选的实现方式中,样本文本的结构化文本特征是按照如下方式得到的:构建文本特征有向图,文本特征有向图的顶点表征词向量所指示的目标对象,文本特征有向图的有向边表征各词向量所指示的目标对象之间的关联关系,其中,词向量所指示的目标对象的相关特征包括以下至少一项:目标对象的属性特征和目标对象的类型特征;根据文本特征有向图,生成样本文本的结构化文本特征。
本公开的上述实施例提供的装置,通过获取单元501获取至少一幅图像以及指定对象的描述文本,提取单元502利用预先训练的跨媒体特征提取网络提取图像的图像特征以及描述文本的文本特征,匹配单元503对图像特征与文本特征进行匹配,确定出包含指定对象的图像,从而利用跨媒体特征提取特征,将图像特征与文本特征投影至图像文本共同特征空间进行特征匹配,实现了跨媒体的目标检索。
下面参考图6,其示出了适于用来实现本公开的实施例的电子设备(例如图1中的服务器)600的结构示意图。图6示出的服务器仅仅是一个示例,不应对本公开的实施例的功能和使用范围带来任何限制。
如图6所示,电子设备600可以包括处理装置(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备 600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置605;包括例如液晶显示器(LCD,Liquid Crystal Display)、扬声器、振动器等的输出装置607;包括例如磁带、硬盘等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图6示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。图6中示出的每个方框可以代表一个装置,也可以根据需要代表多个装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理装置601执行时,执行本公开的实施例的方法中限定的上述功能。
需要说明的是,本公开的实施例的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开的实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开的实 施例中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(Radio Frequency,射频)等等,或者上述的任意合适的组合。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取至少一幅图像以及指定对象的描述文本;利用预先训练的跨媒体特征提取网络提取图像的图像特征以及描述文本的文本特征;对图像特征与文本特征进行匹配,确定出包含指定对象的图像。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的实施例的操作的计算机程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开的各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实 现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开的实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器,包获取单元、提取单元、匹配单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,获取单元还可以被描述为“获取至少一幅图像以及指定对象的描述文本的单元”。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开的实施例中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开的实施例中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。

Claims (14)

  1. 一种检索目标的方法,包括:
    获取至少一幅图像以及指定对象的描述文本;
    利用预先训练的跨媒体特征提取网络提取所述图像的图像特征以及所述描述文本的文本特征,其中,所述跨媒体特征提取网络将所述文本特征与所述图像特征投影至图像文本共同特征空间;
    对所述图像特征与所述文本特征进行匹配,确定出包含所述指定对象的图像。
  2. 根据权利要求1所述的方法,其中,所述跨媒体特征提取网络是按照如下方式生成的:
    获取训练样本集,其中,所述训练样本集包括样本图像文本对,所述样本图像文本对包括:样本图像和描述所述样本图像中包含的对象的样本文本;
    获取初始网络,其中,所述初始网络包括待训练的跨媒体特征提取网络、用于判别特征来源的数据类别的判别网络、特征转化网络,所述待训练的跨媒体特征提取网络包括图像图注意力网络、文本图注意力网络;
    将所述样本图像文本对中的样本图像输入图像图注意力网络,得到第一特征;
    将所述样本图像文本对中的样本文本输入文本图注意力网络,得到第二特征;
    将第一特征和第二特征输入所述判别网络得到类别判别结果,根据所述类别判别结果计算判别损失值,其中,所述特征来源的数据类别包括文本类和图像类,所述判别损失值表征第一特征和第二特征类别判定误差;
    将第一特征和第二特征输入所述特征转化网络得到特征转化结果,根据特征转化结果计算识别损失函数的值和成对损失函数的值,其中,所述识别损失函数表征第一特征和第二特征在图像文本共同特征空间 对所包含的不同对象的区分能力,所述成对损失函数表征同一对象的第一特征和第二特征之间的语义差异性;
    基于所述识别损失函数的值和所述成对损失函数的值,得到预设的特征损失值;
    基于所述判别损失值和所述特征损失值,将所述待训练的跨媒体特征提取网络和所述特征转化网络作为生成网络,与所述判别网络进行对抗训练,得到训练完成的跨媒体特征提取网络、判别网络、特征转化网络。
  3. 根据权利要求2所述的方法,其中,所述图像图注意力网络包括残差网络、图像图注意力卷积网络以及联合嵌入层;以及所述将样本图像输入图像图注意力网络,得到第一特征,包括:
    利用残差网络提取样本图像的初始图像特征,将初始图像特征输入至图像图注意力卷积网络,输出样本图像的结构化图像特征,将初始图像特征与结构化图像特征融合,生成图像特征,将图像特征输入至联合嵌入层,得到第一特征。
  4. 根据权利要求3所述的方法,其中,所述将初始图像特征输入至图像图注意力卷积网络,输出样本图像的结构化图像特征,包括:
    对样本图像进行目标对象检测,确定出样本图像中的目标对象和目标对象的矩形包围盒的位置,并根据所述目标对象的矩形包围盒的位置,提取所述目标对象的相关特征,其中,所述目标对象的相关特征包括以下至少一项:目标对象的外观特征、目标对象的位置特征以及所述目标对象的类型特征;
    构建图像特征有向图,所述图像特征有向图的顶点表征所述目标对象,所述图像特征有向图的有向边表征各目标对象之间的关联关系;
    根据所述图像特征有向图,生成样本图像的结构化图像特征。
  5. 根据权利要求2所述的方法,其中,所述文本图注意力网络包括双向长短期记忆网络、文本图注意力卷积网络以及联合嵌入层;以 及所述将样本文本输入文本图注意力网络,得到第二特征,包括:
    将样本文本进行分词处理,确定样本文本的词向量;
    利用双向长短期记忆网络提取样本文本的词向量的初始文本特征,将初始文本特征输入至文本图注意力卷积网络,输出样本文本的结构化文本特征,将初始文本特征与结构化文本特征融合,生成文本特征,将文本特征输入至联合嵌入层,得到所述第二特征。
  6. 根据权利要求5所述的方法,其中,所述将初始文本特征输入至文本图注意力卷积网络,输出样本文本的结构化文本特征,包括:
    构建文本特征有向图,所述文本特征有向图的顶点表征词向量所指示的目标对象,所述文本特征有向图的有向边表征各词向量所指示的目标对象之间的关联关系,其中,所述词向量所指示的目标对象的相关特征包括以下至少一项:目标对象的属性特征和所述目标对象的类型特征;
    根据所述文本特征有向图,生成样本文本的结构化文本特征。
  7. 一种检索目标的装置,包括:
    获取单元,被配置成获取至少一幅图像以及指定对象的描述文本;
    提取单元,被配置成利用预先训练的跨媒体特征提取网络提取所述图像的图像特征以及所述描述文本的文本特征,其中,所述跨媒体特征提取网络将所述文本特征与所述图像特征投影至图像文本共同特征空间;
    匹配单元,被配置成对所述图像特征与所述文本特征进行匹配,确定出包含所述指定对象的图像。
  8. 根据权利要求7所述的装置,其中,所述跨媒体特征提取网络是按照如下方式生成的:
    获取训练样本集,其中,所述训练样本集包括样本图像文本对,所述样本图像文本对包括:样本图像和描述所述样本图像中包含的对象的样本文本;
    获取初始网络,其中,所述初始网络包括待训练的跨媒体特征提取网络、用于判别特征来源的数据类别的判别网络、特征转化网络,所述待训练的跨媒体特征提取网络包括图像图注意力网络、文本图注意力网络;
    将所述样本图像文本对中的样本图像输入图像图注意力网络,得到第一特征;
    将所述样本图像文本对中的样本文本输入文本图注意力网络,得到第二特征;
    将第一特征和第二特征输入所述判别网络得到类别判别结果,根据所述类别判别结果计算判别损失值,其中,所述特征来源的数据类别包括文本类和图像类,所述判别损失值表征第一特征和第二特征类别判定误差;
    将第一特征和第二特征输入所述特征转化网络得到特征转化结果,根据特征转化结果计算识别损失函数的值和成对损失函数的值,其中,所述识别损失函数表征第一特征和第二特征在图像文本共同特征空间对所包含的不同对象的区分能力,所述成对损失函数表征同一对象的第一特征和第二特征之间的语义差异性;
    基于所述识别损失函数的值和所述成对损失函数的值,得到预设的特征损失值;
    基于所述判别损失值和所述特征损失值,将所述待训练的跨媒体特征提取网络和所述特征转化网络作为生成网络,与所述判别网络进行对抗训练,得到训练完成的跨媒体特征提取网络、判别网络、特征转化网络。
  9. 根据权利要求8所述的装置,其中,所述图像图注意力网络包括残差网络、图像图注意力卷积网络以及联合嵌入层;以及所述第一特征是按照如下方式得到的:
    利用残差网络提取样本图像的初始图像特征,将初始图像特征输入至图像图注意力卷积网络,输出样本图像的结构化图像特征,将初始图像特征与结构化图像特征融合,生成图像特征,将图像特征输入 至联合嵌入层,得到第一特征。
  10. 根据权利要求9所述的装置,其中,所述样本图像的结构化图像特征是按照如下方式得到的:
    对样本图像进行目标对象检测,确定出样本图像中的目标对象和目标对象的矩形包围盒的位置,并根据所述目标对象的矩形包围盒的位置,提取所述目标对象的相关特征,其中,所述目标对象的相关特征包括以下至少一项:目标对象的外观特征、目标对象的位置特征以及所述目标对象的类型特征;
    构建图像特征有向图,所述图像特征有向图的顶点表征所述目标对象,所述图像特征有向图的有向边表征各目标对象之间的关联关系;
    根据所述图像特征有向图,生成样本图像的结构化图像特征。
  11. 根据权利要求8所述的装置,其中,所述文本图注意力网络包括双向长短期记忆网络、文本图注意力卷积网络以及联合嵌入层;以及所述第二特征是按照如下方式得到的:
    将样本文本进行分词处理,确定样本文本的词向量;
    利用双向长短期记忆网络提取样本文本的词向量的初始文本特征,将初始文本特征输入至文本图注意力卷积网络,输出样本文本的结构化文本特征,将初始文本特征与结构化文本特征融合,生成文本特征,将文本特征输入至联合嵌入层,得到所述第二特征。
  12. 根据权利要求11所述的装置,其中,所述样本文本的结构化文本特征是按照如下方式得到的:
    构建文本特征有向图,所述文本特征有向图的顶点表征词向量所指示的目标对象,所述文本特征有向图的有向边表征各词向量所指示的目标对象之间的关联关系,其中,所述词向量所指示的目标对象的相关特征包括以下至少一项:目标对象的属性特征和所述目标对象的类型特征;
    根据所述文本特征有向图,生成样本文本的结构化文本特征。
  13. 一种电子设备,包括:
    一个或多个处理器;
    存储装置,其上存储有一个或多个程序,
    当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如权利要求1-6中任一的方法。
  14. 一种计算机可读介质,其上存储有计算机程序,其中,该程序被处理器执行时实现如权利要求1-6中任一的方法。
PCT/CN2021/073322 2020-03-25 2021-01-22 检索目标的方法和装置 WO2021190115A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US17/764,741 US20230005178A1 (en) 2020-03-25 2021-01-22 Method and apparatus for retrieving target
EP21774930.8A EP4131030A4 (en) 2020-03-25 2021-01-22 METHOD AND APPARATUS FOR TARGET SEARCH

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010215923.4 2020-03-25
CN202010215923.4A CN111782921A (zh) 2020-03-25 2020-03-25 检索目标的方法和装置

Publications (1)

Publication Number Publication Date
WO2021190115A1 true WO2021190115A1 (zh) 2021-09-30

Family

ID=72753040

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/073322 WO2021190115A1 (zh) 2020-03-25 2021-01-22 检索目标的方法和装置

Country Status (4)

Country Link
US (1) US20230005178A1 (zh)
EP (1) EP4131030A4 (zh)
CN (1) CN111782921A (zh)
WO (1) WO2021190115A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114140802A (zh) * 2022-01-29 2022-03-04 北京易真学思教育科技有限公司 一种文本识别方法、装置、电子设备和存储介质
CN114155417A (zh) * 2021-12-13 2022-03-08 中国科学院空间应用工程与技术中心 图像目标的识别方法、装置、电子设备及计算机存储介质
CN114417046A (zh) * 2022-03-31 2022-04-29 腾讯科技(深圳)有限公司 特征提取模型的训练方法、图像检索方法、装置及设备
US11397890B2 (en) * 2017-04-10 2022-07-26 Peking University Shenzhen Graduate School Cross-media retrieval method based on deep semantic space
CN116416440A (zh) * 2023-01-13 2023-07-11 北京百度网讯科技有限公司 目标识别方法、模型训练方法、装置、介质和电子设备
CN116630868A (zh) * 2023-07-26 2023-08-22 上海蜜度信息技术有限公司 视频分类方法、视频分类装置、介质及电子设备

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111782921A (zh) * 2020-03-25 2020-10-16 北京沃东天骏信息技术有限公司 检索目标的方法和装置
CN112270163B (zh) * 2020-12-07 2021-09-10 北京沃东天骏信息技术有限公司 一种文本生成方法及装置、存储介质
CN113591839B (zh) * 2021-06-28 2023-05-09 北京有竹居网络技术有限公司 一种特征提取模型构建方法、目标检测方法及其设备
US20230074950A1 (en) * 2021-08-24 2023-03-09 Nvidia Corporation Object characterization using one or more neural networks
CN114120412B (zh) * 2021-11-29 2022-12-09 北京百度网讯科技有限公司 图像处理方法和装置
CN115908879B (zh) * 2023-03-09 2023-06-16 中国科学技术大学 基于点引导注意力机制的自适应局部图像特征匹配方法
CN117093692A (zh) * 2023-08-23 2023-11-21 广东技术师范大学 一种基于深度融合的多粒度图像-文本匹配方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008217428A (ja) * 2007-03-05 2008-09-18 Fujitsu Ltd 画像検索プログラム、方法及び装置
CN108319686A (zh) * 2018-02-01 2018-07-24 北京大学深圳研究生院 基于受限文本空间的对抗性跨媒体检索方法
CN109783657A (zh) * 2019-01-07 2019-05-21 北京大学深圳研究生院 基于受限文本空间的多步自注意力跨媒体检索方法及系统
CN110765305A (zh) * 2019-10-23 2020-02-07 深圳报业集团 媒介信息推送系统及其基于视觉特征的图文检索方法
CN111782921A (zh) * 2020-03-25 2020-10-16 北京沃东天骏信息技术有限公司 检索目标的方法和装置

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100388282C (zh) * 2006-09-14 2008-05-14 浙江大学 基于多模态信息融合分析的跨媒体检索方法
WO2013159356A1 (zh) * 2012-04-28 2013-10-31 中国科学院自动化研究所 基于判别相关分析的跨媒体检索方法
CN106095893B (zh) * 2016-06-06 2018-11-20 北京大学深圳研究生院 一种跨媒体检索方法
CN106202413B (zh) * 2016-07-11 2018-11-20 北京大学深圳研究生院 一种跨媒体检索方法
CN106547826A (zh) * 2016-09-30 2017-03-29 西安电子科技大学 一种跨模态检索方法、装置及计算机可读介质
CN108694200B (zh) * 2017-04-10 2019-12-20 北京大学深圳研究生院 一种基于深度语义空间的跨媒体检索方法
CN109213876B (zh) * 2018-08-02 2022-12-02 宁夏大学 基于生成对抗网络的跨模态检索方法
CN109299216B (zh) * 2018-10-29 2019-07-23 山东师范大学 一种融合监督信息的跨模态哈希检索方法和系统
CN110147457B (zh) * 2019-02-28 2023-07-25 腾讯科技(深圳)有限公司 图文匹配方法、装置、存储介质及设备
CN110059217B (zh) * 2019-04-29 2022-11-04 广西师范大学 一种两级网络的图像文本跨媒体检索方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008217428A (ja) * 2007-03-05 2008-09-18 Fujitsu Ltd 画像検索プログラム、方法及び装置
CN108319686A (zh) * 2018-02-01 2018-07-24 北京大学深圳研究生院 基于受限文本空间的对抗性跨媒体检索方法
CN109783657A (zh) * 2019-01-07 2019-05-21 北京大学深圳研究生院 基于受限文本空间的多步自注意力跨媒体检索方法及系统
CN110765305A (zh) * 2019-10-23 2020-02-07 深圳报业集团 媒介信息推送系统及其基于视觉特征的图文检索方法
CN111782921A (zh) * 2020-03-25 2020-10-16 北京沃东天骏信息技术有限公司 检索目标的方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4131030A4

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11397890B2 (en) * 2017-04-10 2022-07-26 Peking University Shenzhen Graduate School Cross-media retrieval method based on deep semantic space
CN114155417A (zh) * 2021-12-13 2022-03-08 中国科学院空间应用工程与技术中心 图像目标的识别方法、装置、电子设备及计算机存储介质
CN114140802A (zh) * 2022-01-29 2022-03-04 北京易真学思教育科技有限公司 一种文本识别方法、装置、电子设备和存储介质
CN114417046A (zh) * 2022-03-31 2022-04-29 腾讯科技(深圳)有限公司 特征提取模型的训练方法、图像检索方法、装置及设备
CN116416440A (zh) * 2023-01-13 2023-07-11 北京百度网讯科技有限公司 目标识别方法、模型训练方法、装置、介质和电子设备
CN116416440B (zh) * 2023-01-13 2024-02-06 北京百度网讯科技有限公司 目标识别方法、模型训练方法、装置、介质和电子设备
CN116630868A (zh) * 2023-07-26 2023-08-22 上海蜜度信息技术有限公司 视频分类方法、视频分类装置、介质及电子设备
CN116630868B (zh) * 2023-07-26 2023-11-14 上海蜜度信息技术有限公司 视频分类方法、视频分类装置、介质及电子设备

Also Published As

Publication number Publication date
EP4131030A4 (en) 2024-03-27
US20230005178A1 (en) 2023-01-05
EP4131030A1 (en) 2023-02-08
CN111782921A (zh) 2020-10-16

Similar Documents

Publication Publication Date Title
WO2021190115A1 (zh) 检索目标的方法和装置
US11205100B2 (en) Edge-based adaptive machine learning for object recognition
WO2020006961A1 (zh) 用于提取图像的方法和装置
US20210264227A1 (en) Method for locating image region, model training method, and related apparatus
JP2020135852A (ja) 画像に基づくデータ処理方法、装置、電子機器、コンピュータ可読記憶媒体およびコンピュータプログラム
CN108334627B (zh) 新媒体内容的搜索方法、装置和计算机设备
WO2022257578A1 (zh) 用于识别文本的方法和装置
CN111666416B (zh) 用于生成语义匹配模型的方法和装置
US20230010160A1 (en) Multimodal data processing
CN111062871A (zh) 一种图像处理方法、装置、计算机设备及可读存储介质
CN109582880A (zh) 兴趣点信息处理方法、装置、终端及存储介质
WO2023020005A1 (zh) 神经网络模型的训练方法、图像检索方法、设备和介质
CN111784776B (zh) 视觉定位方法及装置、计算机可读介质和电子设备
KR20200109239A (ko) 이미지를 처리하는 방법, 장치, 서버 및 저장 매체
WO2023065731A1 (zh) 目标地图模型的训练方法、定位方法及相关装置
US11030726B1 (en) Image cropping with lossless resolution for generating enhanced image databases
CN111539903B (zh) 训练人脸图像合成模型的方法和装置
KR20230004391A (ko) 비디오 처리 방법 및 장치, 비디오 조회 방법 및 장치, 비디오 처리 모델의 트레이닝 방법 및 장치, 전자장비, 저장매체 및 컴퓨터 프로그램
CN110263218B (zh) 视频描述文本生成方法、装置、设备和介质
CN112766284B (zh) 图像识别方法和装置、存储介质和电子设备
CN113254716B (zh) 视频片段检索方法、装置、电子设备和可读存储介质
CN112182255A (zh) 用于存储媒体文件和用于检索媒体文件的方法和装置
WO2021104274A1 (zh) 图文联合表征的搜索方法、系统、服务器和存储介质
CN117033609B (zh) 文本视觉问答方法、装置、计算机设备和存储介质
WO2023130925A1 (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: 21774930

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2021774930

Country of ref document: EP

Effective date: 20221025