A cross-modal unstructured data retrieval method based on graph embedding

By constructing k-nearest neighbor graphs within image and text modalities, performing graph convolution aggregation, and constructing cross-modal association graphs, the problem of insufficient intra-modal semantic association and global topological information mining in traditional cross-modal retrieval methods is solved, achieving high-quality cross-modal retrieval results.

CN123138488APending Publication Date: 2026-11-20CHANGSHA ZHIXIN WORKSHOP TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611657755.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-26
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Traditional cross-modal retrieval methods cannot effectively mine the neighborhood semantic associations between samples within a modality and the global topological structure information between samples across modalities, resulting in insufficient semantic distinguishability of common representations and difficulty in meeting the retrieval accuracy and recall requirements of complex semantic scenarios.

Method used

A cross-modal unstructured data retrieval method based on graph embedding is adopted. By constructing k-nearest neighbor graphs in image and text modalities, graph convolution is performed to aggregate neighborhood structure information. Combined with the semantic relationship of graph-text pairing, a cross-modal association graph is constructed. Graph convolution propagation operation with shared semantic embedding is performed to extract multi-scale salient regions of images and fine-grained features at the word level of text. Global semantic calibration and local semantic aggregation are performed to achieve adaptive calculation of cross-modal association weights.

Benefits of technology

It significantly improves the semantic distinguishability and initial alignment accuracy of public representations, enhances the adaptability to complex semantic scenarios and the accuracy of fine-grained retrieval tasks, and improves the recall and ranking accuracy of bidirectional image and text retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123138488A_ABST
    Figure CN123138488A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of cross-modal retrieval, and specifically discloses a cross-modal unstructured data retrieval method based on graph embedding. The method first constructs an image k-neighbor graph and a text k-neighbor graph respectively, aggregates sample neighborhood structure information through graph convolution, and outputs two types of modality-specific embedding vector sets; secondly, a cross-modal correlation graph is built relying on paired image-text semantic labels, and unified sample-level graph embedding representation is generated through attention-weighted fusion; subsequently, an image region-text word fine-grained semantic graph is constructed to mine local semantic details and output enhanced fine-grained embedding; finally, a graph-text bidirectional semantic alignment channel is built through stacked cross-attention, coarse and fine two-level embedding features are fused to complete sample similarity measurement, and graph-text bidirectional retrieval ranking results are output. The application can effectively improve the semantic distinguishability and alignment accuracy of cross-modal representation, and is suitable for large-scale unstructured graph-text data bidirectional retrieval scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of cross-modal retrieval technology and relates to a cross-modal unstructured data retrieval method based on graph embedding. Background Technology

[0002] With the rapid development of digital media technology and the internet industry, the scale of unstructured data such as images and text is growing exponentially. Cross-modal retrieval, as a core technology for achieving multimodal data interconnection, supports bidirectional retrieval needs such as text-to-image and image-to-text searches, and has significant application value in many fields such as e-commerce product matching, digital content management, and public information services. The core objective of cross-modal retrieval is to bridge the heterogeneity gap between different modalities of data, learn a common representation space with semantic consistency, and thereby achieve accurate similarity measurement and ranking of cross-modal samples.

[0003] Traditional methods employ a global feature common subspace mapping scheme. First, global low-level feature vectors of image and text samples are extracted separately through pre-trained deep neural networks. Then, modality-specific projection matrices are trained based on the pairwise semantic matching labels provided in the dataset. This maps the two types of heterogeneous features to a common semantic space of the same dimension. Finally, the similarity of cross-modal samples is calculated using a distance metric function within the common space, and retrieval ranking results are generated.

[0004] However, traditional methods only focus on semantic mapping learning around the global features of a single sample, which cannot effectively mine the neighborhood semantic associations between samples within a modality and the global topological structure information between samples across modalities. As a result, the generated public representations have insufficient semantic discriminativeness and poor adaptability to complex semantic scenarios. Ultimately, the retrieval accuracy and recall rate are difficult to achieve the expected results in fine-grained retrieval needs and large-scale dataset scenarios. Summary of the Invention

[0005] In view of the problems existing in the prior art, the present invention provides a cross-modal unstructured data retrieval method based on graph embedding to solve the above-mentioned technical problems.

[0006] To achieve the above and other objectives, the technical solution adopted by the present invention is as follows: This invention provides a cross-modal unstructured data retrieval method based on graph embedding, which includes the following steps: Step S1: Perform format standardization on image samples and word segmentation encoding preprocessing on text samples from the original unstructured dataset. Generate original feature vectors for images and text respectively through feature extraction. Input the two types of feature vectors into the FPGA graph convolution computing unit, construct the k-nearest neighbor graph within the image and text modal using Euclidean distance as the metric, aggregate neighborhood structure information through graph convolution to complete the intra-modal feature enhancement, and output image and text modal-specific embedding vector sets.

[0007] Step S2: The two types of modality-specific embedding vector sets, along with the image-text pairing semantic matching labels, are fed into the multi-core DSP cross-modal graph convolution acceleration module. Based on the image-text pairing semantic relationship, a cross-modal association graph is constructed. The graph convolution propagation operation of the shared semantic embedding is performed, and a unified sample-level graph embedding representation is generated by attention-weighted fusion.

[0008] Step S3: Based on the original image pixel data and text segmentation sequence, extract multi-scale salient region features of the image and word-level semantic features of the text. Use the unified sample-level graph embedding representation as the global semantic prior to complete the fine-grained feature semantic calibration. Input the calibrated fine-grained features into the graph neural network acceleration card to construct fine-grained semantic graphs of image regions and text words and complete local semantic aggregation. Output the enhanced fine-grained image region embedding and text word embedding.

[0009] Step S4: Input the unified sample-level graph embedding representation and two types of enhanced fine-grained embeddings into the tensor acceleration unit to build a bidirectional semantic alignment path between graph and text to complete the adaptive calculation of cross-modal association weights; fuse global coarse-grained and local fine-grained two-level embedding features to complete the sample similarity measurement and output the bidirectional graph-text retrieval ranking results.

[0010] Another aspect of the present invention provides a cross-modal unstructured data retrieval device based on graph embedding, including a processor, a memory, and a communication bus; The memory stores a computer-readable program that can be executed by the processor; The communication bus enables communication between the processor and the memory; When the processor executes the computer-readable program, it performs steps in the graph embedding-based cross-modal unstructured data retrieval method as described in any one of the present invention.

[0011] As described above, the cross-modal unstructured data retrieval method based on graph embedding provided by the present invention has at least the following beneficial effects: This invention employs a global graph embedding construction method that combines intra-modal k-nearest neighbor graph aggregation with cross-modal heterogeneous graph fusion. It constructs k-nearest neighbor graphs within both image and text modalities to aggregate neighborhood structure information. Based on image-text paired semantic tags, it builds a cross-modal association heterogeneous graph to achieve bidirectional semantic propagation. Attention-weighted fusion then generates a unified sample-level graph embedding representation. The advantages of this method lie in its ability to overcome the limitations of traditional cross-modal retrieval methods that only perform semantic mapping around single-sample global features. It effectively mines intra-modal neighborhood semantic associations and cross-modal global topological structure information, significantly improving the semantic discriminative power and initial alignment accuracy of common representations, and providing a high-quality global feature foundation for cross-modal retrieval on large-scale datasets.

[0012] This invention employs a fine-grained semantic graph feature enhancement method guided by global semantic priors. It extracts multi-scale salient regions from images and word-level fine-grained features from text. Using unified sample-level graph embedding as the global semantic benchmark, it calibrates these fine-grained features. Furthermore, it constructs fine-grained semantic graphs of regions and words and performs local semantic aggregation and residual enhancement through graph convolution. The advantages of this method lie in its ability to overcome the shortcomings of traditional global features in depicting local semantic details, effectively weakening semantic interference from background regions and noise such as function words, fully exploring the inherent semantic dependencies between local elements, significantly enriching the fine-grained semantic information of features, and improving the model's adaptability to complex semantic scenarios and the accuracy of fine-grained retrieval tasks.

[0013] This invention employs a similarity measurement mechanism that combines coarse-grained and fine-grained feature bidirectional semantic alignment with weighted fusion. It establishes a bidirectional semantic alignment pathway between images and text through cross-attention to achieve fine-grained feature cross-modal matching. The final ranking result is output after weighted fusion of global coarse-grained similarity and local fine-grained similarity according to preset weights. The beneficial effects of this mechanism are that it solves the problems of limited accuracy in single-granularity feature matching and incomplete semantic coverage in unidirectional alignment. It takes into account both core topic matching and local detail verification, forming a complementary similarity measurement system. This effectively improves the recall and ranking accuracy of bidirectional image-text retrieval and is adaptable to various bidirectional retrieval scenarios involving large-scale unstructured image-text data. Attached Figure Description

[0014] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a schematic diagram showing the connections between the steps of the method of the present invention; Figure 2 This is the generation process of the global coarse-grained graph embedding representation of the present invention; Figure 3 This is a flowchart of the retrieval device of the present invention; Figure 4 This is a block diagram of the hardware system architecture of the present invention. Detailed Implementation

[0016] The following description, in conjunction with the implementation of this invention, is merely an example and illustration of the concept of this invention. Those skilled in the art can make various modifications or additions to the specific embodiments described, or use similar methods to replace them, as long as they do not deviate from the inventive concept or exceed the scope defined in these claims, all of which should fall within the protection scope of this invention.

[0017] Example 1: Please see Figure 1-2 As shown, a cross-modal unstructured data retrieval method based on graph embedding includes: Step S1: Perform format standardization on image samples and word segmentation encoding preprocessing on text samples from the original unstructured dataset. Generate original feature vectors for images and text respectively through feature extraction. Input the two types of feature vectors into the FPGA graph convolution computing unit, construct the k-nearest neighbor graph within the image and text modal using Euclidean distance as the metric, aggregate neighborhood structure information through graph convolution to complete the intra-modal feature enhancement, and output image and text modal-specific embedding vector sets.

[0018] Preferably, the step of connecting image samples from the original unstructured dataset of images and text to a CMOS image acquisition unit for format standardization and connecting text samples to a text parsing processor for word segmentation and encoding preprocessing includes the following specific steps: This method consists of two independent execution processes: an offline training phase and an online inference and retrieval phase. The offline training phase performs full-process network parameter learning and library sample feature pre-calculation based on a fully labeled image-text pairing dataset. The online inference and retrieval phase, for newly added unlabeled query samples, performs independent forward computation and similarity retrieval based on the trained fixed parameters, without relying on image-text pairing labels or full graph structure reconstruction.

[0019] In one specific embodiment, the CMOS image acquisition unit performs size normalization, linear scaling of pixel values ​​to the [0,1] range, and three-channel alignment correction on the input image sample, and outputs a uniform RGB pixel matrix to eliminate differences in image size and color gamut. The text parsing processor performs word segmentation, stop word filtering, and special character removal on the input text samples. Then, it maps each word to a fixed-length vector using a pre-trained word vector matrix, generating a word embedding sequence corresponding to the text length, thus completing the structured encoding preprocessing of the text.

[0020] Size normalization employs bilinear interpolation to uniformly scale all images to 224×224 pixels, balancing feature extraction accuracy and computational efficiency. Three-channel alignment correction uses the sRGB standard color gamut as a benchmark to calibrate the mean grayscale value of each channel, correcting color deviations caused by different acquisition devices. In the text processing stage, stop word filtering uses a universal stop word list for the corresponding language to remove function words and punctuation marks that do not contribute semantically. Pre-trained word vectors can be either 300-dimensional GloVe vectors or 768-dimensional BERT basic word embeddings, depending on the task scenario, ensuring that the word vectors possess universal semantic prior knowledge. Text samples with insufficient length are padded with zero vectors, and samples exceeding the length threshold are truncated to ensure that all word embedding sequences have uniform length, adapting to subsequent batch parallel computing requirements.

[0021] Preferably, the two types of preprocessed data are simultaneously fed into a GPU feature extraction accelerator card to generate original image feature vectors and original text feature vectors, respectively. The image and text feature vectors are then fed into an FPGA graph convolution calculation unit to construct k-nearest neighbor graphs within the image and text modalities using Euclidean distance as a metric. This process aggregates neighborhood structure information and enhances intra-modal features, outputting image modality-specific embedding vector sets and text modality-specific embedding vector sets. The specific steps include the following: In one specific embodiment, the GPU feature extraction accelerator card calls a ResNet-101 convolutional neural network pre-trained on ImageNet to perform global feature extraction on the standardized image and outputs the original global feature vector of the image with consistent dimensions; it calls a pre-trained BERT language model to perform global semantic encoding on the text word embedding sequence and outputs the original global feature vector of the text. The FPGA graph convolution computation unit calculates the Euclidean distance between all pairs of samples, and selects the k nearest neighbors for each sample. If multiple samples have the same Euclidean distance as the current sample and are at the kth critical position, they are selected sequentially in ascending order of their globally unique IDs until the total number of nearest neighbors reaches k. Undirected k-nearest neighbor graphs are constructed for the image modality and the text modality respectively, generating the corresponding symmetric adjacency matrices. The two-layer graph convolutional neural network adopts a standardized graph convolutional network architecture. The image modality and the text modality share an isomorphic network design but use their own independent trainable parameters. Each layer performs symmetric normalization with self-loops. The operation process includes five steps: neighborhood feature aggregation, linear mapping, batch normalization, nonlinear activation, and Dropout regularization. The specific structural parameters are as follows: The first layer, a graph convolutional layer, is a dimensionality reduction encoding layer used for semantic condensation and preliminary aggregation of neighborhood information from the original high-dimensional features. Its input feature dimension is 2048, corresponding to the dimension of the original global feature vector, and the input feature matrix size is N×2048, where N is the total number of samples within a single modality. The trainable weight matrix size is 2048×1024, with an accompanying 1024-dimensional bias vector, mapping the feature dimension to a 1024-dimensional intermediate space. The output feature matrix size is N×1024. This layer enables batch normalization, performing distribution normalization on the linearly mapped features to eliminate feature scale differences between samples and improve training convergence stability. The activation function uses the tanh hyperbolic tangent function, introducing non-linear modeling capabilities to the network. Dropout regularization is enabled, with a neuron dropout rate set to 0.3, randomly deactivating some feature nodes to suppress network overfitting and improve model generalization ability.

[0022] The second graph convolutional layer is the embedding generation layer, used to further fuse high-order neighborhood information and generate the final modality-specific embedding. Its input feature dimension is 1024, corresponding to the output dimension of the first layer, with an input feature matrix size of N×1024; the trainable weight matrix size is 1024×K, accompanied by a K-dimensional bias vector, where K is the preset common semantic embedding dimension, which is 1024 in this embodiment; the output feature matrix size is N×K, which is the final modality-specific embedding vector set. This layer also uses batch normalization to ensure the stability of the output feature distribution; the activation function uses the tanh hyperbolic tangent function to constrain the output feature values ​​within the [-1,1] interval, eliminating differences in feature magnitude between modalities; the Dropout regularization mechanism is enabled, with the neuron dropout rate set to 0.2, reducing the dropout ratio compared to the first layer to avoid losing core semantic information.

[0023] In terms of parameter count, taking a common embedding dimension K=1024 as an example, the trainable parameters of a two-layer graph convolution in a single modality include the weight matrix, bias vector, and two layers of batch-normalized scaling and offset parameters. Specifically, the first layer has 2048×1024+1024+1024×2=2100224 trainable parameters; the second layer has 1024×1024+1024+1024×2=1051648 trainable parameters; the total number of parameters for the single-modality network is approximately 3.152 million, and the combined total number of parameters for the image and text bimodal networks is approximately 6.304 million. This parameter count is lightweight and suitable for deployment scenarios with limited computing power, such as FPGAs and edge computing.

[0024] ResNet-101, based on a residual convolutional architecture, underwent supervised pre-training on millions of ImageNet samples, demonstrating general visual feature extraction capabilities. This approach fixes the parameters of its bottom convolutional layers, retaining only the top-level feature output path, balancing feature generalization and computational efficiency. During forward propagation, the normalized RGB pixel matrix extracts multi-scale features through five sets of residual convolutional modules, outputting a 7×7×2048 spatial feature map in the fifth set. Global average pooling then aggregates the channel spatial information, ultimately outputting a 2048-dimensional original global feature vector. This dimension was chosen because it corresponds to the deepest channel number in the network, containing rich high-level semantic information while avoiding the parameter inflation and overfitting risks associated with additional fully connected layers, achieving an optimal balance between representational capability and computational efficiency.

[0025] For text modality feature extraction, the BERT language model employs a 12-layer Transformer encoder architecture, pre-trained on a large-scale general corpus, and possesses bidirectional contextual semantic modeling capabilities. After the input text is constructed using word embedding sequences, a special CLS marker is appended to the beginning of the sequence. This marker is designed during pre-training as a classification vector aggregating the semantic information of the entire sentence; therefore, the 768-dimensional vector corresponding to the CLS marker in the Transformer encoder output layer is taken as the initial global semantic feature of the text. To eliminate the dimensionality difference between image and text modalities and provide a unified feature scale for subsequent graph convolution calculations, a linear fully connected layer is set to map the dimensions of the text features. The calculation process can be represented as follows: ; in, This is the initial feature vector of the text output by BERT. This is the trainable weight matrix for the fully connected layer. For the corresponding bias vector, This is the original global feature vector of the text after dimension mapping. The above text features are first upscaled to 2048 dimensions, and then encoded through a two-layer graph convolutional encoding path to progressively reduce dimensionality. This approach achieves three technical benefits: First, it achieves isomorphic input dimensions for modalities, ensuring consistency in graph convolution operations. The original global features output by ResNet-101 for the image modality are naturally 2048 dimensions, while the CLS label features output by the BERT base model for the text modality are only 768 dimensions. After dimensionality alignment through fully connected layers, the input feature dimensions of the two modalities are completely matched. Subsequent intra-modal graph convolutions can use a completely isomorphic network structure and weight dimensions, eliminating the need to customize low-dimensional operators for the text modality. This simplifies the hardware operation logic of the FPGA graph convolutional computation unit and ensures that the aggregation intensity of neighborhood information between the two modalities is on the same order of magnitude, avoiding feature distribution imbalance between modalities caused by dimensionality differences.

[0026] Secondly, it expands the semantic representation space to supplement the discriminative information required for cross-modal alignment. The 768-dimensional features output by BERT are designed for pre-training on general natural language understanding tasks, with semantic emphasis on internal textual contextual dependencies and limited capacity to map visual semantics. The dimensionality-upgrading transformation expands the feature space to 2048 dimensions, allowing the learning of text representation directions that adapt to visual semantics through trainable projection parameters. This supplements the visual attribute semantic information required for alignment with image features, enhances the cross-modal semantic carrying capacity of text features, and provides a richer semantic foundation for subsequent neighborhood aggregation in graph convolution.

[0027] Third, a coding structure of dimensionality enhancement and dimensionality reduction is formed to balance representation accuracy and retrieval efficiency. The high-dimensional features after dimensionality enhancement contain some redundant noise. They are reduced to the target embedding dimension through two layers of graph convolution. This allows for semantic refinement during the aggregation of neighborhood information and the filtering of invalid information. At the same time, the final embedding dimension can be controlled within a reasonable range to avoid the expansion of vector retrieval computation and storage overhead caused by excessive dimensionality. Without increasing the computational burden of online retrieval, the semantic richness of intermediate features and the graph convolution aggregation effect are improved, taking into account both representational discriminability and the real-time performance of large-scale retrieval.

[0028] The construction of the intramodal k-nearest neighbor graph uses the Euclidean distance of sample features as a similarity measure. It iterates through all sample pairs in the dataset to calculate the feature distance between each pair. The formula for calculating the Euclidean distance is: ; in, Let represent the Euclidean distance between the i-th sample and the j-th sample, and d be the dimension of the feature vector. Let m be the value of the m-th dimension of the feature vector of the i-th sample. Let be the m-th dimension of the feature vector of the j-th sample. A smaller distance value indicates higher semantic similarity between two samples, and vice versa. For each sample, all other samples are sorted in ascending order of distance. The k samples with the smallest distances are selected as the nearest neighbors of that node, and their corresponding positions in the adjacency matrix are assigned a value of 1, while the remaining non-nearest neighbor positions are assigned a value of 0. This process ultimately generates a symmetric undirected k-nearest neighbor graph adjacency matrix. , where N is the total number of samples.

[0029] The nearest neighbor number k was set to 20. This value was verified through comparative experiments on two cross-modal retrieval standard datasets, MS-COCO and Flickr30K. The experiments used the mean accuracy (mAP@10) as the core evaluation metric. The test was performed within the range of values. Experimental results show that when... At that time, the average mAP for bidirectional image and text retrieval in both datasets reached its peak, compared to The increase was 4.2% compared to the previous period. The time efficiency was improved by 1.8%; at the same time, the time consumption per round of graph convolution operation was reduced. It reduces the density by 27%, which can control the sparsity of the graph structure while ensuring the integrity of the semantic information of the neighborhood, thus balancing the feature enhancement effect and computational efficiency.

[0030] Before graph convolution, symmetric normalization is performed on the adjacency matrix to eliminate the feature scale imbalance caused by differences in node degree, and to prevent nodes with high degree from having excessive weight during feature aggregation. The normalization process first adds an identity matrix to the adjacency matrix to introduce self-loop connections, ensuring that node features participate in aggregation. Then, the degree matrix is ​​constructed and normalization is performed. The complete calculation formula is: ; in, is the identity matrix, used to implement self-joins of nodes, preserving their own characteristic information; D is the degree matrix corresponding to the adjacency matrix after adding self-loops, and is a diagonal matrix, with elements on the diagonal... Equal to the range from j=1 to N The summation result represents the degree of the i-th node. The entire normalization operation is based on the degree matrix after adding the self-loop. The negative 1 / 2 power of D is the negative 1 / 2 power of the degree matrix after adding the self-loop. It is also a diagonal matrix, and the diagonal elements are the negative 1 / 2 power of the degree of the corresponding node. This is the final symmetric normalized adjacency matrix. This normalization method is the standard symmetric normalization scheme for graph convolutional networks, which can normalize the degree of both source and target nodes simultaneously, keeping the aggregated feature values ​​within a stable distribution range and improving the convergence speed and stability of network training.

[0031] The feature aggregation process in the two-layer graph convolutional neural network is performed layer by layer. Each graph convolution layer performs weighted aggregation of neighborhood information based on a normalized adjacency matrix, and implements feature dimension transformation and nonlinear activation through a trainable weight matrix. The input of the first graph convolution layer is the feature matrix composed of the original feature vectors. The output dimension is 1024, and the calculation formula is: ; in, The trainable weight matrix for the first layer of graph convolution is used to map the 2048-dimensional input features to a 1024-dimensional intermediate feature space. The hyperbolic tangent activation function is used to introduce nonlinear transformation capabilities into the network, enhancing its ability to model complex semantic structures. The first layer reduces the feature dimension to 1024 dimensions, aiming to semantically condense the original high-dimensional features, filter redundant information, and reduce the computational cost of the second layer's graph convolution. The second layer's graph convolution takes the output of the first layer as input, further mapping the feature dimension to a preset common semantic embedding dimension K, calculated as follows: ; in, The trainable weight matrix for the second-layer graph convolution is denoted by K, which is a preset common semantic embedding dimension, ranging from 256 to 2048. Dimensions below 256 are insufficient for feature representation, unable to handle complex cross-modal semantic information, leading to a significant decrease in retrieval accuracy. Dimensions above 2048 show a linear increase in parameter quantity and storage overhead, and are prone to overfitting, resulting in minimal marginal benefits for accuracy improvement. In this embodiment, 1024 is used. This value was determined based on a dimensionality comparison experiment using the MS-COCO dataset. The experimental settings are as follows: Six control groups, results showed Time-based mAP retrieval An increase of 5.1%, compared to It is only 0.9% lower, but the number of model parameters is reduced by 48% and the inference speed is improved by 39%. It can achieve the best balance between semantic representation ability and computational storage overhead, and is on the same order of magnitude as fine-grained feature dimensions, ensuring the numerical stability of subsequent cross-modal alignment and feature fusion. The final output modality-specific embedding vector sets are obtained, corresponding to image modality and text modality, respectively. The second activation function also uses the tanh function, which strictly constrains the values ​​of the output features to a certain range. Within the interval, maintaining a consistent distribution of feature values ​​across different modalities eliminates the interference of magnitude differences on subsequent cross-modal similarity calculations, thereby improving the stability and retrieval accuracy of cross-modal semantic alignment. A two-layer graph convolution structure is the optimal choice, validated through ablation experiments. Single-layer graph convolution has limited neighborhood information aggregation range and insufficient feature enhancement, while three or more layers of graph convolution are prone to over-smoothing, leading to homogenization of features across different nodes and loss of discriminability.

[0032] The FPGA graph convolution computation unit is developed based on the Xilinx Virtex-7 series FPGA platform. It features hardware-level customized acceleration for sparse matrix multiplication operations in graph convolution, employing a block-parallel matrix operation architecture. This architecture divides the large-scale feature matrix and adjacency matrix into 64×64 computational sub-blocks, which are then distributed to 128 parallel DSP computing units within the FPGA for simultaneous execution, fully utilizing the FPGA's parallel computing resources. Under this architecture, the multiplication operation between the adjacency matrix and the feature matrix can be pipelined, achieving an overall computational efficiency improvement of over 5 times compared to the serial computation mode of a general-purpose CPU with the same clock frequency. Simultaneously, memory access overhead is reduced by over 60%, enabling graph convolution operations with hundreds of thousands of samples to be completed in seconds, meeting the real-time processing requirements of large-scale cross-modal retrieval datasets.

[0033] This unit is equipped with a large-capacity on-chip SRAM cache, where intermediate feature data is preferentially processed within the on-chip cache, and only the final output modality is embedded and transmitted across chips. It also supports batch sample pipeline processing, where the next batch of samples can be loaded synchronously while the previous batch of samples is performing graph convolution operations, masking data transmission latency and further improving overall throughput.

[0034] Throughout the feature extraction and graph convolution enhancement process, all image and text samples are bound to a unique global sample ID from the input stage. This ID is transmitted throughout the data flow through all processing modules and is simultaneously attached to the output feature vector. The ID matching mechanism achieves one-to-one alignment between image and text samples, ensuring accurate sample pairing in subsequent cross-modal interaction and hash learning stages, and avoiding cross-modal semantic misalignment caused by data disorder.

[0035] Step S2: The two types of modality-specific embedding vector sets, along with the image-text pairing semantic matching labels, are fed into the multi-core DSP cross-modal graph convolution acceleration module. Based on the image-text pairing semantic relationship, a cross-modal association graph is constructed. The graph convolution propagation operation of the shared semantic embedding is performed, and a unified sample-level graph embedding representation is generated by attention-weighted fusion.

[0036] Preferably, the step of feeding the image modality-specific embedding vector set, the text modality-specific embedding vector set, and the pairwise semantic matching labels that come with the original unstructured image and text datasets into the multi-core DSP cross-modal graph convolution acceleration module, constructing a cross-modal association graph based on the image-text pairing semantic relationship, and performing graph convolution propagation operation with shared semantic embeddings includes the following specific steps: In one specific embodiment, the multi-core DSP cross-modal graph convolution acceleration module establishes cross-modal connections between image nodes and text nodes under the same semantic topic based on image-text pair semantic matching tags; and combines the image modality intra-adjacency matrix and the text modality intra-adjacency matrix to construct a cross-modal heterogeneous graph adjacency matrix containing the two types of nodes. Image modality-specific embeddings and text modality-specific embeddings are used as the initial features of the corresponding nodes and input into the cross-modal graph convolutional network. Through graph convolution operations, the aggregation of neighborhood information within the modality and the bidirectional propagation of semantic information between modalities are realized, and cross-modal shared semantic embeddings are learned, in which image nodes and text nodes complete the initial alignment in the shared semantic space.

[0037] Image-text pair semantic matching labels are derived from the natural one-to-one correspondence between images and text in the dataset. Each sample contains an image and a descriptive text. The two share the same semantic label and global sample ID. The image node and text node corresponding to the same global sample ID have a semantic equivalence relationship. Based on this, cross-modal edges can be established to ensure the semantic accuracy of cross-modal information transmission.

[0038] The cross-modal heterogeneous graph contains a total of Each node, before Each node corresponds to one of the data sets. Image samples, then Each node corresponds to 1 text sample; the adjacency matrix of the graph is of size 1. A symmetric matrix is ​​formed by concatenating four submatrices, and its construction formula is: ; in, The adjacency matrix of the k-nearest neighbor graph within the image modality generated in step S1 is used to preserve the local neighborhood structure information within the image modality; The adjacency matrix of the k-nearest neighbor graph generated in step S1 is used to preserve the local neighborhood structure information within the text modality; For the cross-modal correlation matrix, if the th The image sample and the first If multiple text samples share the same semantic label and have a semantic matching relationship, then the matrix elements... Otherwise, the value is 0.

[0039] In a dataset setting where images and text are paired one-to-one, ,at this time The identity matrix represents the condition where cross-modal connections exist only between image and text samples with the same ID. The total number of nodes in the heterogeneous graph is [value missing]. The adjacency matrix dimension degenerates to For common scenarios where multiple texts correspond to a single image or multiple images correspond to a single text, For generalization A two-part adjacency matrix can establish many-to-many cross-modal connections based on shared semantic categories.

[0040] Semantic categories are defined using the second-level category granularity of the hierarchical semantic annotations provided in the dataset. The edge-connection rule is as follows: if an image node and a text node belong to the same second-level semantic category, a cross-modal edge is established, and the corresponding adjacency matrix element is set to 1; otherwise, it is set to 0. For unlabeled scenarios, the same edge-connection rule can be applied based on the category labels generated by the K-means clustering described above. Shared semantic categories can be directly obtained through the hierarchical semantic annotations provided in the dataset, or K-means unsupervised clustering can be performed on the intra-modal global features output in step S1, with the generated cluster labels used as alternative semantic categories. Euclidean distance is used as the similarity metric for clustering. The initial cluster centers are selected using the K-means++ algorithm to avoid local optima. The iteration termination condition is set to the cluster center offset being less than 1 for two consecutive iterations. Or reach the maximum number of iterations of 100; the number of clusters K is determined by the elbow rule combined with the size of the dataset. For datasets with tens of thousands of samples, the value of K is usually set in the range of 50 to 200.

[0041] Before performing cross-modal graph convolution operations, the cross-modal adjacency matrix needs to undergo symmetric normalization processing consistent with step S1 to eliminate numerical scale bias caused by node degree differences and ensure the numerical stability of the feature aggregation process. The normalization formula is as follows: ; in, for An identity matrix of order 1 is used to introduce node self-connection, ensuring that the node's own features participate in information aggregation and avoiding the loss of its own semantic information during the neighborhood aggregation process; The degree matrix corresponding to the cross-modal adjacency matrix after adding self-loops is a diagonal matrix with diagonal elements. , indicating the first The degree of each node; It is the negative 1 / 2 power of the degree matrix, and it is also a diagonal matrix, with the diagonal elements being the negative 1 / 2 power of the degree of the corresponding node; This is the symmetrically normalized cross-modal adjacency matrix. In a one-to-one image-text pairing scenario... The identity matrix degenerates into The order is fully compatible with the original dimensional representation.

[0042] Cross-modal graph convolutional networks take the concatenated full-node feature matrix as input. The feature matrix is ​​constructed by stacking the image modality-specific embedding vector set and the text modality-specific embedding vector set along the sample dimension, i.e.: ; in The image modality-specific embedding vector set output in step S1, This is a text-specific embedding vector set. In a dataset setting with one-to-one image-text pairing, The stacked feature matrix has a dimension that degenerates to It strictly matches the dimensions of the adjacency matrix, and there is no issue of dimension inconsistency.

[0043] Cross-modal graph convolution employs a two-layer network structure to learn shared semantic embeddings. The first layer of graph convolution performs dimensionality upscaling on the features to enhance semantic representation capabilities and amplify semantic feature differences during cross-modal propagation. The calculation formula is as follows: ; in, The trainable weight matrix for the first layer of cross-modal graph convolution maps the feature dimension from K dimensions to 2K dimensions; It is a linear rectification activation function; This represents the output features of the first layer of graph convolution.

[0044] The second layer of graph convolution maps the feature dimension back to the original semantic embedding dimension, achieving the final alignment of the cross-modal semantic space sharing. The calculation formula is as follows: ; in, The trainable weight matrix for the second-layer cross-modal graph convolution maps the feature dimension from 2K dimensions back to K dimensions; The hyperbolic tangent activation function constrains the output features to the interval [-1, 1], ensuring the numerical stability of subsequent attention fusion operations.

[0045] For the final output of cross-modal graph convolution, it is split into pre- and post-convolutional parts based on node type. Actions and After The rows correspond to the cross-modal shared semantic embeddings of image nodes. Cross-modal sharing of semantic embeddings with text nodes Through information propagation via two layers of cross-modal graph convolution, text and graph nodes can bidirectionally aggregate semantic information from each other, completing preliminary semantic alignment in the shared feature space and partially eliminating feature distribution differences caused by modal heterogeneity.

[0046] Semantic categories are defined using the second-level category granularity of the hierarchical semantic annotations provided in the dataset. The edge-connection rule is as follows: if an image node and a text node belong to the same second-level semantic category, a cross-modal edge is established, and the corresponding adjacency matrix element is set to 1; otherwise, it is set to 0. For unlabeled scenarios, the same edge-connection rule can be applied based on the category labels generated by the K-means clustering described above. Shared semantic categories can be directly obtained through the hierarchical semantic annotations provided in the dataset, or K-means unsupervised clustering can be performed on the intra-modal global features output in step S1, with the generated cluster labels used as alternative semantic categories. Euclidean distance is used as the similarity metric for clustering. The initial cluster centers are selected using the K-means++ algorithm to avoid local optima. The iteration termination condition is set to the cluster center offset being less than 1 for two consecutive iterations. Or it can reach a maximum of 100 iterations; the number of clusters K is determined by the elbow rule combined with the dataset size. For datasets with tens of thousands of samples, the value of K is usually set to... Interval. The rule for determining the connection is: if the image node and the text node belong to the same semantic category, then a cross-modal connection is established, and the corresponding adjacency matrix element is set to 1; otherwise, it is set to 0.

[0047] For weakly supervised scenarios without category labeling, a global feature cosine similarity threshold of 0.5 can be set. This threshold is determined based on a common semantic matching benchmark in cross-modal retrieval, combined with comparative experimental results from two standard datasets: MS-COCO and Flickr30K. The cosine similarity value range is... A value of 0.5 corresponds to an angle of approximately 60° between the feature vector spaces, falling within the general empirical boundary between semantically related and semantically unrelated regions. Experiments were conducted to test... The edge-linking effect was evaluated using edge precision, recall, and final retrieval mAP as metrics: at a threshold of 0.5, the effective semantic edge-linking precision for cross-modal heterogeneous graphs reached 82.3%, the noise and pseudo-association filtering rate reached 75.6%, and the final retrieval mAP reached its peak; when the threshold was below 0.5, the recall increased but the precision decreased significantly, introducing a large number of erroneous edges; when the threshold was above 0.5, the precision increased but the recall was insufficient, resulting in inadequate semantic information propagation. Therefore, 0.5 was selected as the edge-linking decision threshold to achieve the optimal balance between sufficient information propagation and noise suppression effect.

[0048] When the original global feature similarity between an image node and a text node is higher than a certain threshold, cross-modal connections are established to ensure the full propagation of cross-modal semantic information. This is the final adjacency matrix of the cross-modal heterogeneous graph. Using this block-based concatenation method to construct the cross-modal graph allows for the establishment of information transmission pathways between nodes of different modalities through cross-modal edges, while preserving the semantic structure of the neighborhood within a single modality. This provides structural support for subsequent cross-modal semantic alignment.

[0049] Before performing cross-modal graph convolution operations, the cross-modal adjacency matrix needs to undergo symmetric normalization processing consistent with step S1 to eliminate numerical scale bias caused by node degree differences and ensure the numerical stability of the feature aggregation process. The normalization formula is as follows: ; in, It is a 2N-order identity matrix used to introduce node self-connection, ensuring that the node's own features participate in information aggregation and avoiding the loss of its own semantic information during the neighborhood aggregation process; The degree matrix corresponding to the cross-modal adjacency matrix after adding self-loops is a diagonal matrix with diagonal elements. , represents the degree of the i-th node, that is, the total number of edges directly connected to that node; It is the negative 1 / 2 power of the degree matrix, and it is also a diagonal matrix, with the diagonal elements being the negative 1 / 2 power of the degree of the corresponding node; This is the symmetrically normalized cross-modal adjacency matrix. This normalization method can simultaneously normalize the degrees of both the source and target nodes, ensuring that the aggregated feature values ​​remain within a stable distribution range, thus improving the convergence speed and stability of network training.

[0050] Cross-modal graph convolutional networks take the concatenated full-node feature matrix as input. The feature matrix is ​​constructed by stacking the image modality-specific embedding vector set and the text modality-specific embedding vector set along the sample dimension. ,in The image modality-specific embedding vector set output in step S1, The two embedding vector sets are text modality-specific, each with a dimension of N×K, and a total dimension of 2N×K after stacking. Cross-modal graph convolution employs a two-layer network structure to learn the shared semantic embeddings. The first layer of graph convolution performs a dimensionality increase transformation on the features to enhance semantic representation capabilities and amplify the semantic feature differences during cross-modal propagation. The calculation formula is as follows: ; in, The trainable weight matrix for the first layer of cross-modal graph convolution maps the feature dimension from K dimensions to 2K dimensions; It is a linear rectified activation function, which introduces nonlinear modeling capability into the network, and also has sparse activation characteristics, which can effectively alleviate the gradient vanishing problem; The output features of the first layer of graph convolution are shown. The second layer of graph convolution maps the feature dimension back to the original hash dimension, achieving the final alignment of the semantic space shared across modalities. The calculation formula is as follows: ; in, The trainable weight matrix for the second-layer cross-modal graph convolution maps the feature dimension from 2K dimensions back to K dimensions; The hyperbolic tangent activation function constrains the output features to the range [-1, 1], which is consistent with the numerical range of the modality-specific embedding, ensuring the numerical stability of subsequent attention fusion operations and improving the alignment accuracy of cross-modal shared semantic representations. The final output of the cross-modal graph convolution is split into the first N rows and the last N rows according to node type, which correspond to the cross-modal shared semantic embedding of image nodes, respectively. Cross-modal sharing of semantic embeddings with text nodes Through information propagation via two layers of cross-modal graph convolution, text and graph nodes can bidirectionally aggregate semantic information from each other, achieving preliminary semantic alignment in the shared feature space and partially eliminating feature distribution differences caused by modal heterogeneity. The reason for choosing a two-layer structure is that single-layer networks do not sufficiently transmit cross-modal information, resulting in limited modal alignment effects; three or more layers can easily lead to excessive homogenization of modal features, losing modality-specific discriminative information. A two-layer structure can achieve the optimal balance between sufficient information interaction and feature discriminativeness.

[0051] During the online inference retrieval phase, new query samples do not require the construction of a full cross-modal heterogeneous graph or the execution of full-graph convolutional propagation. After the query sample generates a modality-specific embedding in step S1, the cross-modal projection weight parameters learned during the offline training phase are directly called. A unified sample-level graph embedding representation of the query sample is calculated through a linear mapping and attention fusion network. This process relies only on the features of a single sample and pre-trained parameters, without the need to match the image-text pairing labels of the library samples or traverse the entire library to reconstruct the cross-modal graph structure.

[0052] The multi-core DSP cross-modal graph convolution acceleration module is built on the TITMS320C6678 octa-core DSP platform. It employs a multi-core parallel divide-and-conquer strategy to accelerate computation. The 2N×2N cross-modal adjacency matrix is ​​divided into four sub-blocks, which are then distributed across eight DSP cores for parallel matrix multiplication operations. Data exchange between different cores is achieved via an on-chip high-speed SRAM bus, avoiding redundant memory access overhead. Compared to the serial computation mode of a general-purpose CPU with the same power consumption, the multi-core DSP architecture improves the throughput of cross-modal graph convolution operations by more than four times and reduces power consumption by 60%, making it suitable for deployment requirements in large-scale cross-modal retrieval scenarios at the edge.

[0053] After the full cross-modal graph convolution operation is completed during the offline training phase, the learned projection weight parameters are permanently stored in on-chip non-volatile memory. During the online inference phase, the permanently stored parameters are directly called to perform single-sample feature mapping, eliminating the need to transport the full graph structure data across chips. Only single-sample feature vectors need to be transmitted, reducing PCIe bus data interaction by more than 90%. At the same time, the module adopts an interrupt aggregation mechanism to merge multiple data-ready interrupts into batch notifications, reducing operating system context switching overhead.

[0054] Preferably, the computation result is fed into a parallel computing accelerator card to complete attention-weighted fusion and generate a unified sample-level graph embedding representation, including the following specific steps: In one specific embodiment, the parallel computing accelerator card calculates the attention weight coefficients of two sets of features for each modality, using modality-specific embeddings and cross-modality shared semantic embeddings as inputs, through a single-layer feedforward sub-network and a Sigmoid activation function. Softmax normalization is performed on the attention weight coefficients to obtain the fusion ratio of modality-specific information and shared semantic information; weighted summation is performed on the modality-specific embedding and shared semantic embedding according to the weights to obtain the unified sample-level graph embedding representation of image and text modalities, respectively.

[0055] The attention-weighted fusion mechanism designs independent attention computation branches for image and text modalities. While both modalities share the same network structure, they use their own independent trainable parameters to adapt to the differences in feature distribution across modalities and ensure reasonable weight allocation. Taking the image modality as an example, the calculation of attention weights consists of two stages: raw score calculation and normalization. First, the image modality-specific embedding and the cross-modal shared semantic embedding are input into a single-layer feedforward sub-network. The raw attention score is obtained through their respective independent linear transformation parameters and a sigmoid activation function, calculated as follows: ; in, Let i be the image modality-specific embedding vector for the i-th sample. For images of corresponding samples, semantic embedding vectors are shared across modalities; , For the trainable weight vectors and bias terms of the modality-specific embedding branch, , It provides trainable weight vectors and bias terms for cross-modal shared semantic embedding branches; the two sets of parameters are independent of each other and are adaptively updated through backpropagation during network training. They can learn the contribution weights of the two types of features to the final representation separately, rather than the attention difference being determined solely by the numerical distribution of the input features. The Sigmoid activation function is used to map the linear transformation result to the (0,1) interval to obtain the original attention score; and The original attention scores are for modality-specific embeddings and shared semantic embeddings, respectively. Higher scores indicate a greater contribution of the corresponding feature to the final representation. A single-layer feedforward sub-network is used because the attention weights only need to learn the relative importance of the two types of features. A shallow network can meet the fitting requirements, while avoiding the risk of overfitting caused by introducing too many parameters and improving the model's generalization ability.

[0056] To ensure that the sum of the fusion weights for the two types of features is 1, satisfying the coefficient constraints of weighted fusion, the original attention scores are subjected to Softmax normalization to obtain the final fusion weight coefficients, calculated as follows: ; in, Fusion weights for image modality-specific embedding. For image cross-modal sharing of semantic embedding fusion weights, satisfying The constraints are defined. Softmax normalization converts the original scores into probabilistic weight proportions, making the fusion process interpretable. The model can adaptively adjust the contribution ratio of the two types of information according to the actual distribution of sample features, exhibiting stronger adaptability and feature representation flexibility compared to fixed-weight fusion methods.

[0057] The final image modality unified sample-level graph embedding representation is generated through a weighted summation method, which linearly weights and aggregates the two types of features according to their corresponding weights. The calculation formula is as follows: ; in, The image at the i-th sample level is represented by a unified sample-level graph embedding. This representation simultaneously integrates modality-specific detail discriminative information and cross-modal shared semantic information, significantly improving feature discriminability. The attention fusion process for the text modality is completely consistent with that for the image modality. Independent attention network parameters are used to calculate the fusion weights of the text modality-specific embedding and the text cross-modal shared semantic embedding, ultimately generating a unified sample-level graph embedding representation for the text. The two types of unified sample-level graph embeddings have consistent representation dimensions and semantic space alignment, providing a high-quality feature foundation for subsequent cross-modal hashing encoding.

[0058] The parallel computing accelerator card adopts the SIMD single instruction multiple data stream architecture to realize batch parallel computing of attention fusion. It processes the attention weight calculation and weighted summation operation of the entire batch of samples at one time, which improves the speed by an order of magnitude compared with serial computing per sample. It can efficiently complete feature fusion tasks with a sample scale of tens of thousands or more.

[0059] Step S3: Based on the original image pixel data and text segmentation sequence, extract multi-scale salient region features of the image and word-level semantic features of the text. Use the unified sample-level graph embedding representation as the global semantic prior to complete the fine-grained feature semantic calibration. Input the calibrated fine-grained features into the graph neural network acceleration card to construct fine-grained semantic graphs of image regions and text words and complete local semantic aggregation. Output the enhanced fine-grained image region embedding and text word embedding.

[0060] Preferably, the step of integrating the unified sample-level image embedding representation, original image pixel data, and original text segmentation sequence into the visual processing engine, extracting multi-scale salient region features of the image by the object detection acceleration subunit, and extracting word-level semantic features of the text by the NLP-specific acceleration subunit includes the following specific steps: In one specific embodiment, the object detection acceleration subunit of the visual processing engine calls the Faster R-CNN model pre-trained on the VisualGenome dataset to detect the top M most salient object regions in the input image and output the region bounding boxes and corresponding attribute labels. Visual features of each salient region are extracted using the ResNet-101 network, and semantic features of the corresponding attribute labels are extracted using the BERT model. The visual features of the regions and the semantic features of the labels are concatenated and fused to obtain the initial feature set of fine-grained regions of the image. The NLP-specific acceleration subunit calls the BERT pre-trained model to encode the text segmentation sequence word by word, generating initial word vectors at the word level; then the word vectors are input into the bidirectional gated recurrent unit Bi-GRU, which encodes the contextual semantic information of the words from the forward and backward directions respectively, and takes the average value of the bidirectional hidden states as the initial feature set of fine-grained text words. Using a unified sample-level graph embedding representation as the global semantic benchmark, a trainable linear projection layer is first used to map the initial 2816-dimensional image region features to a 1024-dimensional global semantic space, resulting in dimension-aligned image region projection features. The initial features of text words and the global representation are both 1024-dimensional, requiring no additional projection. The cosine similarity between the image region projection features, the initial features of text words, and the global representation is calculated to obtain the semantic weight coefficients of the corresponding nodes. The weight coefficients are then multiplied element-wise with the original initial features of the corresponding nodes to complete the global semantic calibration of fine-grained features. This strengthens the feature weights of regions and words related to the core theme of the sample, weakens the semantic contributions of irrelevant background and function words, and outputs the calibrated image fine-grained region feature set and text fine-grained word feature set.

[0061] The object detection acceleration subunit of the visual processing engine calls a Faster R-CNN model pre-trained on the VisualGenome dataset to detect the top M most salient object regions in the input image, outputting region bounding boxes along with corresponding category and attribute labels. These attribute labels originate from the fine-grained attribute annotation system inherent in the VisualGenome dataset. During pre-training, an attribute prediction branch is added to the standard Faster R-CNN object detection branch, using attribute labels such as color, material, and state from the dataset as supervision for joint training. During inference, the model synchronously outputs corresponding attribute description labels based on the visual features of the detected regions, which are not part of the basic detection output of the standard Faster R-CNN. Visual features of each salient region are extracted using a ResNet-101 network, and semantic features of the corresponding attribute labels are extracted using a BERT model. The region visual features and label semantic features are concatenated and fused to obtain the initial feature set of fine-grained regions in the image. In the fine-grained feature extraction stage of the image, the object detection acceleration subunit of the visual processing engine calls the Faster R-CNN model pre-trained on the VisualGenome dataset to perform salient region detection. This model has general multi-class object recognition and attribute awareness capabilities, and can output high-quality detection results without fine-tuning on the target dataset. During the model's forward propagation, the region proposal network first generates candidate bounding boxes, which are then output as semantic categories and confidence scores via the classification branch. After removing redundant overlapping boxes through non-maximum suppression, the top M salient object regions are selected in descending order of confidence, and the corresponding bounding box coordinates and attribute label text are output simultaneously. The number of salient regions M is set to 36, a value obtained based on general experimental benchmarks in the cross-modal retrieval field and ablation comparison experiments of this scheme on the MS-COCO dataset. Experimental settings The comparison group was used for fine-grained retrieval. As an evaluation indicator, the results show that when At that time, the gain of fine-grained branching on the overall retrieval accuracy reaches its maximum, compared to Time accuracy improved by 3.7%; further improvement to At that time, the accuracy only improved by 0.4%, but the time required for feature extraction per sample increased by 32%. Therefore, we selected... It can fully cover the core subject, secondary objects and key local semantic regions of the image, while controlling computational redundancy, achieving the optimal balance between fine-grained representation capability and computational efficiency.

[0062] For each detected salient region, RoI alignment is first performed on the original feature map based on the bounding box coordinates, mapping region features of different sizes to sub-feature maps of fixed spatial dimensions. These sub-maps are then fed into the top-level feature extraction path of the ResNet-101 network. After global average pooling, the visual feature vector for each region is output, with a fixed dimension of 2048 for each region, consistent with the dimension of the global image features to ensure the uniformity of the visual feature space. Simultaneously, the attribute label text corresponding to each region is input into the BERT language model, and the output vector corresponding to the CLS label is taken as the label semantic feature for that region. The single label semantic feature has a dimension of 768, used to supplement the high-level semantic attribute information of the region. The visual features and label semantic features of the same region are concatenated and fused along the feature dimensions to obtain the fine-grained initial feature vector for that region. The calculation formula for concatenation and fusion is as follows: ; in, Let i be the visual feature vector of the i-th image region. This is the semantic feature vector of the label for the corresponding region. This represents a vector concatenation operation. Let be the fine-grained initial feature vector for the i-th region. After performing the same stitching operation on all M regions of a single image, a region of size is obtained. This involves creating an initial feature set for fine-grained regions of the image. By concatenating and fusing visual features with semantic labels, low-level visual appearance information can be combined with high-level semantic attribute information, thereby enhancing the semantic richness and discriminative ability of fine-grained region features.

[0063] In the fine-grained text feature extraction stage, the NLP-dedicated acceleration subunit first inputs the original text segmentation sequence into the BERT pre-trained model, performs bidirectional context encoding on each word position, and outputs the initial word vector corresponding to each word. The word vector dimension is fixed at 768 dimensions, preserving the semantic information of the word itself and its basic contextual association. To further enhance the ability to model word contextual dependencies, the initial word vectors of all words are input into the Bi-GRU bidirectional gated recurrent unit in sequence, and the text sequence is temporally encoded from both the forward and backward directions to capture long-distance semantic dependencies between words. The forward and backward hidden states of the Bi-GRU are updated as follows: ; in, Let t be the initial word vector of the t-th word, which is the input vector of Bi-GRU; The hidden state output by the forward GRU at the t-th word position encodes the semantic information of the preceding context. The hidden state output by the inverse GRU at the t-th word position encodes the semantic information of the following text after that word; This is the nonlinear update function for the gated recurrent unit, which controls the transmission and forgetting of temporal information through reset and update gates. The hidden layer dimension of the Bi-GRU is set to 1024 dimensions, meaning the dimension of the unidirectional hidden state is 1024. This value is based on a dual consideration of text semantic modeling capabilities and cross-modal dimensional matching: through comparison... Text encoding performance across five dimensions; 1024 dimensions can completely encode the average length in the MS-COCO dataset. The semantic dependence of words on their textual context improves the accuracy of textual semantic representation by 3.2% compared to 512-dimensional text. Simultaneously, this dimension maintains consistency with the dimension after dimensionality reduction of image region features, avoiding scale bias in subsequent fine-grained association calculations due to excessive dimensionality differences, thus ensuring the numerical stability of the fine-grained semantic graph construction. The arithmetic mean of the forward and reverse hidden states is taken as the initial fine-grained feature vector for the t-th word, calculated as follows: ; in, Let be the fine-grained initial feature vector for the t-th word. After performing the same calculation on all words in the text sequence, we obtain the initial fine-grained word feature set. A bidirectional GRU is used for secondary encoding, complementing the BERT global self-attention mechanism: BERT excels at capturing long-distance global semantic dependencies, but has high computational overhead and weak local temporal characterization of neighboring word orders; Bi-GRU strengthens neighboring word order associations and local co-occurrence dependencies with lightweight temporal modeling, highlighting the semantic weights of core content words, while reducing the computational complexity of fine-grained branches, providing initial features with stronger temporal awareness and higher computational efficiency for subsequent fine-grained semantic graph construction. Both the object detection acceleration subunit and the NLP-specific acceleration subunit of the visual processing engine adopt an instruction-level parallel architecture, performing hardware-level pipeline optimization for convolution, RoI alignment, and sequence encoding operations. The overall speed of fine-grained feature extraction is more than 4 times faster than the general CPU serial mode, meeting the latency requirements of real-time processing.

[0064] Preferably, the two types of fine-grained features are input into a graph neural network accelerator card to construct fine-grained semantic maps of image regions and text words, and to complete the aggregation of local semantic information, outputting enhanced fine-grained image region embeddings and enhanced fine-grained text word embeddings, including the following specific steps: In one specific embodiment, the graph neural network accelerator card uses image regions and text words as graph nodes, respectively, and calculates the cosine similarity between each pair of nodes as the edge weight to construct a fully connected fine-grained semantic graph. For image region semantic maps, semantic association propagation between regions is performed through graph convolutional neural networks, which aggregates the contextual information of adjacent regions and introduces residual connections to preserve the original region features, outputting enhanced fine-grained image region embeddings. For the semantic graph of text words, a graph convolutional neural network is used to perform semantic association aggregation between words, strengthen the semantic dependencies between words, and output enhanced fine-grained text word embeddings.

[0065] After obtaining the initial fine-grained features of image regions and text words, a unified sample-level graph embedding representation is used as the global semantic prior. The cosine similarity between each fine-grained node feature and the global representation is calculated to obtain the node-level semantic weight coefficients. The weights are multiplied element-wise with the corresponding node's initial features to complete the global semantic calibration, strengthen the weights of core topic-related features, and weaken the semantic contributions of irrelevant background and function words.

[0066] The calibrated features are fed into a graph neural network accelerator card. Fully connected fine-grained semantic graphs are constructed using salient image regions and text words as graph nodes, respectively, and cosine similarity as edge weights. The edge weights reflect the semantic similarity between nodes. Graph convolution aggregation is then performed. The formula for calculating cosine similarity is: ; in; and Let be the initial feature vectors of the i-th and j-th nodes, respectively. Let be the dot product of two vectors. Let L2 norm be the vector. The cosine similarity between two nodes, with values ​​ranging from 1 to 2. A higher value indicates a higher semantic similarity between two nodes. Cosine similarity is chosen as the edge weight metric because it is not affected by the feature vector magnitude, and can more accurately measure the semantic similarity between different fine-grained elements, avoiding edge weight bias caused by feature scale differences. A fully connected graph structure is used because the number of fine-grained nodes in a single sample is limited, the computational cost of full connection is within a controllable range, and it can completely model the semantic relationships between all elements, avoiding the omission of potential semantic dependencies.

[0067] After obtaining the similarity of all node pairs, an adjacency matrix of the fine-grained semantic graph is constructed. The element values ​​of the adjacency matrix represent the cosine similarity of the corresponding node pairs. To eliminate the imbalance in feature aggregation scale caused by differences in node degree, consistent with the processing logic of global graph convolution, symmetric normalization is performed on the fine-grained adjacency matrix. First, an identity matrix is ​​added to introduce self-loop connections, and then left and right multiplication normalization is performed by raising the degree matrix to its negative 1 / 2 power. The normalization calculation formula is: ; in, This is the original adjacency matrix of the fine-grained semantic graph, where each element represents the cosine similarity of the corresponding node pairs. It is an identity matrix of the same order as the fine-grained adjacency matrix, used to introduce node self-connection and retain the characteristic information of the node itself; This is the degree matrix corresponding to the adjacency matrix after adding self-loops. It is a diagonal matrix with diagonal elements. , where represents the weighted degree of the i-th node; It is the negative 1 / 2 power of the degree matrix, and is also a diagonal matrix; This is the fine-grained adjacency matrix after symmetric normalization.

[0068] For image region semantic maps, a single-layer graph convolutional network with residual connections is used to perform semantic association propagation between regions. This preserves the unique features of the original regions while aggregating neighborhood context information, avoiding feature homogenization caused by over-smoothing. The calculation formula for fine-grained graph convolution is: ; in, This forms the initial feature set for fine-grained regions of the image. This is a trainable weight matrix for fine-grained graph convolution, used to transform the feature dimension, mapping the initial 2816-dimensional concatenated features to... A unified feature space of dimensions, here The dimension is set to 1024, which is consistent with the dimension of fine-grained word features in the text, providing a unified feature scale for subsequent cross-modal fine-grained matching. The residual baseline features are obtained after linear dimensionality reduction mapping of the initial features of the original region. They are used to achieve dimensionality alignment of the residual connections, ensuring dimensionality matching for element-wise summation operations. The calculation method is as follows: In the formula The trainable linear projection weight matrix for the residual branch maps the original 2816-dimensional region features to a shape consistent with the graph convolution output through this linear transformation. The feature space is dimensional, which ensures that the feature dimensions of the residual branch and the graph convolution branch are strictly aligned, thus guaranteeing the validity of the summation operation. For the hyperbolic tangent activation function, nonlinear transformation capability is introduced and the output features are constrained to... interval; This is used for enhanced fine-grained image region embedding in the final output.

[0069] The reason for introducing residual connections is that fine-grained region features themselves have strong unique semantic information. Simple graph convolution aggregation can easily weaken the feature differences between regions. The residual structure can fully preserve the core visual and semantic attributes of the region itself while aggregating the semantics of the neighborhood context, effectively alleviating the problem of excessive smoothing of fine-grained graphs and improving the discriminativeness of region embedding.

[0070] For text word semantic graphs, a single-layer graph convolutional network with residual connections is used to aggregate semantic associations between words. This aggregates semantic information from neighboring words while preserving the original semantic features of each word, avoiding the over-smoothing problem of fine-grained graph convolutions and enhancing the unique semantic discriminative power of words. The formula for calculating the fine-grained graph convolution of text is: ; in, Let L be the initial feature set of fine-grained words in the text, where L is the number of words in a single text segment. It is a trainable weight matrix for text fine-grained graph convolution, used to achieve non-linear transformation of features and semantic space calibration. The residual baseline features are obtained after linear mapping of the initial features of the original words. These features are used to align the feature dimensions of the residual connections and preserve the original semantic information. Their calculation method is as follows: In the formula The trainable linear projection weight matrix of the residual branch is used to spatially calibrate the semantic features of the original words through this linear transformation, so that the output of the residual branch and the output of the graph convolution branch are in the same semantic space and the dimensions are strictly matched, ensuring the legality of element-wise summation operation. Using the hyperbolic tangent activation function, the output features are constrained to... The interval ensures the stability of the feature value distribution; This results in enhanced fine-grained text word embeddings for the final output. Through information aggregation via fine-grained graph convolution, the features of each word incorporate the semantic information of all other words in the text. This strengthens the semantic dependencies between words, better characterizing fine-grained semantic features such as polysemy and contextual relationships, and improving the discriminative power of local text features.

[0071] The graph neural network accelerator card is implemented based on a GPU graph computing optimization architecture and adopts a batch streaming parallel architecture. Addressing the characteristics of small node size and large sample size in fine-grained graphs, it concatenates multiple fine-grained graphs into a large batch for unified computation. It also optimizes memory access scheduling and the computation pipeline. Compared to the sample-by-sample serial computation mode of general-purpose CPUs, it improves computational efficiency by more than 6 times, enabling fine-grained feature enhancement tasks with hundreds of thousands of samples to be completed in a short time.

[0072] The accelerator card is equipped with an independent on-chip feature cache area. All fine-grained intermediate features are aggregated within the on-chip cache, and only the final output enhanced fine-grained embedding is transferred across chips. It also supports pipeline-level scheduling with upstream vision processing engines and NLP-dedicated acceleration subunits. Feature extraction and graph convolution enhancement operations are executed in an overlapping manner to mask data transfer latency.

[0073] Step S4: Input the unified sample-level graph embedding representation and two types of enhanced fine-grained embeddings into the tensor acceleration unit to build a bidirectional semantic alignment path between graph and text to complete the adaptive calculation of cross-modal association weights; fuse global coarse-grained and local fine-grained two-level embedding features to complete the sample similarity measurement and output the bidirectional graph-text retrieval ranking results.

[0074] Preferably, the step of feeding the unified sample-level graph embedding representation, enhanced fine-grained image region embedding, and enhanced fine-grained text word embedding into the tensor acceleration unit to build a bidirectional semantic alignment path between graph and text to complete the adaptive calculation of cross-modal association weights includes the following specific steps: In one specific embodiment, the tensor acceleration unit calculates the cosine similarity matrix between the enhanced fine-grained image region embedding and the enhanced fine-grained text word embedding, and performs sequential processing on the similarity matrix, first truncating and then normalizing it. Softmax normalization is performed along the text dimension to obtain the attention weight of the image region corresponding to each text word. The image region features are then weighted and aggregated to obtain a visual representation aligned with the word, thus completing the attention alignment from text to image. Softmax normalization is performed along the image dimension to obtain the text word attention weights corresponding to each image region. The text word features are then weighted and aggregated to obtain the text representation aligned with the region, thus completing the image-to-text attention alignment. Sample-level mean aggregation is performed on the bidirectional alignment features to obtain the initial local fine-grained alignment representation. The initial local fine-grained alignment representation is mapped to the K-dimensional global common semantic space through a trainable linear projection layer to obtain the final local fine-grained alignment representation. This ensures that the final local fine-grained alignment representation is in the same semantic space as the unified sample-level graph embedding representation, thus guaranteeing the semantic consistency of subsequent similarity calculations. Finally, the local fine-grained alignment representation and the unified sample-level graph embedding representation together constitute coarse and fine complementary features, which are then input into the vector similarity calculation chip.

[0075] The tensor acceleration unit calculates the cosine similarity matrix of enhanced fine-grained image region embeddings and enhanced fine-grained text word embeddings, and performs sequential processing on the similarity matrix, first truncating and then normalizing. The truncation operation sets a similarity threshold of 0.2, which is determined based on the noise distribution statistics of fine-grained image-text matching in the MS-COCO dataset: statistics show that over 92% of the pairing similarities between background regions and function words / stop words are concentrated below 0.2, while over 90% of the pairing similarities between core semantic regions and content words are above 0.2. The fine-grained alignment accuracy was compared by setting the threshold to 0.1, 0.15, 0.2, 0.25, and 0.3 respectively. The results show that when the threshold is 0.2, 89% of invalid noise pairings can be filtered, while the retention rate of core semantic pairings reaches 91%, and the fine-grained alignment accuracy is improved by 2.3% compared to the untruncated threshold. A threshold that is too high will lose some weakly related effective semantic information, while a threshold that is too low will result in insufficient noise filtering. Therefore, 0.2 was selected as the truncation threshold to suppress the interference of background noise and function words on alignment accuracy from the source.

[0076] The tensor acceleration unit calculates the cosine similarity matrix of enhanced fine-grained image region embedding and enhanced fine-grained text word embedding, and performs sequential processing of the similarity matrix, first truncating and then normalizing.

[0077] Truncating is used to filter out invalid regions and word pairings with very weak semantic relevance. The truncating formula is as follows: ; in, For the first The image region node and the first The original cosine similarity of each text word node. This is the similarity value after truncation. Setting a threshold of 0.2 can eliminate interference from background noise, meaningless pairings such as function words in advance, reducing the redundancy of subsequent calculations.

[0078] After truncation, the similarity matrix is ​​subjected to min-max linear normalization row by row, mapping the similarity values ​​of each row to the range [0,1]. The normalization calculation formula is as follows: ; in, For the similarity matrix, the first... The similarity vector after row truncation. and These are the minimum and maximum values ​​of the row vector, respectively. To prevent small constants from being divided by zero, the value is taken as... This is used to avoid the calculation anomaly of a denominator of zero when all similarities within a row are zero. After normalization, the similarity values ​​of different sample pairs are consistent, which can ensure the stability and cross-sample comparability of subsequent Softmax attention weight calculations.

[0079] Softmax normalization is performed along the text dimension to obtain the attention weight of the image region corresponding to each text word. The image region features are then weighted and aggregated to obtain a visual representation aligned with the word, thus completing the attention alignment from text to image. Softmax normalization is also performed along the image dimension to obtain the attention weight of the text word corresponding to each image region. The text word features are then weighted and aggregated to obtain a text representation aligned with the region, thus completing the attention alignment from image to text.

[0080] The reason for adopting the processing order of truncation followed by normalization is as follows: If normalization is performed first and then truncation is performed, low-association noise will participate in the min-max extreme value calculation, compressing the weight ratio of high semantic pairings. Moreover, the truncated values ​​have not undergone secondary normalization, which will lead to inconsistencies in the numerical ranges of different rows, interfering with the stability of subsequent Softmax attention calculations. Truncation first can uniformly set invalid weak association values ​​to zero, eliminating the interference of noise on the normalization benchmark. Then, min-max linear normalization is performed on the remaining valid values ​​and mapped to the [0,1] interval. This can amplify the relative weight ratio of strong association pairings, strengthen the alignment guidance role of core semantics, and eliminate the differences in similarity distribution between samples, ensuring the numerical stability and cross-sample consistency of subsequent Softmax calculations.

[0081] Sample-level mean aggregation is performed on the bidirectional alignment features to obtain an initial local fine-grained alignment representation. This initial local fine-grained alignment representation is then mapped to a K-dimensional global common semantic space through a trainable linear projection layer, yielding the final local fine-grained alignment representation. The formula for calculating the linear projection is: ; in, This is the initial local fine-grained alignment representation vector after mean aggregation; It is a trainable projection weight matrix used to complete the semantic space transformation of the feature dimension; is the corresponding trainable bias vector used to adjust the numerical distribution benchmark of the features; K is the dimension of the global common semantic space, which is consistent with the dimension of the unified sample-level graph embedding representation.

[0082] This linear projection places the local fine-grained alignment representation and the unified sample-level graph embedding representation in the same semantic space, ensuring the semantic consistency of subsequent similarity calculations. Ultimately, the local fine-grained alignment representation and the unified sample-level graph embedding representation together constitute coarse and fine complementary features, which are then input to the vector similarity calculation chip.

[0083] The Tensor Acceleration Unit (TCU) is implemented based on the NVIDIA TensorCore architecture and employs a 3D tensor parallel scheme. It decomposes similarity matrix calculation, Softmax normalization, and weighted aggregation into multiple tasks to be executed in parallel. Simultaneously, it leverages on-chip high-bandwidth caching to store intermediate features, significantly reducing memory access latency. It supports batch-dimensional pipelined scheduling and can complete bidirectional attention alignment calculations for 64 samples in a single cycle. Compared to general-purpose GPUs, it reduces latency by 40% and improves computational utilization by 35%, efficiently supporting cross-modal fine-grained alignment tasks on large-scale datasets.

[0084] Preferably, the alignment feature input vector similarity calculation chip calculates global coarse-grained similarity and local fine-grained similarity respectively, and completes the sample similarity measurement by weighted fusion with preset weights. Finally, the ranking acceleration processor outputs the bidirectional image and text retrieval ranking result, including the following specific steps: In one specific embodiment, the vector similarity calculation chip calculates the cosine similarity between the unified sample-level graph embedding representation of the query sample and the sample to be retrieved, as the global coarse-grained similarity. Calculate the cosine similarity between the local fine-grained alignment representations of the query sample and the sample to be retrieved, and use it as the local fine-grained similarity; then, weight and fuse the global coarse-grained similarity and the local fine-grained similarity according to preset weights to obtain the final image-text sample pair similarity. The ranking accelerator sorts the search samples in descending order of similarity for two types of tasks: image retrieval of text and text retrieval of images. It outputs a ranking list of Top-K search results and corresponding similarity scores.

[0085] The weighted fusion of global coarse-grained similarity and local fine-grained similarity employs a linear weighting method with fixed weight coefficients. Among these, the global coarse-grained similarity... The similarity is calculated from the mean of the matching similarity between the image regions and text words of the query sample and the sample to be retrieved after bidirectional attention alignment. Its value range is [-1, 1]. This represents the local fine-grained similarity. The range of values ​​is [0,1]; first, The global coarse-grained similarity is obtained by mapping to the [0,1] interval using the following formula. : ; Then map the Substituting into the weighted fusion formula for calculation, the fusion calculation method is as follows: ; In the formula, λ is the preset fusion weight coefficient, and its value range is [0,1]. For global coarse-grained similarity, This represents local fine-grained similarity.

[0086] Because of the calculation The matching similarity score, after truncation and then min-max normalization, is constrained to the range of [0,1]. The actual value range is [0,1]. A higher value indicates a higher degree of semantic matching between the two samples at the local detail level. The calculation formula is: ; in, The total number of salient regions in a single image. The total number of words in a single text segment. The first normalized result is the first... The image region and the first The alignment similarity value of individual words in a text is a metric that reflects the degree of semantic matching between two samples at the level of local details.

[0087] The weight coefficient for global similarity is set to 0.6, and the corresponding weight coefficient for local similarity is 0.4. The weight coefficients are normalized to a sum of 1, satisfying the following conditions: The constraints ensure that the overall similarity value scale after weighted fusion remains consistent with the single-dimensional similarity, thus avoiding numerical distribution shift. The final image-text sample pair comprehensive similarity score, with a value range of [value range missing]. The weighting coefficient λ is set to 0.6, a value obtained through comparative experiments using the MS-COCO and Flickr30K datasets. Experimental setup. Six control groups were compared, with the average mAP@10 for bidirectional retrieval as the evaluation index. The results showed that when λ=0.6, the average retrieval accuracy of both datasets reached its peak, compared to... A 1.5% increase compared to The accuracy is improved by 1.1%. Global semantic features carry the core topic information of the sample and are the main basis for cross-modal matching, so they are assigned higher weights. Local fine-grained features, as a supplement to global features, are used to distinguish samples with similar global semantics but different details, so they are assigned relatively lower weights. This weight ratio can achieve optimal complementarity between the two levels of features and achieve the best retrieval accuracy.

[0088] The vector similarity calculation chip is based on an in-memory computing architecture and features customized hardware circuitry for cosine similarity calculation. It incorporates 1024 dedicated vector inner product calculation units, supporting parallel similarity calculation for massive vector pairs. A single chip can simultaneously complete similarity calculations for 1024 feature vectors. Compared to the serial computing mode of general-purpose CPUs, the throughput of similarity calculation is increased by more than 8 times, and the power consumption per sample is reduced by 70%. It can complete the full similarity calculation of a million-sample database in milliseconds, meeting the real-time requirements of large-scale cross-modal retrieval.

[0089] The chip incorporates a large-capacity in-memory computing storage unit. The two-level embedded representations of the entire database samples are pre-stored within this unit, and similarity calculations are performed directly within the storage unit. This eliminates the need to transfer database sample features from external memory via the PCIe bus, thus removing the cross-chip transmission overhead of large-scale database data at its source. Simultaneously, the chip supports batch query parallel processing, allowing multiple query samples to be processed simultaneously with the entire database samples in a single operation, reducing the average latency of a single query.

[0090] The ranking accelerator is implemented using FPGA hardware-based ranking circuitry and employs a hardware-based heap sort algorithm architecture. It is deeply optimized for Top-K retrieval scenarios, eliminating the need for a complete ranking of all samples. Instead, it quickly selects the top K most similar samples by maintaining a min-heap structure of size K, significantly reducing the computational load. The default value for Top-K is 50, which can be dynamically adjusted from 10 to 1000 via register configuration for different application scenarios. During the ranking process, the similarity score of each selected sample is recorded and arranged in descending order of similarity, ultimately generating a structured ranking list. For bidirectional retrieval tasks, including image-to-text retrieval and text-to-image retrieval, the ranking accelerator can execute two ranking processes in parallel, simultaneously outputting retrieval results from both directions. This eliminates the need for repeated similarity calculations and ranking operations, further improving the processing efficiency of bidirectional retrieval.

[0091] Before the online inference retrieval phase, the entire database samples have already undergone pre-computation of unified sample-level graph embedding representations and local fine-grained alignment representations during the offline training phase, and these representations are stored in the built-in storage unit of the vector similarity calculation chip. During retrieval, only the single-sample forward computation of steps S1 to S4 is performed on the input query sample. After generating the two-level embedding representation of the query sample, batch similarity calculation and sorting are directly performed with the pre-stored full sample representations in the database. There is no need to repeatedly perform feature extraction and graph convolution enhancement operations on the database samples, which significantly reduces the online computation load and data transfer overhead.

[0092] The datasets are divided into three independent subsets—training, validation, and test—using standard partitioning rules across the cross-modal retrieval domain. Taking the MS-COCO dataset as an example, following the official partitioning scheme, 80,000 image-text pairing samples are selected for the training set, 10,000 for the validation set, and 5,000 for the test set. Similarly, for the Flickr30K dataset, 29,000 image-text pairing samples are selected for the training set, 1,000 for the validation set, and 1,000 for the test set. The training set is used for iterative learning and updating of network parameters, the validation set is used for hyperparameter tuning and early stopping detection, and the test set is used for final retrieval performance evaluation. The three subsets have no overlapping samples, ensuring the objectivity and generalization of the evaluation results.

[0093] Model training uses triplet samples as the basic unit. A difficult-to-negative-sample sampling strategy is employed to select anchor samples, semantically matching positive samples, and semantically mismatched negative samples to form triplet pairs. During sampling, anchor samples and their corresponding positive samples are randomly selected, and then negative samples are randomly selected from the top 30% of difficult-to-distinguish samples with global feature similarity to the anchor samples, improving the model's ability to distinguish difficult-to-distinguish samples. Each training batch contains an equal number of image anchor samples and text anchor samples to ensure the training balance of the bidirectional retrieval task. Training uses the bidirectional triplet ranking loss as the core loss function, calculated as follows: ; Where B is the training batch size. , , The final fused representations, corresponding to the anchor sample, positive sample, and negative sample in the i-th triplet, are obtained by weighted fusion of global coarse-grained unified sample-level graph embedding and local fine-grained alignment representation. This is completely consistent with the sample representations used for similarity measurement during the retrieval stage. The cosine similarity function is used, where α is a preset margin parameter, set to 0.3. This value is determined based on the general settings and optimization experiments of cross-modal retrieval triplet loss. Too small a value will result in insufficient loss constraint, and the model's ability to distinguish between positive and negative samples will be weak. An excessively large learning rate can lead to difficulty in convergence and training instability. 0.3 is considered the optimal range based on extensive validation within the field. Training employs the Adam optimizer, iteratively updating all trainable parameters in the network through backpropagation. The initial learning rate is set to 0.0001, determined through a learning rate grid search experiment. Among four candidate values ​​(0.001, 0.0005, 0.0001, and 0.00005), 0.0001 simultaneously ensures both convergence speed and accuracy, avoiding oscillations caused by an excessively large learning rate and slow convergence caused by an excessively small learning rate. The training iterations are set to 30 epochs. Experiments show that the loss curve stabilizes around epoch 25, and by epoch 30, the loss value decreases below 0.001, reaching convergence. Continuing training thereafter does not significantly improve accuracy; therefore, 30 epochs are set as the termination condition, completing the training of the entire cross-modal retrieval model.

[0094] Example 2: Please see Figure 3-4 As shown, a cross-modal unstructured data retrieval device based on graph embedding includes a processor, a memory, and a communication bus. The memory stores a computer-readable program that can be executed by the processor; The communication bus enables communication between the processor and the memory; When the processor executes the computer-readable program, it performs steps in the graph embedding-based cross-modal unstructured data retrieval method as described in any one of the present invention.

[0095] It should be noted that the interval and threshold sizes are set for ease of comparison. The size of the threshold depends on the amount of sample data and the base number set by those skilled in the art for each set of sample data, as long as it does not affect the proportional relationship between the parameter and the quantized value. Furthermore, the above formulas are all dimensionless calculations, and the formulas are derived from software simulations using a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0096] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0097] It should be understood that determining B based on A does not mean determining B solely based on A; it also means determining B based on A and / or other information.

[0098] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0099] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A cross-modal unstructured data retrieval method based on graph embedding, characterized in that, include: Step S1: Perform format standardization on image samples and word segmentation encoding preprocessing on text samples from the original unstructured dataset of images and text. After feature extraction, generate original feature vectors for images and text respectively. Input the two types of feature vectors into the FPGA graph convolution computing unit, construct the k-nearest neighbor graph within the image and text modal using Euclidean distance as the metric, aggregate neighborhood structure information through graph convolution to complete the intra-modal feature enhancement, and output image and text modal-specific embedding vector sets. Step S2: The two types of modality-specific embedding vector sets, along with the image-text pairing semantic matching labels, are fed into the multi-core DSP cross-modal graph convolution acceleration module. Based on the image-text pairing semantic relationship, a cross-modal association graph is constructed. The graph convolution propagation operation with shared semantic embedding is performed, and a unified sample-level graph embedding representation is generated by attention-weighted fusion. Step S3: Based on the original image pixel data and text word segmentation sequence, extract multi-scale salient region features of the image and word-level semantic features of the text. Use the unified sample-level graph embedding representation as the global semantic prior to complete the fine-grained feature semantic calibration. Input the calibrated fine-grained features into the graph neural network acceleration card to construct fine-grained semantic graphs of image regions and text words and complete local semantic aggregation. Output the enhanced fine-grained image region embedding and text word embedding. Step S4: Input the unified sample-level graph embedding representation and two types of enhanced fine-grained embeddings into the tensor acceleration unit to build a bidirectional semantic alignment path between graph and text to complete the adaptive calculation of cross-modal association weights; fuse global coarse-grained and local fine-grained two-level embedding features to complete the sample similarity measurement and output the bidirectional graph-text retrieval ranking results.

2. The method for cross-modal unstructured data retrieval based on graph embedding according to claim 1, characterized in that, The process of performing format standardization on image samples and word segmentation encoding preprocessing on text samples from the original unstructured dataset, followed by feature extraction to generate original feature vectors for both images and text, includes the following specific steps: The CMOS image acquisition unit performs size normalization, linear scaling of pixel values ​​to the [0,1] range, and three-channel alignment correction on the input image samples, and outputs a uniform RGB pixel matrix to eliminate differences in image size and color gamut. The text parsing processor performs word segmentation, stop word filtering, and special character removal on the input text samples. Then, it maps each word to a fixed-length vector using a pre-trained word vector matrix, generating a word embedding sequence corresponding to the text length, thus completing the structured encoding preprocessing of the text.

3. The method for cross-modal unstructured data retrieval based on graph embedding according to claim 2, characterized in that, The process of inputting two types of feature vectors into the FPGA graph convolution calculation unit, constructing k-nearest neighbor graphs within the image and text modalities using Euclidean distance as a metric, aggregating neighborhood structure information through graph convolution to complete intra-modal feature enhancement, and outputting image and text modal-specific embedding vector sets includes the following specific steps: The GPU feature extraction accelerator card calls a ResNet-101 convolutional neural network pre-trained on ImageNet to perform global feature extraction on the standardized image and outputs the original global feature vector of the image with consistent dimensions; it calls a pre-trained BERT language model to perform global semantic encoding on the text word embedding sequence and outputs the original global feature vector of the text. The FPGA graph convolution computation unit calculates the Euclidean distance between all pairs of samples and selects the k nearest neighbors for each sample. If there are multiple samples with the same Euclidean distance as the current sample and are at the kth critical position, they are selected in ascending order of global ID until the total number of nearest neighbors reaches k. Undirected k-nearest neighbor graphs for image modality and text modality are constructed respectively, and corresponding symmetric adjacency matrices are generated. In each modality, a two-layer graph convolutional neural network is used to perform feature aggregation. Each graph convolutional layer first performs symmetric normalization on the adjacency matrix, then multiplies the node features with the normalized adjacency matrix and performs trainable weight mapping and nonlinear activation to complete the weighted aggregation of neighborhood information. After two layers of graph convolutional iteration, the output is an image modality-specific embedding vector set and a text modality-specific embedding vector set that integrate neighborhood structure information.

4. The cross-modal unstructured data retrieval method based on graph embedding according to claim 3, characterized in that, The process of feeding the two types of modality-specific embedding vector sets along with the image-text pairing semantic matching labels into the multi-core DSP cross-modal graph convolution acceleration module, constructing a cross-modal association graph based on the image-text pairing semantic relationship, and performing graph convolution propagation operation with shared semantic embeddings includes the following specific steps: The multi-core DSP cross-modal graph convolution acceleration module establishes cross-modal connections between image nodes and text nodes under the same semantic topic based on image-text pair semantic matching tags; and combines the image modality intra-adjacency matrix and the text modality intra-adjacency matrix to construct a cross-modal heterogeneous graph adjacency matrix containing the two types of nodes. Image modality-specific embeddings and text modality-specific embeddings are used as the initial features of the corresponding nodes and input into the cross-modal graph convolutional network. Through graph convolution operations, the aggregation of neighborhood information within the modality and the bidirectional propagation of semantic information between modalities are realized, and cross-modal shared semantic embeddings are learned, in which image nodes and text nodes complete the initial alignment in the shared semantic space.

5. The cross-modal unstructured data retrieval method based on graph embedding according to claim 4, characterized in that, The process of generating a unified sample-level graph embedding representation through attention-weighted fusion includes the following specific steps: The parallel computing accelerator card takes modality-specific embedding and cross-modality shared semantic embedding as input for each modality, and calculates the attention weight coefficients of the two sets of features through a single-layer feedforward sub-network and a Sigmoid activation function. Softmax normalization is performed on the attention weight coefficients to obtain the fusion ratio of modality-specific information and shared semantic information; weighted summation is performed on the modality-specific embedding and shared semantic embedding according to the weights to obtain the unified sample-level graph embedding representation of image and text modalities, respectively.

6. The method for cross-modal unstructured data retrieval based on graph embedding according to claim 5, characterized in that, The process of extracting multi-scale salient region features from the original image pixel data and text word segmentation sequence, and using a unified sample-level graph embedding representation as a global semantic prior to complete fine-grained feature semantic calibration, includes the following specific steps: The object detection acceleration subunit of the visual processing engine calls the Faster R-CNN model pre-trained on the VisualGenome dataset to detect the top M most salient object regions in the input image and output the region bounding boxes and corresponding attribute labels. Visual features of each salient region are extracted using the ResNet-101 network, and semantic features of the corresponding attribute labels are extracted using the BERT model. The visual features of the regions and the semantic features of the labels are concatenated and fused to obtain the initial feature set of fine-grained regions of the image. The dedicated NLP acceleration subunit calls the BERT pre-trained model to encode the text segmentation sequence word by word, generating initial word vectors at the word level. The word vectors are then input into the Bi-GRU (Bi-Gated Recurrent Unit) to encode the contextual semantic information of the words from both the forward and backward directions, and the average value of the bi-directional hidden states is taken as the initial feature set of the fine-grained text words. Using a unified sample-level graph embedding representation as the global semantic benchmark, a trainable linear projection layer is first used to map the initial 2816-dimensional image region features to a 1024-dimensional global semantic space, resulting in dimension-aligned image region projection features. The initial features of text words and the global representation are both 1024-dimensional, requiring no additional projection. The cosine similarity between the image region projection features, the initial features of text words, and the global representation is calculated to obtain the semantic weight coefficients of the corresponding nodes. The weight coefficients are then multiplied element-wise with the original initial features of the corresponding nodes to complete the global semantic calibration of fine-grained features. This strengthens the feature weights of regions and words related to the core theme of the sample, weakens the semantic contributions of irrelevant background and function words, and outputs the calibrated image fine-grained region feature set and text fine-grained word feature set.

7. A cross-modal unstructured data retrieval method based on graph embedding according to claim 6, characterized in that, The process of inputting the calibrated fine-grained features into a graph neural network accelerator card, constructing fine-grained semantic maps of image regions and text words, completing local semantic aggregation, and outputting enhanced fine-grained image region embeddings and text word embeddings includes the following specific steps: The graph neural network accelerator uses image regions and text words as graph nodes, respectively, and calculates the cosine similarity between each pair of nodes as the edge weight to construct a fully connected fine-grained semantic graph. For image region semantic maps, semantic association propagation between regions is performed through graph convolutional neural networks, which aggregates the contextual information of adjacent regions and introduces residual connections to preserve the original region features, outputting enhanced fine-grained image region embeddings. For the semantic graph of text words, a graph convolutional neural network is used to perform semantic association aggregation between words, strengthen the semantic dependencies between words, and output enhanced fine-grained text word embeddings.

8. A cross-modal unstructured data retrieval method based on graph embedding according to claim 7, characterized in that, The process of fusing global coarse-grained and local fine-grained two-level embedding features to complete sample similarity measurement and output bidirectional image-text retrieval ranking results includes the following specific steps: The tensor acceleration unit calculates the cosine similarity matrix of enhanced fine-grained image region embedding and enhanced fine-grained text word embedding, and performs sequential processing of the similarity matrix by first truncating and then normalizing. Softmax normalization is performed along the text dimension to obtain the attention weight of the image region corresponding to each text word. The image region features are then weighted and aggregated to obtain a visual representation aligned with the word, thus completing the attention alignment from text to image. Softmax normalization is performed along the image dimension to obtain the text word attention weights corresponding to each image region. The text word features are then weighted and aggregated to obtain the text representation aligned with the region, thus completing the image-to-text attention alignment. Sample-level mean aggregation is performed on the bidirectional alignment features to obtain the initial local fine-grained alignment representation. The initial local fine-grained alignment representation is mapped to the K-dimensional global common semantic space through a trainable linear projection layer to obtain the final local fine-grained alignment representation. This ensures that the final local fine-grained alignment representation is in the same semantic space as the unified sample-level graph embedding representation, thus guaranteeing the semantic consistency of subsequent similarity calculations. Finally, the local fine-grained alignment representation and the unified sample-level graph embedding representation together constitute coarse and fine complementary features, which are then input into the vector similarity calculation chip.

9. A cross-modal unstructured data retrieval method based on graph embedding according to claim 8, characterized in that, The alignment feature input vector similarity calculation chip fuses coarse and fine-level embedded features to complete the sample similarity measurement. Finally, the ranking acceleration processor outputs the bidirectional image and text retrieval ranking results, including the following specific steps: The vector similarity calculation chip calculates the cosine similarity between the unified sample-level graph embedding representation of the query sample and the sample to be retrieved, as the global coarse-grained similarity. Calculate the cosine similarity between the local fine-grained alignment representations of the query sample and the sample to be retrieved, and use it as the local fine-grained similarity; then, weight and fuse the global coarse-grained similarity and the local fine-grained similarity according to preset weights to obtain the final image-text sample pair similarity. The ranking accelerator sorts the search samples in descending order of similarity for two types of tasks: image retrieval of text and text retrieval of images. It outputs a ranking list of Top-K search results and corresponding similarity scores.

10. A cross-modal unstructured data retrieval device based on graph embedding, characterized in that, Includes processor, memory, and communication bus; The memory stores a computer-readable program that can be executed by the processor; The communication bus enables communication between the processor and the memory; When the processor executes the computer-readable program, it performs steps in the graph embedding-based cross-modal unstructured data retrieval method as described in any one of claims 1 to 9.