Controllable generation method of geographical teaching images based on structural condition constraint diffusion model

By using LoRA domain adaptation and ControlNet line structure control, the problem of style and structure inconsistency in the generation of geographical teaching images was solved, achieving accuracy and usability of the generated results, and providing textless, editable geographical teaching images.

CN123160716APending Publication Date: 2026-11-24BEIJING NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611420226.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-14
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing latent diffusion models struggle to precisely constrain lines, regions, symbols, and topological relationships when generating geography teaching images. This results in generated images that do not match the style of geography teaching images, have unstable spatial structures, insufficient expression of topological relationships, and residual text artifacts, affecting the accuracy and usability of the teaching images.

Method used

The LoRA domain style adaptation fine-tunes the basic diffusion model, and constructs line structure control branches through ControlNet. Combined with semantic categories, topological relationships, symbol objects, and negative text constraints, geographical teaching images are generated and filtered to ensure that the generated results meet the structural and stylistic requirements of geographical teaching images.

Benefits of technology

It significantly improves the line connectivity and regional closure of geography teaching images, ensures the accuracy of contour line nesting, regional inclusion, and arrow direction, reduces invalid text residue, and provides teaching base maps with reliable structure and consistent style.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160716A_ABST
    Figure CN123160716A_ABST
Patent Text Reader

Abstract

This invention discloses a controllable generation method for geographical teaching images based on a structurally constrained diffusion model, belonging to the field of geographical teaching image generation. The method includes: using LoRA for style adaptation within the geographical teaching image domain, enabling the model to learn black-and-white line drawing and textbook-style composition; then constructing ControlNet line structure control branches based on linear conditions to constrain linear skeletons such as boundary lines, contour lines, river lines, latitude and longitude grids, and arrow outlines; furthermore, semantic categories, topological relationships, symbol objects, and negative text constraints are used as hierarchical auxiliary constraints to evaluate and filter the line connectivity, region closure, symbol standardization, and text artifacts of the generated images. This method can generate structurally reliable, stylistically consistent geographical teaching base maps free of text artifacts, providing effective technical support for the automated construction of geographical teaching resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of geography teaching image generation, and particularly relates to a controllable generation method for geography teaching images based on a structural condition-constrained diffusion model. Background Technology

[0002] With the implementation of the geography curriculum standards for general high schools and compulsory education, geographical teaching images such as maps, contour maps, climate distribution maps, and latitude and longitude grid maps have become indispensable teaching resources in classroom explanations, test design, and courseware production. These images not only serve a visual display function but also express spatial location, regional relationships, geographical processes, and conceptual structures. Their structural correctness, symbolic standardization, and readability directly affect the accuracy of geographical knowledge expression. In recent years, latent diffusion models, represented by StableDiffusion, have demonstrated strong semantic understanding and visual generation capabilities in text-to-image generation tasks, providing a new technical path for the automatic generation of teaching images. Building upon this, LoRA parameter efficient fine-tuning technology, by freezing the original model parameters and learning low-rank weight increments, can achieve style adaptation of pre-trained models in specific domains with low training costs. ControlNet technology, by introducing trainable control branches on the basis of freezing the main body of the pre-trained diffusion model, can inject external structural conditions such as edge maps and line drawings into the denoising network, enhancing the ability of the generated results to conform to a given spatial structure. These technologies have made certain progress in general image generation and related fields.

[0003] However, general text-to-image diffusion models are primarily designed for open-domain image generation. Text prompts typically only describe the image's subject, object, and style, making it difficult to precisely constrain the organization of lines, regions, symbols, and topological relationships in geographic images. This leads to the following problems with the generated images: First, insufficient adaptation to the domain style results in images that tend to resemble photographs, illustrations, or artistic maps, deviating significantly from the textbook-style visual style of geographic teaching images, characterized by white backgrounds with black lines, simple lines, clear structures, low texture, and minimal shadows. Second, unstable spatial structures are common, with issues such as broken or adhered contour lines, incomplete regional boundaries, disconnected river lines, and distorted latitude and longitude grids, failing to meet the basic requirements of line connectivity and regional closure for geographic teaching images. Third, insufficient expression of topological relationships results in chaotic contour line nesting, incorrect arrow directions, and an inability to effectively guarantee the inclusion relationships and directional consistency between geographic objects, directly affecting the accuracy of geographic knowledge expression. Fourth, prominent text artifacts are a significant problem, with the model easily generating meaningless text, incorrect place name labels, or pseudo-labels such as question options in images, reducing the usability of teaching base maps and the convenience of subsequent editing. The aforementioned problems are not merely local visual flaws in geography teaching image generation, but rather key obstacles affecting the representation of image knowledge and classroom usability. Therefore, there is an urgent need for a geography teaching image generation method that can balance domain style adaptation, spatial structure control, and topological relationship constraints. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides a method for controllable generation of geographical teaching images based on a structurally constrained diffusion model, comprising: Obtain the basic diffusion model; Based on the geographical teaching image dataset, the basic diffusion model is fine-tuned by LoRA domain style adaptation to obtain the adapted diffusion model. Obtain the line structure conditions of the target geography teaching image; Based on the line structure conditions, a line structure control branch is constructed using ControlNet, and the line structure control branch is injected into the adapted diffusion model to obtain a diffusion model with controllable structure. Obtain hierarchical auxiliary constraints, which include semantic category constraints, topological relationship constraints, symbol object constraints, and negative text constraints; Based on the hierarchical auxiliary constraints, the candidate images generated by the structure-controllable diffusion model are evaluated and screened, and the target geographic teaching image is output.

[0005] Optionally, the basic diffusion model is fine-tuned for LoRA domain style adaptation, including: Freeze the original linear mapping weights of the UNet network in the basic diffusion model; Based on the geographical teaching image dataset, learn the low-rank weight increment of the original linear mapping weights; The adapted linear mapping weights are determined based on the original linear mapping weights and the low-rank weight increments.

[0006] Optionally, the condition for obtaining the line structure of the target geographic teaching image includes: Obtain the original images used to generate the target geography teaching images; Line drawing is extracted from the original image to obtain the linear conditional graph of the target geographical teaching image.

[0007] Optionally, the step of constructing a line structure control branch using ControlNet and injecting the line structure control branch into the adapted diffusion model includes: Obtain the multi-scale feature layers of the UNet network in the adapted diffusion model; By using the trainable control branches of ControlNet, feature extraction is performed on the line structure conditions to obtain conditional features; The conditional features are mapped to the multi-scale feature layer of the UNet network and superimposed with the original features of the multi-scale feature layer to obtain the features after injecting structural conditions.

[0008] Optionally, the semantic category constraints can be obtained in the following ways: Obtain hierarchical category path information for geography teaching images, including image subject category, geographic branch category, and image type category; Based on the hierarchical category path information, image content description information, and style description information, positive prompt words are constructed.

[0009] Optionally, the topological constraints include connectivity constraints, closure constraints, nesting constraints, and directional consistency constraints, and the evaluation of the generated image based on the hierarchical auxiliary constraints includes: Based on the connectivity constraints, determine the connectivity evaluation index of line objects in the generated image; Based on the aforementioned closure constraints, a closure evaluation index for the region boundaries in the generated image is determined; Based on the nesting relationship constraints, determine the evaluation index of the nesting relationship of geographic objects in the generated image; Based on the aforementioned directional consistency constraints, determine the directional consistency evaluation index for arrow-type symbols in the generated image; The topology quality evaluation score is obtained by weighted summation of the connectivity evaluation index, the closure evaluation index, the nesting relationship evaluation index, and the directional consistency evaluation index.

[0010] Optionally, the symbol object constraints include arrow direction constraints, north arrow integrity constraints, and legend symbol integrity constraints, and the method further includes: Based on the symbol object constraints, the shape and orientation of the symbol objects in the generated image are detected to obtain a symbol normalization evaluation index.

[0011] Optionally, it also includes a training phase and an inference phase: During the training phase, the basic diffusion model is fine-tuned for LoRA domain style adaptation based on the geographical teaching image dataset, and the line structure control branch of ControlNet is trained based on the line structure conditions and the geographical teaching image dataset. In the reasoning stage, target text prompts and target line structure conditions are obtained. Multiple candidate images are generated through the trained structure-controllable diffusion model. The multiple candidate images are evaluated and filtered according to the hierarchical auxiliary constraints, and the target geographical teaching image is output.

[0012] On the other hand, the present invention also provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method when executing the computer program.

[0013] On the other hand, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method.

[0014] Compared with the prior art, the present invention has the following advantages and technical effects: The geographical teaching image generation method provided by this invention, through LoRA domain style adaptation, enables the basic diffusion model to stably learn the visual distribution of white background and black lines, textbook-style composition, effectively overcoming the problem that the generated results of general models tend to resemble photos, illustrations, or artistic maps; through lineart-ControlNet line structure control, it controls the branch constraints of boundary lines, contour lines, river lines, and latitude and longitude grids, significantly improving line connectivity and regional closure; through topological relationship constraints, it evaluates and filters connectivity, closure, nesting relationships, and directional consistency after generation, effectively ensuring the accuracy of contour line nesting, regional inclusion, and arrow direction; through negative prompt words and OCR filtering mechanisms, it suppresses the generation of text, numbers, and pseudo-annotations, reducing the interference of invalid text residues on the usability of the teaching base map, and providing a textless geographical teaching base map with a reliable structure, unified style, and strong editability for subsequent large-scale model auxiliary annotation and procedural overlay. Attached Figure Description

[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a schematic diagram of a controllable diffusion generation framework for geographical teaching images based on hierarchical structure constraints, according to an embodiment of the present invention. Figure 2 This is a schematic diagram illustrating the hierarchical structure constraint representation of a geographical teaching image according to an embodiment of the present invention; Figure 3 This is a schematic diagram of topological errors and constraint targets in geographical teaching images according to an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the generation and hierarchical evaluation and screening of the main control conditions based on lineart in an embodiment of the present invention. Detailed Implementation

[0016] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0017] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0018] Example 1 This embodiment provides a method for controllable generation of geographical teaching images based on a structurally constrained diffusion model, including: Obtain the basic diffusion model; Based on the geographical teaching image dataset, the basic diffusion model is fine-tuned by LoRA domain style adaptation to obtain the adapted diffusion model. Obtain the line structure conditions of the target geography teaching image; Based on the line structure conditions, a line structure control branch is constructed using ControlNet, and the line structure control branch is injected into the adapted diffusion model to obtain a diffusion model with controllable structure. Obtain hierarchical auxiliary constraints, which include semantic category constraints, topological relationship constraints, symbol object constraints, and negative text constraints; Based on the hierarchical auxiliary constraints, the candidate images generated by the structure-controllable diffusion model are evaluated and screened, and the target geographic teaching image is output.

[0019] The specific process includes: The goal of this embodiment is to generate a textless geographical teaching base map under the combined effect of text prompts and structural conditions, serving as the foundation image for subsequent large-scale model auxiliary annotation and procedural annotation overlay. Let the text prompt be p, and the line structure condition be... Category conditions are The generated image is The generation process can be represented as follows: ; in, This represents a diffusion generator adapted with LoRA and incorporating linear control. Topological relationships, symbolic objects, and OCR detection are not used as end-to-end training inputs for the first-stage main network, but are primarily used for structural quality evaluation and candidate result selection. Figure 1 As shown, this embodiment first uses Stable Diffusion as the basis for generating a model, and uses its text-to-image generation capability to obtain general visual priors; secondly, LoRA is used to adapt the basic model to the geographic teaching image domain, so that the model can learn the visual distribution of black and white line drawing, textbook-style composition and geographic schematic diagram; thirdly, a line structure control module is constructed based on lineart conditions to improve the spatial consistency between the generated image and the target line drawing.

[0020] The basic diffusion model is unstable in its representation of the style of middle school geography teaching images. Geography teaching images typically feature white backgrounds with black lines, simple lines, clear structures, low texture, and few shadows. To adapt the basic model to this visual style, this embodiment first uses LoRA for domain-specific fine-tuning. For the linear mapping weights in the diffusion model UNet... LoRA freezes the original parameters and only learns low-rank increments: ; in, , , , For LoRA rank, The scaling factor is used. This method significantly reduces the number of trainable parameters, which is beneficial for stable training on limited-scale geographical teaching image data. In this embodiment, LoRA is positioned as a domain style adaptation module, whose role is to learn the visual distribution of geographical teaching images, rather than directly performing structural control. After LoRA adaptation, the model can generate black and white line drawings and textbook-style compositions more stably, but problems such as non-closed contour lines, disconnected rivers, and unstable arrow directions may still occur. Therefore, it is necessary to further introduce linear structural control.

[0021] like Figure 2As shown, this embodiment decomposes geographical teaching images into layers such as semantic categories, line skeletons, topological relationships, symbolic objects, and negative text constraints. Each layer plays a different role in the method: semantic categories are mainly used for standardizing cue word construction; line skeletons serve as the main control conditions for lineart-ControlNet in training and inference; topological relationships and symbolic objects are mainly used for post-generation structure evaluation; and negative text constraints are used for negative cue words and OCR filtering during the inference stage. This hierarchical organization transforms the structural requirements of geographical teaching images into different trainable, evaluable, and filterable stages.

[0022] Geographic teaching images have a clear category system, with different categories corresponding to different structural patterns. For example, contour maps emphasize closed curves and variations in density, ocean current maps emphasize arrow directions and land-sea distribution, and climate distribution maps emphasize regional blocks and boundaries. This embodiment incorporates hierarchical category paths into training prompts, enabling text conditions to simultaneously include image content descriptions and geographic image category information. For example, a contour map can be represented as "Map Category—Natural Geographic Map—Contour Map". This approach does not modify the text encoder structure but enhances the model's ability to distinguish between different geographic image types by standardizing prompts.

[0023] Line skeletons are the most basic structural features of geographical teaching images. This example obtains line conditions from the image using edge extraction or line drawing extraction functions: ; in, Canny, HED, lineart, or binarized line drawing extraction methods can be used; this embodiment preferably uses lineart line drawings. While the line skeleton can provide local geometric contours, it cannot fully express the spatial relationships between geographic objects; therefore, further topological conditions need to be constructed.

[0024] Many structural errors in geography teaching images stem from incorrect relationships between lines. For example, contour lines need to maintain proper nesting, rivers need to remain connected, regional boundaries need to be closed, and arrows need to conform to the direction of geographical processes. To express these relationships, this embodiment defines image structural relationships for geography teaching image generation tasks, mainly including connectivity, closure, nesting relationships, and directional consistency: ; in, Indicates connectivity, Indicates closure. Indicates a nested or containment relationship. This indicates directional consistency. After generation, it is extracted from candidate images or subject to manual evaluation to assess the structural reliability of the generated result. The comprehensive topological evaluation score is calculated as follows: ; in, , , , For various topological evaluation weights, , , , These represent the evaluation scores for connectivity, closure, nesting, and directional consistency, respectively.

[0025] Figure 3 This illustrates the topological errors and constraint targets in geography teaching images.

[0026] Geographic teaching images often contain objects such as arrows, frontal symbols, scale bars, compasses, and legend symbols, which have clear teaching meanings. This embodiment explicitly records symbol object information in prompts and structural evaluations, focusing on issues such as arrow direction, compass retention, and the integrity of legend symbols. For arrow-type symbols, their directional consistency is described by the start point, end point, or azimuth angle: ; in, To generate the direction of the arrows detected in the image, This is the target direction. This indicator is mainly used for post-generation evaluation.

[0027] To obtain a textless geographical teaching base map that facilitates subsequent teaching annotation, text, numbers, letters, place names, and meaningless pseudo-labels are all considered content to be suppressed during generation. This embodiment uses negative text constraints as auxiliary constraints in the hierarchical structure conditions, for constructing negative prompts and filtering generated results during the reasoning stage. Positive prompts retain image category, structural object, and teaching image style descriptions. ; Negative prompts incorporate constraints such as text, numbers, letters, place names, coordinate labels, question stems, options, and pseudo-text to reduce the probability of the model generating invalid annotations. These constraints, along with OCR detection, constitute a text residue suppression mechanism during the inference phase. The set of negative text constraints is represented as follows: ; Negative text prompts are constructed based on the set of negative text constraints. .

[0028] in, Indicates a positive prompt word, Indicates category conditions, This indicates a description of the image content. Description of the style of images used in geography teaching. This represents a set of negative literal constraints.

[0029] After completing the LoRA domain style adaptation, this embodiment further introduces lineart-ControlNet to control the line structure of the generated image. ControlNet adds a trainable control branch to the frozen pre-trained diffusion model body, injecting external structural conditions into the multi-scale feature layers of the UNet, thereby enhancing the consistency between the generated result and the given structural conditions. The external structural condition used in this embodiment is a single-channel lineart condition map, mainly used to constrain linear structures such as boundary lines, contour lines, latitude and longitude grids, river lines, and arrow outlines in geographic teaching images. The injection process is represented as follows: ; in, Indicates UNet's first Layer original features, Represents the conditional plot of lineart. This indicates that the ControlNet control branch is in the first... Conditional features extracted from layers. This indicates a zero-initialized convolution mapping. This indicates the characteristics after the injection structure conditions are met.

[0030] This embodiment organizes structural information using a "main control condition + auxiliary evaluation constraint" approach. The lineart condition is the only main control condition directly involved in ControlNet training; semantic categories are incorporated into the text conditions through normalized prompts, positive prompts limit image types, and negative prompts suppress text and pseudo-text generation; topological relationships, symbol objects, and OCR detection are used for post-generation candidate evaluation and selection. Since many key structures in geographical teaching images exist in linear form (such as administrative boundaries, coastlines, contour lines, latitude and longitude grids, river lines, and arrow outlines), the lineart condition can cover the most important spatial skeleton information. Simultaneously, by limiting image types through category prompts, suppressing text artifacts through negative prompts, and selecting candidate results through topological, symbolic, and OCR indicators, it compensates for the inability of a single line control to directly express complex relationships. The method in this embodiment is a controllable generation framework with lineart as the main control condition and hierarchical evaluation and selection as auxiliary constraints (see [link to documentation]). Figure 4 ).

[0031] During the training phase, the base model is first adapted to the LoRA domain using geographical teaching image data, enabling the model to learn the style of geographical teaching images. Then, based on the LoRA-adapted model, a lineart-ControlNet is trained, using lineart conditions as the main structural control input, allowing the model to learn the spatial correspondence between line conditions and the target image. The diffusion loss function is defined as: ; in, Represents the latent variables of the original image. Indicates the first Latent variables after adding noise Represents real noise. This represents the model's prediction noise. Indicates text prompt words, This represents the conditional plot of lineart.

[0032] During the inference phase, the input includes category hints, image descriptions, linear conditions, and negative text hints. CFG (Classifier-Free Guidance) is used to adjust the influence of text conditions on the generated results. For the same set of input conditions, the model generates multiple candidate images, which are then comprehensively selected based on semantic consistency, line structure fidelity, topological consistency, symbol regularity, and OCR text persistence. The final output is a textless geography teaching base map with higher educational usability. The CFG prediction noise calculation formula is as follows: ; in, This indicates the CFG scale.

[0033] In this embodiment, the diffusion model learns the data distribution through forward noise addition and backward denoising processes, and can be applied to tasks such as image generation, editing, and content restoration. Specifically, using the latent diffusion model, the original image is first encoded as latent variables. , No. The latent variables after adding noise are represented as follows: ; in, Indicates the first Step-noisy latent variables, It is Gaussian noise. This represents the cumulative retention coefficient in noise scheduling. The model gradually recovers image content from noise by learning the inverse denoising process.

[0034] This embodiment transfers the diffusion process to a low-dimensional latent space and introduces semantic conditions through a text encoder and cross-attention mechanism to improve the efficiency and controllability of text-to-image generation.

[0035] Considering the issues of inconsistent domain styles and biased generation distributions when directly transferring large-scale pre-trained diffusion models to the domain of geographical teaching images, this embodiment employs LoRA (Low-Rank Adaptation) for efficient parameter fine-tuning. Specifically, the original model parameters are frozen, and only low-rank weight increments are learned to achieve domain adaptation at a lower training cost, avoiding overfitting on small-scale professional datasets. In this embodiment, LoRA is used to learn visual features such as black and white line drawings, textbook-style compositions, simple symbols, and geographical schematics, reducing the problem of generated results biased towards photographs, illustrations, or artistic maps. However, LoRA mainly works on domain style and image distribution adaptation and cannot guarantee contour closure, river connectivity, correct arrow direction, or reasonable regional relationships on its own. Therefore, further structural control methods need to be introduced.

[0036] To enhance the diffusion model's responsiveness to external structural information, this embodiment introduces ControlNet. ControlNet, based on a frozen pre-trained diffusion model, adds trainable control branches, injecting conditions such as edge maps, line drawings, depth maps, and pose maps into the denoising network, enabling the generated results to better conform to the given spatial structure. For geographic teaching images, the linear condition is preferred as the main structural control condition because it can describe basic linear structures such as boundary lines, contour lines, river lines, latitude and longitude grids, and arrow outlines.

[0037] This embodiment divides structural constraints into two levels: in-model control and out-of-model evaluation. Linearity conditions are used as the main structural input to ControlNet to constrain the line skeleton and spatial layout. Semantic categories, topological relationships, symbol objects, and text residue detection are used as auxiliary structural information for prompt word standardization, generation result evaluation, and inference stage filtering. This approach improves the structural credibility and pedagogical usability of the generated images without introducing complex multi-branch control networks.

[0038] On the other hand, this embodiment also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method when executing the computer program.

[0039] On the other hand, this embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method.

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

Claims

1. A method for controllable generation of geographical teaching images based on a structural condition-constrained diffusion model, characterized in that, include: Obtain the basic diffusion model; Based on the geographical teaching image dataset, the basic diffusion model is fine-tuned by LoRA domain style adaptation to obtain the adapted diffusion model. Obtain the line structure conditions of the target geography teaching image; Based on the line structure conditions, a line structure control branch is constructed using ControlNet, and the line structure control branch is injected into the adapted diffusion model to obtain a diffusion model with controllable structure. Obtain hierarchical auxiliary constraints, which include semantic category constraints, topological relationship constraints, symbol object constraints, and negative text constraints; Based on the hierarchical auxiliary constraints, the candidate images generated by the structure-controllable diffusion model are evaluated and screened, and the target geographic teaching image is output.

2. The method of claim 1, wherein, The basic diffusion model is fine-tuned for LoRA domain style adaptation, including: Freeze the original linear mapping weights of the UNet network in the basic diffusion model; Based on the geographical teaching image dataset, learn the low-rank weight increment of the original linear mapping weights; The adapted linear mapping weights are determined based on the original linear mapping weights and the low-rank weight increments.

3. The method of claim 1, wherein, The conditions for obtaining the line structure of the target geographical teaching image include: Obtain the original images used to generate the target geography teaching images; Line drawing is extracted from the original image to obtain the linear conditional graph of the target geographical teaching image.

4. The method according to claim 1, characterized in that, The step of constructing a line structure control branch using ControlNet and injecting the line structure control branch into the adapted diffusion model includes: Obtain the multi-scale feature layers of the UNet network in the adapted diffusion model; By using the trainable control branches of ControlNet, feature extraction is performed on the line structure conditions to obtain conditional features; The conditional features are mapped to the multi-scale feature layer of the UNet network and superimposed with the original features of the multi-scale feature layer to obtain the features after injecting structural conditions.

5. The method according to claim 1, characterized in that, The methods for obtaining the semantic category constraints include: Obtain hierarchical category path information for geography teaching images, including image subject category, geographic branch category, and image type category; Based on the hierarchical category path information, image content description information, and style description information, positive prompt words are constructed.

6. The method according to claim 1, characterized in that, The topological constraints include connectivity constraints, closure constraints, nesting constraints, and directional consistency constraints. The evaluation of the generated image based on the hierarchical auxiliary constraints includes: Based on the connectivity constraints, determine the connectivity evaluation index of line objects in the generated image; Based on the aforementioned closure constraints, a closure evaluation index for the region boundaries in the generated image is determined; Based on the nesting relationship constraints, determine the evaluation index of the nesting relationship of geographic objects in the generated image; Based on the aforementioned directional consistency constraints, determine the directional consistency evaluation index for arrow-type symbols in the generated image; The topology quality evaluation score is obtained by weighted summation of the connectivity evaluation index, the closure evaluation index, the nesting relationship evaluation index, and the directional consistency evaluation index.

7. The method according to claim 1, characterized in that, The symbol object constraints include arrow direction constraints, north arrow integrity constraints, and legend symbol integrity constraints. The method further includes: Based on the symbol object constraints, the shape and orientation of the symbol objects in the generated image are detected to obtain a symbol normalization evaluation index.

8. The method according to claim 1, characterized in that, It also includes a training phase and an inference phase: During the training phase, the basic diffusion model is fine-tuned for LoRA domain style adaptation based on the geographical teaching image dataset, and the line structure control branch of ControlNet is trained based on the line structure conditions and the geographical teaching image dataset. In the reasoning stage, target text prompts and target line structure conditions are obtained. Multiple candidate images are generated through the trained structure-controllable diffusion model. The multiple candidate images are evaluated and filtered according to the hierarchical auxiliary constraints, and the target geographical teaching image is output.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1-8.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-8.