Skip to Content
BuildingsBuildings
  • Article
  • Open Access

14 April 2026

A Compliance-Driven Generative Framework for Zhejiang-Style Rural Facades

,
,
,
and
School of Landscape Architecture, Zhejiang A&F University, Hangzhou 311300, China
*
Author to whom correspondence should be addressed.

Abstract

Under the background of the Rural Revitalization Strategy, Zhejiang Province is promoting “Zhejiang-style Vernacular Dwellings” as a crucial measure to enhance the rural living environment and architectural appearance. However, traditional stylistic control tools, such as standardized rural housing design atlases, exhibit limitations including weak responsiveness to villagers’ individualized needs and high professional thresholds. Consequently, they struggle to address the bottlenecks in grassroots governance efficiency caused by massive and personalized housing demands. Meanwhile, when applied to architectural design, general generative AI technologies often suffer from “structural hallucinations” and the weakening of regional characteristics due to a lack of physical tectonic constraints. Oriented towards the governance requirements of the Zhejiang Provincial Rural Housing Design Guidelines, this study proposes a compliance evaluation-driven “Contour-Semantic-Image” hierarchical generative control framework. This aims to construct a visual scheme generation and pre-screening workflow that deeply adapts to the logic of rural governance. At the data level, this research aggregates multi-source materials, including official standardized atlases, government stylistic guidelines, and real-world photographs. Through expert screening and standardized processing of 596 schemes, a dataset of 333 high-quality, finely annotated structured samples is constructed. Furthermore, a human-guided, machine-segmented workflow assisted by Segment Anything Model 2 (SAM 2) is employed to establish a semantic label system comprising 4 major categories and 13 subcategories of components, thereby achieving the structural deconstruction of architectural prior knowledge. At the generation level, a two-stage model is trained based on Stable Diffusion and ControlNet: Stage I utilizes contour conditions and “layout prompts” to generate semantic label maps, aiming to strengthen component topology and layout consistency; Stage II employs the semantic label maps and “style prompts” as conditions to generate photorealistic facade images. By utilizing explicit semantic constraints to guide the model from pixel synthesis to logical generation, it achieves the controllable rendering of stylistic details and material expressions. At the evaluation level, an automated verification system featuring “clause translation–metric calculation–comprehensive scoring” is proposed. It conducts scoring, re-ranking, and diagnostic feedback on the generated variants across three dimensions: Design Rationality (Q), General Compliance (G), and Jiangnan water-town Regional Characteristics (P-J), forming a closed-loop “Generation-Evaluation-Feedback” workflow. Overall, this framework provides a “visualizable, evaluable, and explainable” pathway for scheme generation and pre-screening in the digital governance of rural architectural appearance.

1. Introduction

Driven by the Rural Revitalization strategy, Zhejiang Province has identified the promotion of “Zhejiang-style Vernacular Dwellings” as a key lever for enhancing rural landscape quality. However, traditional style management relies heavily on static Rural Housing Standard Drawing Collections [1]. This top-down supply model has increasingly exposed its limitations in practice. First, the inadequate supply of effective design schemes has become a core bottleneck restricting farmers’ choices and the improvement of rural aesthetics [2]. Taking Hangzhou as an example, the rural population is approximately 1.922 million, with 6000 to 8000 rural houses newly built or renovated annually. In contrast, the current district- and county-level general drawing collections provide only about 230 sets of schemes. This significant imbalance between supply and demand (a gap of approximately 1:30) leads farmers, in the absence of professional guidance, to blindly imitate urban residential buildings [3]. Consequently, this has resulted in the dilution of regional architectural characteristics and the phenomenon of “one face for a thousand villages”.
As Li et al. pointed out, one of the root causes of rural landscape homogenization during rapid urbanization is that traditional management models struggle to respond to farmers’ diverse needs regarding plot shape, family structure, and personalized aesthetics [4]. From a theoretical perspective, Duarte’s “Shape Grammar” theory emphasizes that an important path to mitigating the contradiction between “standardized production” and “individualized demand” is to achieve “Mass Customization” in architectural design [5].
However, although digital means such as Parametric Tools have made mass customization possible, existing professional tools present high cognitive and operational barriers for rural builders and farmers who lack an architectural background, making them difficult to popularize. Therefore, as stated by Fortenberry, B.R, there is an urgent need for a “Digital Vernacular” tool characterized by low barriers and high-efficiency interaction [6]. Such a tool should be capable of generating personalized schemes at low design costs that both conform to regional contextual logic and respond to modern living requirements, thereby achieving proactive guidance and precise management of rural landscapes.
Regarding generative technology, early research on architectural generation was primarily based on Generative Adversarial Networks (GANs). The Pix2Pix model proposed by Isola et al. (2017) achieved image-to-image translation and has been widely applied to generation from sketches to architectural facades [7]. Newton (2019) further demonstrated the potential of multi-story floor plan generation using GAN [8]. However, GANs generally suffer from unstable training, mode collapse, and resolution constraints, making it difficult to meet the refined requirements of architectural design. In recent years, methods represented by Denoising Diffusion Probabilistic Models (DDPM) have achieved breakthrough progress. The Latent Diffusion Model (Stable Diffusion) proposed by Rombach et al. (2022) significantly outperforms GANs in image quality and diversity [9]. Notably, ControlNet, introduced by Zhang et al. (2023), enables diffusion models to precisely adhere to architects’ line drawing constraints by incorporating additional conditional control layers (e.g., edge detection, depth maps) [10]. This marks a transition in AI-aided design from “stochastic inspiration generation” to a new stage of “controllable generation.”
Nevertheless, improvements in generation quality do not imply that architectural logic issues have been resolved. Yiannoudes (2025) pointed out that general image generation models may still produce “structural hallucinations” in architectural scenes, such as suspended eaves, misaligned column grids, or doors and windows that cannot be opened [11]. The fundamental reason is that such models primarily learn pixel-level statistical patterns rather than architectural construction logic and regulatory constraints. In the field of architectural engineering, scholars such as Eastman (2009) and Nawari (2012) have established mature Automated Rule Checking (ARC) systems based on Building Information Modeling (BIM) [12,13]. However, these methods focus on rule verification and judgment rather than providing generative capabilities for scheme supply. Conversely, diffusion models possess strong generative capabilities but lack clause-driven rule verification and interpretable diagnostic mechanisms. According to the literature review conducted in this study, in the specific context of rural residential facade style management, few existing studies have systematically coupled “controllable diffusion generation,” “clause-driven evaluation,” and “diagnostic feedback” into a unified workflow. The research entry point of this paper is to bridge this methodological gap between “generative capability” and “compliance verification capability.”
A systematic review of current rural housing governance and the research progress of AIGC reveals three technical bottlenecks. First, there is a contradiction between the “lagging nature” of governance tools and high-intensity individual needs. Existing rural housing design atlases are mostly static presets, making them difficult to adapt to the growing diverse and personalized housing demands of villagers. At the grassroots governance level, the traditional model—reliant on manual design and communication—faces immense workload pressure and high communication costs when reviewing massive personalized schemes, making it difficult to balance “compliance” and “flexibility” in practice. Second, the “non-tectonic nature” of general generative AI poses a significant challenge. Although Artificial Intelligence Generated Content (AIGC) has demonstrated powerful pattern-generation capabilities, its latent space reasoning lacks a prior understanding of architectural construction logic and regulatory constraints. This easily leads to irrational facade results that violate the requirements of the Zhejiang Provincial Rural Housing Design Guidelines (hereinafter referred to as the “Guidelines”), rendering them difficult to use directly within approval and governance contexts. Finally, and most critically, there is a disconnection between “generation and evaluation.” In rural architectural appearance governance scenarios, research architectures that translate qualitative policy clauses into computable evidence and establish a dynamic “Generation-Evaluation-Feedback” loop remain rare. This decoupling prevents digital governance from forming a traceable and explainable decision-making chain.
Based on these bottlenecks, this study proposes a compliance evaluation-driven “Contour-Semantic-Image” hierarchical generative control framework. Rather than viewing generative AI as a simple pixel-synthesis tool, this framework positions it as a “visual scheme generation engine” tailored for rural architectural appearance governance. It provides pre-screening and interpretability support through clause-driven evaluation and diagnostic mechanisms. To address the aforementioned pain points, this research adopts the following benchmarking strategies:
  • Addressing the contradiction between “governance efficiency” and “massive personalized needs”: Constructing an automated candidate supply mechanism oriented toward governance workflows.
The traditional governance model, which relies on professionals and static atlases, often leads to insufficient supply and rising communication costs when facing vast and fragmented personalized housing demands. The goal of introducing AIGC in this study is to enhance the efficiency of candidate scheme generation and presentation, lower the threshold for non-professional users to obtain compliant reference schemes, and provide a more operable pre-screening entry point for grassroots review.
2.
Addressing the “non-tectonic nature” of general AI: Establishing a hierarchical control mechanism with semantic constraints.
To enhance the professionalism of the generation process and mitigate the risk of “structural hallucinations” in general models, this framework establishes a “Contour-Semantic-Image” hierarchical control chain. The core support for this stems from the regional structured dataset constructed in this study: through a human-guided, machine-segmented semantic annotation workflow assisted by Segment Anything Model 2 (SAM 2) [14], 333 high-quality samples were deconstructed at the component level to establish a semantic label system containing 13 categories of key architectural components. Furthermore, the research translates identifiable spatial and component rules from standardized atlases and the Guidelines into control signals understandable by the model—such as Facade Contour Maps and Semantic Label Maps. This shifts the generation process from “pixel synthesis based solely on texture and style” to “hierarchical layout-style generation under controlled conditions,” thereby improving the stability and interpretability of facade component layouts while maintaining visual diversity.
3.
Addressing the disconnection between “generation and evaluation”: Implementing a clause-driven Evaluation-Diagnosis-Reranking feedback mechanism.
The core innovation of this study lies in the coupling of the “Generation-Evaluation-Feedback” workflow. The compliance evaluation system is no longer an isolated post hoc assessment but functions as a feedback mechanism involving “clause translation–evidence extraction–gatekeeper screening–re-ranking–diagnostic output.” This allows for computable screening and causal traceability within the candidate solution space. It should be emphasized that “feedback” in this paper primarily refers to closed-loop support at the screening and diagnostic levels, aimed at enhancing the compliance verifiability and interpretability of candidate sets within a governance context; it does not imply that this study has completed end-to-end architectural performance optimization or physical simulation at the engineering deepening stage. Through this pathway, the framework establishes a more traceable bridge between the rigor of digital governance and the flexibility of generative design.

2. Materials and Methods

2.1. “Contour-Semantic-Image” Hierarchical Control Framework

This study develops a two-stage generative model to mitigate the “black box” unpredictability in end-to-end generation for the management of Zhejiang-style Vernacular Dwellings. This framework employs diagrammatic language to separate the generation task into two tiers: “component layout control” and “style expression control.” Its objective is to create a generative design methodology that adheres to official Style Management standards while accommodating the needs of farmers.
Figure 1 depicts the technical roadmap, which consists of three fundamental modules:
Figure 1. Technical Roadmap.
Module A: Data Input & Clause Digitization This module serves as the framework’s base, creating multi-source heterogeneous datasets and executing digital mapping of aesthetic principles. The research amalgamates Standard Drawing Collections, authentic photographs, and aesthetic Guidelines, while innovatively implementing a SAM2-assisted semi-automatic annotation pipeline [15,16]. This pipeline converts unstructured image data into structured data blocks comprising building contours and semantic label maps, while translating Guidelines into computer-executable threshold standards, thereby furnishing a computable “base map” for subsequent generation.
Module B: Two-Stage Hierarchical Generation. As the core generative engine of the framework, this module is fundamentally grounded in the deep decoupling of design dimensions. Rather than a simple linear stacking of steps, the framework decomposes complex architectural generation tasks into progressive hierarchical constraints. Through two concatenated models, it achieves end-to-end generation ranging from initial contours to photorealistic facades:
Morphological Envelope Control Layer (Stage I: Contour-to-Semantic): In this layer, the research translates complex design guidelines into geometric constraints. Using a low-information Facade Contour Map as the sole geometric input, combined with Prompt 1, the model is trained to generate high-information semantic label maps. This stage addresses the “0 to 1” generation of the spatial skeleton, ensuring that the scheme strictly adheres to baseline management requirements regarding volume and scale.
Topological Syntax Control Layer (Stage II: Semantic-to-Image): In this layer, the semantic label maps generated in Stage I serve as strong spatial constraints for ControlNet. By encoding the adjacency relationships and spatial syntax among architectural elements, and incorporating Prompt 2, the model translates the structured semantic layout into photorealistic appearance images. This stage solves the “1 to N” challenge of material representation and detailed expression.
Through this approach, we materialize the abstract concept of “hierarchical generation” into a logical progression from Geometry to Topology and finally to Texture. This architecture ensures that each level carries specific design constraints, enabling the AI to realize a precise transmission from global constraints to local details based on the underlying structure, rather than performing “blind generation” at a superficial image level.
Module C: Compliance Evaluation & Application. This module creates a closed-loop generate-evaluate-feedback mechanism. Utilizing digital guidelines, the system implements a three-tier evaluation metric system that includes design rationality (Q), general compliance (G), and geographical features of the Jiangnan water-town (P-J). By employing automated scoring and filtering (Top-K Ranking) [17] of created outcomes, it produces compliance reports and optimization recommendations, so affirming the efficacy of the generation and aiding in final design determinations.

2.2. Dataset Development and Rule Interpretation

2.2.1. Collection of Multi-Source Data

The quality of data directly influences the model’s precision in comprehending and generalizing the Zhejiang-style regional aesthetic. This study implemented a multi-source heterogeneous data acquisition mechanism that integrates “online retrieval + offline research + field supplementation.” Initially, the Rural Housing Standard Drawing Collection and pertinent policy documents were systematically sourced and downloaded from the websites of the Zhejiang Provincial Department of Housing and Urban-Rural Development and associated local government functional departments. Secondly, field research was undertaken to acquire offline paper copies of the Standard Drawing Collection from local housing and urban-rural development departments and neighborhood/village committees, thereby addressing online data deficiencies. Ultimately, exterior photographs of finished rural self-built houses were taken on-site to enhance the dataset further. A total of 596 design concepts for south-facing facades of rural houses were collected through these three channels. The southern facade was chosen as the training sample primarily because of its significant importance in the formal composition of rural residences. The structured generation framework established in this study demonstrates significant transferability, with its fundamental mechanism adaptable to generation tasks for different orientations, including east and west facades.

2.2.2. Data Preprocessing and Rule Conversion

Data preprocessing was performed on the 596 facade design schemes to create “image-condition” data pairs appropriate for training the ControlNet network.
Step 1: Data Evaluation. Ten senior rural architects were invited to perform a two-round evaluation of the 596 designs, strictly following the “Architectural Style Control” section of the Zhejiang Provincial Design Guidelines for Rural Housing. The first round evaluated stylistic adherence, concentrating on five elements: massing composition, roof form, gable wall treatment, material palette, and decorative details. Non-local style schemes (e.g., European, American) were excluded, resulting in the retention of 389 schemes that exemplify four distinct Zhejiang-style Vernacular Dwellings: Jiangnan water-town, Hui-style-like, island/hilly terrain, and modern Zhejiang-style. The second round assessed image quality, discarding samples with incomplete rendering, blurred contours, or inadequate resolution. This produced 333 genuine samples of good quality and consistency. For detailed statistical data, see Appendix C.
Step 2: Standardization of Data. To improve model generalization, all samples were subjected to uniform processing (Table 1). Every image was allocated a distinct ID and positioned within a 1024 × 1024 pixel square canvas. Images were optimally centered and scaled while maintaining their original aspect ratio to preserve architectural elements, resulting in equally sized model inputs.
Table 1. Flowchart for Data Preprocessing Standardization (Example: Image ID 000089).
Step 3: Human-AI Collaborative Semi-Automated Annotation. To achieve refined control over the generation process, this study constructs multi-level conditional data comprising “Facade Contour Maps” and “Semantic Label Maps.” A novel human-AI collaborative semi-automated annotation pipeline based on SAM 2 (Segment Anything Model 2) is proposed to address the inefficiencies and lack of consistency inherent in traditional manual semantic annotation.
To enable the generative model to precisely parse the design features of Zhejiang-style vernacular dwellings, we translate complex architectural design guidelines into standard image control modalities for the AIGC field. This process involves the definition and application of two core terms:
Facade Contour Map: Distinct from topographic contour maps in surveying, the “Facade Contour Map” in this framework specifically refers to Geometric Boundary Constraints. It extracts the bays, heights, and rooflines (such as Horse-head wall profiles) of traditional dwellings into binary edge masks. These serve as the first-level spatial guidance during the diffusion model’s generation process, ensuring that the generated schemes comply with the baseline requirements of style management regarding volume and scale. In this study, the external contours of the building’s south facade are extracted to construct a pure black (RGB: 0, 0, 0) vector mask. Unlike traditional facade line drawings, the Facade Contour Map acts as a strong geometric conditioning that conveys the binary relationship between the building’s volume boundary and the background to the model. By limiting the pixel-filling range during generation, this layer prevents common issues in generative models such as “structural overflow” or “scale distortion,” constituting the highest level of the hierarchical control framework: “Morphological Envelope Control.”
Semantic Label Map (facade-component semantic segmentation mask): This term follows semantic segmentation specifications in computer vision and aims to establish a Spatial-Component Correspondence. We encode 13 categories of core Zhejiang-style components (e.g., doors and windows) into specific semantic color blocks. These are not merely pixel-level markers but serve as “Positional Priors” for architectural components within the facade logic. This ensures that the AI establishes a layout conforming to architectural construction logic before generating material details.
This study establishes a digital mapping mechanism based on diagrammatic language, translating the style rules from the “Guidelines” into machine-readable component semantic layouts. To compensate for the generic models’ lack of understanding regarding architectural construction logic, we define a semantic label system comprising 13 categories of physical components (Figure 2): Primary Ontology: Includes wall, roof, main entrance, and door/window elements. Subordinate Functional Components: Includes PiYan (eave-like canopies), balcony railings, etc., which reflect the regional characteristics of the Zhejiang-style.
Figure 2. 13-category semantic label system.
Each component category is assigned a unique RGB value as an index. This 13-category semantic label system is more than a classification for pixels; it is essentially an explicit expression of topological priors regarding adjacency logic. It enables the model to establish spatial priors—such as “the base supports the wall,” “the roof covers the wall,” and “openings are embedded in the wall”—before generating realistic textures. Through this approach, we materialize the abstract “hierarchical generation” into a logical progression from Geometry to Topology and subsequently to Texture, rather than a simple linear sequence of steps.
The Annotation Pipeline Process commences with SAM 2 executing coarse-grained segmentation (Figure 3). Utilizing SAM 2’s zero-shot segmentation functionality, it autonomously analyzes facade images and swiftly produces preliminary masks for elements (e.g., walls, doors/windows) according to visual prompts. Subsequently, regularized topology rectification is implemented. Architectural a priori criteria are implemented to geometrically enhance the segmentation results of SAM 2. For example, rules such as “roofs are positioned above walls” and “doors/windows align horizontally” automatically rectify boundary overflows or logical discrepancies. Correction requirements reflect the landscape provisions outlined in the Zhejiang Provincial Design Guidelines for Rural Housing. Ultimately, manual interactive rectification transpires. Experts evaluate the revised annotated maps, employing interactive technologies to promptly rectify remaining problems (e.g., overlooked or inaccurately named regions), thereby producing high-precision semantic label maps.
Figure 3. Schematic Representation of the Human-AI Collaboration Semantic Labeling Pipeline.
This approach enhances annotation efficiency by roughly 50% and markedly improves uniformity across labels and guidelines.
Step 4: Hierarchical Text Prompt Development. To achieve deep synergy between textual semantics and image conditions, this study constructs a hierarchical prompt descriptive matrix (see Table 2). Table 2 illustrates the logical structure of the prompt library: the Top Header corresponds to the content examples of Prompt 1, focusing on the building’s macro-physical attributes (e.g., building stories, volumetric characteristics) to provide global structural guidance for the generation task; the Left Sidebar corresponds to the attribute dimensions of Prompt 2, refining the description down to the material, color, and regional decorative features of specific components.
Table 2. Hierarchical Text Prompts (Illustration: Image ID 000166).
Step 5: Database Development and Data Segmentation. A structured image-text database was constructed by assigning unified identification numbers to 333 data groups (comprising original images, facade contour maps, and semantic label maps) and their corresponding two-level prompts. To ensure the impartiality of model evaluation and enhance generalization capabilities, a stratified sampling method was employed to partition the dataset into a training set (266 groups) and a test set (67 groups) using an 8:2 ratio. The key variables for stratification included regional distribution, building types, and stylistic characteristics, ensuring that the critical feature distributions remained consistent across the training and test sets to effectively mitigate model bias.
Although the original sample size was 333 groups, this study did not train the diffusion model from scratch; instead, domain-specific fine-tuning was performed on the large-scale pre-trained Stable Diffusion v2.1. Consequently, these 333 data groups were primarily utilized to learn the domain mapping of “condition-to-result” for Zhejiang-style Vernacular Dwelling facades (e.g., contour/semantic maps → facade rendering) rather than learning general visual representations. To minimize the risk of overfitting on a small sample and ensure fair evaluation, three measures were implemented:
Gold Standard Data: The 333 samples were selected and verified by experts based on the Zhejiang-style Vernacular Dwelling Drawing Collection or its standards, ensuring stylistic purity and structural component logic consistency.
Strict Isolation between Training and Testing: Stratified sampling was used to divide the training set (266) and the test set (67) at an 8:2 ratio. All subsequent quantitative evaluations and baseline comparisons were conducted exclusively on the test set.
Paired Consistent Data Augmentation: Data augmentation was applied only to the training set. Operations such as flipping, random cropping, color jittering, and slight perspective transformations were simultaneously applied to both the “condition maps” (contour/semantic maps) and the “target images” (original facade images). This approach prevents condition-target misalignment and test leakage, expanding the effective training samples to over 5000 groups. Generalization verification is detailed in Section 3.1, Section 4.1 and Section 4.2.

2.3. Model Development and Training Framework

This research develops a two-stage generative framework grounded in the principles of LDM (Latent Diffusion Models) [9,18]. This system utilizes Stable Diffusion v2.1, a quintessential pre-trained model of this architecture, as the primary generator, incorporating ControlNet technology for meticulous regulation of architectural spaces. As illustrated in Figure 4, this architecture facilitates efficient conversion between Pixel Space and Latent Space via a Variational Autoencoder (VAE) [19,20]. Within this process, the Encoder (denoted as “E” in the VAE) is responsible for compressing high-dimensional image data into low-dimensional latent representations, thereby effectively reducing computational complexity.
Figure 4. Diagram of Model Training Utilizing Stable Diffusion and ControlNet.
Model 1: Contour-Constrained Layout Generation. This stage creates a topological mapping relationship between the “external contour” and “internal functional components.”
The training mechanism utilizes standardized “facade contour maps” as control signals for ControlNet. Throughout the training process, the model assimilates not only pixel distributions but also the spatial syntax inherent in architectural typologies. For example, when confronted with a particularly wide building contour, the model deduces the layout principles of “dual entrances, central axis symmetry, and multiple bays” by leveraging textual prompts (e.g., “duplex”) from Prompt 1 via Cross-Attention mechanisms. This prevents arbitrary filling, resulting in structurally cohesive semantic label maps.
Model 2: Architectonic Rendering with Semantic Constraints. This stage seeks to accomplish accurate translation from “semantic color blocks” to “realistic materials.”
Training Mechanism: The semantic label maps generated in Stage I serve as strong spatial constraints. Contrastive Language-Image Pre-training (CLIP) transforms descriptions in Prompt 2—such as “white walls and dark tiles” (white painted wall, black roof) and “wood-colored window frames”—into text embedding vectors [21,22]. During the reverse denoising process, the U-Net strictly adheres to the regional boundaries defined by the semantic labels, accurately mapping the material features described in the text to the corresponding component areas [23]. This ensures that the generated results possess both sophisticated rendering effects and material details while remaining strictly faithful to the established architectural structural framework.
The research effectively encodes architectural knowledge through the cascade of two-stage models, with the design logic advancing from contour limitations to functional divisions and subsequently to facade formal language, specifically within the generating process of deep neural networks.
The setup of the training environment is outlined in Table 3. The key hyperparameters for the two-stage model training are detailed in Appendix D.
Table 3. Configuration of Experimental Hardware and Software Environment.

2.4. Compliance Evaluation Driven by Clauses

2.4.1. Assessment Inputs and Mask Protocol

This study integrates a clause-driven compliance evaluation module to facilitate the verification of generated results against regulatory requirements, extending beyond the two-stage generation framework. This module adheres to an evidence chain logic of “clause translation → metric calculation → comprehensive scoring → diagnostic feedback,” wherein landscape-related clauses from the Zhejiang Provincial Design Guidelines for Rural Housing are aligned with computable metrics. Generated outputs are subjected to automated verification, ranking, and root cause investigation, creating a “generate-evaluate-feedback” loop (refer to Figure 1).
Evaluation inputs comprise (1) facade renderings produced by Model 2 and (2) corresponding component masks. To reconcile computability with annotation expenses, the evaluation utilizes six macro-level masks: roof, main wall, plinth, PiYan (eave-like canopy), main entrance door, and window. The “door” category specifically refers to the principal ground-floor entrance for the determination of entrance logic (Q3); “window” collectively includes all light and ventilation apertures, such as windows and balcony doors, to standardize calculations for opening ratio (G6) and orderliness (G7–G8) metrics.
In contrast to the 13 semantic labels utilized during the generation stage, the assessment process independently generates 6 macro masks from the produced facade image: Initially, SAM 2-assisted segmentation yields a preliminary mask. Subsequently, regularization adjustments and requisite swift human modifications guarantee geometric consistency and the verifiability of the assessment evidence chain. Regularization corrections encompass: (1) Mutual exclusivity constraints: Guaranteeing that each pixel is assigned to a single category, thereby eliminating overlapping ambiguities; (2) Topological a priori constraints: For instance, roof area centers must be positioned higher than wall centers (supporting Q2), and main entrances must be enclosed within walls with bottom edges near the horizon (supporting Q3); (3) Morphological regularization: Eliminating minor isolated noise and executing closing operations on primary components to fill voids, thereby enhancing stability in area proportions and geometric statistics (supporting Q1, G6, etc.).

2.4.2. Translation of Clauses and Definition of Metrics

In this study, the regulatory clauses from the Guidelines are organized into three categories of metrics: Design Rationality (Q), General Compliance (G), and Jiangnan water-town Regional Characteristics (P-J). For each clause, a 0–1 normalized score and a threshold-based judgment are defined (Table 4). The evaluation thresholds within the system (e.g., G6 Facade Void-to-Solid Ratio [0.15, 0.50], G9 Aspect Ratio [0.6, 1.8]) are not determined arbitrarily but are derived from statistical inference based on expert knowledge. During the expert-assisted data cleaning stage described in Section 2.2.2, 333 sets of high-quality “Zhejiang-style Vernacular Dwelling” samples were selected by 10 senior architects to form the “standard dataset.” This study calculated the distribution intervals of various metrics within this dataset, using the mean and standard deviation as the initial “pass intervals” for the automated evaluation system. These were subsequently cross-referenced with the semantic requirements of the Guidelines and adjusted conservatively by experts to ensure the thresholds are both verifiable and contextually appropriate for rural governance.
Table 4. Evaluation criteria table.
It must be emphasized that the [0.15, 0.50] interval for G6 serves as a front-end screening range for the facade solid-to-void ratio (sum of window and door area divided by wall area). Its purpose is to exclude extreme candidates that are “excessively enclosed” or “excessively opened” at the early design stage, rather than being interpreted as the “optimal interval” for the energy-lighting tradeoff in the Zhejiang region. The lower limit of 0.15 is consistent with the estimated window-to-floor area ratio of 1/7 (approx. 0.143) commonly used in the preliminary stage of the Standard for Daylighting Design of Buildings (GB 50033-2013 [24]), serving to prevent potential lighting deficiencies. The upper limit of 0.50 acts as a conservative bound for facade opening ratios to suppress candidates with potential heat loss or overheating risks associated with “excessive glazing.”
While this configuration aligns in principle with the thermal envelope control for Hot Summer and Cold Winter (HSCW) zones specified in the Design Standard for Energy Efficiency of Rural Residential Buildings (GB/T 50824-2013 [25]), it is not equivalent to the fixed optimal values prescribed by that standard. Further calibration using Building Performance Simulation (BPS) will be conducted in future work (see Section 4.4.1).
Therefore, although real-time manual scoring is not introduced at this stage, the core of the automated evaluation engine can be viewed as a “digital projection of expert consensus.” By algorithmically constraining the generated results to fall within an expert-approved “compliance interval,” the system enhances the professional reliability of the verification process without requiring direct human intervention.
Category Q (Q1–Q3) serves as gating indicators designed to exclude manifest structural irrationalities, such as missing components, topological errors, and suspended entrances. Specifically, Q1 (Component Integrity) defines a threshold (Aratio ≥ 0.002) based on image resolution to ensure that components are identifiable and evaluable by the model at the pixel level. Q2 (Topological Correctness) emphasizes the fundamental topological logic of facade construction—namely, that “the center of gravity of the roof must be higher than that of the wall”—thereby preventing irrational generative errors like “floating” or “inverted” roofs. This principle constitutes a basic axiom in architectural physics. Q3 (Entrance Grounding) defines a distance threshold (Distnorm ≤ 0.08) derived from statistical analysis of the compliant dataset. It ensures a visually rational connection between the base of the entrance doorway and the plinth or ground reference line, effectively eliminating blatant structural defects such as “suspended doors.”
Category G covers universal style constraints, including: Color Propensity (G1–G3): “Dark tiles and white walls”, low saturation. Component Proportions (G4–G6): Plinth height, opening ratio. Compositional Order and Form (G7–G9): Alignment, rhythm, and aspect ratio.
Specifically, the setting for G6 is based not only on aesthetic composition principles but also on the suggested ranges for window-to-wall ratios in rural residential energy-saving standards (e.g., the requirement that the ratio should not exceed 0.5 for hot-summer and cold-winter regions). The target range of [0.15, 0.50] balances lighting requirements with the prevention of heat loss in winter or overheating in summer. It should be emphasized that G6 serves here as a geometric proxy indicator for facade opening proportions, primarily used for style proportion, lighting, ventilation, and thermal baseline compliance screening; it does not replace structural calculations or detail design in the engineering phase. G7 (Window Alignment) and G8 (Bay Rhythm) serve as proxy indicators for buildability. G7 favors consistent top elevations for windows on the same floor (corresponding to lintel/ring beam continuity), while G8 favors modular bay spacing (corresponding to common column grid/bay logic). These indicators reduce generation defects related to “architectural structural rationality” by minimizing layout anomalies.
Category P-J is used to characterize typical elements of the Jiangnan water-town sub-style. P-J1 (PiYan Decoration Rate): Given the diverse positioning of PiYan (eave-like canopies)—which can be above doors, windows, or standalone—this indicator introduces a human-in-the-loop mechanism. Based on expert-enhanced annotation of PiYan masks, the ratio of the PiYan area to the total area of all openings APiYan/(Awindow + Adoor) is calculated to quantify the decorative intensity of this regional component.
P-J2 (Plinth Material): This calculates the proportion of the blue-gray color gamut in the plinth area to approximate a “Blue-stone Plinth” material tendency.
Other style sub-category indicators are reserved as extensible modules for future research and are not included in the scoring for this round of experiments.

2.4.3. Holistic Scoring, Gatekeeper, and Diagnosis

The evaluation engine successively computes metric scores and produces Pass/Fail outcomes together with comprehensible diagnostic information. This paper utilizes a Q-class design rationality gatekeeper to prevent “visually similar but structurally invalid” solutions from being ranked. If any Q metric is not met, the solution’s structure is considered invalid, its composite score is assigned a value of 0, and the diagnostic specifies the reason for failure (e.g., “missing component”).
For samples that pass the gatekeeper, the weighted aggregate score S (ranging from 0 to 1) is computed as follows:
S = w Q Q ¯ + w G G ¯ + w P P ¯
Default weights are established as wQ = 0.30, wG = 0.55, wP = 0.15, in accordance with the governance priority of “structural validity first, universal compliance as the primary focus, supplemented by regional characteristics”. In practical application, weights are adjustable to facilitate the migration of Guidelines across various regions.
To mitigate the risk of “generic modern boxes” potentially arising during AI generation, our framework introduces a weight dynamic calibration mechanism. Management authorities can flexibly adjust the weight of Regional Identity (P) or tighten the P-thresholds based on the stylistic sensitivity of the target village. This allows for a stronger penalty during the ranking phase for candidate schemes that lack regional characteristics. (As shown in the typical cases in Section 3.2.3, Image ID 1–5 were significantly down-ranked due to P-J1 (PiYan Decoration Ratio) = 0.0).

2.4.4. Top-k Reordering and Closed Loop

Under identical shape and prompt conditions, diffusion models can produce many generation variants. This paper employs a “generative redundancy” strategy by generating 25 candidates for each input, assessing them through thorough Q/G/P-J evaluations, and ranking them in descending order of S-value to provide Top-k [26] recommendations. This approach reduces generative randomness via “post-processing filtering,” thereby improving output compliance stability without necessitating training alterations. Simultaneously, the system generates failure diagnostics (e.g., “roof color deviation”), facilitating precise modifications to following prompts or control signals for closed-loop optimization.

2.4.5. Execution and Efficacy

The assessment engine is developed in Python with NumPy and OpenCV [27], with each metric encapsulated as a distinct function (Appendix B). It facilitates batch evaluation and reproducibility through the use of clause tables or JSON as configuration templates. The efficiency of evaluation is quantified by the mean duration needed to finalize the complete Q/G/P-J procedure for an individual facade image. The Results section reports test conditions and average durations (script outputs can replicate these statistics). This study illustrates the Top-k reordering effect on a candidate set with k = 25 (see Section 3.2.2 and Section 3.2.3).

3. Results

3.1. Controlled Validation of Decoupled Layout and Style Generation

A controlled comparison experiment was conducted by intervening with prompts to assess the proposed hierarchical framework’s accuracy in addressing architectural facade components and its capacity to decouple control. The 67th sample from the test dataset served as the baseline. The generation performance of the two-stage model was evaluated by substituting important attribute descriptions in the Prompt, employing the single-variable technique, while maintaining the control signals (facade contour map or semantic label map) constant.
(1)
Validation of Model 1: Morphological Response and Topological Consistency in Layout Generation:
Table 5 displays the outcomes of Model 1’s semantic layout generation across various Prompt 1 interventions. The results illustrate the model’s exact responsiveness to architectural “rigid metrics” and its intrinsic ability to preserve spatial logic.
Table 5. Results of the controlled intervention. Validation for Model 1 (layout generation), exemplified by sample group 63.
Explicit Morphological Response: When modifications are made to the Prompt’s specifications—such as altering the number of stories (“three-story” to “two-story”), the number of bays (“six-bay” to “four-bay”), or the residential unit type (“duplex” to “detached”)—the produced semantic label map experiences exact adaptive modifications in geometric volume. This encompasses the reduction in facade height, alteration of bay quantities, and adaptive placement of doors and windows. Following directives such as “remove the balcony” or “add a garage,” the model not only incorporated or eliminated corresponding color blocks but also autonomously modified the arrangement of adjacent elements (e.g., window placements, wall ratios), showcasing remarkable interpretability. All five samples exhibited topologically coherent structures without component misalignment or omission.
Implicit Topological Maintenance: Despite significant layout alterations, the model consistently maintained the topological invariants of architectural typology. None of the generated outputs displayed logical inconsistencies such as “floating roofs,” “overlapping doors/windows,” or “structural misalignments.” This demonstrates that Model 1 is not simply a random arrangement of pixels but has effectively learned and internalized the vertical sequence of “base-wall-roof” along with the adjacency relationships and spatial syntax among components.
(2)
Model 2 Validation: Texture Mapping and Geometric Stability in Style Rendering:
Table 6 displays facade drawings from Model 2 according to various Prompt 2 interventions. The results demonstrate controllability across stylistic dimensions when conducted with a fixed semantic label map.
Table 6. Results of the controlled intervention. Validation for Model 2 (style rendering), exemplified by sample group 63.
Accurate Material Texture Translation: When material descriptions (e.g., “white painted wall” substituted with “gray brick wall”) or component styles (e.g., “modern windows” replaced with “classical style windows”) in prompts were modified, the model effectively correlated abstract semantic color blocks to specific materials, exhibiting realistic light and shadow characteristics.
Stringent Geometric Constraints: During style transfer, the building’s outline, window placements, and overall proportions uphold pixel-level fidelity to the input semantic labels. The “lock-and-skin” feature illustrates ControlNet’s strong spatial limitations in Stage II, thereby averting structural collapse typical of conventional generative models.
In summary, the combined evidence from explicit response and implicit learning demonstrates that the proposed “Contour–Semantic–Image” hierarchical mechanism successfully achieves independent control over layout generation and style rendering. Benefiting from this decoupling characteristic, the model can respond to user requirements for functional layout or stylistic features without mutual interference, even under low-information inputs, thereby generating highly credible architectural schemes. When provided with new contours and prompts, the model is capable of generating facades with correct layouts and novel styles, rather than merely replicating samples from the training set. This proves that the model has internalized underlying rules rather than engaging in rote memorization, reflecting significant generalization capabilities.

3.2. Validation of the Effectiveness of the Compliance Screening Mechanism

This work devised a single-variable divergence experiment to visually validate the function of the “generate-evaluate-feedback” loop in solution optimization. The experiment randomly chose a set of standard building outlines from the test set as fixed input conditions to assess the model’s generative diversity under uniform geometric restrictions and the evaluation system’s screening efficacy.

3.2.1. Generation of Candidate Solution Set

The experiment utilized a “tree-like divergence” technique to produce 25 potential solutions, as illustrated in the generation matrix in Table 7.
Table 7. Candidate Solution Matrix and Comparative Analysis of Group Performance.
Phase 1 (Layout Divergence): The chosen contour was entered into Model 1. Utilizing Prompt 1 and a random seed, five semantic label maps with unique configurations were produced, labeled as Label Map 1 through Label Map 5.
Phase 2 (Style Rendering): Each of the five label maps functioned as control conditions for Model 2, producing five photorealistic facade pictures for each map. This produced 25 facade generation outcomes inside the identical contour (Candidate Pool, N = 25).
The “5 × 5” tree-like generation technique seeks to comprehensively encompass randomness in the generation of layout and detail characteristics while maintaining manageable computational expenses. This experiment utilizes “Jiangnan water-town,” the quintessential and prevalent representation of Zhejiang-style Vernacular Dwellings, as the control target to assess the evaluation system’s refined screening capability within specific stylistic paradigms. Future research will incorporate additional subcategory indicators for other architectural styles as extensible modules.

3.2.2. Automated Assessment and Ranking Analysis

Utilizing the suggested compliance review pipeline, we performed extensive quantitative tests on 25 candidate solutions (Image IDs 1-1 to 5-5). Table 7 presents comprehensive quantitative data. All metrics were computed automatically based on generated images and six categories of masks.
(1)
Calibration and Validation of Gatekeeping Indicators:
Experimental data indicate that, due to ControlNet’s stringent layout constraints, all 25 candidate solutions attained perfect scores (Pass, 100% Gatekeeping pass rate) across the three essential metrics: Q1, Q2, and Q3. This validates the generative model’s remarkable stability in “structural soundness,” with no critical errors such as absent components or inverted logic.
(2)
Quantitative Divergence of Physical Attributes and Style:
In the general compliance (G-class) evaluation, metrics demonstrated variation. Significantly, for G6, certain plans with “large glass surfaces” (e.g., plans 1–5) had actual opening ratios of 0.73, substantially beyond the compliance upper limit of 0.50 established in this study, hence resulting in a zero score for G6.

3.2.3. Evaluating Outcomes and Deliberating on Preferred Selections

The detailed ranking based on the overall score S (refer to Table 8) indicates quality disparities among various generational cohorts:
Table 8. This presents the quantitative evaluation results of the created facade schemes, including the top three and typical failure cases.
Top Recommendation (Top-1): Proposal 2-2 (S ≈ 0.877). This proposal exhibits an optimal equilibrium across all metrics. In terms of physical compliance, its G6 of 0.46 resides within the ideal energy-saving range [0.15, 0.50] (Score = 1.0), thereby maximizing daylighting while preventing excessive glazing. Regarding stylistic distinctiveness, the pivotal P-J1 (PiYan embellishment rate) indicator reveals a 0.21 embellishment ratio, affirming the effective coverage of door/window openings by the Zhejiang-style PiYan. The system identifies this as the highest-quality “benchmark solution,” characterized by a high fidelity in G2 wall color (0.84).
Group Variance: This experiment categorized 25 schemes into 5 groups (Group 1–5) according to 5 semantic label maps. Figure 5 illustrates the joint distribution of each group’s schemes within the two-dimensional plane defined by G6 and P-J1 (PiYan modification rate). Data analysis and visualization indicate that Group 1 (red cluster in the figure), derived from Label Map 1, demonstrates the least favorable overall performance (average score S ≈ 0.76). This group markedly diverges from the green compliance zone, exhibiting a distribution pattern characterized by “high opening” (G6 > 0.50) and “low ornamentation” (P-J1 < 0.10). The underlying cause can be traced to Group 1’s “genetic defect,” which arises from disproportionately large window configurations in its label map, resulting in multiple solutions (e.g., 1-1, 1-5) consistently accruing penalties on G6. Conversely, Group 2 (blue cluster) demonstrates a more equitable distribution, with the majority of solutions situated within the compliant and stylistically unique zone, affirming its designation as a “benchmark solution.” Furthermore, the inclination towards “dull materials” induced by random seeds is notably apparent in solution 1-1 (G2 = 0.35), substantiating the evaluation system’s attribution capabilities across both “layout origin” and “rendering detail” dimensions.
Figure 5. Joint distribution plot of G6 and PJ1.
Efficient Interception: The system effectively intercepted Plan 1–5 (Rank 24, S ≈ 0.720). The diagnostic report identified several faults, including “Fail: G2, G6, PJ1, PJ2,” notably the significant disparity between G6’s Facade Void-to-Solid Ratio (0.73) and P-J1’s PiYan modification rate (0.0). This accurately delineated the generative hallucination problem of “structural compliance yet stylistic inadequacy,” offering explicit guidance for future enhancement.

4. Discussion

4.1. Efficacy of the Generation Method—Analysis of the Loss Function

The MSE (Mean Squared Error) [28] serves as the primary loss function [29,30] during training. This seeks to enhance the noise prediction network ϵθ to closely mimic the standard Gaussian noise [31] ϵ injected during forward diffusion [32,33] with the latent variable xt. The loss function is delineated as follows:
P ¯ L MSE = E x 0 , ϵ N ( 0 , I ) , t ϵ   ϵ θ ( x t , t , c ) 2
Let x0 represent the original input (label image for Model 1, rendered image for Model 2), t ∈ {1, 2, …, T} (where T = 100) denotes the randomly sampled diffusion step count, and c signifies the composite condition consisting of text features from the CLIP encoder (associated with Prompt 1 or Prompt 2) and spatial control conditions (facade contour map or semantic label map). This objective function directs the U-Net to more precisely assess the noise to be eliminated at each step t, forming the conventional training framework for diffusion models.
As illustrated in Figure 6, the training losses of Model 1 and Model 2 exhibit a consistent decline with the progression of iterations, ultimately reaching a state of stabilization, which signifies adequate training and an enhancement in generation quality. Specifically, Model 1’s loss diminished from 0.08 to 0.04 (a 50% reduction) across 100,000 iterations: around step 20,000, the loss decreased to 0.05, reflecting the acquisition of contour constraints; by step 60,000 (loss 0.045), its proficiency in modeling component relationships and construction logic markedly improved; finally, it stabilized near 100,000 steps, achieving a local optimum. Model 2 exhibited accelerated convergence, diminishing loss from 0.103 to roughly 0.073 over 50,000 steps, demonstrating a tripartite pattern: Steps 0–5000 indicated a rapid decline stage with minimal fluctuations, signifying foundational feature acquisition; a consistent decline from 5000 to 20,000 steps characterized the detail optimization stage; post 20,000 steps, it experienced slight fluctuations around 0.07 before achieving stabilization at a local optimum. The swift convergence of the MSE suggests that after roughly 40,000 iterations, Model 2 proficiently acquired the translation principles from color block labels to actual architectural materials.
Figure 6. Model training loss function convergence curves.
Overall, the training loss curves for both models exhibit a consistent downward trend and gradual convergence, indicating a well-optimized and numerically stable training process (see Figure 6). It should be noted, however, that while these curves reflect the models’ convergence on the noise prediction objective, they do not independently constitute sufficient evidence of generalization capability or the absence of overfitting. Therefore, the generalization performance of the models in this study is primarily validated through Inception Score(IS)/Fréchet Inception Distance (FID)/Kernel Inception Distance (KID) metrics on a strictly held-out test set (N = 67), as well as through controlled prompt intervention experiments (see Section 3.1 and Section 4.2).

4.2. Performance Comparison with the Baseline Model (Pix2Pix)

To objectively evaluate model performance, this study compares the proposed framework with the widely adopted baseline method, Pix2Pix, under identical dataset settings. The evaluation metrics include IS, FID, and KID. It should be noted that all metrics were calculated on a strictly held-out test set (N = 67); specifically, samples were generated using conditional inputs from the test set and compared against the distribution of corresponding ground-truth facade images, ensuring the training set did not participate in the metric calculation. As shown in Table 9, the proposed model outperforms the Pix2Pix baseline across all three indicators: IS increased from 1.72 to 1.92 (+11.63%), indicating superior quality and diversity of the generated samples; FID decreased from 186.13 to 150.01 (−19.41%), suggesting that the generated distribution is closer to the real distribution with more realistic textures and lighting effects; and KID decreased from 0.076 to 0.042 (−44.74%). The consistent improvement in both FID and KID further validates the robustness of the model’s evaluation results under a small-sample setting.
Table 9. Comparison of Generative Quality Metrics (vs. Pix2Pix).
In summary, the hierarchical control of Stable Diffusion + ControlNet demonstrates superior image quality, diversity, and distributional consistency on the test set compared to the Pix2Pix baseline. The advantages regarding architectural logic performance and style compliance are further supported by the “Controlled Verification of Decoupled Layout and Style Generation” in Section 3.1 (used to verify conditional response, decoupled control, and topological stability) and the gating, ranking, and diagnostic results based on the Q/G/P indicator system in Section 3.2.

4.3. Application Scenarios

To implement the proposed “Contour–Semantic–Image” hierarchical generative control framework and compliance evaluation system into the practice of rural self-built housing style management in Zhejiang Province, we have constructed a human-AI collaborative workflow(Figure 7) encompassing input standardization, hierarchical generation, compliance evaluation, and result optimization. This workflow effectively supports two typical scenarios: the construction of new rural residential buildings and the renovation of existing ones.
Figure 7. Application Scenarios.
In the new construction scenario, users first input basic geometric parameters (e.g., number of stories, bays), and the system automatically generates a standardized facade contour map. Subsequently, the two-stage generation framework is invoked: Stage I combines layout prompts to generate semantic label maps, ensuring a rational component layout; Stage II generates photorealistic facades based on these semantic labels and style prompts. A critical step is the compliance evaluation module, which performs automated scoring and diagnosis of the generated schemes to filter out preferred options that comply with the Zhejiang Provincial Design Guidelines for Rural Housing. In the renovation scenario for existing rural houses, images of the existing facades are first collected and their contours extracted to be converted into standardized contour inputs. The subsequent process remains consistent with the new construction scenario. Finally, Stable Diffusion-based super-resolution technology can be optionally employed to provide visual enhancement for the selected results. By integrating the creativity of generative AI with rule-based evaluation, this workflow significantly lowers the design barrier and provides efficient, operable technical support for grassroots style management.
It should be noted that the aforementioned content primarily demonstrates the process-level application path and prototypical operability of the system within rural style management scenarios. Its usability and governance effectiveness in real-world settings still require further validation through subsequent user studies, expert reviews, and on-site pilot projects.

4.4. Limitations and Future Prospects

The “compliance-driven” generation framework proposed in this study aims to establish a digital bridge between the “creative divergence” of Generative Artificial Intelligence and the “regulatory rigor” of rural architectural governance. While the current research focuses on the synthesis of regional styles at the visual level, the framework outputs traceable structural information at both geometric and semantic levels, providing an interface for subsequent coupling with Building Performance Simulation (BPS) and engineering verification.

4.4.1. Coupling of Geometric Constraints and Building Physics

Current evaluation metrics are primarily anchored in two-dimensional (2D) visual and geometric representations. The General Compliance metric G6 constrains the opening ratio within the [0.15, 0.50] interval, serving as a geometric proxy constraint for the window-to-wall ratio. This constraint is utilized in the early stages of the scheme to perform pre-screening of extreme candidates, such as those that are “excessively closed” or “excessively opened,” thereby preliminarily accounting for lighting, ventilation, and potential thermal risks in the absence of dynamic performance simulations. It must be emphasized that the study currently positions clause-driven metrics like G6 as “performance-related geometric proxy filters.” Their role is to provide verifiable screening and diagnostic evidence for early-stage generated schemes, rather than achieving optimized energy consumption or lighting performance. Specifically, the value range of [0.15, 0.50] is a conservative, regulation-oriented setting based on empirical data, which requires further calibration using refined physical models during the engineering deepening phase.
Furthermore, “PiYan”, a core feature of Zhejiang-style architecture, can be physically regarded as a typical passive shading component. In the P-J metric system, P-J1 is established to characterize the presence and coverage potential of overhangs on the facade. Consequently, it serves as a performance-related 2D geometric proxy metric to suppress candidate schemes lacking adequate shading during the pre-screening stage. It should be noted that P-J1 reflects the degree of coverage at the 2D facade representation level and is not equivalent to the three-dimensional (3D) projection depth of the overhang; nor can it directly extrapolate shading coefficients or cooling/heating load reduction ratios in the current version of this study. From the perspective of building physics, increasing the depth of the overhang generally helps reduce direct solar radiation on window surfaces during summer (lowering cooling loads), but an excessive depth may also block solar heat gain during winter (potentially increasing heating demands). This effect interacts with orientation, latitude, and window/eave height. Therefore, this study treats the “position and presence” of PiYan as a necessary condition for pre-screening, while the quantitative evaluation of its thermal benefits remains a significant direction for future expansion.
Future work will, therefore, extend beyond static geometric constraints. We intend to integrate BPS tools via modular interfaces. Using Typical Meteorological Year (TMY) data and common rural construction types as boundary conditions, we will employ tools such as EnergyPlus, DesignBuilder, or DeST to conduct sensitivity analyses on opening ratios, orientations, and the scale of shading components (e.g., PiYan). Based on these results, we will calibrate the intervals and weights of G6 and the parameter specifications of shading-related proxy metrics (e.g., P-J1) at the climate zone and orientation levels, achieving an evolution from “geometric proxy screening” to “integrated physical performance evaluation.” Particularly regarding thermal comfort assessment, we plan to introduce the Mood State Correction Factor and Turhan and Özbey Coefficients (MSCF) proposed by Turhan and Özbey [37,38]. This will incorporate occupants’ subjective emotional states and environmental thermal perception into future evaluation paths, extending the connotation of “design rationality” from pure engineering physics to the sensory dimension of psychological thermal comfort. Overall, these expansions aim to drive the generation system from single “visual compliance” toward a comprehensive evaluation framework emphasizing both physical performance and subjective perception.

4.4.2. Digital Workflow and Semantic-Based Integration

To bridge the technical gap between the “pixelated output” of generative models and engineering verification tools (e.g., EnergyPlus, DesignBuilder), this study proposes a structured interface path based on semantic labels. Unlike general AIGC that only outputs renderings, the semantic label maps generated by this framework provide component categories and pixel-level geometric boundary information. This data can be used to extract the position, scale, and opening ratio of door and window apertures, providing a traceable input base for subsequent BIM and BPS modeling. It is important to clarify that the current version of this study has not yet achieved end-to-end “Image-to-BIM” automated modeling or real-time thermal performance linkage; semantic labels primarily serve as a “structural carrier of components and geometry” in this research. Material thermal properties (e.g., U-values, Solar Heat Gain Coefficient (SHGC), and thermal capacity) still require assignment through construction selection and performance library mapping during the engineering phase.
In future work, we plan to explore the mapping relationships between semantic component categories and typical construction/material performance libraries. By utilizing semi-automatic geometric reconstruction and model exchange workflows (such as Revit, Industry Foundation Classes (IFC), or Green Building XML (gbXML)), data can be imported into BPS tools for energy consumption and thermal comfort verification. This will reduce the conversion cost between scheme generation and performance validation, expanding the framework from “geometric proxy screening” to a “geometry–construction–performance” coupled evaluation. Additionally, standardized checks for Indoor Air Quality (IAQ) and natural ventilation typically depend on plan zoning, opening ratios, and wind environment boundary conditions, which are not quantitatively checked in the current version. Future iterations will introduce metrics such as the effective ventilation area ratio and utilize ventilation network models or Computational Fluid Dynamics (CFD) for the validation of representative schemes.

4.4.3. Economic Feasibility, Life Cycle Cost, and Multi-Context Adaptability

In the practical implementation of rural architectural governance, the economic value of this framework primarily lies in the reduction of “soft costs” related to design and management. Rural housing construction has long been constrained by insufficient design resources, high communication costs, and financial waste caused by approval reworks. By implementing the “compliance-driven generation–evaluation–diagnostic feedback” workflow, this study provides non-professional users with low-threshold scheme generation and pre-screening capabilities, thereby reducing decision uncertainty and the risk of error correction during construction. It should be noted that this study has not yet conducted a detailed Life Cycle Cost Analysis (LCCA) or payback period calculation, nor has it established a complete cost database compared to traditional construction methods [39]. Thus, no numerical conclusions on “energy saving benefits vs. payback period” are provided. We define economic feasibility here as a verifiable trend: the compliance-driven screening logic tends to suppress extreme openings and unnecessary non-standard components, thereby reducing the risk of material waste and construction complexity associated with “excessive openings or non-standard construction.” Simultaneously, compliance-oriented shading or structural organization may lead to incremental costs for certain components; whether this translates into a life cycle cost advantage requires quantitative assessment based on typical construction methods, material unit prices, and energy consumption boundaries. To deepen economic assessment, future research will introduce local material prices and construction libraries, mapping them to semantic labels and geometric parameters to semi-automatically generate a preliminary Bill of Quantities (BOQ) and cost estimates. This will be combined with BPS results and local energy price parameters to conduct LCCA and payback evaluations.
Furthermore, this framework is not a closed system applicable only to the Zhejiang context, but rather a transferable methodological template. Its portability stems from the modular organization of “data–rules–generation,” where fixed thresholds can be adjusted across different regions. When migrating to other geographic and climate zones, two key modules need to be systematically reconstructed: (1) Replacing training data with local design atlases or real-world cases and reconstructing the semantic label system (categories and codes) based on typical local components, followed by fine-tuning the two-stage generation models (Model I: Contour-to-Semantic; Model II: Semantic-to-Facade); (2) Re-translating local guidelines and energy-saving standards into a computable metric system, with thresholds and weights recalibrated. Differences across climate zones are primarily reflected in thermal-related G-type metrics and their threshold/weight configurations (e.g., constraints for opening ratios and shading proxies), which can be dynamically set according to climate zoning and orientation. Subsequent research will introduce TMY data and common construction assumptions, utilizing BPS tools to conduct sensitivity analyses for further calibration of thresholds and weights, thereby advancing the framework from “geometric proxy screening” toward “performance-coupled evaluation.”

5. Conclusions

This research adeptly addresses the fundamental issue of generative AI in the generation of “Zhejiang-style Vernacular Dwellings,” wherein AI comprehends drawing yet lacks logical reasoning, by developing a hierarchical generative control framework of “Contour-Semantic-Image.” This approach integrates spatial syntax and logical constraints derived from architectural typology into the generation process, facilitating dual controllable generation of building facade layout and style expression with minimal input data.
The principal innovations are twofold: Firstly, the implementation of the SAM2 model to create a human-AI collaborative semi-automatic semantic annotation pipeline, which markedly improves data preprocessing efficiency and label quality; Secondly, and more critically for governance, the transition of the annotation system from a “generation-driven” approach to a “compliance evaluation-driven” framework. This modification ensures that generated outcomes correspond with specific provisions of the Zhejiang Provincial Design Guidelines for Rural Housing, thereby establishing a computable and verifiable governance evidence chain that preliminarily mitigates the challenges of nominal compliance in generative design.
This research possesses specific limitations. Initially, model efficacy is contingent upon high-quality, consistent annotation datasets [40,41]. The precision of the compliance evaluation module is partially contingent upon the efficacy of semantic segmentation utilized on generated images, necessitating further enhancement in subsequent research. Future extensions of this study encompass the development of automated prompt optimization mechanisms to reduce user barriers [42,43], the exploration of multimodal information fusion (e.g., three-dimensional volumes, environmental contexts) [44,45,46], and the expansion from single-building to building-cluster levels. This will enhance the profound application of AI technologies in more intricate contexts, such as rural landscape management and architectural heritage conservation.

Author Contributions

Conceptualization, Y.W. and C.W.; methodology, C.W., L.H. and S.T.; software, C.W.; validation, C.W., L.H., J.Z. and Y.W.; formal analysis, C.W. and L.H.; investigation, C.W., L.H., S.T. and J.Z.; resources, Y.W.; data curation, C.W. and L.H.; writing—original draft preparation, C.W.; writing—review and editing, all authors; visualization, C.W.; supervision, Y.W.; project administration, Y.W.; funding acquisition, Y.W. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Basic Public Welfare Research Program of Zhejiang Province, grant number LGF22E080017. This research was funded by Supported by the Scientific Research Development Foundation of Zhejiang A&F University, grant number 2025LFR058.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Acknowledgments

During the preparation of this manuscript, the authors used Stable Diffusion (SD 2.1) and ControlNet for the purpose of generating and controlling rural residential facade designs based on contour and semantic layouts. The authors have reviewed and edited the output and take full responsibility for the content of this publication. During the preparation of this study, the authors used SAM 2 for the purpose of assisting in the semi-automatic annotation of architectural element masks in facade image data. The authors have reviewed and edited the output and take full responsibility for the content of this publication.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
SAMSegment Anything Model
LDMLatent Diffusion Models
MSEMean Squared Error

Appendix A

Table A1. Quantitative evaluation results of generated facade schemes.

Appendix B

Figure A1. Core Computation Logic of the assessment engine.

Appendix C

Table A2. Statistical Table of On-site Collected Evidence and Number of Data Filtering Solutions.

Appendix D

Table A3. Hyperparameters of Model 1 and Model 2.

References

  1. Wu, Y.; Chen, X.; Zhou, X.; Wang, Y.; Pan, X. Research on the Construction Method Based on Menu-Type Standard Drawing Collections in Lin’an District of Hangzhou. World Archit. 2021, 8, 94–101+127. [Google Scholar] [CrossRef]
  2. Su, Q.; Chen, X.; Wu, Y.; Huang, W. Research on Menu-style Farmhouse Design System under the Background of New Countryside. Archit. Cult. 2019, 7, 35–37. [Google Scholar]
  3. Xu, L.; Huang, W.; Wu, Y. Study on the New Type of Farmhouse under the Cooperation of Multiple Partners—A Case of Construction of Farmhouses in Xiaogucheng Village, Yuhang District, Hangzhou. Archit. Cult. 2018, 6, 171–173. [Google Scholar]
  4. Li, Y.; Westlund, H.; Liu, Y. Why some rural areas decline while some others not: An overview of rural evolution in the world. J. Rural. Stud. 2019, 68, 135–143. [Google Scholar] [CrossRef] [Scilit]
  5. Duarte, J.P. Towards the mass customization of housing: The grammar of Siza’s houses at Malagueira. Environ. Plan. B Plan. Des. 2005, 32, 347–380. [Google Scholar]
  6. Fortenberry, B.R. Digital documentation in vernacular architecture studies. Build. Landsc. J. Vernac. Archit. Forum 2019, 26, 98–114. [Google Scholar] [CrossRef] [Scilit]
  7. Isola, P.; Zhu, J.-Y.; Zhou, T.; Efros, A.A. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; IEEE: New York, NY, USA, 2017; pp. 1125–1134. [Google Scholar]
  8. Newton, D. Generative deep learning in architectural design. Technol. Archit. Des. 2019, 3, 176–189. [Google Scholar] [CrossRef] [Scilit]
  9. Rombach, R.; Blattmann, A.; Lorenz, D.; Esser, P.; Ommer, B. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; IEEE: New York, NY, USA, 2022; pp. 10684–10695. [Google Scholar]
  10. Zhang, L.; Rao, A.; Agrawala, M. Adding conditional control to text-to-image diffusion models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Paris, France, 2–3 October 2023; IEEE: New York, NY, USA, 2023; pp. 3836–3847. [Google Scholar]
  11. Yiannoudes, S. Shaping architecture with generative artificial intelligence: Deep learning models in architectural design workflow. Architecture 2025, 5, 94. [Google Scholar] [CrossRef] [Scilit]
  12. Nawari, N.O. Automated code checking in BIM environment. In Proceedings of the 14th International Conference on Computing in Civil and Building Engineering, Moscow, Russia, 27–29 June 2012. [Google Scholar]
  13. Eastman, C.; Lee, J.-M.; Jeong, Y.-S.; Lee, J.-K. Automatic rule-based checking of building designs. Autom. Constr. 2009, 18, 1011–1033. [Google Scholar] [CrossRef] [Scilit]
  14. Ravi, N.; Gabeur, V.; Hu, Y.-T.; Hu, R.; Ryali, C.; Ma, T.; Khedr, H.; Rädle, R.; Rolland, C.; Gustafson, L. Sam 2: Segment anything in images and videos. arXiv 2024, arXiv:2408.00714. [Google Scholar]
  15. Chen, T.; Lu, A.; Zhu, L.; Ding, C.; Yu, C.; Ji, D.; Li, Z.; Sun, L.; Mao, P.; Zang, Y. Sam2-adapter: Evaluating & adapting segment anything 2 in downstream tasks: Camouflage, shadow, medical image segmentation, and more. arXiv 2024, arXiv:2408.04579. [Google Scholar] [CrossRef] [Scilit]
  16. Xiong, X.; Wu, Z.; Tan, S.; Li, W.; Tang, F.; Chen, Y.; Li, S.; Ma, J.; Li, G. Sam2-unet: Segment anything 2 makes strong encoder for natural and medical image segmentation. arXiv 2024, arXiv:2408.08870. [Google Scholar] [CrossRef] [Scilit]
  17. Fagin, R.; Kumar, R.; Sivakumar, D. Comparing top k lists. SIAM J. Discret. Math. 2003, 17, 134–160. [Google Scholar]
  18. Podell, D.; English, Z.; Lacey, K.; Blattmann, A.; Dockhorn, T.; Müller, J.; Penna, J.; Rombach, R. Sdxl: Improving latent diffusion models for high-resolution image synthesis. arXiv 2023, arXiv:2307.01952. [Google Scholar] [CrossRef] [Scilit]
  19. Fan, J.; Tang, G.; Wu, K.; Zhao, Z.; Zhou, Y.; Huang, S. Score-VAE: Root Cause Analysis for Federated-Learning-Based IoT Anomaly Detection. IEEE Internet Things J. 2024, 11, 1041–1053. [Google Scholar] [CrossRef] [Scilit]
  20. Razghandi, M.; Zhou, H.; Erol-Kantarci, M.; Turgut, D. Smart Home Energy Management: VAE-GAN Synthetic Dataset Generator and Q-Learning. IEEE Trans. Smart Grid 2024, 15, 1562–1573. [Google Scholar] [CrossRef] [Scilit]
  21. Hafner, M.; Katsantoni, M.; Köster, T.; Marks, J.; Mukherjee, J.; Staiger, D.; Ule, J.; Zavolan, M. CLIP and complementary methods. Nat. Rev. Methods Primers 2021, 1, 20. [Google Scholar] [CrossRef] [Scilit]
  22. Ramesh, A.; Dhariwal, P.; Nichol, A.; Chu, C.; Chen, M. Hierarchical text-conditional image generation with clip latents. arXiv 2022, arXiv:2204.06125. [Google Scholar] [CrossRef] [Scilit]
  23. Ronneberger, O.; Fischer, P.; Brox, T. U-net: Convolutional networks for biomedical image segmentation. In Medical Image Computing and Computer-Assisted Intervention–MICCAI 2015: 18th International Conference, Munich, Germany, 5–9 October 2015; Springer: Cham, Switzerland, 2015; pp. 234–241. [Google Scholar]
  24. GB 50033-2013; Standard for Daylighting Design of Buildings. China Architecture & Building Press: Beijing, China, 2013.
  25. GB/T 50824-2013; Design Standard for Energy Efficiency of Rural Residential Buildings. China Architecture & Building Press: Beijing, China, 2013.
  26. Ilyas, I.F.; Beskales, G.; Soliman, M.A. A survey of top-k query processing techniques in relational database systems. ACM Comput. Surv. (CSUR) 2008, 40, 11. [Google Scholar] [CrossRef] [Scilit]
  27. Howse, J. OpenCV Computer Vision with Python; Packt Publishing: Birmingham, UK, 2013; Volume 27. [Google Scholar]
  28. Janocha, K.; Czarnecki, W.M. On loss functions for deep neural networks in classification. arXiv 2017, arXiv:1702.05659. [Google Scholar] [CrossRef] [Scilit]
  29. Dickson, M.C.; Bosman, A.S.; Malan, K.M. Hybridised loss functions for improved neural network generalisation. In Proceedings of the Pan-African Artificial Intelligence and Smart Systems Conference; Springer: Cham, Switzerland, 2021; pp. 169–181. [Google Scholar]
  30. Ma, C.; Kunin, D.; Wu, L.; Ying, L. Beyond the quadratic approximation: The multiscale structure of neural network loss landscapes. arXiv 2022, arXiv:2204.11326. [Google Scholar] [CrossRef] [Scilit]
  31. Ho, J.; Jain, A.; Abbeel, P. Denoising diffusion probabilistic models. Adv. Neural Inf. Process. Syst. 2020, 33, 6840–6851. [Google Scholar]
  32. Niu, C.; Song, Y.; Song, J.; Zhao, S.; Grover, A.; Ermon, S. Permutation invariant graph generation via score-based generative modeling. In Proceedings of the 23rd International Conference on Artificial Intelligence and Statistics, Palermo, Italy, 26–28 August 2020; pp. 4474–4484. [Google Scholar]
  33. Sohl-Dickstein, J.; Weiss, E.; Maheswaranathan, N.; Ganguli, S. Deep unsupervised learning using nonequilibrium thermodynamics. In Proceedings of the International Conference on Machine Learning, Lille, France, 6–11 July 2015; pp. 2256–2265. [Google Scholar]
  34. Wood, D.; Mu, T.; Brown, G. Bias-variance decompositions for margin losses. In Proceedings of the International Conference on Artificial Intelligence and Statistics, Valencia, Spain, 28–30 March 2022; pp. 1975–2001. [Google Scholar]
  35. Kynkäänniemi, T.; Karras, T.; Aittala, M.; Aila, T.; Lehtinen, J. The role of imagenet classes in Fréchet inception distance. arXiv 2022, arXiv:2203.06026. [Google Scholar]
  36. Dimitrakopoulos, P.; Sfikas, G.; Nikou, C. Wind: Wasserstein inception distance for evaluating generative adversarial network performance. In Proceedings of the ICASSP 2020—2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Barcelona, Spain, 4–8 May 2020; IEEE: New York, NY, USA, 2020; pp. 3182–3186. [Google Scholar]
  37. Turhan, C.; Özbey, M.F.; Lotfi, B.; Akkurt, G.G. Integration of psychological parameters into a thermal sensation prediction model for intelligent control of the HVAC systems. Energy Build. 2023, 296, 113404. [Google Scholar] [CrossRef] [Scilit]
  38. Turhan, C.; Özbey, M.F.; Çeter, A.E.; Akkurt, G.G. A novel data-driven model for the effect of mood state on thermal sensation. Buildings 2023, 13, 1662. [Google Scholar] [CrossRef] [Scilit]
  39. Islam, H.; Jollands, M.; Setunge, S. Life cycle assessment and life cycle cost implication of residential buildings—A review. Renew. Sustain. Energy Rev. 2015, 42, 129–140. [Google Scholar] [CrossRef] [Scilit]
  40. Liu, Y.; Wu, P.; Li, X.; Mo, W. Application and renovation evaluation of Dalian’s industrial architectural heritage based on AHP and AIGC. PLoS ONE 2024, 19, e0312282. [Google Scholar]
  41. Sadek, M.G.; Hassan, A.; O Diab, T.; Abdelhafeez, A. Creating Images with Stable Diffusion and Generative Adversarial Networks. Int. J. Telecommun. 2024, 4, 1–14. [Google Scholar] [CrossRef] [Scilit]
  42. Beri, G.; Srivastava, V. Advanced Techniques in Prompt Engineering for Large Language Models: A Comprehensive Study. In Proceedings of the 2024 IEEE 4th International Conference on ICT in Business Industry & Government (ICTBIG), Indore, India, 13–14 December 2024; IEEE: New York, NY, USA, 2024; pp. 1–4. [Google Scholar]
  43. Sahoo, P.; Singh, A.K.; Saha, S.; Jain, V.; Mondal, S.; Chadha, A. A systematic survey of prompt engineering in large language models: Techniques and applications. arXiv 2024, arXiv:2402.07927. [Google Scholar] [CrossRef] [Scilit]
  44. Baltrušaitis, T.; Ahuja, C.; Morency, L.-P. Multimodal machine learning: A survey and taxonomy. IEEE Trans. Pattern Anal. Mach. Intell. 2018, 41, 423–443. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  45. Ngiam, J.; Khosla, A.; Kim, M.; Nam, J.; Lee, H.; Ng, A.Y. Multimodal deep learning. In Proceedings of the 28th International Conference on Machine Learning, Washington, DC, USA, 28 June–2 July 2011; Omnipress: Madison, WI, USA, 2011; pp. 689–696. [Google Scholar]
  46. Turk, M. Multimodal interaction: A review. Pattern Recognit. Lett. 2014, 36, 189–195. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.