A text watermark embedding, identifying and attribution method and system based on semantic dimension division
By performing dimensional partitioning and watermark injection on the text semantic vector, the problem of insufficient semantic preservation and attribution capabilities in existing technologies is solved, achieving efficient watermark embedding and accurate attribution determination in text embedding service scenarios, adapting to multi-subject and cross-domain applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN NORMAL UNIVERSITY
- Filing Date
- 2026-05-15
- Publication Date
- 2026-06-19
AI Technical Summary
Existing watermarking solutions for text embedding services suffer from insufficient semantic preservation, weak attribution capabilities, and poor cross-domain adaptability, making it difficult to effectively embed watermarks and determine the attribution object while maintaining the semantic stability of the text.
By dividing the semantic vector of the text to be watermarked into dimensions, distinguishing between core and non-core dimensions, and injecting the main watermark and attribution watermark respectively, combined with semantic contribution quantification and stability constraints, a watermarked text representation vector is generated, and multi-level matching is performed in the detection and attribution stages to determine the attribution object.
It improves the semantic preservation and fine-grained attribution recognition capabilities during the watermark embedding process, adapts to copyright protection in multi-subject and cross-domain scenarios, and enhances the robustness and accuracy of digital watermarks.
Smart Images

Figure CN122241667A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence content security, natural language processing, and digital watermarking technology, and in particular to a method for embedding, identifying, and attributing text watermarks based on semantic dimension division, as well as the corresponding system, electronic device, and computer-readable storage medium. Background Technology
[0002] With the widespread application of text embedding models in tasks such as information retrieval, semantic matching, text classification, question answering recall, and knowledge base construction, an increasing number of service providers are offering text vector generation capabilities through application programming interfaces (APIs). Users can obtain corresponding semantic vectors after submitting text, and then use these semantic vectors for subsequent task processing. This type of application scenario can be summarized as a text embedding service scenario.
[0003] In such scenarios, service providers typically incur significant costs in model training, data cleaning, and system deployment. However, attackers can continuously call APIs to collect large numbers of text-vector sample pairs and then use these samples to train alternative models. While the alternative models may not be structurally identical to the original models, their output performance may be close to the original service, leading to issues such as model imitation, intellectual property infringement, and damage to commercial interests.
[0004] To address the aforementioned issues, existing technologies have proposed various vector watermarking or text watermarking schemes. One type of scheme adds fixed-directional perturbations, preset rules, or triggering patterns to the output vector for subsequent detection; another type attempts to encode the subject information into the vector or text for subsequent source tracing. While these schemes can provide identification capabilities to some extent, there is still room for improvement in semantic preservation, attribution differentiation, and cross-scenario adaptation.
[0005] For example, existing technologies include text embedding watermarking schemes based on semantic region triggering mechanisms, such as the technical solution disclosed in the paper "RegionMarker: A Region-Triggered Semantic Watermarking Framework for Embedding-as-a-Service Copyright Protection". This scheme constructs trigger regions in a low-dimensional semantic space and performs watermark injection when the region triggering conditions are met, thereby enhancing the robustness of the watermark in scenarios involving semantic perturbation, model imitation, and similarity attacks. Compared with traditional fixed trigger words or single linear transformation schemes, this type of scheme has certain advantages in terms of semantic relevance and anti-attack capabilities. However, this type of scheme mainly focuses on semantic region triggering conditions and region-related watermarking, without explicitly quantifying the semantic carrying capacity of each dimension of the original semantic vector, nor forming a core dimension and non-core dimension division mechanism based on the semantic contribution of dimensions. Therefore, it is still difficult to simultaneously take into account semantic preservation capability, watermark recognition stability, and fine-grained attribution determination in multi-subject scenarios during the watermark embedding process.
[0006] For example, existing technologies include multi-target watermarking schemes for text embedding service scenarios, such as the technical solution disclosed in the paper "Defending against similarity shift attack for EaaS via adaptive multi-target watermarking". This scheme improves the detectability of embedded watermarks in model imitation scenarios by constructing multiple watermark vectors, introducing base vectors, and performing adaptive injection and verification based on similarity. Compared with single fixed watermarking schemes, this type of scheme has certain advantages in multi-target differentiation and detection stability. However, this type of scheme usually still mainly focuses on watermark vector design and injection verification mechanisms. Although it can reduce the risk of leakage of a single watermark vector to a certain extent, it still does not explicitly distinguish the semantic carrying capacity of different dimensions of the original semantic vector, lacks a mechanism for dividing core and non-core dimensions based on the semantic contribution of dimensions, and does not further solve the problem of fine-grained determination of the attribution object in multi-subject scenarios after recognition is successful.
[0007] In summary, existing watermarking solutions for text embedding services still have the following shortcomings: First, they lack semantic preservation capabilities. Many solutions process the overall semantic vector uniformly without distinguishing the importance of different dimensions to the semantic expression, which can easily destroy the original semantic representation while embedding the watermark. Second, they have limited fine-grained attribution recognition capabilities. Some solutions can only determine whether a watermark exists, and it is difficult to further determine which specific object the watermark belongs to in multi-subject scenarios. Third, they lack cross-domain adaptability, making it difficult to simultaneously achieve semantic preservation, watermark recognition, and attribution determination. Fourth, they lack adaptive capabilities. Parameter selection relies on human experience, and there is a lack of an adaptive partitioning mechanism that can balance semantic preservation and embeddable capacity.
[0008] Therefore, a new text watermarking technology solution is needed. While maintaining the stability of the text semantic vector, the watermark should be embedded in the dimension with the least impact on the semantics. After the watermark recognition is completed, the attribution object should be given in order to adapt to the digital copyright protection needs in multi-subject, cross-domain and actual service deployment scenarios. Summary of the Invention
[0009] (a) Technical problems to be solved
[0010] Based on the shortcomings mentioned in the background technology above, the present invention provides a method and system for embedding, recognizing and attributing text watermarks based on semantic dimension division, so as to solve the problems of insufficient semantic preservation ability, weak attribution ability and poor cross-domain adaptability in existing solutions.
[0011] (II) Technical Solution
[0012] To achieve the above objectives, the present invention adopts the following technical approach: First, the text to be watermarked is encoded to obtain an original semantic vector; then, the semantic contribution of each dimension of the original semantic vector is quantified, and the semantic space is divided into a core dimension set and a non-core dimension set accordingly; subsequently, based on the original semantic vector, candidate watermark vectors are selected from the watermark vector library and the main watermark vector is determined; then, an attribution watermark vector is generated based on the domain, entity name, attribute information, and source type corresponding to the main watermark vector; then, the main watermark vector and the attribution watermark vector are injected into the main watermark injection region and the attribution watermark injection region in the non-core dimension set, respectively, to obtain a watermarked text representation vector; when there is suspicion of infringement, watermark detection is performed on the text to be detected; after detecting that the text to be detected contains a watermark, the main watermark matching degree, the attribution watermark matching degree, and their fusion matching results are combined with the ranking results in the candidate set in the same domain and the ranking results in the set of all candidate attribution objects to determine the attribution object.
[0013] In one implementation, the semantic contribution metric includes at least global contribution metric and local contribution metric; in another implementation, a stability constraint term and a minimum non-core capacity condition may be further introduced to select the final partitioning result from multiple candidate partitioning ratios.
[0014] In one embodiment, the watermark vector library pre-stores multiple candidate watermark vectors and object information associated with each candidate watermark vector. The object information includes at least the domain, entity name, attribute information, and source type. The main watermark vector can be selected and determined from the watermark vector library based on the original semantic vector, and the attribution watermark vector can be generated based on the domain, entity name, attribute information, and source type corresponding to the main watermark vector.
[0015] In one implementation, the non-core dimension set can be further divided into the main watermark injection region and the attribution watermark injection region. Multiple candidate watermarked text representation vectors are generated by traversing multiple sets of main watermark injection strength and attribution watermark injection strength. Then, the final watermarked text representation vector is obtained by combining the semantic preservation condition of the embedding stage and the main watermark matching degree from the multiple candidate watermarked text representation vectors.
[0016] In one implementation, when there is suspicion of infringement, the text to be detected can be obtained, and a semantic vector to be detected can be generated using a text embedding model; then, a set of candidate main watermark vectors can be obtained from the watermark vector library, and the main watermark matching degree between the semantic vector to be detected and each candidate main watermark vector in the main watermark injection area can be calculated; when the maximum main watermark matching degree is not lower than the second threshold and the semantic consistency condition of the detection stage is met, it is determined that the text to be detected contains a watermark.
[0017] In one implementation, after determining that the text to be detected contains a watermark, the domain information corresponding to the text to be detected can be obtained, and a set of candidate attribution objects can be obtained from the watermark vector library based on the domain information; then, the main watermark matching degree between the semantic vector to be detected and the main watermark vector corresponding to each candidate attribution object in the main watermark injection area, and the attribution watermark matching degree between the semantic vector to be detected and the attribution watermark vector corresponding to each candidate attribution object in the attribution watermark injection area are calculated respectively; based on the main watermark matching degree, the attribution watermark matching degree and their fusion matching results, and combined with the ranking results in the candidate set in the same domain and the ranking results in the full candidate attribution object set, the attribution object corresponding to the text to be detected is determined.
[0018] To facilitate understanding of the above technical solutions, some terms involved in this invention will be further explained below.
[0019] In this invention, the “dimensional partitioning semantic preservation condition” refers to the judgment condition used to constrain the ability of the core dimension set to retain the original semantic representation. It can be represented by the cosine similarity between the vector after retaining only the core dimensions and the original semantic vector. When the similarity is not lower than the preset dimension partitioning threshold, the partitioning result is judged to meet the dimension partitioning semantic preservation condition.
[0020] In this invention, the "minimum non-core capacity condition" refers to the minimum number of dimensions required to carry both the main watermark vector and the attribution watermark vector. When the number of non-core dimensions corresponding to a candidate partitioning result is lower than the preset minimum dimension threshold, it indicates that the candidate partitioning result cannot meet the subsequent watermark injection requirements, and therefore the candidate partitioning result is determined to be invalid.
[0021] In this invention, a "watermark vector library" refers to a data set that pre-stores multiple candidate watermark vectors and information about objects associated with each candidate watermark vector; the object information includes at least the domain, entity name, attribute information, and source type.
[0022] In this invention, the "semantic preservation condition during the embedding stage" refers to the judgment condition used to constrain the degree of semantic deviation between the watermarked text representation vector and the original semantic vector. When the cosine similarity between the candidate watermarked text representation vector and the original semantic vector is not lower than a first threshold, the candidate watermarked text representation vector is determined to satisfy the semantic preservation condition during the embedding stage.
[0023] In this invention, the "semantic consistency condition in the detection phase" refers to a judgment condition used to constrain the degree of semantic consistency between the semantic vector to be detected and the reference semantic vector. When the cosine similarity between the semantic vector to be detected and the reference semantic vector is not lower than a third threshold, the semantic vector to be detected is determined to satisfy the semantic consistency condition in the detection phase. The reference semantic vector is used to characterize the semantic reference information of the original business content or target business content corresponding to the text to be detected. The reference semantic vector can be generated by a text embedding model from reference text associated with the business content corresponding to the text to be detected. In one embodiment, the reference text can be the original unwatermarked text corresponding to the text to be detected, or a semantic reference text corresponding to the business content of the original unwatermarked text.
[0024] In this invention, the "full candidate attribution object set" refers to the set of all candidate attribution objects in the watermark vector library; the "same domain candidate set" refers to the set of candidate objects selected from the full candidate attribution object set based on the domain information corresponding to the text to be detected.
[0025] In this invention, "fusion matching result" refers to the comprehensive matching result generated based on the main watermark matching degree and the attribution watermark matching degree, which is used to improve the stability and accuracy of the determination of the attribution object.
[0026] (III) Beneficial Effects
[0027] Compared with existing technologies, the present invention has at least the following beneficial effects:
[0028] 1. This invention does not uniformly apply watermark perturbation to the entire semantic vector. Instead, it first divides the semantic space according to the semantic contribution of each dimension, determines the dimensions that have a greater impact on the stability of text semantic representation as the core dimension set, and determines the dimensions that can be used to carry watermark information as the non-core dimension set, thereby improving the balance between semantic preservation and payload carrying during the watermark embedding process.
[0029] 2. This invention further divides the non-core dimension set into a main watermark injection region and an attribution watermark injection region, and injects the main watermark vector and attribution watermark vector respectively. The main watermark vector is used to complete watermark existence identification, while the attribution watermark vector is used to improve the distinguishing ability between different candidate attribution objects, thereby achieving hierarchical processing of watermark identification and attribution determination.
[0030] 3. In the process of dimension partitioning, this invention considers global contribution, local contribution, and stability constraint terms simultaneously, and combines semantic preservation index, cross-domain stability index, and non-core dimension embeddability capacity index to determine the final partitioning result. This avoids the bias caused by partitioning dimensions based on a single statistic and improves the stability and reliability of the partitioning result.
[0031] 4. In the attribution determination stage, this invention combines candidate object retrieval, main watermark matching, attribution watermark matching, and the ranking results in the same domain candidate set with the ranking results in the full candidate attribution object set to make a comprehensive judgment, thereby improving the accuracy of attribution object determination. It is applicable to copyright protection and source tracking in text embedding service scenarios. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in this invention or the prior art, the accompanying drawings used in the embodiments will be briefly described below:
[0033] Figure 1 This is a schematic diagram of the overall process of the method of the present invention;
[0034] Figure 2 This is a flowchart of the watermark vector determination and segmented injection process in this invention;
[0035] Figure 3 This is a flowchart of the candidate object retrieval and matching ranking process in this invention;
[0036] Figure 4 This is a flowchart of the watermark verification and determination process in this invention;
[0037] Figure 5 Flowchart for determining the attribution object in this invention;
[0038] Figure 6 This is a schematic diagram of the system structure of the present invention;
[0039] Figure 7 This is a schematic diagram illustrating the verification of the semantic preservation capabilities of the core and non-core dimensions of this invention.
[0040] Figure 8 This is a schematic diagram illustrating the verification of the semantic contribution distribution of the embedded dimensions in this invention.
[0041] Figure 9 This is a schematic diagram of the end-to-end batch verification code interface for 150 samples of this invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0043] Example 1: Overall Method Flow
[0044] like Figure 1 As shown, the text watermark embedding, recognition, and attribution method based on semantic dimension division in this invention generally includes the following steps:
[0045] Step S1: Obtain the text to be watermarked and generate the original semantic vector using a text embedding model.
[0046] Step S2 involves quantifying the semantic contribution of each dimension of the original semantic vector and dividing it into a core dimension set and a non-core dimension set accordingly.
[0047] Step S3: Based on the original semantic vector, candidate watermark vectors are selected from the watermark vector library and the main watermark vector is determined. Then, attribution watermark vectors are generated based on the domain, entity name, attribute information and source type corresponding to the main watermark vector.
[0048] Step S4: Inject the main watermark vector and the attribution watermark vector into the main watermark injection region and the attribution watermark injection region in the non-core dimension set, respectively, to obtain the watermarked text representation vector.
[0049] Step S5: When there is suspicion of infringement, obtain the text to be detected, generate the semantic vector to be detected using the text embedding model, and then perform watermark detection based on the main watermark matching degree and the semantic consistency condition of the detection stage.
[0050] Step S6: After detecting that the text to be detected contains a watermark, the candidate attribution object set is selected from the watermark vector library according to the domain information corresponding to the text to be detected, and the main watermark matching degree, attribution watermark matching degree and their fusion matching results of the candidate attribution objects are calculated respectively. The attribution object is determined by combining the ranking results in the candidate set in the same domain and the ranking results in the full candidate attribution object set.
[0051] In this embodiment, the text to be watermarked can be a natural language sentence, paragraph, or fragment of business text. The text embedding model can employ a pre-trained sentence vector model, such as E5-large-v2, BGE series models, or other models capable of outputting fixed-dimensional semantic vectors. Let the text embedding dimension be... The original semantic vector is denoted as .
[0052] Example 2: Two-Stage Semantic Contribution Measurement and Dimensional Partitioning
[0053] This embodiment is... Figure 1 Step S2 will be explained below. The core idea is: first, quantify the global distinguishing ability of each dimension from the perspective of the overall semantic space; then, quantify the local representation ability of each dimension from the perspective of different domains or different semantic categories; finally, merge the two and combine the stability constraint term and the minimum non-core capacity condition to determine the core dimension set and the non-core dimension set.
[0054] To reduce the impact of noise and local outliers, the sample embedding matrix can be adjusted first. Perform dimensionality reduction and noise reduction processing. Specifically, for Perform principal component analysis, retain the preset cumulative variance, and then perform inverse transformation reconstruction to obtain the denoised embedding matrix. .
[0055] For the For each sample, we can first calculate its average cosine similarity to other samples. And determine the sample weights accordingly. The more semantically unique a sample is, the higher its weight, to avoid the over-dominance of contribution evaluation by high-frequency homogeneous samples. Sample weights can be expressed as:
[0056] In the formula, This represents the normalization operation. Indicates the first The average cosine similarity between each sample and other samples.
[0057] Based on this, for the first The global contribution of each dimension can be measured using weighted variance:
[0058] In the formula, Indicates the first The sample at the th Values on the dimension, Indicates the first The weighted mean of the dimensions. The larger it is, the more likely it is to be the first The stronger the dimension, the better it is at distinguishing different texts in the overall semantic space.
[0059] To reflect the distinguishing power of a dimension within different domains or semantic categories, samples can be divided according to domain labels or semantic category labels. A subset. For the first subset. Sub-set The local variance of dimension can be written as:
[0060] In the formula, Indicates the first Sample sets from various fields Indicates the first Number of samples in each domain Indicates the first The first field in The mean over the dimension.
[0061] The average variance within each domain can be used as the first... Local contribution of dimension:
[0062] In the formula, The larger the value, the better the distinguishing ability of this dimension within different fields.
[0063] Considering that core dimensions not only need to contribute highly, but also should remain relatively stable across different domains, we can further calculate the degree of fluctuation between domains:
[0064] In the formula, Used to characterize the Stability across different domains The smaller the value, the smaller the cross-domain fluctuation of that dimension.
[0065] By normalizing and weighting the global and local contributions, and then penalizing cross-domain fluctuations, the final semantic contribution can be obtained.
[0066] In the formula, , and These represent the normalized global contribution, local contribution, and stability constraint term, respectively. and These are the global contribution weight and the local contribution weight, respectively. ; This represents the stability penalty coefficient, in a preferred embodiment. The value can range from 0.1 to 0.3, and can be adjusted according to the cross-domain stability requirements in different application scenarios. The larger the value, the more suitable the dimension is as a core dimension.
[0067] It should be noted that this invention introduces a stability constraint term when fusing global and local contributions. The purpose of this constraint is to prevent dimensions that fluctuate significantly only within a few domains but lack cross-domain consistency from being misclassified as high-contribution dimensions. In other words, while some dimensions may exhibit significant representational differences within specific domains, these differences may stem from local noise, sample distribution bias, or accidental perturbations, and do not necessarily represent a stable contribution to the overall semantic representation of the text. By introducing the stability constraint term, dimensions with high semantic carrying capacity across different domains can be prioritized as core dimensions, thereby improving the reliability of subsequent dimension partitioning.
[0068] Based on the semantic contribution of each dimension After sorting in descending order, multiple candidate partition ratios can be set. This results in a set of candidate core dimensions. and candidate non-core dimension set For each candidate proportion, a semantic preservation metric can be calculated. Cross-domain stability indicators And non-core dimensions that can be embedded with capacity metrics Candidate partitioning results that do not meet the semantic preservation condition of dimension partitioning or the minimum non-core capacity condition are eliminated. The final partitioning result is then determined based on the semantic preservation index, cross-domain stability index, and non-core dimension embeddability capacity index.
[0069] In one specific implementation, the candidate segmentation ratio can be set between 0.70 and 0.85, and the final segmentation result can be taken as approximately 81% for the core dimension. In this case, the core dimension is mainly responsible for maintaining the original semantic representation, while the non-core dimensions are mainly responsible for carrying the watermark information. It should be noted that the aforementioned ratio is merely an example, and the present invention is not limited to this value.
[0070] Example 3: Watermark Vector Generation and Band Injection
[0071] This embodiment combines Figure 2 right Figure 1Steps S3 and S4 are explained below. The core of this process is as follows: First, candidate watermark vectors are selected from the watermark vector library based on the original semantic vector, and the main watermark vector is determined. Then, an attribution watermark vector is generated based on the domain, entity name, attribute information, and source type corresponding to the main watermark vector. Finally, the main watermark vector and the attribution watermark vector are injected into the main watermark injection area and the attribution watermark injection area in the non-core dimension set, respectively.
[0072] In this embodiment, the watermark vector library pre-stores multiple candidate watermark vectors and object information associated with each candidate watermark vector. For the original semantic vector obtained from the input text, the matching degree between it and each candidate watermark vector can be calculated, and the candidate watermark vectors can be filtered accordingly. Based on this, the candidate watermark vector with the highest matching degree can be determined as the main watermark vector according to the filtering results.
[0073] In one implementation, candidate watermark vectors in the watermark vector library can be obtained by fusing low-correlation basis vectors with preset basis vectors. Specifically, for different candidate objects, multiple low-correlation basis vectors can be pre-constructed. To reduce computational complexity, the basis vectors can be generated using a piecewise construction method, without relying on complex orthogonalization calculations. Let the semantic space dimension be... The number of basis vectors is ,Will dimensional space is divided into The nth continuous dimension segment, for the nth For each dimension segment, the first half can be assigned a value of +1, the second half a value of -1, and the remaining dimensions a value of 0, then execute... Normalization (i.e., Euclidean normalization). The basis vectors constructed in this way have low correlation between each pair, and can be used to distinguish the candidate watermark vectors corresponding to different candidate objects.
[0074] To make the candidate watermark vectors closer to the distribution of the true semantic vectors, a pre-defined basic vector can be introduced. In one implementation, the candidate watermark vector can be represented as:
[0075] In the formula, Indicates the first The candidate watermark vector corresponding to each candidate object Indicates the first basis vectors Represents the preset fundamental vector. This represents the fusion strength coefficient. By introducing a base vector, the naturalness and concealment of the candidate watermark vector distribution can be enhanced.
[0076] After determining the master watermark vector, an attribution code can be generated based on the domain, entity name, attribute information, and source type corresponding to the master watermark vector. This attribution code is then normalized to obtain the attribution watermark vector. The master watermark improves the stability of watermark existence determination, while the attribution watermark improves fine-grained attribution differentiation. For each candidate object, there is one and only one master watermark vector and one attribution watermark vector. Let... If the hash mapping function is used, then the attribution watermark vector can be represented as:
[0077] In the formula, to Representing different types of metadata, to This indicates the fusion weight of each element. This represents the attribution watermark vector. This method allows fine-grained attributes of candidate attribution objects to be mapped into a vector space.
[0078] After determining the main watermark vector and the attribution watermark vector, the non-core dimension set is divided into a main watermark injection region and an attribution watermark injection region. The main watermark injection region carries the main watermark vector, and the attribution watermark injection region carries the attribution watermark vector. In one embodiment, the non-core dimension set can preferably be divided into the main watermark injection region and the attribution watermark injection region in a 72:28 ratio.
[0079] Let the selected master watermark vector be denoted as . , and Let the mask vectors be the main watermark injection region and the attribution watermark injection region, respectively. Then the watermarked text representation vector is... It can be represented as:
[0080] In the formula, Represents the original semantic vector. Represents the main watermark vector. Represents the attribution watermark vector. This indicates element-wise multiplication. Indicates the intensity of the main watermark injection. This indicates the intensity of the attribution watermark injection.
[0081] To balance semantic preservation and watermark detectability, multiple sets of candidate values for the main watermark injection strength and multiple sets of candidate values for the attribution watermark injection strength can be pre-set to generate multiple candidate watermarked text representation vectors. These candidate watermarked text representation vectors are then filtered based on the semantic preservation conditions during the embedding stage and the main watermark matching degree. The semantic preservation metric can be expressed as the cosine similarity between the vectors before and after embedding:
[0082] when If the value is not lower than the first threshold, the corresponding candidate watermarked text representation vector is determined to satisfy the semantic preservation condition during the embedding stage.
[0083] In one specific implementation, the main watermark injection strength and the attribution watermark injection strength can be selected from several candidate values to generate multiple sets of candidate watermarked text representation vectors. Under the premise of satisfying the semantic preservation condition during the embedding stage, this invention can further combine the main watermark matching degree to select the candidate watermarked text representation vector with a main watermark matching degree not lower than a preset main watermark matching threshold and with the best overall effect as the final output. The aforementioned parameters are merely examples of embodiments and do not limit the scope of protection of this invention.
[0084] Example 4: Candidate Object Retrieval and Matching Ranking
[0085] This embodiment combines Figure 3 The process of candidate object retrieval and matching ranking is explained. This process is used to filter the most likely corresponding object from the candidate object set after detecting that the text to be detected contains a watermark.
[0086] First, the text to be detected and its semantic vector are input, and the domain information of the text to be detected is obtained. Then, a coarse search is performed from the watermark vector library based on the domain information to obtain a set of candidate objects. The coarse search can be based on domain labels, business labels, or other prior information to narrow down the scope of subsequent matching calculations.
[0087] For each candidate object in the candidate attribution object set, the primary watermark matching degree and the attribution watermark matching degree can be calculated separately. The primary watermark matching degree can be expressed as:
[0088] In the formula, Indicates the first The main watermark matching degree of each candidate object. This represents the semantic vector to be detected corresponding to the text to be detected.
[0089] Correspondingly, the attribution watermark matching degree can be expressed as:
[0090] In the formula, Indicates the first Attribution watermark matching degree of each candidate object Indicates the first The attribution watermark vector corresponding to each candidate object.
[0091] To balance existence identification and fine-grained attribution identification, the main watermark matching score and the attribution watermark matching score can be weighted and fused to obtain the fused matching result. The corresponding comprehensive matching score can be expressed as:
[0092] In the formula, Indicates the first The overall matching score of each candidate. Indicates the main watermark matching weight. This indicates the weight of the attribution watermark matching degree, and The primary watermark has a higher matching weight and is used to prioritize ensuring the stability of watermark existence determination; the attribution watermark has a lower matching weight, but can provide fine-grained attribution differentiation capabilities.
[0093] Based on the overall matching score Candidate objects within the same domain candidate set are sorted to obtain a ranking result for that set. Simultaneously, candidate objects can be matched, scored, and ranked across the entire candidate attribution set to obtain a ranking result for the entire candidate attribution set. Finally, by combining the ranking results from both the same domain candidate set and the entire candidate attribution set, the attribution object corresponding to the text to be detected can be determined.
[0094] Example 5: Watermark Verification and Judgment
[0095] This embodiment combines Figure 4 right Figure 1 Step S5 will be explained below. The watermark verification adopts a dual-condition judgment logic, which judges whether the text to be detected contains a valid watermark from two aspects: the matching degree of the main watermark and the semantic consistency of the detection stage.
[0096] First, the text to be detected and its semantic vector are input, and a set of candidate master watermark vectors is obtained from the watermark vector library. Then, the master watermark matching degree between the semantic vector to be detected and each candidate master watermark vector in the master watermark injection area is calculated, and the maximum master watermark matching degree is taken as the master watermark determination index for the current text to be detected. Simultaneously, reference text associated with the business content corresponding to the text to be detected is obtained, and a reference semantic vector is generated using a text embedding model for semantic consistency determination during the detection phase. In one embodiment, the reference text can be the original unwatermarked text corresponding to the text to be detected, or semantic reference text corresponding to the business content of the original unwatermarked text.
[0097] In one implementation, when the maximum main watermark matching degree is not lower than a second threshold, and the cosine similarity between the semantic vector to be detected and the reference semantic vector is not lower than a third threshold, the text to be detected is determined to pass watermark verification and is considered to contain a watermark; otherwise, the text to be detected is determined to fail watermark verification. In one specific implementation, the third threshold can be 0.95. It should be noted that the second and third thresholds can be set according to the false detection rate and false negative rate requirements under different business scenarios. The aforementioned parameters are only examples of embodiments and do not limit the scope of protection of the present invention.
[0098] Example 6: Determining the Attribution Object
[0099] This embodiment combines Figure 5 right Figure 1 Step S6 will be explained below. The attribution object determination process is executed after the watermark detection is passed. First, the domain information corresponding to the text to be detected is obtained, and a coarse search is performed from the watermark vector library based on the domain information to obtain a set of candidate attribution objects.
[0100] For each candidate object in the candidate attribution object set, the main watermark matching degree between the semantic vector to be detected and the corresponding main watermark vector of the candidate object in the main watermark injection region, and the attribution watermark matching degree between the semantic vector to be detected and the corresponding attribution watermark vector of the candidate object in the attribution watermark injection region can be calculated. Subsequently, a fusion matching result can be generated based on the main watermark matching degree and the attribution watermark matching degree.
[0101] In one implementation, a candidate set within the same domain and a set of all candidate attribution objects can be further constructed. The candidate set within the same domain is a set of candidate objects selected from the candidate attribution object set based on the domain information corresponding to the text to be detected; the set of all candidate attribution objects is a set consisting of all candidate attribution objects in the watermark vector library.
[0102] Finally, by combining the ranking results in the candidate set within the same domain and the ranking results in the full candidate attribution set, a comprehensive judgment can be made on the main watermark matching degree, the attribution watermark matching degree, and their fusion matching results, and the final attribution object corresponding to the text to be detected can be determined accordingly.
[0103] Example 7 System Structure
[0104] This embodiment combines Figure 6 The corresponding system of this invention will be described below. The system may include a text encoding module, a semantic contribution quantification module, a dimension partitioning module, a watermark vector determination module, a watermark injection module, a watermark detection module, and an attribution confirmation module.
[0105] The text encoding module is used to acquire the text to be watermarked and generate the original semantic vector. The semantic contribution metric module is used to perform global and local contribution metric on each dimension of the original semantic vector. The dimension partitioning module is used to partition the data into core dimension sets and non-core dimension sets based on the semantic contribution metric results.
[0106] The watermark vector determination module is used to filter candidate watermark vectors from the watermark vector library based on the original semantic vector and determine the main watermark vector, and to generate an attribution watermark vector based on the domain, entity name, attribute information, and source type corresponding to the main watermark vector. The watermark injection module is used to divide the non-core dimension set into a main watermark injection region and an attribution watermark injection region, and inject the main watermark vector and attribution watermark vector into the corresponding regions respectively to obtain a watermarked text representation vector. In one embodiment, the watermark injection module can also be used to generate multiple candidate watermarked text representation vectors according to multiple combinations of main watermark injection strength and attribution watermark injection strength, and to determine the watermarked text representation vector from them based on the semantic preservation conditions during the embedding stage and the main watermark matching degree.
[0107] The watermark detection module is used to obtain the semantic vector corresponding to the text to be detected when there is suspicion of infringement. Based on the main watermark matching degree between the semantic vector to be detected and the candidate main watermark vectors in the main watermark injection area, and the semantic consistency condition during the detection stage, the module performs watermark detection on the text to be detected. The attribution confirmation module is used to determine the final attribution object when the text to be detected is determined to contain a watermark. This is done based on the domain information corresponding to the text to be detected, the main watermark matching result between the semantic vector to be detected and the candidate attribution object's corresponding main watermark vector in the main watermark injection area, the attribution watermark matching result between the semantic vector to be detected and the candidate attribution object's corresponding attribution watermark vector in the attribution watermark injection area, and their fusion matching result. This is combined with the ranking results in the candidate set within the same domain and the ranking results in the entire candidate attribution object set.
[0108] The system can be implemented by one or more processors executing programs stored in a storage medium, and can be deployed in a standalone environment or a cloud service environment.
[0109] Example 8: Parameters and Optional Implementation
[0110] In one specific implementation, the text embedding model can employ a pre-trained sentence vector model, such as E5-large-v2, BGE series models, GTE series models, or other models capable of outputting fixed-dimensional semantic vectors; the corresponding semantic vector dimension can be determined according to the selected model, for example, 768-dimensional, 1024-dimensional, 1536-dimensional, or other fixed dimensions. The sample corpus used for semantic contribution quantification can cover multiple domains such as FOOD, CLOTHING, BUILDINGS, NEWS, EMAIL, SENTIMENT, etc., and can also be replaced with corpora from other domains according to the actual application scenario; the watermark vector library can contain multiple candidate attribution objects and be pre-indexed according to domain.
[0111] In one specific implementation, the main watermark injection region and the attribution watermark injection region can be divided in a 72:28 ratio; the main watermark injection strength and the attribution watermark injection strength can be selected from several candidate values; the fusion weights of the main watermark matching degree and the attribution watermark matching degree can be set to 0.75 and 0.25, respectively. The above parameters are merely examples of embodiments and can be adjusted according to the application scenario, semantic vector dimension, text type, and the need to distinguish the attribution object. This invention is not limited to the above values.
[0112] In practical batch deployment scenarios, an anomaly fallback mechanism can be set up. If, after traversing all candidate combinations of injection strength, no candidate result still meets the semantic preservation conditions during the embedding stage, one or more of the upper limits of the main watermark injection strength and the attribution watermark injection strength can be reduced before regenerating candidate combinations. If, after re-traversal, no candidate result still meets the semantic preservation conditions during the embedding stage, it can be determined that the current text has a high semantic concentration or insufficient embedding capacity for non-core dimensions. This text is then marked as a sample requiring a low-intensity injection strategy, or, under the current parameter configuration, no watermarked result is output. Simultaneously, relevant metadata is recorded for subsequent optimization of dimension partitioning rules or injection strength configuration. This anomaly fallback mechanism improves the stability and implementability of the present invention in practical deployment scenarios.
[0113] Example 9: Effect Verification
[0114] To verify the effectiveness of the text watermark embedding, recognition, and attribution method based on semantic dimension partitioning described in this invention, in one specific embodiment, a pre-trained sentence vector model E5-large-v2 is used to generate 1024-dimensional original semantic vectors. Semantic contribution quantification, partitioning of the core dimension set and non-core dimension set, and subsequent verification are then performed based on 12,000 offline corpora. Verification results show that in this specific embodiment, a differentiated division of labor between the core dimension set and the non-core dimension set can be formed, thus providing a foundation for subsequent watermark embedding, detection, and attribution confirmation.
[0115] In the validation of the dimensionality partitioning, the ability of core dimensions and non-core dimensions to retain the original semantic representation was examined, and the results are shown in Table 1.
[0116] Table 1. Results of semantic preservation capabilities for core and non-core dimensions.
[0117]
[0118] From Table 1 and Figure 7-8 It can be seen that the core dimension maintains a high similarity with the original semantic vector, while the non-core dimension has a significantly lower similarity with the original semantic vector. This indicates that the dimension division method described in this invention can effectively achieve functional separation between the core dimension and the non-core dimension. That is, the core dimension is mainly used to maintain the original semantic representation, while the non-core dimension is mainly used to carry watermark information.
[0119] To further verify the stability of the proposed dimensionality partitioning method across different domains, the retention effect of the core dimensions on the original semantic representation was statistically analyzed on corpora from multiple domains. Since the effective sample size in different domains can vary depending on preprocessing, deduplication, and filtering conditions, the following results are primarily used to illustrate the semantic retention stability of the proposed dimensionality partitioning method across different domains, and are not based on the premise that the sample size is consistent across all domains. The results are shown in Table 2.
[0120] Table 2. Verification results of semantic preservation stability of core dimensions in different domains
[0121]
[0122] As shown in Table 2, the core dimensions and the original semantic vectors maintain a high degree of similarity under different domain corpora, indicating that the semantic contribution quantification and dimension division method described in this invention has good cross-domain stability and generalization ability.
[0123] In further end-to-end batch verification, such as Figure 9 As shown in the watermark verification code interface, the inventors selected 150 samples to perform overall verification of the watermark embedding, detection, and attribution process described in this invention. The results are shown in Table 3. The batch verification results show that the total number of samples is 150, the overall verification pass rate is 100%, and the average semantic similarity is approximately 0.9789.
[0124] Table 3 End-to-end process verification results
[0125]
[0126] In this specific embodiment, all samples completed watermark verification, and the candidate object ranking results could correctly locate the target object, indicating that the present invention can achieve stable watermark detection and attribution confirmation while maintaining high semantic consistency. The aforementioned verification results are merely exemplary results under this specific embodiment and do not constitute a limitation on the scope of protection of the present invention.
[0127] In the embodiments provided by this invention, the embedding, identification, and attribution method of this invention can be implemented in the form of computer software programs. When the software functional units corresponding to the above steps are stored in a storage medium, they include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for embedding, recognizing, and attributing text watermarks based on semantic dimension segmentation, characterized in that, Includes the following steps: S1: Obtain the text to be watermarked, and use a text embedding model to generate the original semantic vector corresponding to the text to be watermarked; S2: Perform semantic contribution metric on each dimension of the original semantic vector. The semantic contribution metric includes global contribution metric and local contribution metric. Based on the semantic contribution metric results, divide the original semantic vector into a core dimension set and a non-core dimension set. The dimensions in the core dimension set are used to maintain the stability of semantic representation during watermark embedding, and the dimensions in the non-core dimension set are used to carry watermark information during watermark embedding. S3: Based on the original semantic vector, filter candidate watermark vectors from the watermark vector library, and determine the main watermark vector from the candidate watermark vectors; generate an attribution watermark vector based on the domain, entity name, attribute information and source type corresponding to the main watermark vector; S4: Divide the non-core dimension set into a main watermark injection region and an attribution watermark injection region, and inject the main watermark vector and the attribution watermark vector into the corresponding regions according to multiple combinations of main watermark injection strength and attribution watermark injection strength, respectively, to obtain multiple candidate watermarked text representation vectors; calculate the main watermark matching degree between the multiple candidate watermarked text representation vectors and the main watermark vector, and select the candidate watermarked text representation vector with a main watermark matching degree not lower than a preset main watermark matching threshold from the candidate watermarked text representation vectors that meet the semantic preservation condition of the embedding stage as the watermarked text representation vector, wherein the semantic preservation condition of the embedding stage is: the cosine similarity between the candidate watermarked text representation vector and the original semantic vector is not lower than a first threshold; S5: When there is suspicion of infringement, obtain the text to be detected and generate the semantic vector to be detected corresponding to the text to be detected using a text embedding model; obtain a set of candidate main watermark vectors from the watermark vector library, and calculate the main watermark matching degree between the semantic vector to be detected and each candidate main watermark vector in the main watermark injection area; when the maximum main watermark matching degree is not lower than the second threshold and the semantic consistency condition of the detection stage is met, it is determined that the text to be detected contains a watermark. S6: If it is determined that the text to be detected contains a watermark, obtain the domain information corresponding to the text to be detected, and filter out a set of candidate attribution objects from the watermark vector library based on the domain information; calculate the main watermark matching degree between the semantic vector to be detected and the main watermark vector corresponding to each candidate attribution object in the main watermark injection area, and the attribution watermark matching degree between the semantic vector to be detected and the attribution watermark vector corresponding to each candidate attribution object in the attribution watermark injection area; determine the attribution object corresponding to the text to be detected based on the main watermark matching degree, attribution watermark matching degree and their fusion matching result of each candidate attribution object.
2. The method according to claim 1, characterized in that, The semantic contribution metric in step S2 includes: The distinguishing power of each dimension of the original semantic vector in the overall semantic space is quantified to obtain the global contribution of each dimension. The representational differences of each dimension of the original semantic vector in different domains or different semantic categories are quantified to obtain the local contribution of each dimension; The global contribution, the local contribution, and the stability constraint term representing cross-domain stability are fused to obtain the semantic contribution metric results corresponding to each dimension.
3. The method according to claim 2, characterized in that, The stability constraint term is used to characterize the degree of fluctuation of the local contribution of the k-th dimension in different domains or different semantic categories. The stability constraint term is obtained by calculating the degree of dispersion of the local contribution of the dimension in each domain or semantic category relative to the average local contribution. The step of dividing the original semantic vector into a core dimension set and a non-core dimension set based on the semantic contribution metric results includes: The results are sorted according to the semantic contribution metric of each dimension, and multiple candidate split ratios are set. For each candidate partitioning ratio, the semantic preservation index, cross-domain stability index, and non-core dimension embeddability capacity index of the corresponding partitioning results are calculated respectively. Candidate partitioning results that do not meet the semantic preservation condition of dimension partitioning or the minimum non-core capacity condition are removed; From the remaining candidate partitioning results, the final partitioning result is determined based on the semantic preservation index, cross-domain stability index, and non-core dimension embeddability capacity index, and the core dimension set and non-core dimension set are determined accordingly. The minimum non-core capacity condition includes: when the number of non-core dimensions corresponding to the candidate partitioning result is lower than the preset minimum dimension number threshold, the candidate partitioning result is determined to be invalid.
4. The method according to claim 1, characterized in that, The watermark vector library pre-stores multiple candidate watermark vectors and object information associated with each candidate watermark vector. The object information includes at least the domain, entity name, attribute information, and source type.
5. The method according to claim 4, characterized in that, Step S3 includes: Based on the matching relationship between the original semantic vector and each candidate watermark vector, candidate watermark vectors are selected from the watermark vector library; The main watermark vector is determined based on the screening results; Attribution codes are generated based on the domain, entity name, attribute information, and source type corresponding to the main watermark vector, and the attribution codes are normalized to generate attribution watermark vectors.
6. The method according to claim 1, characterized in that, Step S4 includes: The non-core dimension set is divided into the main watermark injection region and the attribution watermark injection region. Set the injection intensity of the main watermark vector and the attribution watermark vector respectively; By traversing multiple sets of main watermark injection strengths and multiple sets of attribution watermark injection strengths, multiple candidate watermarked text representation vectors are generated. Based on the semantic preservation condition during the embedding stage and the main watermark matching degree, the watermarked text representation vector is determined from the multiple candidate watermarked text representation vectors. Both the main watermark injection region and the attribution watermark injection region are located within the non-core dimension set, and the number of dimensions of the main watermark injection region is greater than the number of dimensions of the attribution watermark injection region.
7. The method according to claim 1, characterized in that, Step S5 includes: Obtain a set of candidate master watermark vectors from the watermark vector library; Calculate the main watermark matching degree between the semantic vector to be detected and each candidate main watermark vector in the main watermark injection region; Watermark detection is performed on the text to be detected based on the main watermark matching degree and the semantic consistency condition of the detection stage; The semantic consistency condition in the detection stage is: the cosine similarity between the semantic vector to be detected and the reference semantic vector is not lower than the third threshold, and the reference semantic vector is a semantic vector generated by a text embedding model from a reference text associated with the business content corresponding to the text to be detected.
8. The method according to claim 1, characterized in that, Step S6 includes: Based on the domain information corresponding to the text to be detected, a set of candidate belonging objects is obtained by filtering from the watermark vector library; Calculate the main watermark matching degree between the semantic vector to be detected and the main watermark vector corresponding to each candidate attribution object in the main watermark injection area, and the attribution watermark matching degree between the semantic vector to be detected and the attribution watermark vector corresponding to each candidate attribution object in the attribution watermark injection area. A fusion matching result is generated based on the main watermark matching degree and the attribution watermark matching degree. The final attribution object is determined by combining the ranking results of the candidate attribution object in the same domain candidate set and the ranking results in the full candidate attribution object set. The full candidate attribution object set is a set consisting of all candidate attribution objects in the watermark vector library.
9. A text watermark embedding, recognition, and attribution system based on semantic dimension segmentation, characterized in that, include: The text encoding module is used to obtain the text to be watermarked and generate the original semantic vector corresponding to the text to be watermarked; The semantic contribution metric module is used to perform semantic contribution metric on each dimension of the original semantic vector. The semantic contribution metric includes global contribution metric and local contribution metric. The dimension partitioning module is used to divide the original semantic vector into a core dimension set and a non-core dimension set based on the semantic contribution metric result. The watermark vector determination module is used to filter candidate watermark vectors from the watermark vector library based on the original semantic vector and determine the main watermark vector, and to generate an attribution watermark vector based on the domain, entity name, attribute information and source type corresponding to the main watermark vector. The watermark injection module is used to divide the non-core dimension set into a main watermark injection region and an attribution watermark injection region, and inject the main watermark vector and the attribution watermark vector into the corresponding regions respectively to obtain a watermarked text representation vector. The watermark detection module is used to obtain the semantic vector to be detected corresponding to the text to be detected when there is suspected infringement, and to perform watermark detection on the text to be detected based on the main watermark matching degree between the semantic vector to be detected and the candidate main watermark vector in the main watermark injection area and the semantic consistency condition in the detection stage. The attribution confirmation module is used to determine the attribution object corresponding to the text under test when it is determined that the text under test contains a watermark, based on the domain information corresponding to the text under test, the main watermark matching result between the semantic vector under test and the main watermark vector corresponding to the candidate attribution object in the main watermark injection area, the attribution watermark matching result between the semantic vector under test and the attribution watermark vector corresponding to the candidate attribution object in the attribution watermark injection area, and their fusion matching result.
10. The system according to claim 9, characterized in that: The semantic contribution quantification module is used to quantify the global and local contributions of each dimension respectively, and to fuse the quantification results. The dimension partitioning module is used to set multiple candidate partitioning ratios based on the fused semantic contribution metric results, and to determine the final partitioning result based on semantic preservation index, cross-domain stability index, and non-core dimension embeddability capacity index. The watermark injection module is used to generate multiple candidate watermarked text representation vectors according to the combination of multiple sets of main watermark injection strength and attribution watermark injection strength, and to determine the watermarked text representation vector from them according to the semantic preservation conditions of the embedding stage and the main watermark matching degree. The watermark detection module is used to perform watermark detection on the text to be detected based on the main watermark matching degree between the semantic vector to be detected and the candidate main watermark vector in the main watermark injection area and the semantic consistency condition in the detection stage. The attribution confirmation module is used to determine the final attribution object by combining the ranking results in the candidate set in the same domain and the ranking results in the full candidate attribution object set, wherein the full candidate attribution object set is a set consisting of all candidate attribution objects in the watermark vector library.