Cultural relic cross-modal retrieval method based on text-driven local view construction
By using a text-driven local view construction method, the position and scale of the local view are dynamically adjusted using semantic units and visual feature response maps. This solves the problem that local view alignment errors cannot be fed back in existing technologies, and improves the accuracy and stability of cultural relic retrieval.
Patent Information
- Application Number
- CN202611366032.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-11-24
AI Technical Summary
Existing cross-modal retrieval methods struggle to effectively utilize local detail information in cultural relic image databases, resulting in insufficient ability to distinguish similar cultural relics. Furthermore, local view alignment errors cannot be fed back to the view geometry, affecting retrieval accuracy.
By parsing the retrieved text into semantic units with type and confidence, a multi-scale response map is generated to determine the position and scale of candidate local views. Then, unbalanced transmission is performed through type constraints of text empty matching and visual empty matching nodes to correct the position and scale of local views, ultimately forming a dynamic local evidence extraction and feedback correction chain.
It improves the accuracy of cultural relic retrieval, reduces the omission of local evidence, suppresses the dilution of local representation by background and repeated views, and ensures the reasonable integration of local and global matching scores.
Smart Images

Figure CN123157935A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of digital cultural relic information retrieval and computer vision, and in particular to a cross-modal retrieval method for cultural relics based on text-driven local view construction. Background Technology
[0002] With the development of digital acquisition of cultural relics, museum collection databases, and digital display platforms, retrieving corresponding cultural relics from image databases using natural language descriptions has become a crucial step in digital cultural relic information management. Existing cross-modal retrieval methods typically encode the entire image of the cultural relic and its descriptive text separately, determining the ranking based on the overall similarity between the two global features. While this approach can express the category and main appearance of the cultural relic, for relics of similar categories and with similar main outlines but different local details, the averaging of global features can weaken the distinguishing information formed by inscriptions, patterns, glaze colors, component shapes, damage locations, and manufacturing techniques.
[0003] To supplement local information, existing methods also employ fixed cropping, uniform segmentation, or general object detection to obtain image regions. However, fixed regions lack semantic reference to the retrieved text and are difficult to adapt to changes in the position and scale of the local view based on object, location, color, material, and state descriptions; general detection regions may also miss details unique to cultural relics. Shooting angle, occlusion, scale variations, background areas, and multiple similar local regions further contribute to response diffusion and view redundancy, making it impossible for a limited number of local views to stably cover the evidence truly involved in text matching.
[0004] Furthermore, when there are limited labeled samples, large intra-class differences, local similarities between classes, and blurred negative sample boundaries, single local cropping and fixed alignment cannot determine whether there is still uncovered quality in the text semantics, nor can they determine whether the selected local view mainly corresponds to empty matches or irrelevant regions. Therefore, it is difficult to feed back the alignment error to the local view geometry.
[0005] Therefore, there is a need for a cross-modal retrieval method for cultural relics based on text-driven local view construction that can overcome the shortcomings of the existing technology. Summary of the Invention
[0006] One objective of this invention is to propose a cross-modal retrieval method for cultural relics based on text-driven local view construction. Addressing the problems of existing technologies that rely on a single global representation, lack textual semantic guidance for local regions, and fail to feed back alignment residuals to view geometry, this invention proposes parsing the retrieval text into semantic units with type and confidence levels. Multi-scale response maps of candidate cultural relic images are generated for each semantic unit. The center, width, height, and scale of candidate local views are determined based on the spatial distribution and cross-scale concentration of response quality. A set of local views is selected based on semantic coverage and view redundancy under a view quantity budget. Furthermore, semantic mismatch quality and view empty match quality are obtained through unbalanced transmission with type constraints and textual and visual empty match nodes. These qualities are used as control variables for local view translation, size correction, weight reduction, or deletion. After updating the local visual representation and local matching score, these are fused with the global matching score, thereby forming a local evidence extraction and feedback correction chain that dynamically corresponds to the retrieval semantics.
[0007] This invention provides a cross-modal retrieval method for cultural relics based on text-driven local view construction, including:
[0008] S1. Obtain the search text and candidate cultural relic images, parse the search text, and obtain a set of semantic units with semantic types;
[0009] S2. Extract the multi-scale visual feature map of the candidate cultural relic image, calculate the cross-modal response of each semantic unit to the multi-scale visual feature map, and obtain a multi-scale response map including response quality.
[0010] S3. Determine the position, size, and scale of the candidate local views based on the response quality in the multi-scale response map, and select a set of local views based on semantic coverage and view redundancy under the view quantity budget.
[0011] S4. Sample the local view set to obtain local visual representation, and obtain global visual representation from the multi-scale visual feature map;
[0012] S5. Construct a type-constrained unbalanced transfer graph containing text empty matching nodes and visual empty matching nodes between the set of semantic units and the local visual representation. Solve the type-constrained unbalanced transfer graph to obtain the local matching score, the quality of unmatched semantic units and the quality of empty matching of local views.
[0013] S6. Correct the position and size of the local view based on the unmatched quality of the semantic unit and the response quality outside the local view coverage, adjust the local view based on the local view empty matching quality, update the local visual representation and local matching score; merge the updated local matching score with the global matching score between the search text and the global visual representation to obtain the final search score and output the ranking result.
[0014] Optionally, S1 includes: using the retrieved text as input data for semantic parsing, performing word segmentation, dependency analysis and entity attribute recognition on the retrieved text, and classifying the recognition results into object semantic type, part semantic type, pattern or inscription semantic type, color or glaze semantic type, material or process semantic type and state or damage semantic type.
[0015] The dependency relationship weight is determined based on the relationship confidence output from the dependency relationship analysis and the mapping value associated with the corresponding relationship type in the dependency relationship type weight mapping table. The semantic confidence is determined based on the weighted result of the text fragment relevance, entity recognition probability, and the dependency relationship weight of the semantic unit.
[0016] Each semantic unit is recorded with its text location, semantic type, semantic confidence, dependency relationship with other semantic units, and the weight of the dependency relationship, forming the set of semantic units.
[0017] Optionally, S2 includes: encoding the semantic unit into a semantic feature vector, and projecting the spatial feature vectors in the visual feature maps at each scale to the same feature space as the semantic feature vector;
[0018] Calculate the similarity between the normalized semantic feature vector and the spatial feature vector, and retain non-negative response values for spatial locations with similarity not less than the response benchmark value;
[0019] When there is no spatial location that satisfies the response benchmark value or the sum of the retained response values is zero, the retained response value of the spatial location that ranks first in similarity is set to a unit value, and the retained response values of the remaining spatial locations are set to zero.
[0020] The response quality is obtained by dividing the retained response value at each spatial location by the sum of the retained response values of the same semantic unit at the corresponding scale. The response benchmark value is determined by the set quantile of the similarity distribution between non-corresponding semantic units and spatial feature vectors in the retrieval calibration sample.
[0021] The response quality at each scale is mapped to a unified image coordinate system to form the multi-scale response map.
[0022] Optionally, S3 includes: determining the center of the candidate local view based on the weighted centroid of the response quality, and determining the width and height of the candidate local view based on the second-order spatial moment of the response quality relative to the weighted centroid and the quantile boundary including the set cumulative response quality.
[0023] The cross-scale response concentration is determined based on the proportion of response quality at each scale that falls within the quantile boundary, and the scale of the candidate local view is selected based on the cross-scale response concentration.
[0024] A candidate local view graph is constructed using candidate local views as nodes. The semantic unit identifiers and corresponding semantic confidence scores covered by each candidate local view are written into the node attributes as a semantic coverage set. The redundancy formed by spatial intersection-union ratio and visual feature similarity is written into the edge attributes.
[0025] Furthermore, selecting the local view set includes: taking the union of the semantic coverage sets of the selected nodes, taking the sum of the semantic confidence of each semantic unit in the union as the set coverage gain, and taking the weighted sum of the spatial intersection-union ratio and visual feature similarity between the selected nodes as the set redundancy.
[0026] The set of local views is determined by subtracting the set redundancy from the set coverage benefit as the selection objective, provided that the number of selected nodes does not exceed the view quantity budget and the selected local views are within the boundary constraints of the candidate cultural relic images.
[0027] When there are no candidate local views that satisfy the image boundary constraints, the candidate local views are cropped to the image boundary. Image region sampling is then performed on the cropped candidate local views. The semantic coverage set, spatial intersection-union ratio, and visual feature similarity are re-determined, and the corresponding node attributes and edge attributes are updated. The local view set is then determined based on the updated candidate local view graph.
[0028] Optionally, S4 includes: converting the center, width, height, and scale of the local view into a sampling grid in the coordinate system of the candidate artifact image; using a differentiable sampling operator to interpolate and sample the multi-scale visual feature map within the sampling grid; and performing pooling and feature projection on the sampling results to obtain the local visual representation of each local view.
[0029] Scale alignment and weighted pooling are performed on the multi-scale visual feature map to obtain the global visual representation, wherein the pooling weights of each scale are determined according to the normalization of the feature response variance of the corresponding scale.
[0030] Optionally, S5 includes: reading a semantic type weight mapping table, a supply smoothing value, and a capacity smoothing value from the inference configuration data of the retrieval model, wherein the supply smoothing value and the capacity smoothing value are both greater than zero, and the mapping value of the semantic type of the semantic unit in the semantic type weight mapping table is the type weight.
[0031] Semantic units are encoded to obtain semantic feature vectors;
[0032] The normalized result of adding the product of the type weight, semantic confidence, and dependency weight to the supply smoothing value is the semantic supply quality of each semantic unit.
[0033] The sum of the squares of the proportions of response quality at each scale falling within the local view range is taken as the cross-scale response concentration. The sum of the semantic confidence of the semantic units covered by the local view is taken as the semantic coverage. The average of the normalized weighted values of the spatial intersection-union ratio and visual feature similarity between the local view and other local views in the set of local views is taken to obtain the redundancy aggregation value. The weighted result of the complement of the cross-scale response concentration, semantic coverage, and redundancy aggregation value is added to the capacity smoothing value and then normalized to obtain the view capacity of each local view.
[0034] The semantic type of the semantic unit that ranks first in the sum of response quality within the local view is recorded as the response source type of the corresponding local view. The transmission cost is determined based on the cross-modal similarity between the semantic feature vector and the local visual representation, the type compatibility between the semantic type and the response source type, and the local view spatial relationship corresponding to the dependency relationship between semantic units.
[0035] The transmission of semantic units to text empty matching nodes and the transmission of visual empty matching nodes to local views are taken as allowed edges. The type-constrained unbalanced transmission graph is solved with marginal deviation penalty constraints to obtain the transmission plan.
[0036] The local matching score is obtained based on the transmission quality between semantic units and local views and the corresponding cross-modal similarity. The alignment confidence is obtained based on the proportion of non-empty matching transmission quality to semantic supply quality. The unmatched quality of the semantic unit is obtained by dividing the transmission quality of each semantic unit to the text empty matching node by the corresponding semantic supply quality. The empty matching quality of the local view is obtained by dividing the transmission quality of the visual empty matching node to each local view by the corresponding view capacity.
[0037] Furthermore, solving the transport plan involves converting the differences between semantic feed quality and transport plan row margins, and the differences between view capacity and transport plan column margins, into marginal deviation penalty terms, respectively.
[0038] The weighted sum of transmission cost, marginal deviation penalty term, and transmission plan entropy regularization term is used as the transmission target;
[0039] The type compatibility is compared with a compatibility threshold. When the type compatibility is not less than the compatibility threshold, the edge between the corresponding semantic unit and the local view is determined as an allowed edge and a limited transmission cost is allocated. When the type compatibility is less than the compatibility threshold, a masking flag is allocated to the corresponding edge. The compatibility threshold is determined by a set quantile of the type compatibility distribution of the correct correspondence between the semantic type and the local view response source in the retrieved calibration sample.
[0040] The empty matching cost of text empty matching nodes and visual empty matching nodes is determined based on the transmission cost distribution of correct and non-corresponding pairs in the retrieval calibration samples.
[0041] The transmission plan is iteratively updated until the absolute value of the difference between two adjacent transmission targets is no greater than the convergence threshold or the number of iterations reaches a set upper limit, wherein the convergence threshold and the set upper limit are recorded in the inference configuration data.
[0042] Optionally, S6 includes: when the semantic unit mismatch quality exceeds the semantic mismatch threshold, deducting the response quality that overlaps with the current local view coverage in the corresponding multi-scale response map, and determining the translation amount and width and height correction amount of the local view center based on the centroid and dispersion of the remaining response quality.
[0043] The matching weights of the local view participating in the local matching score calculation are initialized to unit values. When the local view's empty matching quality exceeds the view's empty matching threshold, the width and height of the corresponding local view are reduced when the local view's empty matching quality is not greater than the first action threshold. When the local view's empty matching quality is greater than the first action threshold but not greater than the second action threshold, the size of the corresponding local view is shrunk, and the matching weights are multiplied by a decay coefficient. When the local view's empty matching quality is greater than the second action threshold, the corresponding local view is deleted. Here, the first action threshold is less than the second action threshold, and the decay coefficient is greater than zero and less than one.
[0044] The semantic mismatch threshold, the view empty match threshold, the first action threshold, and the second action threshold are determined by the set quantiles of the semantic unit mismatch quality distribution and the local view empty match quality distribution of the retrieval calibration sample, respectively.
[0045] Resample the local views that have not been deleted, multiply the matching weights into the matching contribution of the corresponding local view when recalculating the local matching score, and record the adjustment status and reason for the local view.
[0046] Furthermore, updating the local matching score includes: caching the local view, local visual representation, transport plan, local matching score, and alignment confidence before each local view adjustment; recalculating the transport plan after the local view adjustment; and comparing the absolute value of the difference between two adjacent local matching scores with the corrected termination threshold.
[0047] The local view adjustment is terminated when the absolute value is not greater than the correction termination threshold or the number of corrections reaches the upper limit of the number of corrections. The correction termination threshold is determined by the set quantile of the distribution of the absolute value of the difference in local matching scores obtained by continuous correction in the retrieved calibration sample. The upper limit of the number of corrections and the minimum sampling area are recorded in the inference configuration data.
[0048] When the sum of the remaining response quality is zero or the adjusted local view area is less than the minimum sampling area, the corresponding adjustment state is recorded as abnormal, the cached local view, local visual representation, transmission plan, local matching score and alignment confidence are restored, and the current round of adjustment of the corresponding local view is terminated.
[0049] The fusion weight of the updated local matching score and global matching score is determined based on the alignment confidence, and the final retrieval score, adjustment status, adjustment reason and sorting position are saved as retrieval verification records.
[0050] The beneficial effects of this invention are:
[0051] 1. Determine the position, width, height, and scale of the local view based on the multi-scale response quality corresponding to the semantic unit, so that the candidate image region changes with the semantics of object, part, texture, color, material, and state, reducing the omission of discriminative local evidence by fixed cropping and uniform block division.
[0052] 2. Based on the spatial and feature redundancy relationship between the semantic coverage set and the candidate local views, select a set of local views within the view quantity budget, and update node attributes and edge attributes after out-of-bounds clipping, thereby suppressing the dilution of local representation by the background region and repeated views.
[0053] 3. Two types of empty matching quality are obtained through unbalanced transmission with type constraints of text empty matching nodes and visual empty matching nodes. The local view geometry, matching weight and retention status are corrected with the empty matching quality so that the omitted semantics and irrelevant views can enter the feedback processing. The local and global matching scores are then combined to form the ranking result. Attached Figure Description
[0054] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0055] Figure 1 This is a flowchart of the cross-modal retrieval method for cultural relics based on text-driven local views, as described in this invention.
[0056] Figure 2 This is a flowchart of the construction and solution of the type-constrained unbalanced transport graph in S5 of the present invention. Detailed Implementation
[0057] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0058] refer to Figures 1-2A cross-modal retrieval method for cultural relics based on text-driven local views includes:
[0059] S1. Obtain the search text and candidate cultural relic images, parse the search text, and obtain a set of semantic units with semantic types;
[0060] S2. Extract the multi-scale visual feature map of the candidate cultural relic image, calculate the cross-modal response of each semantic unit to the multi-scale visual feature map, and obtain a multi-scale response map including response quality.
[0061] S3. Determine the position, size, and scale of the candidate local views based on the response quality in the multi-scale response map, and select a set of local views based on semantic coverage and view redundancy under the view quantity budget.
[0062] S4. Sample the local view set to obtain local visual representation, and obtain global visual representation from the multi-scale visual feature map;
[0063] S5. Construct a type-constrained unbalanced transfer graph containing text empty matching nodes and visual empty matching nodes between the set of semantic units and the local visual representation. Solve the type-constrained unbalanced transfer graph to obtain the local matching score, the quality of unmatched semantic units and the quality of empty matching of local views.
[0064] S6. Correct the position and size of the local view based on the unmatched quality of the semantic unit and the response quality outside the local view coverage, adjust the local view based on the local view empty matching quality, update the local visual representation and local matching score; merge the updated local matching score with the global matching score between the search text and the global visual representation to obtain the final search score and output the ranking result.
[0065] In this specific embodiment, S1 includes:
[0066] In this specific implementation, the cross-modal retrieval server receives the retrieval text and a set of candidate cultural relic images, generates a retrieval task identifier for this retrieval, and writes the UTF-8 encoded retrieval text, candidate image identifier, image width and height, collection source identifier, and model version number into the retrieval task record; the server performs full-width and half-width character unification, simplified and traditional Chinese character standardization, and punctuation boundary segmentation on the text, retaining the original character start and end positions, and empty text or input containing only stop symbols is marked as an invalid task and subsequent local view construction is stopped;
[0067] The server uses the retrieved text as input data for semantic parsing and performs cleaning on the input records. The cleaning rules include removing invisible control characters, compressing consecutive whitespace into a single space, converting variant punctuation marks into uniform boundary characters, merging synonyms according to the collection terminology, and preserving the character position mapping before and after cleaning. Candidate artifact images are deduplicated using image identifiers, and duplicate identifiers are retained for records that pass both resolution and integrity checks. Records with failed image decoding, zero width and height, or mismatched checksums are written to an exception queue.
[0068] The semantic parsing module employs a Chinese Transformer encoder and dependency parser fine-tuned for cultural relic description corpus. It organizes the word segmentation results into a lexical sequence list. Each lexical record includes the lexical identifier, the start and end positions of the original text, part of speech, dependency header identifier, dependency relation type, and relation confidence. The entity attribute recognition header outputs six categories of labels and their probabilities on the same encoding sequence: object, location, pattern or inscription, color or glaze, material or craftsmanship, and state or damage. The training samples are taken from verified collection catalog texts and expert retrieval phrases. The training set and validation set are divided according to cultural relic identifiers. The inference model version, label dictionary version, and macro-average harmonic evaluation value of the validation set are written into the model registration table.
[0069] During the training phase, the semantic parsing model is updated by weighting and updating the lexical cross-entropy, entity boundary loss, and dependency classification loss. The collection age, artifact type, and provenance institution are hierarchically distributed between the training and validation sets to avoid rewritten texts of the same artifact appearing across sets. The model is registered as a reasoning version only when the macro-average harmonic evaluation value of the six types of entities in the validation set is not lower than 0.86 and the dependency accuracy is not lower than 0.88. Versions that do not reach the validation limits remain offline.
[0070] For consecutive entities of the same type that span multiple word units, the semantic parsing module merges them into a semantic unit according to the start and end positions. It retains both nested objects and parts of entities and connects them with dependency edges. For duplicate entities generated from the same original text fragment, it retains the one with the higher label probability value. Each semantic unit records the unit identifier, text fragment, character range, semantic type, entity recognition probability, the identifier of the retrieval task to which it belongs, and the set of dependency edges with other semantic units. Fragments that do not fall into the six categories of labels and have a verification probability of less than 0.55 are not included in the semantic unit set.
[0071] The dependency relation type weight mapping table uses the relation type code as the lookup key and records the mapping value, effective range, corpus version, and effective time. In this specific implementation, the mapping values for subject-predicate, verb-object, attributive-head, coordinate, and prepositional relation mappings are set to 1.00, 1.00, 0.90, 0.80, and 0.75 respectively. Other registered relations use 0.60, and unregistered relations use 0.50 and are written to the calibration queue. The relation weights are calculated according to... calculate, Indicates the first The semantic unit and the first The dependency relationships between semantic units are weighted and dimensionless. and Indicates semantic unit index, This represents the relation confidence level output by the dependency parser and ranges from 0 to 1. Representing relation type Dimensionless mapping values in the mapping table, This indicates the encoding of the corresponding dependency relationship type;
[0072] Text fragment relevance is obtained by linearly mapping the cosine similarity between semantic unit encoding and whole sentence encoding from 0 to 1; entity recognition probability is directly taken as the posterior probability of entity attribute recognition head; all three terms are dimensionless values; semantic confidence is calculated according to... calculate, Indicates the first The semantic confidence of each semantic unit, with a value between 0 and 1. This indicates the relevance of the text fragment to the semantic unit. This represents the entity recognition probability of the semantic unit. This represents the average weight of the dependency relationships associated with this semantic unit. , and The three terms represent the dimensionless fusion weights, and their sum is 1. In this specific implementation, the grid search on the validation set selects 0.35, 0.40, and 0.25 respectively; the average value of the dependency weights of isolated semantic units is 0.50, and the calculation results are truncated to 0 to 1.
[0073] The semantic parsing module assigns semantic unit numbers in ascending order of the original text position and forms a semantic subgraph with the object unit and its directly or two-hop dependently reachable parts, patterns, colors, materials, and states. When an attribute unit is connected to multiple object units at the same time, the unit with the larger product value of the dependency path weight is selected first. If the products are the same, the unit with the smaller character distance value is selected. If they are still the same, the unit with the earlier original text position is selected, and the arbitration basis is saved in the edge record.
[0074] Before forming a set of semantic units, the semantic parsing module performs field integrity checks, requiring each unit to have text position, semantic type, semantic confidence, and encoding vector reference, and requiring that the starting and ending units of each dependency edge exist in the same retrieval task; if the semantic confidence is not a finite number or exceeds 0 to 1, it is recalculated using 64-bit floating-point numbers according to the same formula, and units that still do not meet the requirements are deleted and dangling dependency edges are deleted simultaneously.
[0075] An executable record in the semantic unit record table includes the retrieval task identifier, unit identifier, text fragment, character range, semantic type, semantic confidence, encoded vector reference, and dependency edge reference. The dependency edge record includes the starting unit identifier, ending unit identifier, relation type, relation confidence, and dependency relation weight. All confidence is stored as 32-bit floating-point numbers, the character range uses a left-closed, right-open index, and the encoded vector reference points to the semantic vector cache used by S2.
[0076] The semantic model registration form stores the training corpus deadline, the version of the collection terminology list, the number of samples for the six categories of labels, the validation limits, and the rollback version using the model version as the key. Offline retraining is triggered when the cumulative number of newly added collection catalog texts reaches 10,000 or the error rate of any semantic type in the online review records exceeds 0.10. The retrained model will only replace the inference version if the validation metrics for all six categories of labels are not lower than the current version. Otherwise, the current version will continue to be used and the review samples will be retained for the next round of training.
[0077] When the entity attribute recognition result is empty but there is a noun-type headword in the text, the semantic parsing module registers the headword with the highest label probability of not less than 0.40 as an object semantic unit and marks it as a low-confidence state. When there is no noun-type headword or the highest label probability is less than 0.40, the candidate task ends and returns to the unparsable state. The resulting set of semantic units, six semantic types, semantic confidence and dependency weights are written into the semantic unit cache and used as the common input for S2 cross-modal response calculation and S5 semantic supply quality calculation.
[0078] In this specific embodiment, S2 includes:
[0079] S2 reads the semantic unit cache and candidate artifact image records written by S1, scales the candidate images to 1024 pixels without distortion along the long side and fills them with zeros to form a 1024x1024 pixel input tensor, and records the scaling ratio and padding offset; the visual encoder adopts a hierarchical visual Transformer that is jointly contrastively learned with the text encoder, and outputs three-layer visual feature maps with strides of 8, 16 and 32 pixels. The spatial features of each layer are linearly projected by one to one to obtain a 512-dimensional vector. The text encoder encodes the original text fragment and its adjacent dependent fragments for each semantic unit and outputs a 512-dimensional semantic feature vector.
[0080] The visual encoder extracts features sequentially through an image block layer with a stride of 4 pixels and four levels of attention blocks. The outputs of levels 2 to 4 correspond to multi-scale visual feature maps with strides of 8, 16, and 32 pixels, respectively. Each layer output records the batch dimension, channel dimension, spatial width and height, feature stride, and effective region mask. The linear projection layer unifies the different number of channels to 512 dimensions, so that the spatial feature vectors of each scale are in the same feature space as the 512-dimensional semantic feature vector.
[0081] The joint coding model is trained using images from the collection, catalog texts, and manually annotated regions or decorative areas. The training objectives include image-text contrast loss and region semantic alignment loss. The calibration set is isolated from the training set according to the artifact identifier. Each training batch contains correct image-text pairs and difficult negative pairs of the same artifact type but semantically incompatible. Region annotations are drawn independently by two annotators and are submitted to a reviewer for confirmation when the intersection-union ratio is below 0.75. The inference configuration data records the visual encoder version, text encoder version, projection matrix version, input normalized mean and standard deviation, and response baseline values at each scale. Historical response caches are not reused when the model versions are inconsistent.
[0082] The cross-modal response module performs L2 normalization on the semantic feature vector and the projection vector at each spatial location at each scale, and then... Calculate similarity. Indicates the first A semantic unit at scale spatial location The dimensionless cosine similarity at the location Represents the normalized i-th A semantic feature vector, Represents the normalized scale In position Spatial feature vector at that location, Indicates scale index. and Represents the horizontal and vertical spatial indices of the feature map. This indicates the transpose of a vector; if the L2 norm of a vector is less than the positive protection value in the inference configuration, the corresponding vector will be marked as invalid and will not participate in the similarity ranking.
[0083] The response baseline value for each scale is determined by the 95th quantile of the similarity distribution between non-corresponding semantic units and spatial feature vectors in the calibration set. The configuration record uses semantic type and scale index as a joint key, and the fields include response baseline value, sample size, quantile, model version, and update time. This response baseline value also serves as a spatial matching threshold. During runtime, non-negative values are retained for positions with similarity not less than the spatial matching threshold, and zeros are written for positions with similarity below the threshold. If the joint key is not matched, the 97th quantile of all semantic types at the same scale is used, and a configuration fallback flag is recorded.
[0084] Nonnegative response values according to calculate, Indicates the first A semantic unit at scale Location The non-negative response value is retained at that point. Indicates the corresponding cosine similarity. This represents the dimensionless spatial matching threshold obtained by jointly looking up a table based on semantic type and scale. Indicates semantic unit index, Indicates scale index. and Indicates spatial location index, This indicates that the larger of the two values is taken; this calculation makes the response of positions below the spatial matching threshold 0.
[0085] Spatial matching threshold configuration is generated only on an independent calibration set and checked on an independent validation set for correct region response recall and non-corresponding region false activation rate. When the correct region response recall of a semantic type is below 0.85 at any scale, the quantile of that type is gradually reduced by one percentage point and revalidated. When the non-corresponding region false activation rate exceeds 0.10, it is gradually increased by one percentage point until both validation limits are met or the 90 to 99 quantile search boundary is reached. If the two validation limits are not met, the combination of scales for that type is discontinued.
[0086] For the semantic units and scales The retained response value is denoted as And in accordance with Calculate response quality, Indicates position The response quality at that point is a dimensionless value between 0 and 1. This indicates the non-negative response value retained when the value at that position is not less than the response baseline value. and The spatial location index used for summation at the same scale indicates the total number of retained response values for that semantic unit at the corresponding scale; the sum of the response quality at each location is 1; the module is further categorized according to... Record the amount of scale-based evidence that can be compared across scales. Indicates the first A semantic unit at scale Non-negative dimensionless scale of evidence Representing scale The positive reliability calibration coefficient, This represents the number of spatial locations of the valid regions in the original image at this scale. The summation iterates through the same valid regions. The reliability calibration coefficient is obtained by normalizing the median of the total number of valid location retention responses per unit in the independent calibration set of the same model version, so that the evidence of correct responses at the three scales is of the same order of magnitude. It is recorded together with the model version, scale index and calibration sample size.
[0087] When there is no position that meets the response baseline value, the total number of retained response values is zero, or all position vectors are invalid, the cross-modal response module selects the position with the highest similarity among the valid positions, sets the retained response value and response quality of that position to 1, and sets the remaining positions to 0; if there is no valid position, the scale is marked as unavailable and the other scales are responsible for the response calculation; when all three scales are unavailable, the retrieval calculation of the candidate image is terminated; when the highest similarity is tied, the first one is selected in ascending order of spatial index, first horizontally and then vertically.
[0088] The coordinate mapping module uses the scaling ratio, fill offset, and step size of each scale in the S2 input preprocessing record to map the feature map center of the response quality location back to the original coordinate system of the candidate artifact image. It also uses bilinear allocation to write the discrete quality into a uniform quarter-image resolution grid. The mapping rule takes the upper left corner of the input tensor as the origin, first subtracts the fill offset and then divides by the scaling ratio. The horizontal and vertical coordinates are truncated to the width and height boundaries of the original image, respectively. The mapping only changes the spatial carrying position of the quality and does not change the total quality of the same semantic unit at the same scale. After the quality falling in the fill area is deleted, it is renormalized when the remaining total quality is a finite positive number. When the remaining total quality is zero, the first one in the spatial position of the effective area of the original image at that scale is selected in descending order of similarity and its response quality is set to 1. When the similarity is the same, it is arbitrated in ascending order of horizontal and vertical coordinates. When there is no effective original image area position for the vector at that scale, it is marked as unusable and the remaining scales will take over. When all three scales are unusable, the retrieval calculation of the candidate image is terminated. The S2 end quality and verification skips the scales that have been marked as unusable.
[0089] After coordinate mapping is completed, the module uses the center of the manually labeled region as a reference to calculate the normalized distance between the centroid of the response quality and the labeled center on the validation set. The distance is divided by the image diagonal to obtain the dimensionless error. The median error of the same model version must not be higher than 0.08. If it exceeds this limit, the scaling ratio, padding offset and feature step size records are checked and the corresponding response map is stopped from being published to prevent the coordinate chain from entering S3 incorrectly.
[0090] Multi-scale response maps are grouped and stored according to candidate image identifiers, semantic unit identifiers, and scale indexes. Each response record includes uniform coordinates, response quality, original similarity, response baseline value, valid flags, and model version. At the same time, the number of non-zero locations, quality peaks, and quality centroids at each scale are recorded to help S3 determine the candidate local view geometry.
[0091] The response graph cache uses candidate image identifier, semantic unit identifier, joint coding model version and threshold configuration version as composite keys. Any change in any key value will invalidate the old cache. When a candidate image is re-entered into the database or the checksum is changed, its historical response index is deleted to prevent different image contents from sharing the same spatial response record.
[0092] After the cross-modal response module completes the calculation of all semantic units of the same candidate image, it verifies the response quality of each effective scale and the deviation from 1 to no more than 10 to the power of negative 6. If it exceeds this, it is renormalized using 64-bit floating-point numbers and the numerical correction flag is recorded. The multi-scale response map that has passed the verification is written into the response map cache as input for the construction of the S3 local view and the calculation of the remaining response quality in S6.
[0093] In this specific embodiment, S3 includes:
[0094] S3 reads the multi-scale response map of S2, traverses the non-zero response quality positions according to semantic units and scale, and forms response point records in the original coordinate system of the candidate cultural relic image. The fields include semantic unit identifier, scale index, horizontal and vertical coordinates, response quality, and boundary validity flag. The coordinate unit is uniformly pixels. Response points outside the valid area of the candidate image do not participate in the geometric calculation of the candidate local view.
[0095] Candidate view generation module according to and Calculate the weighted centroid. and They represent the first A semantic unit at scale The x and y coordinates of the candidate center are given, in pixels. This indicates the quality of the response obtained from S2. and Representing spatial location The x and y coordinates after mapping to the original image and Indicates a spatial location index;
[0096] Candidate view generation module according to and Calculate the second-order space moments. and They represent the first A semantic unit at scale The horizontal and vertical response variances are expressed in squared pixels. This indicates the spatial location of the semantic unit at this scale. The response quality obtained from S2, and These represent the x and y coordinates of the location mapped to the original image, in pixels. and These represent the x and y coordinates of the weighted centroid mentioned in the previous paragraph, in pixels. Indicates semantic unit index, Indicates scale index. and The horizontal and vertical indices of the spatial location are represented. Both summations traverse all valid spatial locations of the same semantic unit at the same scale. The module is also sorted by the horizontal and vertical offsets of the distance-weighted centroids to determine the smallest axis-aligned quantile boundary containing a cumulative response quality of 0.90. The candidate width and height are taken as the larger of the quantile boundary width and height and four times the horizontal and vertical standard deviations, respectively, and are restricted to between 0.08 and 0.80 of the length of the corresponding direction in the original image.
[0097] For the same semantic unit, the candidate view generation module first calculates the proportion of response quality that falls within the corresponding quantile boundary at each scale. Then according to Obtain the scale mass ratio, Indicates the first A semantic unit at scale The proportion of the response quality within the quantile boundary to the total response quality at that scale. This indicates the amount of cross-scale comparable evidence recorded in S2. Representing scale The dimensionless scale mass ratio, and the sum of the ratios of all available scales is 1. This represents the summation index of all available scales; when the sum of the products of the scale evidence quantity and the proportion of response quality within the quantile boundaries of all available scales is zero or not a finite positive number, the scale with the highest average original similarity per unit effective location is selected from the available scales and its proportion is set to 1. When scales are tied, arbitration is performed in ascending order of feature step size and then scale index, while simultaneously writing a scale evidence backoff flag; according to... Calculate the cross-scale response concentration. Indicates the first Dimensionless cross-scale response concentration of semantic units The scale index is represented; the concentration threshold is determined by a grid search of the top ten average precision values from a calibration set consistent with the current model version and is registered as 0.60; before scale constraint comparison, the feature step size in the input tensor is divided by the image scaling ratio recorded by S2 to obtain the effective step size of the original image belonging to the same pixel coordinate system as the candidate width and height; when the cross-scale response concentration is not less than the threshold, only the scale with the highest scale quality ratio and the effective step size of the original image is not greater than one-quarter of the short side of the candidate width and height is selected; when the cross-scale response concentration is less than the threshold, the scale with the highest scale quality ratio under the same constraint is the main scale, and its adjacent available scales are registered as auxiliary sampling scales. When no available scale satisfies the effective step size constraint of the original image, the available scale with the smallest effective step size of the original image is selected as the main scale, auxiliary scales are not registered, and a scale constraint backoff flag is written; when there are multiple scales, the scale with the smaller feature step size is selected first, and then the scale index is determined in ascending order; the scale quality ratio is uniformly used for the selection of main and auxiliary scales, local peak synthesis, S4 cross-scale characterization and S6 response synthesis, and the unavailable scale ratio is set to 0 and renormalized among the remaining scales; the candidate node records the scale evidence quantity, the quality ratio within the quantile boundary, the scale quality ratio, the cross-scale response concentration, the concentration threshold, the main scale, the auxiliary sampling scale, and the arbitration basis;
[0098] Local peak candidates are generated on a unified coordinate response grid of the main and auxiliary sampling scales registered in S3. Each participating scale is re-normalized among the actual available scales according to the quality ratio of the preceding scales and then weighted and synthesized. The synthesized grid is normalized again until the sum of the masses is 1. Points with a response value of not less than 0.02 and not less than other locations within a 7x7 grid neighborhood centered on the current location are recorded as initial peaks. Platform peaks are sorted in ascending order of x-coordinate and y-coordinate, retaining only the first point. Using the initial peak as a seed, response locations are absorbed outward according to the eight-neighbor connection relationship. Each time, from the leading edge positions that are connected to the eight-neighbor areas of the absorbed region and have not yet been absorbed, they are selected in descending order of response quality, ascending order of Euclidean distance to the seed center, ascending order of x-coordinate, and ascending order of y-coordinate. First, when the cumulative absorption quality first reaches or exceeds 0.90 of the quality of the connected response region to which the peak belongs, the last absorption position is retained and the process stops. The same sorting and arbitration rules are used for platform peaks and frontiers with multiple connected branches. Within the absorption region, candidate centers and dimensions are recalculated according to the aforementioned weighted centroid, second moment, and quantile boundary rules. Candidate scores are the product of the absorption region's response quality and the source semantic confidence. Non-maximum suppression is performed in descending order of scores. If the center distance is less than 0.25 times the smaller of the two candidates' shorter sides, only the candidate with the higher score is retained. If scores are the same, the order is determined sequentially by descending absorption quality, ascending area, and ascending center coordinates. Each semantic unit ultimately retains a maximum of three candidates; if fewer than three, the candidate is retained. All are retained; if there are more than three, the top three are selected. If there is no initial peak, a backoff candidate is formed using the aforementioned overall weighted centroid, and a backoff flag is recorded. For each candidate rectangle, the module uses the scaling ratio, fill offset, and feature step size recorded in S2 to convert the rectangle boundary to the feature map coordinates of the registered main scale and auxiliary sampling scale, respectively. Within each actual usable scale, bilinear region alignment is performed at a fixed grid center to obtain a 7x7x512 sampling tensor. After channel layer normalization, the average pooling at 49 locations yields a 512-dimensional scale summary. Each scale summary uses the scale quality ratio registered in S3 as the original weight, is re-normalized between actual usable scales, weighted summed, and then subjected to L2 normalization with positive protection values to obtain... The unique 512-dimensional initial local feature summary has a weight of 1 when a single scale is available. If sampling at a certain scale fails, its weight is proportionally distributed to the remaining available scales. If sampling at all registered scales fails, the summary is marked as invalid, the visual feature similarity is set to 0, and only spatial intersection-union comparisons are allowed to trigger redundant edges. The candidate local view node fields include node identifier, center, width and height, main scale, auxiliary sampling scale, cross-scale response concentration, candidate score, boundary state, set of covering semantic units, local feature summary, summary validity flag, participating scale, and normalized scale weight. The set of covering semantic units consists of semantic units that fall into the candidate rectangle and whose cumulative response quality is not less than 0.60, and the corresponding semantic confidence is recorded.
[0099] Edges are established between candidate local view graphs when the spatial intersection-union ratio (IUU) of any two nodes is greater than 0 or the cosine similarity of local features is not less than 0.70. Edge redundancy is determined according to... calculate, Represents a node With nodes Dimensionless redundancy between 0 and 1 This represents the spatial intersection-union ratio of two candidate rectangles. This represents the value of the cosine similarity of local features between two nodes after mapping from 0 to 1. and This indicates that the redundancy fusion weights sum to 1; in this specific implementation, they are set to 0.60 and 0.40 respectively. and Indicates the candidate node index;
[0100] Within the view quantity budget, select modules based on node sets as candidates, according to... Evaluate the selected set, Represents a set The larger the value, the better. Represents the set of selected candidate nodes. Represents a set The union of the semantic coverage sets of each node in the set. Indicates the first obtained by S1 Semantic confidence of each semantic unit Represents a node With nodes Redundancy, This represents a dimensionless redundancy penalty coefficient, determined to be 0.35 by grid search of the calibration set retrieval ranking index. This means that each node pair is counted only once;
[0101] The selection module employs a deterministic greedy algorithm, starting from an empty set and adding valid boundary nodes that maximize the incremental change of the selection target in each round, until the increment is no greater than 0 or the number of nodes reaches the view quantity budget. In this specific implementation, the view quantity budget is 6. If the increments are the same, the node with the larger semantic coverage confidence score, smaller area value, and smaller node identifier value is selected in that order. Unselected nodes are retained in the candidate image for S6 feedback correction. When the set is empty after the greedy process, among the candidates with valid boundaries, width and height of no less than 32 pixels, and a non-empty semantic coverage set, the first node is selected as the deterministic non-empty backoff node in that order, in descending order of semantic coverage confidence score, descending order of candidate score, ascending order of area, and ascending order of node identifier. If no qualified candidate still exists, the candidate image is marked as a local branch unusable, and no pseudo-local view is generated.
[0102] When a candidate rectangle crosses the image boundary, it is first cropped to the valid image area. If the cropped area is not less than 0.50 of the original area and both width and height are not less than 32 pixels, the local feature summary is regenerated using the aforementioned fixed grid bilinear region alignment, pooling, cross-scale weighting, and normalization rules. The semantic coverage set, spatial intersection-union ratio, visual feature similarity, node attributes, and connected edge attributes are recalculated. If there are no valid boundary nodes, the above update is performed only if the candidate with the largest cropped area meets the area ratio and minimum width and height conditions, and it is selected as the only node. Nodes that are still smaller than the minimum size after cropping are marked as invalid and cannot be selected. If all candidates are invalid, the candidate image is marked as a local branch that is unavailable.
[0103] After the set of local views is determined, the selection module checks the set coverage and repetition rate of the artificial part regions in the calibration set. The set coverage is the proportion of the number of high-confidence semantic units covered by any view to the total number of high-confidence semantic units. The repetition rate is the average of the pairwise spatial intersection-union ratios of the selected views. When the coverage is lower than 0.80 or the repetition rate is higher than 0.45, only the redundancy penalty coefficient and the view number budget are adjusted and the same selection rule is re-executed without changing the geometric and semantic confidence sources of the candidate nodes.
[0104] The selected nodes are sorted by semantic coverage confidence and in descending order to generate local view records. Each record includes local view identifier, source semantic unit, center, width and height, scale, node version, semantic coverage set, boundary adjustment status, and candidate graph reference. The local view set and candidate local view graphs are written to the view cache for S4 to sample local visual representations and for S6 to perform geometric feedback adjustments.
[0105] In this specific embodiment, S4 includes:
[0106] S4 reads the set of local views from S3, the three-layer visual feature map from S2, and the image preprocessing record. It establishes a normalized sampling grid of 7x7 for each local view. The center, width, and height of the local view are first converted from the pixel coordinates of the original image to the input tensor coordinates, and then converted into the continuous coordinates of the corresponding feature map according to the feature step size of each scale. The scaling and filling parameters are taken from the record of S2 to avoid coordinate drift caused by repeated scaling.
[0107] For the horizontal index of the sampling grid and vertical index The original image sampling coordinates are based on and Sure, and These represent the x and y coordinates of the sampling points, respectively, with the unit being pixels. and These represent the x and y coordinates of the center of the partial view, respectively, in pixels. and These represent the width and height of the partial view, respectively, in pixels. and This represents the sampling grid index with values from 0 to 6; the coordinates on the boundary are truncated to the valid image range, and the truncation flag is written to the sampling record;
[0108] The differentiable sampling operator performs bilinear interpolation on the selected scale and its adjacent scales. Each sampling point is weighted by the product of the horizontal and vertical distances of the four adjacent feature locations, and the sum of the distance weights is normalized to 1. If the adjacent scales are marked as unavailable by S2, only the selected scale is used. If the selected scale is unavailable, the second highest scale quality ratio of the available scale is selected. If all scales are unavailable, the local view is marked as a sampling failure and deleted from the local matching in this round.
[0109] The 7x7x512 sampling tensor obtained at each scale is first normalized at the channel layer, and then attention pooling is performed on 49 spatial locations. The attention query vector is generated by the confidence-weighted semantic vector of the corresponding local view covering semantic unit. The pooling output of each scale is first passed through the same shared linear projection to obtain a 512-dimensional scale output. Then, using the scale quality ratio recorded in S3 as the original weight, the weights are renormalized to a sum of 1 between the main scale and auxiliary sampling scales that are actually available in this view. After weighted summation of the outputs of each 512-dimensional scale, L2 normalization is performed to form a unique 512-dimensional local visual representation for each local view. When only one scale is available, its normalized weight is 1. When an auxiliary scale is unavailable, its weight is proportionally distributed to the other available scales. When all scales are unavailable, the sampling failure branch is entered. The participating scales, normalized weights, local view identifiers, node versions, vector norms, and truncation ratios are recorded.
[0110] When a local view covers multiple semantic units, the attention query vector uses the weights normalized by the semantic confidence of each semantic unit; when the coverage set is empty, the semantic vector of the source semantic unit of the local view is used; when the source semantic unit is also unavailable, the view enters the sampling failure branch; local views with a truncation ratio exceeding 0.40 retain the representation but write the boundary low reliability flag, which is used by S5 to reduce the effective capacity when calculating the view capacity.
[0111] The global representation module bilinearly aligns the three-layer visual feature maps to a spatial grid with a stride of 16 pixels, performs channel normalization and global average pooling on each layer, and follows the... Determine the scale pooling weights. Representing scale The dimensionless pooling weights have a sum of 1 across all scales. It represents the channel average variance of all effective spatial characteristic responses at this scale, and is a dimensionless value. This represents a positive smoothing value to prevent all variances from being zero, and is set to 10 to the power of negative 6 in the inference configuration. Indicates the scale index used for summation;
[0112] Global visual representation according to get, This represents a 512-dimensional normalized global visual representation. Representing scale The 512-dimensional vector obtained after alignment and global average pooling This indicates the corresponding scale pooling weight. Indicates scale index. This represents the L2 normalization operator with positive protection values; weights that cannot be scaled are set to 0 and the remaining weights are renormalized;
[0113] Local visual representations are written to the local representation cache using the local view identifier and node version as a joint key, while global visual representations are written to the global representation cache using the candidate image identifier and visual encoder version as a joint key. Local records also store the semantic unit identifier, sampled grid summary, boundary low reliability flag, and feature vector checksum, enabling S6 to resample only the local views that have changed after adjusting the geometry.
[0114] After S4 is completed, the number of local visual representations is checked to be consistent with the number of local views that were not deleted and were successfully sampled. All output vectors are checked to be finite values and the deviation of the L2 norm from 1 does not exceed 10 to the power of -5. The checked local visual representations are passed to S5 to construct a type-constrained unbalanced transport graph. The global visual representations are retained until S6 to calculate the global matching score with the retrieved text and complete the final fusion. If S3 has marked the local branch as unavailable, or if the number of local visual representations is zero after S4 deletes the failed sampled views, a zero valid local view flag is written, ordinary visual nodes are not passed to S5, and valid global visual representations are retained for subsequent global rollback.
[0115] In this specific embodiment, S5 includes:
[0116] S5 reads the semantic unit set of S1, the local view set of S3, and the local visual representation of S4, and reads the semantic type weight mapping table, type compatibility matrix, supply smoothing value, capacity smoothing value, compatibility threshold, empty matching cost, marginal penalty coefficient, entropy regularization coefficient, convergence threshold, and iteration upper limit from the inference configuration data; the configuration uses the model version and calibration set version as joint keys, and the values record the effective range and effective time. When the versions are inconsistent, the solution is stopped and the configuration is not mixed; when zero valid local view flags are read or the local visual representation set is empty, the transmission graph containing ordinary visual nodes is not constructed and the transmission solution is not started. The local matching score and alignment confidence are both set to 0, the unmatched quality of each semantic unit is set to 1, the empty matching quality of the local view is recorded as an empty set, the local branch is unavailable and the global rollback state is written, and the process is directly transferred to the global rollback branch of S6;
[0117] A record in the semantic type weight mapping table contains the semantic type, type weight, and calibration sample size. In this specific embodiment, the type weights for object, part, pattern or inscription, color or glaze, material or process, and condition or damage are 1.00, 0.95, 1.10, 0.80, 0.90, and 1.05, respectively; the supply quality is based on... calculate, Indicates the first The dimensionless semantic supply quality of semantic units 0 to 1, This represents the dimensionless type weight of the semantic type of the unit. Indicates semantic confidence. This represents the mean of the weights of the interdependencies within this unit. This represents a supply smoothing value greater than 0 and is set to 10 to the power of negative 4. Indicates the summation index of semantic units;
[0118] For the For each local view, the module first aggregates the multi-scale responses of all semantic units within the semantic coverage set of that view. The aggregation weight of each semantic unit is taken as its normalized semantic confidence. When the coverage set is empty, only the source semantic units that generated the view are retained, and their weights are set to 1. If a semantic unit or scale lacks a valid response, it is excluded, and the weights are re-normalized among the remaining valid semantic units. The response quality at each scale is obtained by weighted summing of the response quality of each valid semantic unit at that scale that falls within the view's range, and then... Obtain the cross-scale response concentration. This represents the dimensionless cross-scale response concentration from 0 to 1. Representing scale The proportion of the aggregation response quality to the total aggregation response quality of all effective scales in this view. The scale index is represented; when the aggregated response quality of all valid scales is zero, the available scale with the highest response quality in the source semantic unit is selected first and its ratio is set to 1. If there is still no valid response, the view is marked as invalid capacity input and removed from subsequent capacity normalization; the semantic coverage is the sum of semantic confidence in the node coverage set and divided by the sum of confidence of the current semantic unit to obtain the normalized coverage between 0 and 1.
[0119] The redundancy aggregation value is the average of the spatial intersection-union ratio and the normalized weighted value of visual feature similarity between the local view and other currently valid local views that have not been deleted. If no other valid local views exist, the redundancy aggregation value is set to 0, indicating no cross-view redundancy; otherwise, the number of other valid local views is used as the average number of terms. The reliability coefficient for low-reliability boundary views is set to 0.8, and for the rest to 1; the original view capacity is calculated according to... calculate, Indicates the first The dimensionless original capacity of a partial view This indicates the first paragraph mentioned above. The dimensionless multi-scale response concentration of each local view from 0 to 1 is calculated using the corresponding formula. This represents the normalized semantic coverage. Represents redundant aggregate values from 0 to 1. , and This indicates a dimensionless capacity weight, and the sum of the three is 1. The index represents the local view. In this specific embodiment, the three capacity weights are 0.35, 0.40, and 0.25, respectively. The view capacity is obtained by multiplying the original capacity by the reliability coefficient, adding the capacity smoothing value, and then normalizing it across all views.
[0120] The transmission graph uses semantic units as ordinary nodes on the text side and local views as ordinary nodes on the visual side, and adds text empty matching nodes and visual empty matching nodes respectively; the semantic type of the semantic unit with the highest sum of response quality within the local view is recorded as the response source type of that view; the type compatibility matrix uses semantic type and response source type as joint keys to record compatibility from 0 to 1, calibration sample size and version; the 10th quantile that correctly corresponds to the compatibility distribution is set as the compatibility threshold;
[0121] The transmission cost between ordinary nodes is based on calculate, Represents semantic units With partial view The dimensionless transmission cost between them is minimized, and the smaller the cost, the better. This represents the value of the cosine similarity between the semantic feature vector and the local visual representation after mapping from 0 to 1. Indicates the semantic type's compatibility with the response source type as a number between 0 and 1. This indicates the degree to which the dependency relation is not satisfied and takes a value between 0 and 1. , and The three non-negative weights sum to 1, which in this specific implementation are 0.55, 0.25, and 0.20 respectively. The horizontal axis of the image coordinates is to the right, and the vertical axis is downward. The spatial dependencies are constructed in the order of spatial terms first, followed by the mapping table of collection locations, and finally non-spatial dependencies. For top, bottom, left, and right relationships, the displacement of the candidate center beyond the corresponding directional boundary of the object center is used as the violation deviation, with the horizontal deviation divided by the width of the object rectangle and the vertical deviation divided by the height of the object rectangle. For internal or inner wall relationships, the maximum distance of the candidate rectangle beyond the four sides of the object rectangle is divided by the corresponding width or height of the object rectangle as the violation deviation. For perimeter relationships, the normalized distance is obtained by dividing the distance from the candidate center to the nearest boundary of the object rectangle by the length of the short side of the object rectangle, and a value not greater than 0.10 is considered satisfactory. When the direction or inclusion criterion is satisfied... The value is set to 0. When the violation deviation is greater than or equal to the tolerance, it is set to 1. When the deviation is between 0 and the tolerance, the corresponding degree of non-compliance is obtained by linear interpolation of the violation deviation divided by the tolerance. The orientation and inclusion tolerance are set to 0.10 in the current model version configuration. This value is selected from the independent calibration set using a grid with a step size of 0.02 to 0.20. If the configuration is missing, non-finite, or not greater than 0, it is rolled back to 0.10, and a rollback flag is recorded. When there are multiple object views, the one with the highest semantic coverage confidence is selected. If they are in tandem, they are ordered in ascending order by view identifier. If an object view is missing, the object rectangle width or height is not greater than zero, the mapping table is not hit, or the dependency relationship does not express spatial meaning, the following conditions apply: Set the neutral value to 0.50 and record the reason for the rollback;
[0122] When the type compatibility is not less than the compatibility threshold, ordinary edges are retained and a limited transmission cost is written. When it is less than the compatibility threshold, a masking flag is written and the edge does not participate in the iteration. Edges from semantic units to text empty matching nodes and from visual empty matching nodes to local views are always allowed. The empty matching cost of the two is taken as the value that maximizes the ranking index of the validation set near the intersection of the cost distribution of correct and non-corresponding pairs in the calibration set. Type pairs not registered in the compatibility matrix adopt a compatibility of 0 and can only be transmitted through empty matching edges.
[0123] The row target supply quality of visual empty matching nodes is constructed according to 0.20 of the total general view capacity, and the column target capacity of text empty matching nodes is constructed according to 0.20 of the total general semantic supply quality. The coefficient 0.20 is determined by the same version calibration set in the range of 0.05 to 0.50 with a grid search of 0.05 steps and the maximum average accuracy of the top ten retrieved items. This represents the row target vector composed of the total general semantic supply quality and the visual spatial matching node supply quality. This represents the column target vector consisting of the total capacity of all normal views and the capacity of empty matching nodes in the text; the configuration records two empty matching target coefficients, calibration sample size, version and validity period. If the configuration is missing, the previous valid version is used, and the solution stops when the previous version does not exist.
[0124] Transmission Plan By minimizing Seeking, This indicates a dimensionless transmission target, and the smaller the value, the better. Represents a non-negative transport plan matrix. Represents a node To node Transmission quality, This indicates the corresponding transmission cost. and This represents a positive dimensionless marginal deviation penalty coefficient. This represents the marginal deviation function of the generalized relative entropy as defined in the next paragraph. This represents a vector of all 1s with the same dimension as the corresponding target vector. and These represent the row target vector and column target vector defined in the previous section, respectively. Indicates the transpose of the transmission plan. Represents the positive dimensionless entropy regularity coefficient. This represents the entropy regularization term for the transmission plan defined in the next section. and These represent the row node and column node indices, respectively. The first item sums only the edges in the allowed edge set.
[0125] The generalized relative entropy marginal deviation function is according to calculate, Represents a nonnegative dimensionless vector of the same dimension. Relative to the target vector dimensionless generalized relative entropy, and Represent the first and second vectors respectively. One portion, This represents the index of all vector components, including ordinary nodes and their corresponding empty matching nodes. Represents the natural logarithm; by convention hour Take 0, and When this component is positive infinity, The total contribution of this component is taken as 0; the entropy regularization term is based on... calculate, This represents the dimensionless negative entropy regularization term. This represents the set of allowed edges determined by type compatibility and null matching rules. This represents the row and column index pairs that allow edges; summation only iterates through them. and agreed hour Set to 0;
[0126] During the solution process, except for negative constraints, for each ordinary semantic unit Apply And for each ordinary local view Apply In the preceding formula Traverse all allowed target nodes of the semantic unit, including empty matching nodes, in the latter formula Iterate through all allowed source nodes that flow to this partial view, including visually empty matching nodes. and These represent the corresponding ordinary semantic supply quality and ordinary view capacity, respectively; this hard upper bound, together with the generalized relative entropy soft marginal deviation, enters the constrained solution, ensuring that the quality flowing to the empty matching node of the text is no greater than the corresponding Furthermore, the quality of the visual empty matching node flowing into the local view is no greater than that of the corresponding node. ;
[0127] The solver employs a logarithmic domain generalized Sinkhorn iteration, updating the logarithmic scaling variable only on the allowed edges between ordinary nodes. After each kernel scaling update, it first calculates the sum of the quality of ordinary semantic rows flowing to ordinary local views. If this exceeds the corresponding semantic supply quality, it subtracts the natural logarithm of the excess proportion from the logarithmic transmission quality of all ordinary allowed edges in that row. Then, it calculates the sum of the quality received by ordinary local view columns from ordinary semantic nodes. If this exceeds the corresponding view capacity, it subtracts the natural logarithm of the excess proportion from the logarithmic transmission quality of all ordinary allowed edges in that column. Column projection only reduces edge quality without violating the already satisfied row upper bound. Subsequently, the unused supply difference of each ordinary semantic row is written over the transmission edge from the semantic unit to the text empty matching node, and the unfilled capacity difference of each ordinary local view column is written over the transmission edge from the visual empty matching node to the local view, ensuring that the total supply difference of ordinary semantic rows is equal to the supply difference of the text empty matching node. Transmission quality equals the corresponding semantic supply quality, and the total reception quality of ordinary local view columns equals the corresponding view capacity. Empty matching edges are updated using the difference coverage of this round without being accumulated with the previous round, and forbidden edges always maintain zero quality. After each iteration, the current plan is recorded as a feasible iteration and the transmission target is calculated only if the quality of all allowed edges is a finite non-negative number, the quality of all forbidden edges is zero, and the absolute values of the difference between the total quality of each ordinary row and the supply quality, and the difference between the total quality of each ordinary column and the view capacity, do not exceed 10 to the power of -8. If the feasibility check fails, the current plan is not accepted, the previous feasible plan is restored, and the entropy regularization coefficient is doubled to retry once. The process stops when the absolute value of the difference between two adjacent feasible transmission targets is not greater than 10 to the power of -6 in the inference configuration or the number of iterations reaches 300. If a non-finite value appears or the process is still infeasible after retrying, the candidate image is marked as a transmission solution failure and is not included in the final sorting.
[0128] Local matching score according to calculate, The value represents a local matching score from 0 to 1, with a higher score indicating a better local matching. The summation only includes allowed edges from ordinary semantic units to ordinary local views. This indicates the transmission quality of that side. This indicates the corresponding cross-modal similarity. and These represent ordinary semantic units and ordinary local view indices, respectively; when the total transmission quality of ordinary allowed edges is zero, the local matching score is set to 0 and a no-valid-match flag is written.
[0129] Alignment confidence is calculated by dividing the sum of the transmission quality of ordinary semantic units flowing to ordinary local views by the sum of the quality of all ordinary semantic units supplied; the quality of mismatched semantic units is determined according to... calculate, Indicates the first The quality of unmatched semantic units ranging from 0 to 1. This indicates that the semantic unit flows to the text empty matching node. Transmission quality, Indicates an empty matching node in the text. Indicates the corresponding semantic supply quality; local view empty matching quality is according to calculate, Indicates the first The quality of empty matching for each local view from 0 to 1. Represents visual empty matching nodes The transmission quality to this local view, Indicates a visual empty matching node. The corresponding view capacity is indicated; the range of 0 to 1 for the two ratios is guaranteed by the aforementioned difference coverage rule for each round and the total mass equation of ordinary node rows and columns. When the denominator is not a finite positive number, the corresponding ratio is set to 1 and written to the supply or capacity abnormality flag. The threshold comparison and calibration sample quantile of S6 use the backed-up ratio of the same name.
[0130] The transmission plan, local matching score, alignment confidence, quality of unmatched semantic units and quality of empty matching of local views are written into the matching status cache along with the configuration version. The cache also stores the allowed edge mask, the reason for empty matching and the solution convergence status, which serve as the direct input for S6 to judge missing semantics and irrelevant views and to perform local view feedback adjustments.
[0131] In this specific embodiment, S6 includes:
[0132] S6 reads the matching state cache of S5, the multi-scale response map of S2, the local view and candidate map of S3, and the local and global visual representations of S4, and reads the semantic mismatch threshold, view empty match threshold, first action threshold, second action threshold, attenuation coefficient, correction termination threshold, upper limit of correction times, and minimum sampling area from the inference configuration; the semantic mismatch threshold is read according to the semantic unit type, and the view empty match threshold and the two-level action threshold are read according to the view response source type recorded in S5; these thresholds are determined by the set quantiles of the corresponding quality or score difference distribution in the retrieval calibration samples consistent with the current model version, and the configuration records the applicable type, quantiles, sample size, and update time;
[0133] For each semantic unit that triggers feedback, S6 reads the response quality on the unified coordinate grid of S2 according to the main scale and auxiliary sampling scale recorded in S3 for its local view to be adjusted. Using the scale quality ratio registered in S3 as the original weight, it is re-normalized to a sum of 1 among the actual available scales and then weighted and synthesized position by position. The synthesized response quality is then normalized to a sum of 1 again, serving as the unique unified coordinate response map for this round. When an auxiliary scale is missing, its weight is proportionally allocated to the other available scales. When the main scale is unavailable, the available auxiliary scale with the highest scale quality ratio is selected. If they are in parallel, they are sorted in ascending order by scale index. When all registered scales are unavailable or the weight sum is zero, the feedback of the semantic unit is stopped and a response scale anomaly flag is written. All scales that have been mapped to the same original map coordinate grid are directly accumulated at the positions that fall in the same coordinate. When there are no records in the same coordinate, they are aligned according to the same bilinear allocation rule as in S2.
[0134] The mapping from semantic units to the local views to be adjusted first filters the currently selected views that cover the semantic unit, and then selects the first view in descending order of the ordinary edge transmission quality from the semantic unit to the view, descending order of the response coverage quality of the semantic unit within the view, descending order of semantic coverage confidence, and ascending order of view identifier. If there are no selected views, the first view is selected from the unselected candidates retained by S3 in descending order of candidate score, ascending order of area, and ascending order of node identifier to be added to the current view set. If the number of views has been reached, the view that has not been selected by any triggered semantics in this round and has the highest empty match quality is deleted first. If the empty match quality is tied, the view is selected in ascending order of matching weight and then view identifier. Delete objects are selected in descending order, and then candidates are added. If the budget is full and all selected views are selected by the triggered semantics in this round, the current view set is not changed, no candidates are added, the current semantics are marked as budget conflict pending and deferred to the next round. If this state occurs in the last round or the next round when there are still no views to delete, the unadjustable state is recorded and the original view set is retained. If there are no candidates to add, the unadjustable state is also recorded. When the same view is selected by multiple triggered semantics, only the one with the highest unmatched quality is processed. If the unmatched quality is tied, the selection is carried out in descending order of semantic confidence and ascending order of semantic unit identifier. The remaining semantics are deferred to the next round for remapping.
[0135] When the When the quality of a semantic unit's unmatched response exceeds the semantic mismatch threshold, the adjustment module deducts the response quality overlapping with the current local view's coverage area from the unified coordinate response map of that semantic unit and renormalizes the remaining quality; according to and Determine the translation amount. and These represent the horizontal and vertical translations of the center of the local view, respectively, in pixels. and The x and y coordinates represent the weighted centroid coordinates of the remaining response quality, in pixels. and These represent the horizontal and vertical coordinates of the center of the current local view, respectively, in pixels.
[0136] The horizontal and vertical dispersion of the residual response quality according to and calculate, and They represent the first The horizontal and vertical standard deviations of the residual responses of each semantic unit, in pixels. Indicates the remaining positions The quality of the renormalized response. and Representing positions respectively The x and y coordinates are in pixels. Indicates the index of the remaining response location. and The x and y coordinates of the centroid of the remaining response are represented in pixels, and the square root operation takes the non-negative principal value.
[0137] The width and height correction amount is jointly determined by the horizontal and vertical standard deviations of the remaining response quality relative to the remaining centroid and the quantile boundary containing 0.90 of the cumulative remaining quality. The target width and height are taken as the larger value between the quantile boundary width and height and four times the standard deviation, and then the current width and height are subtracted to obtain the correction amount. After translation, the center is restricted to within the image boundary, and the target width and height are restricted to between 32 pixels and 0.80 times the corresponding image side length. When it exceeds the boundary, the same cropping and node attribute update as S3 are performed.
[0138] Each local view's matching weight is initialized to 1. When its empty match quality exceeds the view's empty match threshold but is not greater than the first action threshold, its width and height are multiplied by 0.90 to exclude edge backgrounds. When the empty match quality is greater than the first action threshold but not greater than the second action threshold, its width and height are multiplied by 0.75 and the matching weight is multiplied by a decay coefficient of 0.70. When the empty match quality is greater than the second action threshold, the local view is deleted. The first action threshold is strictly less than the second action threshold, and all thresholds and decay coefficients are dimensionless values between 0 and 1.
[0139] At the start of each round, the S5 matching state of the current round is frozen, and a set of actions for deletion, empty matching shrinkage and weight reduction, and semantic omission geometric correction is generated at once. All trigger judgments use the unmatched quality and empty matching quality in the frozen state. The action priority is as follows: deletion, semantic omission translation and target width and height correction, and empty matching shrinkage and weight reduction. The deletion action is mutually exclusive with other actions. When the same undeleted view has both semantic omission and empty matching actions, the center and target width and height are determined first according to the semantic omission result. Then, the target width and height are multiplied by the corresponding empty matching shrinkage coefficient and boundary and minimum area checks are performed. The matching weight reduction is performed last. Multiple semantic geometric proposals for the same view are retained according to the front-end mapping rules. After all view actions are applied, the geometric version is incremented uniformly, resampled once, and the transport plan is solved again. Recalculation is not performed between individual actions. If any action causes resampling or solution failure, the pre-round cache is restored for the entire round.
[0140] Before each local view adjustment, the caching module saves the local view geometry, node and edge attributes, local visual representation, transport plan, local matching score, alignment confidence and matching weight with the candidate image identifier, adjustment round and local view version as keys; the local views that have not been deleted are resampled by the same sampling rules of S4, the local representation version increases with the geometry version, and then the allowed edges are reconstructed and the transport plan is solved with the same configuration of S5.
[0141] When recalculating the local matching score, the matching weight of each local view is multiplied into the transmission contribution corresponding to that view in both the numerator and denominator of the S5 local matching score, so that the influence of the shrunken and deweighted view on the score is reduced synchronously while the score remains between 0 and 1; each round records the local matching score, alignment confidence, number of local views, deletion flag, translation amount, size correction amount and trigger threshold before and after adjustment.
[0142] Calculation for each adjustment round , Indicates the first The absolute value of the difference between the local matching scores of the round and the previous round, and is a dimensionless value. This indicates the adjustment round starting from 1. Indicates the first The local matching score after each round of updates This represents the local matching score in the previous round, and the absolute value sign indicates that the difference is non-negative.
[0143] When the absolute value of the difference between local matching scores in two adjacent rounds is not greater than the correction termination threshold, and the delayed semantic queue and the budget conflict queue are both empty, and there are no trigger items that still exceed the corresponding threshold but have not yet been executed or have not yet been clearly marked as unadjustable, the adjustment is terminated. In this specific implementation, the correction termination threshold is taken as the 90th quantile of the absolute value of the continuous correction score difference of the calibration sample and is limited to between 0.005 and 0.02. When the score difference meets the termination threshold but there are still pending items, the next round continues until all queues are cleared or the maximum number of corrections is reached (3 times). When the maximum number of corrections is reached, the round also terminates. If there are still unmatched quality, delayed semantic, budget conflict, or unadjustable items that exceed the threshold, the incomplete convergence or unadjustable state, the corresponding semantic unit identifier, and the reason are written in the retrieval verification record. It is not registered as converged and the loop does not continue.
[0144] When the sum of the remaining response quality after deducting the coverage area of a semantic unit is zero, the adjusted local view area is less than the minimum sampling area of 1024 square pixels in the inference configuration, resampling fails, or the transmission solution fails, the current adjustment state is recorded as abnormal, the local view, local visual representation, transmission plan, local matching score, and alignment confidence of the previous cached version are restored, and the current adjustment of the corresponding candidate image is terminated; the restoration operation retains the reason for the abnormality, the failure round, and the restoration version number;
[0145] The threshold configuration table uses model version and applicable type as a joint key: semantic type records the semantic mismatch threshold, view response source type records the view empty match threshold and two-level action threshold, and model version level records the correction termination threshold; the two-level action thresholds in the current type record are 0.45 and 0.75 respectively, the view empty match threshold is 0.30, the semantic mismatch threshold is 0.35, and the sample size, quantiles and validity period are also recorded. The semantic mismatch threshold prioritizes reading valid records of the same model version and semantic type. If the record is missing, expired, not finite, or not within the range of 0 to 1, the global semantic mismatch default value of 0.35 for the same model version is used. If this default value is still unavailable, the configuration of the same semantic type of the previous valid model version is used and the rollback version is recorded. If the previous valid version is still unavailable, the adjustment of the corresponding semantic unit is stopped and a configuration exception flag is output. If the view lacks a response source type or the corresponding type configuration is missing, expired, not finite, or not within the range of 0 to 1, the global default values of 0.30, 0.45, and 0.75 for the same model version are used. If the global default value on the view side is also unavailable, the corresponding configuration of the previous valid model version is used and the rollback version is recorded. If the previous valid version is still unavailable, the adjustment is stopped and a configuration exception flag is output. Each rollback records the actual threshold used, the threshold source version, and the rollback reason. These configurations are generated by an independent calibration set and checked on the validation set to ensure that the local matching score does not decrease and the exception recovery rate does not exceed 0.05 after adjustment. If the validation fails, the system rolls back to the previous configuration version.
[0146] The global matching module calculates the cosine similarity between the entire sentence encoding vector of the retrieved text and the global visual representation of S4, and maps it to 0 to 1 as the global matching score; the final retrieval score of the normal local branch is calculated according to... calculate, The score ranges from 0 to 1, with a higher score indicating a better match between the candidate artifact image and the search text. This represents the updated local matching score. Indicates the global matching score. The fusion weights are represented as 0 to 1 and truncated to 0.30 to 0.80 according to the alignment confidence. In this specific implementation, the truncated alignment confidence is directly taken. When there are zero valid local views or local branches that are unavailable, S6 does not perform local feedback adjustment, and records the adjustment state as global rollback, the correction round as 0, and the fusion weights as zero. The global matching score is fixed at 0, and the final retrieval score is set to equal the global matching score. If the global visual representation is also unavailable, the candidate image is marked as having an unavailable representation and is excluded from the final ranking.
[0147] The fusion weights are checked on the independent validation set using the average accuracy of the top ten retrievals as the evaluation metric. If the weights obtained by truncating according to alignment confidence cause the evaluation metric to fall below the fixed weight baseline of 0.50, the truncation lower and upper limits registered in the previous model version are maintained. For candidate images with missing alignment confidence or not a finite number, the fusion weights are set to 0.30 and low-reliability fusion states are recorded, so that the global matching score makes the main contribution.
[0148] The retrieval server outputs candidate artifact images in descending order of the final retrieval score. When scores are the same, the order is determined by descending alignment confidence, descending adjustment status priority, and ascending candidate image identifier. Among the adjustment status priority values, 3 is assigned to converged and without anomalies, 2 is assigned to reach the upper limit of correction times but not fully converged, 1 is assigned to anomalies and restore the pre-round cache, 3 is assigned to complete a valid initial match without performing local adjustments, 1 is assigned to global rollback, and 0 is assigned to missing status. Each candidate result saves the final retrieval score, local matching score, global matching score, alignment confidence, fusion weight, local branch availability flag, adjustment status, adjustment status priority, adjustment reason, correction round, local view version, model and configuration version, and sorting position, forming a traceable retrieval verification record and serving as the terminal output of this method.
[0149] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
[0150] This invention utilizes the cross-modal response between semantic units of the retrieved text and multi-scale visual features of candidate artifact images to convert information about objects, parts, patterns, colors, materials, and states in the text into spatial location and scale control criteria for local views. Under view budget constraints, it jointly processes coverage gains and view redundancy, making the local visual representations that enter subsequent alignment more concentrated in image regions related to the retrieved text.
[0151] This invention changes the processing structure of fixed matching after the initial local view is formed. By using text empty matching nodes and visual empty matching nodes in the unbalanced transmission with type constraints, it represents the uncovered semantics and irrelevant views respectively, and feeds back the quality of the two types of empty matching to view translation, size correction, matching contribution adjustment and deletion operations. After resampling and alignment, it is then fused with the global matching score, so that local evidence selection, structured alignment and retrieval ranking form a closed technical processing chain.
Claims
1. A method for cross-modal retrieval of cultural relics based on text-driven local view construction, characterized in that, include: S1. Obtain the search text and candidate artifact images, parse the search text, and obtain a set of semantic units with semantic types; S2. Extract multi-scale visual feature maps from candidate cultural relic images, calculate the cross-modal response of each semantic unit and the multi-scale visual feature map, and obtain a multi-scale response map including response quality. S3. Determine the location, size, and scale of candidate local views based on the response quality in the multi-scale response map, and select the set of local views based on semantic coverage and view redundancy under the view quantity budget. S4. Sample the local view set to obtain local visual representation, and obtain global visual representation from multi-scale visual feature map; S5. Construct a type-constrained unbalanced transfer graph containing text empty matching nodes and visual empty matching nodes between the semantic unit set and the local visual representation. Solve the type-constrained unbalanced transfer graph to obtain the local matching score, the semantic unit unmatch quality and the local view empty matching quality. S6. Correct the position and size of the local view based on the quality of the unmatched semantic unit and the response quality outside the coverage of the local view. Adjust the local view based on the quality of the empty match of the local view. Update the local visual representation and the local matching score. Fuse the updated local matching score with the global matching score between the search text and the global visual representation to obtain the final search score and output the ranking result.
2. The cross-modal retrieval method for cultural relics based on text-driven local view construction according to claim 1, characterized in that, S1 includes: The retrieved text is used as input data for semantic parsing. Word segmentation, dependency relation analysis, and entity attribute recognition are performed on the retrieved text. The recognition results are divided into object semantic type, location semantic type, pattern or inscription semantic type, color or glaze semantic type, material or craftsmanship semantic type, and state or damage semantic type. Dependency relation weights are determined based on the relation confidence output from dependency relation analysis and the mapping values associated with the corresponding relation types in the dependency relation type weight mapping table. Semantic confidence is determined based on the weighted result of the text fragment relevance, entity recognition probability, and the dependency relation weights corresponding to the semantic unit. The text position, semantic type, semantic confidence, dependency relation with other semantic units, and the dependency relation weights are recorded for each semantic unit, forming the semantic unit set.
3. The cross-modal retrieval method for cultural relics based on text-driven local view construction according to claim 1, characterized in that, S2 include: The semantic unit is encoded into a semantic feature vector, and the spatial feature vectors in the visual feature maps at each scale are projected onto the same feature space as the semantic feature vector. The similarity between the normalized semantic feature vector and the spatial feature vector is calculated, and non-negative response values are retained for spatial locations with similarity not less than the response benchmark value. When there is no spatial location that satisfies the response benchmark value or the sum of the retained response values is zero, the retained response value of the spatial location with the highest similarity ranking is set to a unit value, and the retained response values of the remaining spatial locations are set to zero. The retained response values of each spatial location are divided by the sum of the retained response values of the same semantic unit at the corresponding scale to obtain the response quality. The response benchmark value is determined by the set quantile of the similarity distribution between non-corresponding semantic units and spatial feature vectors in the retrieval calibration sample. The response quality of each scale is mapped to a unified image coordinate system to form the multi-scale response map.
4. The cross-modal retrieval method for cultural relics based on text-driven local view construction according to claim 2, characterized in that, S3 includes: determining the center of the candidate local view based on the weighted centroid of the response quality; determining the width and height of the candidate local view based on the second-order spatial moment of the response quality relative to the weighted centroid and the quantile boundary containing the set cumulative response quality; determining the cross-scale response concentration based on the proportion of response quality at each scale falling within the quantile boundary; selecting the scale of the candidate local view based on the cross-scale response concentration; constructing a candidate local view graph using the candidate local view as nodes; writing the semantic unit identifiers and corresponding semantic confidence scores covered by each candidate local view as a semantic coverage set into the node attributes; and writing the redundancy formed by the spatial intersection-union ratio and visual feature similarity into the edge attributes.
5. The cross-modal retrieval method for cultural relics based on text-driven local view construction according to claim 1, characterized in that, S4 includes: converting the center, width, height, and scale of the local view into a sampling grid in the coordinate system of the candidate artifact image; using a differentiable sampling operator to interpolate and sample the multi-scale visual feature map within the sampling grid; performing pooling and feature projection on the sampling results to obtain the local visual representation of each local view; and performing scale alignment and weighted pooling on the multi-scale visual feature map to obtain the global visual representation, wherein the pooling weight of each scale is determined according to the normalization of the feature response variance of the corresponding scale.
6. The cross-modal retrieval method for cultural relics based on text-driven local view construction according to claim 2, characterized in that, S5 includes: reading a semantic type weight mapping table, supply smoothing value, and capacity smoothing value from the inference configuration data of the retrieval model, wherein the supply smoothing value and capacity smoothing value are both greater than zero, and the mapping value of the semantic type of the semantic unit in the semantic type weight mapping table is the type weight; encoding the semantic unit to obtain a semantic feature vector; the normalized result of adding the product of the type weight, semantic confidence, and dependency relation weight to the supply smoothing value is the semantic supply quality of each semantic unit; taking the sum of the squares of the proportions of response quality at each scale falling within the local view range as the cross-scale response concentration, taking the sum of the semantic confidence of the semantic units covered by the local view as the semantic coverage, taking the average of the normalized weighted values of the spatial intersection-union ratio and visual feature similarity of the local view with other local views in the local view set to obtain a redundancy aggregation value, and adding the weighted result of the cross-scale response concentration, semantic coverage, and the complement of the redundancy aggregation value to the capacity smoothing value and then normalizing it to obtain the view of each local view. Capacity; The semantic type of the semantic unit that ranks first in the sum of response quality within the local view is recorded as the response source type of the corresponding local view. The transmission cost is determined based on the cross-modal similarity between the semantic feature vector and the local visual representation, the type compatibility between the semantic type and the response source type, and the local view spatial relationship corresponding to the dependency relationship between semantic units. The transmission of semantic units to text empty matching nodes and the transmission of visual empty matching nodes to local views are taken as allowed edges. The type-constrained unbalanced transmission graph is solved with marginal deviation penalty constraints to obtain the transmission plan. The local matching score is obtained based on the transmission quality between semantic units and local views and the corresponding cross-modal similarity. The alignment confidence is obtained based on the proportion of non-empty matching transmission quality to semantic supply quality. The unmatched quality of the semantic unit is obtained by dividing the transmission quality of each semantic unit to the text empty matching node by the corresponding semantic supply quality. The empty matching quality of the local view is obtained by dividing the transmission quality of the visual empty matching node to each local view by the corresponding view capacity.
7. The cross-modal retrieval method for cultural relics based on text-driven local view construction according to claim 6, characterized in that, S6 include: When the semantic unit mismatch quality exceeds the semantic mismatch threshold, the response quality overlapping with the current local view coverage area is subtracted from the corresponding multi-scale response map. The translation amount and width / height correction amount of the local view center are determined based on the centroid and dispersion of the remaining response quality. The matching weights of the local view participating in the local matching score calculation are initialized to unit values. When the local view's empty matching quality exceeds the view empty matching threshold, the width and height of the corresponding local view are reduced if the local view's empty matching quality is not greater than a first action threshold. Size shrinkage is performed on the corresponding local view if the local view's empty matching quality is greater than the first action threshold but not greater than a second action threshold. The matching weight is multiplied by an attenuation coefficient, and the corresponding local view is deleted when the local view's empty matching quality is greater than the second action threshold. The first action threshold is less than the second action threshold, and the attenuation coefficient is greater than zero and less than one. The semantic non-matching threshold, the view empty matching threshold, the first action threshold, and the second action threshold are determined by the set quantiles of the semantic unit non-matching quality distribution and the local view empty matching quality distribution of the retrieved calibration samples, respectively. The local views that have not been deleted are resampled, and when the local matching score is recalculated, the matching weight is multiplied into the matching contribution of the corresponding local view, and the adjustment status and adjustment reason of the local view are recorded.
8. The cross-modal retrieval method for cultural relics based on text-driven local view construction according to claim 4, characterized in that, Step S3 involves selecting a set of local views, which includes: taking the union of the semantic coverage sets of the selected nodes, using the sum of the semantic confidence of each semantic unit in the union as the set coverage gain, and using the weighted sum of the spatial intersection-union ratio and visual feature similarity between the selected nodes as the set redundancy; using the set coverage gain minus the set redundancy as the selection target, and determining the set of local views under the condition that the number of selected nodes does not exceed the budget for the number of views and the selected local views are located within the boundary constraints of the candidate artifact image; when there are no candidate local views that satisfy the image boundary constraints, cropping the candidate local views to the image boundary, re-sampling the image region on the cropped candidate local views, re-determining the semantic coverage set, spatial intersection-union ratio, and visual feature similarity, and updating the corresponding node attributes and edge attributes, and then determining the set of local views based on the updated candidate local view graph.
9. The cross-modal retrieval method for cultural relics based on text-driven local view construction according to claim 6, characterized in that, Step S5, solving the transmission plan, includes: converting the difference between semantic supply quality and the transmission plan row margin, and the difference between view capacity and the transmission plan column margin, into margin deviation penalty terms; using the weighted sum of transmission cost, margin deviation penalty term, and transmission plan entropy regularization term as the transmission target; comparing the type compatibility with a compatibility threshold, and when the type compatibility is not less than the compatibility threshold, determining the edge between the corresponding semantic unit and the local view as an allowed edge and allocating a limited transmission cost, and when the type compatibility is less than the compatibility threshold, assigning a masking flag to the corresponding edge, wherein the compatibility threshold is determined by a set quantile of the type compatibility distribution of the correct correspondence between semantic type and local view response source in the retrieval calibration sample; determining the null matching cost of text null matching nodes and visual null matching nodes according to the transmission cost distribution of correct and non-corresponding correspondences in the retrieval calibration sample; iteratively updating the transmission plan until the absolute value of the difference between two adjacent transmission targets is not greater than a convergence threshold or the number of iterations reaches a set upper limit, wherein the convergence threshold and the set upper limit are recorded in the inference configuration data.
10. The cross-modal retrieval method for cultural relics based on text-driven local view construction according to claim 7, characterized in that, Step S6, updating the local matching score, includes: caching the local view, local visual representation, transport plan, local matching score, and alignment confidence before each local view adjustment; recalculating the transport plan after the local view adjustment; and comparing the absolute value of the difference between two adjacent local matching scores with a correction termination threshold; terminating the local view adjustment when the absolute value is not greater than the correction termination threshold or the number of corrections reaches the upper limit of the correction count. The correction termination threshold is determined by a set quantile of the distribution of the absolute values of the differences in local matching scores obtained through continuous corrections in the retrieval calibration samples. The upper limit of the correction count and the minimum sampling area are recorded in the inference configuration data. When the sum of the remaining response qualities is zero or the adjusted local view area is less than the minimum sampling area, the corresponding adjustment state is recorded as abnormal, the cached local view, local visual representation, transport plan, local matching score, and alignment confidence are restored, and the current round of adjustment of the corresponding local view is terminated. The fusion weight of the updated local matching score and the global matching score is determined based on the alignment confidence, and the final retrieval score, adjustment state, adjustment reason, and sorting position are saved as retrieval verification records.
