A child intelligent picture book image generation method based on semantic decoupling security optimization

CN122368259BActive Publication Date: 2026-09-15HUAQIAO UNIVERSITY +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610815543.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-08
Publication Date
2026-09-15
Estimated Expiration
2046-06-08

AI Technical Summary

Technical Problem

但是,扩散模型在预训练阶段所依赖的大规模数据集,通常难以完全避免不良信息,从而在一定程度上影响模型的生成倾向,使其在特定文本提示词的诱导下,可能生成不适宜儿童阅读、违背内容安全规范的有害图像

Benefits of technology

[0052] (1) By adopting an orthogonal semantic feature decoupling strategy, this invention accurately identifies and removes high-risk components hidden in the text embedding vector. Compared with traditional surface filtering, this method cuts off the activation path of unsafe concepts from the high-dimensional vector space, effectively solving the technical problem that harmful content is easily reactivated under specific inducement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122368259B_ABST
    Figure CN122368259B_ABST
Patent Text Reader

Abstract

The application discloses a kind of children's smart picture book image generation methods based on semantic decoupling security optimization, it is related to image generation technical field.First, text embedding vector security optimization method is proposed, high-risk semantic components in unsafe text embedding vector are separated by orthogonal semantic feature decoupling, and pre-training text encoder is fine-tuned by constructing contrast decoupling and feature alignment loss function, and safe embedding vector is output;Second, a security reinforcement optimization method is proposed, to minimize the adversarial loss update disturbance vector, and insert it into the safe embedding vector to construct the adversarial embedding vector, under the condition of fixed disturbance, construct a consistency loss function to constrain the prediction noise under different embedding conditions, and realize safe and semantic consistent image generation.The application can block the generation of undesirable content and improve the security of children's picture book image generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image generation technology, and in particular to a method for generating images of children's intelligent picture books based on semantic decoupling and security optimization. Background Technology

[0002] Generative artificial intelligence, represented by diffusion models, has been widely applied in text-driven scenarios such as the automatic generation of children's smart picture books, effectively improving the creation efficiency and visual richness of children's educational content. However, the large-scale datasets relied upon by diffusion models during the pre-training stage often cannot completely avoid harmful information, thus affecting the model's generation tendency to some extent. Under the guidance of specific text prompts, it may generate harmful images unsuitable for children's reading and violating content safety regulations. Existing traditional protection methods mostly mitigate risks by modifying model parameters or inputs. However, such superficial modifications cannot touch upon or completely eliminate the internal associations and activation paths of harmful concepts. Harmful information that is not eradicated will be solidified in the model parameters in the form of residual knowledge and reactivatable paths, causing the inherent vulnerability of the model's security state. Malicious attackers can efficiently reactivate these previously blocked harmful content generation capabilities through specially designed adversarial fine-tuning attacks. Therefore, there is an urgent need to invent a safer generative model for the safe image generation of children's smart picture books. Summary of the Invention

[0003] The purpose of this invention is to solve the problems in the prior art.

[0004] The technical solution adopted by this invention to solve its technical problem is: to provide a method for generating images of children's intelligent picture books based on semantic decoupling and security optimization, including the following steps:

[0005] By using unsafe warning words to perform security optimization training on the original pre-trained text encoder, a well-trained secure semantic text encoder is obtained.

[0006] A perturbation vector is constructed to simulate malicious perturbations. During the training phase of the diffusion generation model, the perturbation vector and the noise prediction network are optimized sequentially using a cross-training method to obtain a trained noise prediction network.

[0007] A trained secure semantic text encoder outputs a secure embedding vector based on prompt words; a trained noise prediction network obtains an initial latent representation under the guidance of the secure embedding vector; and an image decoder maps the initial latent representation back to the pixel space to output the final secure generated image.

[0008] Preferably, the step of performing security optimization training on the original pre-trained text encoder using insecure prompt words to obtain a trained secure semantic text encoder includes the following steps:

[0009] For each unsafe warning word, the original pre-trained text encoder is used. The generated raw insecure embedding vector ;

[0010] An orthogonal semantic feature decoupling strategy is used to identify and modify the original insecure embedding vector. The expression of medium- and high-risk semantic components is used to calculate and determine a target security embedding vector located within a security subspace. ;

[0011] Constructing a comparison decoupling loss function Feature alignment loss function Total loss function Using the total loss function as the optimization objective, a secure semantic text encoder is developed. The parameters are updated iteratively.

[0012] Preferably, the orthogonal semantic feature decoupling strategy is used to identify and modify the original insecure embedding vector. The expression of medium- and high-risk semantic components is used to calculate and determine a target security embedding vector located within a security subspace. This includes the following steps:

[0013] Using pre-constructed medium-to-high risk semantic vectors As a directional reference, the original insecure embedding vector is calculated. The projection component in the said direction, and the projection component from the original insecure embedding vector. Subtracting from the middle yields the target secure embedding vector that reduces the impact of medium- and high-risk semantics. , is represented as:

[0014] ;

[0015] in, Indicates the first Each target security embedding vector; This represents the square of the Euclidean norm.

[0016] Preferably, the contrastive decoupling loss function , is represented as:

[0017] ;

[0018] in, This represents the cosine similarity operator, used to measure the semantic consistency between vectors; Represents a secure semantic text encoder unsafe warning words The current insecure embedding vector obtained by encoding; This represents the temperature scaling factor, used to adjust the smoothness and contrast intensity of the similarity distribution; Indicates the first Each target security embedding vector; Represents a semantic vector indicating medium to high risk; This represents the exponential mapping function, which is used to amplify differences in semantic similarity and improve the distinguishability between different semantic vectors.

[0019] Preferably, the feature alignment loss function , is represented as:

[0020] ;

[0021] in, This represents the total number of cue word pairs contained in a single training batch, with each pair including one safety cue word. and an unsafe warning word ; The hyperparameter represents the weights of safe and unsafe samples in the total loss, and ranges from 0 to 1; Represents the original pre-trained text encoder Safety prompts The original secure embedding vector obtained by encoding; Represents a secure semantic text encoder Safety prompts The current secure embedding vector obtained through encoding; Represents a secure semantic text encoder unsafe warning words The current insecure embedding vector obtained by encoding; Denotes the Euclidean norm; Indicates the first A target secure embedding vector.

[0022] Preferably, the construction of the perturbation vector for simulating malicious perturbation, and the sequential optimization of the perturbation vector and the noise prediction network using a cross-training method during the training phase of the diffusion generation model to obtain a trained noise prediction network, includes the following steps:

[0023] The perturbation vector construction steps include initializing the perturbation vector. Combine it with the secure embedding vector Combining to form adversarial embedding vectors ;

[0024] Optimize the perturbation vector step and freeze the noise prediction network. Using the adversarial loss function For the perturbation vector Update;

[0025] Optimize the noise prediction network steps and fix the updated adversarial embedding vector. Combine it with the secure embedding vector Common Input Noise Prediction Network Using the consistency loss function Predicting network parameters for noise Update;

[0026] The collaborative optimization step alternately executes the steps of optimizing the perturbation vector and optimizing the noise prediction network until the preset maximum number of training iterations or the consistency loss function is reached. Training is complete when the training converges to the predetermined threshold.

[0027] Adversarial loss function , is represented as:

[0028] ;

[0029] Among them, the adversarial loss function The unsafe score of the generated image is maximized by minimizing this loss; This represents the pre-trained unsafe content classifier's score for the unsafe category of the input image; The image decoder is used to convert the initial latent representation Decoded into pixel space; This represents a U-Net-based noise prediction network in a diffusion model, with time steps... and embedding vector As a condition, for the latent representation Predict the noise components in the data; Indicates at time step The potential representation of;

[0030] Consistency loss function , is represented as:

[0031] ;

[0032] in, This indicates that gradient updates have been stopped. This represents the square of the L2 norm.

[0033] Preferably, the perturbation vector construction step specifically includes:

[0034] Initialize one or more perturbation vectors perturbation vector Configured to embed vectors securely The front-end splicing, back-end splicing, or insertion at specific or multiple positions within it are represented as:

[0035] ;

[0036] in, Represents the adversarial embedding vector; Represents the perturbation vector; Represents a secure embedding vector; Functions that combine elements by prefix, suffix, or insertion.

[0037] Preferably, the step of optimizing the perturbation vector includes the following steps:

[0038] The noise prediction network is frozen, with the optimization objective being to maximize the insecurity score of the generated image under adversarial embedding vector conditions;

[0039] Constructing an adversarial loss function Calculate the adversarial loss function Relative to the perturbation vector The gradient is calculated, and the perturbation vector is updated along the gradient direction. To encourage the adversarial loss function Decrease, represented as:

[0040] ;

[0041] in, Indicates the first The perturbation vector for the next iteration; Indicates the first The perturbation vector for the next iteration; This indicates the step size for updating the perturbation vector; Represents a symbolic function; express right The gradient.

[0042] Preferably, the step of optimizing the noise prediction network includes the following steps:

[0043] Fixed adversarial embedding vector Combine it with the secure embedding vector Common Input Noise Prediction Network ;

[0044] Constructing a consistency loss function Using the consistency loss function Optimize and update noise prediction network parameters , is represented as:

[0045] ;

[0046] in, Indicates the first The parameters of the noise prediction network during the next training iteration; Indicates the first The parameters of the noise prediction network during the next training iteration; The consistency loss function represents the network parameters. The gradient; This represents the learning rate used to update the parameters of the noise prediction network.

[0047] This invention also provides a children's intelligent picture book image generation system based on semantic decoupling and security optimization, comprising:

[0048] The secure semantic text encoder training module uses unsafe prompt words to perform security optimization training on the original pre-trained text encoder, resulting in a trained secure semantic text encoder.

[0049] The noise prediction network training module constructs a perturbation vector to simulate malicious perturbations. During the training phase of the diffusion generation model, a cross-training method is used to optimize the perturbation vector and the noise prediction network in sequence to obtain a trained noise prediction network.

[0050] The image generation module uses a trained secure semantic text encoder to output a secure embedding vector based on prompt words; a trained noise prediction network obtains an initial latent representation under the guidance of the secure embedding vector; and an image decoder maps the initial latent representation back to the pixel space to output the final securely generated image.

[0051] The present invention has the following beneficial effects:

[0052] (1) By adopting an orthogonal semantic feature decoupling strategy, this invention accurately identifies and removes high-risk components hidden in the text embedding vector. Compared with traditional surface filtering, this method cuts off the activation path of unsafe concepts from the high-dimensional vector space, effectively solving the technical problem that harmful content is easily reactivated under specific inducement.

[0053] (2) By introducing a perturbation vector into the secure embedding vector and using an alternating optimization mechanism of adversarial loss and consistency loss, the present invention enables the noise prediction network of the diffusion model to cope with adversarial perturbation attacks. It can not only defend against ordinary instruction inducement, but also effectively resist adversarial attacks carried out by means of prefix splicing, internal insertion and other methods.

[0054] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments, but the present invention is not limited to the embodiments. Attached Figure Description

[0055] Figure 1 This is a step diagram illustrating a method for generating images of children's intelligent picture books based on semantic decoupling and security optimization, according to an embodiment of the present invention.

[0056] Figure 2 This is a schematic diagram illustrating the training of the secure semantic text encoder in an embodiment of the present invention;

[0057] Figure 3 This is a schematic diagram illustrating the training of the diffusion model in an embodiment of the present invention;

[0058] Figure 4 This is a schematic diagram of the structure of a children's intelligent picture book image generation system based on semantic decoupling and security optimization, according to an embodiment of the present invention. Detailed Implementation

[0059] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0060] See Figure 1 As shown, a method for generating images for children's intelligent picture books based on semantic decoupling and security optimization is described, the method comprising:

[0061] S101, use unsafe prompts to perform security optimization training on the original pre-trained text encoder to obtain a trained secure semantic text encoder;

[0062] S102, construct a perturbation vector to simulate malicious perturbation, and use cross-training to optimize the perturbation vector and noise prediction network in turn during the training phase of the diffusion generation model to obtain a trained noise prediction network.

[0063] S103, the trained secure semantic text encoder outputs a secure embedding vector based on the prompt words; the trained noise prediction network obtains an initial latent representation under the guidance of the secure embedding vector; the image decoder maps the initial latent representation back to the pixel space and outputs the final secure generated image.

[0064] Specifically, in this embodiment of the invention, training data is first acquired and preprocessed. A dataset of paired safe-unsafe warning words for specific scenarios generated by children's intelligent picture books is collected to form a set of safety warnings. and a set of unsafe warnings Simultaneously, a set of medium- and high-risk semantic vocabulary was selected, and a pre-trained language model was used ( Encode the language model. Then perform model initialization configuration. Select the original pre-trained language model ( As the basic text encoder, it is used to extract the semantic embedding vectors of prompt words. The diffusion model adopts a mainstream image generation architecture, including a cross-attention layer, a noise prediction network, and a decoder module. Insecure prompt words focus on medium-to-high-risk scenarios, while secure prompt words are risk-free expressions in the corresponding scenarios. The perturbation vector supports three optional methods: all-zero initialization, random initialization, and manual predefined initialization. Its insertion position can be flexibly configured as the prefix position, suffix position, or one or more specified positions within the vector sequence of secure embedding vectors. Finally, a security defense system for children's smart picture books resistant to malicious activation is constructed, including two core modules: a text embedding vector security optimization method and a security hardening optimization method.

[0065] Specifically, the text embedding vector security optimization method is described in [reference needed]. Figure 2 As shown.

[0066] Processing based on text embedding vector security optimization method: using the original pre-trained text encoder. For the set of unsafe warning words and a collection of safety tips Encode it. As shown below:

[0067] ;

[0068] ;

[0069] in, This represents the original pre-trained text encoder; Represents the original pre-trained text encoder unsafe warning words The original insecure embedding vector obtained by encoding; Represents the original pre-trained text encoder Safety prompts The original secure embedding vector obtained by encoding;

[0070] An orthogonal semantic feature decoupling method is adopted, using pre-constructed medium- and high-risk semantic vectors. As a directional reference, the original insecure embedding vector is calculated. The projection component in the said direction, and the projection component from the original insecure embedding vector. Subtracting from the middle yields the target secure embedding vector that reduces the impact of medium- and high-risk semantics. As shown below:

[0071] ;

[0072] in, Indicates the first Each target security embedding vector; Represents the square of the Euclidean norm;

[0073] For the original pre-trained text encoder Perform security optimizations and fine-tuning to build a secure semantic text encoder. The prompt words are encoded to obtain the current secure semantic embedding vector and the current insecure semantic embedding vector, as shown below:

[0074] ;

[0075] ;

[0076] in, Indicates by The parameters are obtained through safety optimization training and are continuously updated. Represents a secure semantic text encoder unsafe warning words The current insecure embedding vector obtained by encoding; Represents a secure semantic text encoder Safety prompts The current secure embedding vector obtained through encoding;

[0077] Constructing a contrastive decoupling loss function The model is forced to actively remove medium- and high-risk semantic vectors during training. This achieves semantic decoupling, as shown below:

[0078] ;

[0079] in, This represents the cosine similarity operator, used to measure the semantic consistency between vectors; This represents the temperature scaling factor, used to adjust the smoothness and contrast intensity of the similarity distribution; Represents the target security embedding vector; Represents a semantic vector indicating medium to high risk; This represents an exponential mapping function, used to amplify differences in semantic similarity and improve the distinguishability between different semantic vectors; Represents a secure semantic text encoder unsafe warning words The current insecure embedding vector obtained by encoding;

[0080] Constructing a feature alignment loss function As shown below:

[0081] ;

[0082] in, This represents the total number of cue word pairs contained in a single training batch, with each pair including one safety cue word. and an unsafe warning word ; The hyperparameter representing the balance between safe and unsafe losses (i.e., the hyperparameter balancing the weights of safe and unsafe samples in the total loss) ranges from 0 to 1. Represents the original pre-trained text encoder Safety prompts The original secure embedding vector obtained by encoding; Represents a secure semantic text encoder Safety prompts The current secure embedding vector obtained through encoding; Represents a secure semantic text encoder unsafe warning words The current insecure embedding vector obtained by encoding.

[0083] During the fine-tuning training phase of the text encoder, the decoupling loss function is compared. Feature alignment loss function The weighted sum is used to construct the total loss function. For secure semantic text encoders The parameters are updated to ensure that the model accurately removes high-risk and harmful semantic information while fully preserving the effective semantic information required for the generation task. As shown below:

[0084] ;

[0085] in, Let the total loss function be the optimization objective for the secure semantic text encoder. The parameters are iteratively updated so that the model can accurately remove high-risk and harmful semantic information while fully retaining effective semantic information.

[0086] Finally, a secure embedding vector is output using a fine-tuned secure semantic text encoder. .

[0087] Specifically, the security hardening and optimization method is described in [reference needed]. Figure 3 As shown, a perturbation vector is constructed to simulate malicious perturbations. During the training phase of the diffusion generation model, a cross-training method is used to sequentially optimize the perturbation vector and the noise prediction network, resulting in a trained noise prediction network. One or more perturbation vectors are initialized. perturbation vector Configured to embed vectors securely The initial adversarial embedding vector is formed by concatenating the front and back ends of the vector, or by inserting it at specific or multiple positions within the vector. As shown below:

[0088] ;

[0089] in, Represents the adversarial embedding vector; Represents the perturbation vector; Represents a secure embedding vector; Indicates will Secure embedding vectors can be used with prefixes, suffixes, or intermediate insertions. Functions that perform combinations.

[0090] In optimizing the adversarial loss, the noisy prediction network is frozen at each step. Update the perturbation vector By adjusting This makes it possible for the Conditionally generated images, decoded and noise prediction network After use, its unsafety score It is maximized. As shown below:

[0091] ;

[0092] in, This represents the adversarial loss function, which maximizes the insecurity score of the generated image by minimizing this loss; This represents the pre-trained unsafe content classifier's score for the unsafe category of the input image; The image decoder is used to convert the initial latent representation Decoded into pixel space; This represents a U-Net-based noise prediction network in a diffusion model, with time steps... and embedding vector As a condition, for the latent representation Predict the noise components in the data; Indicates at time step The potential representation of;

[0093] Secondly, calculate the adversarial loss function. Relative to the perturbation vector The gradient is calculated, and the perturbation vector is updated along the gradient direction. To encourage the adversarial loss function Decrease. As shown below:

[0094] ;

[0095] in, Indicates the first The perturbation vector for the next iteration; Indicates the first The perturbation vector for the next iteration; This indicates the step size for updating the perturbation vector; Represents a symbolic function; express right The gradient;

[0096] Next, the adversarial embedding vector is fixed and compared with the secure embedding vector. Common Input Noise Prediction Network By minimizing the consistency loss between predicted noise, the model ensures consistent noise prediction results under both conditions, thereby guaranteeing the stability and safety of the generation process. As shown below:

[0097] ;

[0098] in, This indicates that gradient updates have been stopped. Represents the square of the L2 norm; Indicates at time step The potential representation of;

[0099] Then, using the consistency loss function Optimize and update noise prediction network parameters As shown below:

[0100] ;

[0101] in, Indicates the first The parameters of the noise prediction network during the next training iteration; Indicates the first The parameters of the noise prediction network during the next training iteration; The consistency loss function represents the network parameters. The gradient; The learning rate represents the parameter update of the noise prediction network;

[0102] Finally, the trained secure semantic text encoder outputs a secure embedding vector based on the prompt words; the trained noise prediction network, guided by the secure embedding vector, obtains an initial latent representation; the image decoder maps the initial latent representation back to the pixel space, outputting the final securely generated image. As shown below:

[0103] ;

[0104] in, This represents the final output security image; This represents the initial latent representation obtained after the complete denoising process.

[0105] This embodiment presents a children's intelligent picture book image generation method based on semantic decoupling security optimization. The core objective of this children's intelligent picture book secure image generation technology test is to comprehensively verify whether the system can simultaneously meet two core requirements when facing three types of inputs: normal picture book creation instructions, hidden harmful instructions, and malicious adversarial attacks. On the one hand, it ensures that all generated images strictly comply with children's reading safety standards and eliminate any harmful content; on the other hand, it fully preserves the visual texture and narrative consistency that children's picture books should have, without sacrificing the quality of generation due to security reinforcement.

[0106] See Figure 4 The diagram shown is a structural schematic of a children's intelligent picture book image generation system based on semantic decoupling and security optimization according to an embodiment of the present invention, comprising:

[0107] The secure semantic text encoder training module 401 uses unsafe prompt words to perform security optimization training on the original pre-trained text encoder to obtain a trained secure semantic text encoder.

[0108] The noise prediction network training module 402 constructs a perturbation vector to simulate malicious perturbation. During the training phase of the diffusion generation model, the perturbation vector and the noise prediction network are optimized sequentially using a cross-training method to obtain a trained noise prediction network.

[0109] The image generation module 403 uses a trained secure semantic text encoder to output a secure embedding vector based on prompt words; the trained noise prediction network obtains an initial latent representation under the guidance of the secure embedding vector; and the image decoder maps the initial latent representation back to the pixel space to output the final securely generated image.

[0110] 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 or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating images for children's intelligent picture books based on semantic decoupling and security optimization, characterized in that, Includes the following steps: By using unsafe warning words to perform security optimization training on the original pre-trained text encoder, a well-trained secure semantic text encoder is obtained. A perturbation vector is constructed to simulate malicious perturbations. During the training phase of the diffusion generation model, the perturbation vector and the noise prediction network are optimized sequentially using a cross-training method to obtain a trained noise prediction network. A trained secure semantic text encoder is used to output secure embedding vectors based on prompt words. The trained noise prediction network, guided by the secure embedding vector, obtains an initial latent representation; the image decoder then maps the initial latent representation back to the pixel space, outputting the final securely generated image. The process of performing security optimization training on the original pre-trained text encoder using insecure prompt words to obtain a trained secure semantic text encoder includes the following steps: For each unsafe warning word, the original pre-trained text encoder is used. The generated raw insecure embedding vector ; An orthogonal semantic feature decoupling strategy is used to identify and modify the original insecure embedding vector. The expression of medium- and high-risk semantic components is used to calculate and determine a target security embedding vector located within a security subspace. ; Constructing a comparison decoupling loss function Feature alignment loss function Total loss function Using the total loss function as the optimization objective, a secure semantic text encoder is developed. The parameters are updated iteratively; The orthogonal semantic feature decoupling strategy is used to identify and modify the original insecure embedding vector. The expression of medium- and high-risk semantic components is used to calculate and determine a target security embedding vector located within a security subspace. This includes the following steps: Using pre-constructed medium-to-high risk semantic vectors As a directional reference, the original insecure embedding vector is calculated. The projection component in the said direction, and the projection component from the original insecure embedding vector. Subtracting from the middle yields the target secure embedding vector that reduces the impact of medium- and high-risk semantics. , is represented as: ; in, Indicates the first Each target security embedding vector; Represents the square of the Euclidean norm; The comparison decoupling loss function , is represented as: ; in, This represents the cosine similarity operator, used to measure the semantic consistency between vectors; Represents a secure semantic text encoder unsafe warning words The current insecure embedding vector obtained by encoding; This represents the temperature scaling factor, used to adjust the smoothness and contrast intensity of the similarity distribution; This represents an exponential mapping function, used to amplify differences in semantic similarity and improve the distinguishability between different semantic vectors; The feature alignment loss function , is represented as: ; in, This represents the total number of cue word pairs contained in a single training batch, with each pair including one safety cue word. and an unsafe warning word ; The hyperparameter represents the weights of safe and unsafe samples in the total loss, and ranges from 0 to 1; Represents the original pre-trained text encoder Safety prompts The original secure embedding vector obtained by encoding; Represents a secure semantic text encoder Safety prompts The current secure embedding vector obtained through encoding; Represents a secure semantic text encoder unsafe warning words The current insecure embedding vector obtained by encoding; This represents the Euclidean norm.

2. The method for generating images of children's intelligent picture books based on semantic decoupling and security optimization according to claim 1, characterized in that, The construction of the perturbation vector to simulate malicious perturbation, and the subsequent optimization of the perturbation vector and noise prediction network using cross-training during the training phase of the diffusion generation model to obtain a trained noise prediction network, includes the following steps: The perturbation vector construction steps include initializing the perturbation vector. Combine it with the secure embedding vector Combining to form adversarial embedding vectors ; Optimize the perturbation vector step and freeze the noise prediction network. Using the adversarial loss function For the perturbation vector Update; Optimize the noise prediction network steps and fix the updated adversarial embedding vector. Combine it with the secure embedding vector Common Input Noise Prediction Network Using the consistency loss function Predicting network parameters for noise Update; The collaborative optimization step alternately executes the steps of optimizing the perturbation vector and optimizing the noise prediction network until the preset maximum number of training iterations or the consistency loss function is reached. Training is complete when the training converges to the predetermined threshold. Adversarial loss function , is represented as: ; Among them, the adversarial loss function The unsafe score of the generated image is maximized by minimizing this loss; This represents the pre-trained unsafe content classifier's score for the unsafe category of the input image; The image decoder is used to convert the initial latent representation Decoded into pixel space; This represents a U-Net-based noise prediction network in a diffusion model, with time steps... and embedding vector As a condition, for the latent representation Predict the noise components in the data; Indicates at time step The potential representation of; Consistency loss function , is represented as: ; in, This indicates that gradient updates have been stopped. This represents the square of the L2 norm.

3. The children's intelligent picture book image generation method based on semantic decoupling and security optimization according to claim 2, characterized in that, The perturbation vector construction steps are as follows: Initialize one or more perturbation vectors perturbation vector Configured to embed vectors securely The front-end splicing, back-end splicing, or insertion at specific or multiple positions within it are represented as: ; in, Represents the adversarial embedding vector; Represents the perturbation vector; Represents a secure embedding vector; Functions that combine elements by prefix, suffix, or insertion.

4. The children's intelligent picture book image generation method based on semantic decoupling and security optimization according to claim 2, characterized in that, The step of optimizing the perturbation vector includes the following steps: The noise prediction network is frozen, with the optimization objective being to maximize the insecurity score of the generated image under adversarial embedding vector conditions; Constructing an adversarial loss function Calculate the adversarial loss function Relative to the perturbation vector The gradient is calculated, and the perturbation vector is updated along the gradient direction. To encourage the adversarial loss function Decrease, represented as: ; in, Indicates the first The perturbation vector for the next iteration; Indicates the first The perturbation vector for the next iteration; This indicates the step size for updating the perturbation vector; Represents a symbolic function; express right The gradient.

5. The method for generating images of children's intelligent picture books based on semantic decoupling and security optimization according to claim 2, characterized in that, The step of optimizing the noise prediction network includes the following steps: Fixed adversarial embedding vector Combine it with the secure embedding vector Common Input Noise Prediction Network ; Constructing a consistency loss function Using the consistency loss function Optimize and update noise prediction network parameters , is represented as: ; in, Indicates the first The parameters of the noise prediction network during the next training iteration; Indicates the first The parameters of the noise prediction network during the next training iteration; The consistency loss function represents the network parameters. The gradient; This represents the learning rate used to update the parameters of the noise prediction network.

6. A children's intelligent picture book image generation system based on semantic decoupling and security optimization, characterized in that, include: The secure semantic text encoder training module uses unsafe prompt words to perform security optimization training on the original pre-trained text encoder, resulting in a trained secure semantic text encoder. The noise prediction network training module constructs a perturbation vector to simulate malicious perturbations. During the training phase of the diffusion generation model, a cross-training method is used to optimize the perturbation vector and the noise prediction network in sequence to obtain a trained noise prediction network. The image generation module uses a trained secure semantic text encoder to output secure embedding vectors based on prompt words; The trained noise prediction network, guided by the secure embedding vector, obtains an initial latent representation; the image decoder then maps the initial latent representation back to the pixel space, outputting the final securely generated image. The process of performing security optimization training on the original pre-trained text encoder using insecure prompt words to obtain a trained secure semantic text encoder includes the following steps: For each unsafe warning word, the original pre-trained text encoder is used. The generated raw insecure embedding vector ; An orthogonal semantic feature decoupling strategy is used to identify and modify the original insecure embedding vector. The expression of medium- and high-risk semantic components is used to calculate and determine a target security embedding vector located within a security subspace. ; Constructing a comparison decoupling loss function Feature alignment loss function Total loss function Using the total loss function as the optimization objective, a secure semantic text encoder is developed. The parameters are updated iteratively; The orthogonal semantic feature decoupling strategy is used to identify and modify the original insecure embedding vector. The expression of medium- and high-risk semantic components is used to calculate and determine a target security embedding vector located within a security subspace. This includes the following steps: Using pre-constructed medium-to-high risk semantic vectors As a directional reference, the original insecure embedding vector is calculated. The projection component in the said direction, and the projection component from the original insecure embedding vector. Subtracting from the middle yields the target secure embedding vector that reduces the impact of medium- and high-risk semantics. , is represented as: ; in, Indicates the first Each target security embedding vector; Represents the square of the Euclidean norm; The comparison decoupling loss function , is represented as: ; in, This represents the cosine similarity operator, used to measure the semantic consistency between vectors; Represents a secure semantic text encoder unsafe warning words The current insecure embedding vector obtained by encoding; This represents the temperature scaling factor, used to adjust the smoothness and contrast intensity of the similarity distribution; This represents an exponential mapping function, used to amplify differences in semantic similarity and improve the distinguishability between different semantic vectors; The feature alignment loss function , is represented as: ; in, This represents the total number of cue word pairs contained in a single training batch, with each pair including one safety cue word. and an unsafe warning word ; The hyperparameter represents the weights of safe and unsafe samples in the total loss, and ranges from 0 to 1; Represents the original pre-trained text encoder Safety prompts The original secure embedding vector obtained by encoding; Represents a secure semantic text encoder Safety prompts The current secure embedding vector obtained through encoding; Represents a secure semantic text encoder unsafe warning words The current insecure embedding vector obtained by encoding; This represents the Euclidean norm.