An ancient building intelligent research method and system based on multi-stage cascade detection
By combining multi-level cascaded detection and knowledge graphs, the robustness problem of ancient building image recognition in complex scenarios is solved, enabling personalized cultural interpretation and learning paths, and improving the recognition accuracy and learning sustainability of intelligent research and study of ancient buildings.
Patent Information
- Application Number
- CN202611288390.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-11-06
AI Technical Summary
In existing technologies, ancient building image recognition methods lack sufficient recognition accuracy in complex scenarios and lack a linkage mechanism between recognition results and cultural interpretation, knowledge graph, learning path and review task, resulting in insufficient recognition robustness and poor learning experience.
An intelligent learning approach based on multi-level cascaded detection is adopted, which combines target detection, contextual feature inference and heuristic backtracking. Personalized learning paths are generated through semantic association of knowledge graphs, and the priority of learning tasks is adjusted through interval repetition rules to form a continuous learning closed loop.
It improves the robustness of ancient building images in complex scenes, ensures the accuracy of recognition results and the relevance of cultural interpretation, enhances the continuity and personalization of learning, and provides a systematic means of cultural heritage protection and dissemination.
Smart Images

Figure CN123052318A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical fields of artificial intelligence and the digitization of cultural heritage, and in particular to an intelligent research and study method and system for ancient architecture. Background Technology
[0002] Ancient Chinese architecture is a material testament to the millennia-long continuity of Chinese civilization. Its construction system, centered on timber frames, has formed an independent technical tradition and aesthetic paradigm distinct from Western stone architecture. With the acceleration of urbanization, hundreds of historically valuable ancient buildings are disappearing every year, making the digital preservation of cultural heritage an urgent national priority. In the field of ancient architecture research, the general public, especially international students studying in China, face two major obstacles in understanding Chinese ancient architecture: firstly, language barriers leading to difficulties in understanding architectural terminology; and secondly, the lack of immersive and intelligent support in traditional research methods.
[0003] In existing technologies, some digital culture platforms primarily offer text and image displays, 3D browsing, or online courses, providing some cultural resource presentation. However, they typically lack the ability to automatically recognize user-input images and lack a linkage mechanism between recognition results and cultural interpretations, knowledge graphs, learning paths, and review tasks. Some image recognition systems can classify or detect objects in architectural images, but their output usually remains at the level of category labels and confidence levels, making it difficult to further generate cultural interpretation content suitable for study tours. Single object detection models are prone to low confidence or misidentification under conditions of changing lighting, changing shooting angles, image occlusion, or input of partial architectural components, resulting in insufficient robustness.
[0004] Furthermore, the lack of a binding relationship between cultural interpretation content and recognition results leads to generated content that easily deviates from the architectural type or component characteristics corresponding to the user-uploaded images, resulting in content generalization issues. Knowledge of ancient architecture is typically presented in static text form, lacking the ability to establish node associations, recommend paths, and compare Chinese and foreign architecture based on knowledge graphs. Study platforms usually only offer one-time browsing or quiz functions, lacking a continuous learning mechanism that automatically generates review tasks and quiz feedback based on user learning records. Summary of the Invention
[0005] To address the shortcomings of existing ancient building image recognition methods, such as insufficient accuracy in complex scenes and lack of linkage mechanisms between recognition results and cultural interpretation, knowledge graphs, learning paths, and review tasks, this invention proposes an intelligent learning method and system for ancient buildings based on multi-level cascaded detection. This method improves the robustness of ancient building image recognition through a three-level cascaded recognition strategy combining target detection, contextual feature inference, and heuristic backoff. Simultaneously, it transforms single recognition results into a continuous learning process through semantic association with a knowledge graph, thereby enhancing the recognition accuracy and learning sustainability of intelligent learning for ancient buildings.
[0006] To achieve the above objectives, the technical solution of the present invention is implemented as follows:
[0007] In the first aspect, a smart research and learning method for ancient buildings based on multi-level cascaded detection is proposed, including:
[0008] S1: Obtain the ancient building image input by the user, and perform preprocessing to obtain the preprocessed ancient building image;
[0009] S2: The recognition result of ancient building images is determined by a three-level cascaded recognition strategy that combines object detection, contextual feature inference and heuristic backoff;
[0010] S3: Using the recognition results of ancient building images as constraints, construct prompt words and generate multi-level, multi-dimensional, and multilingual cultural interpretation content through a large language model;
[0011] S4: A dual-track knowledge graph architecture is used to perform association queries on the recognition results of ancient building images and to recommend personalized learning paths based on the query results;
[0012] S5: Based on the personalized learning path recommendation, perform personalized learning and set downgrade processing strategies; during the personalized learning process, generate review tasks based on the interval repetition rule to dynamically adjust the priority of learning tasks and review tasks.
[0013] Furthermore, the three-level cascaded identification strategy includes:
[0014] S21: Use a pre-trained target detection model to identify the pre-processed ancient building image to obtain the identified ancient building image, and obtain the first candidate identification result, bounding box position and first confidence score. When the first confidence score reaches the preset first threshold, output the first candidate identification result as the identification result of the final ancient building image. The identification result of the final ancient building image includes building type or component category.
[0015] S22: When the first confidence level is lower than the preset first threshold, extract multi-dimensional image context features from the identified ancient building image, calculate the second confidence level based on the multi-dimensional image context features through weighted scoring, and output the corresponding first candidate recognition result as the final recognition result of the ancient building image when the second confidence level reaches the preset second threshold.
[0016] S23: When the second confidence level is lower than the preset second threshold, a heuristic backoff rule is used to identify the identified ancient building image to obtain the final identification result of the ancient building image.
[0017] Furthermore, step S22 includes:
[0018] S221. Perform HSV color space conversion on the identified ancient building image, and calculate the distribution statistics of each channel after conversion as color histogram features; the distribution statistics include at least mean, variance, skewness, and kurtosis.
[0019] S222. The identified ancient building image is converted to grayscale, a multi-directional gray-level co-occurrence matrix is calculated, and texture GLCM features are extracted; the texture GLCM features include at least contrast, correlation, energy, and homogeneity;
[0020] S223. Calculate the aspect ratio of the bounding box region in the identified ancient building image;
[0021] S224. Calculate the similarity between the color histogram feature, texture GLCM feature, and aspect ratio feature and the preset reference feature templates for various types of buildings, and obtain the color histogram feature score. Texture GLCM feature score Aspect Ratio Feature Score The scores are then weighted to obtain a weighted score. ;
[0022] S225, Weighted scoring The second confidence level is obtained by mapping the segmented threshold mapping function to the 0-1 interval. When the second confidence level reaches the preset second threshold, the corresponding first candidate recognition result is output.
[0023] Furthermore, step S23 includes:
[0024] S231. Calculate the overall average brightness of the identified ancient building image;
[0025] S232. Use a high-pass filter to extract the high-frequency texture components of the identified ancient building image, and perform binarization processing on the high-frequency texture components with a preset threshold to obtain a binary map of the high-frequency texture region. Calculate the proportion of the area of the high-frequency texture region to the total area as the texture density.
[0026] S233. Use an edge detection algorithm to extract the image edges of the identified ancient building image, and calculate the proportion of edge pixels to the total pixels to obtain the edge proportion.
[0027] S234: By using a preset rule mapping table, the feature combination of average brightness, texture density, and edge proportion is mapped to building type or component category, generating the final recognition result of the ancient building image.
[0028] Furthermore, step S3 includes:
[0029] S31. The recognition result of the final ancient building image is used as a constraint to construct a prompt word template. The prompt word template includes building type constraint, component category constraint and recognition confidence constraint. The building type constraint specifies that the generated content must revolve around the building type. The component category constraint specifies that the generated content must cover the technical features and cultural significance of the component. When the recognition confidence constraint is lower than the preset third threshold, the prompt "The following interpretation is for reference only" is added to the generated content.
[0030] S32. Call the large language model to generate at least three levels of cultural interpretation content based on the prompt word template. The three levels of depth include the initial understanding level, the comprehension level, and the in-depth exploration level. The cultural interpretation content of each level of depth covers at least seven dimensions: architectural overview summary, sensory narrative, comparative stories of Chinese and Western architecture, learning suggestions, discussion guidance questions, bilingual summary, and mnemonic devices. Three output modes are adopted: Chinese, English, and bilingual.
[0031] Furthermore, the dual-track knowledge graph architecture includes a first-track professional engine and a second-track learning engine;
[0032] The first professional engine is built on a graph database and is used to map the recognition results of ancient building images to corresponding nodes in the knowledge graph. Through multi-hop association query and shortest path query, it traverses adjacent nodes along semantic relationship edges, calculates the association weight of each node based on the shortest path hop count, and obtains the association node list of the building professional node. Association weight = 1 / shortest path hop count.
[0033] The second-track learning engine is built on relational databases and graph computing libraries, and consists of two stages: data storage and learning path recommendation.
[0034] Data storage stage: Store three types of structured data from the architecture professional nodes of the first track professional engine: a list of related nodes and the related weights of each node, the difficulty coefficient of the preset knowledge nodes, and user learning behavior; user learning behavior includes at least learning time, learning duration, answer records, review frequency, and mastery level, and mastery level includes at least three states: not learned, learning in progress, and mastered.
[0035] Learning path recommendation stage: The graph computing library reads the three types of structured data from the relational database, constructs a directed graph of learning paths starting from the nodes corresponding to the recognition results, and comprehensively scores and sorts adjacent knowledge nodes based on user's historical learning records, knowledge node difficulty, node association weight, and user test results. The personalized learning paths are obtained by arranging them in descending order of comprehensive scores.
[0036] Furthermore, in step S5, during the personalized learning process, review tasks are generated based on interval repetition rules to dynamically adjust the priority of learning and review tasks, including:
[0037] S51. Based on the knowledge points of the user's current learning content in the personalized learning path recommendation, query the learning progress record and determine whether the current knowledge point has entered the review cycle.
[0038] S52. If the current knowledge point enters the review cycle, a corresponding review task is generated. The review task includes three types of questions: true / false, multiple choice, and short answer. If the current knowledge point has not entered the review cycle, the next knowledge point is recommended for learning according to the personalized learning path.
[0039] S53. Dynamically adjust the difficulty and review priority of subsequent learning content based on the user's correct answer rate. When the user's correct answer rate is lower than the preset lower threshold, reduce the difficulty and shorten the review interval. When the user's correct answer rate is higher than the preset upper threshold, increase the difficulty and extend the review interval.
[0040] S54. Based on the Ebbinghaus forgetting curve, design an interval repetition algorithm to arrange the next review, repeat step S51, and form a closed loop of learning, review, and testing.
[0041] Furthermore, the degradation processing strategy includes:
[0042] When the target detection model service is unavailable, switch to the heuristic image feature analysis mode and perform fallback identification based on heuristic backoff rules;
[0043] When the large language model service is unavailable, it will be downgraded to the local template generation mechanism, which generates basic cultural interpretation content based on the preset cultural interpretation template and recognition results.
[0044] The analysis progress status is pushed to the client in real time via the WebSocket protocol. The analysis progress status includes the stages of model loading, inference, and interpretation generation.
[0045] Furthermore, step S1 also includes a text description input method, including inputting the building type, component type, or a natural language description of the ancient building image;
[0046] The target detection model in step S21 is either the YOLOv8 target detection model or the Faster R-CNN target detection model.
[0047] The high-pass filter in step S232 uses either the Sobel operator or the Laplacian operator;
[0048] The edge detection algorithm in step S233 adopts the Canny edge detection algorithm;
[0049] The mapping rules for the segmented threshold mapping function in step S225 are as follows: when the comprehensive score is greater than 0.8, the second confidence level is set to 0.82; when the comprehensive score is greater than 0.5, the second confidence level is set to 0.72; when the comprehensive score is greater than 0.2, the second confidence level is set to 0.62; when the comprehensive score is greater than 0.05, the second confidence level is set to 0.55; when the comprehensive score is less than or equal to 0.05, the second confidence level is set to 0.45.
[0050] The graph database used during the construction of the first professional engine is Neo4j graph database;
[0051] The second learning engine uses a relational database (MySQL) and a graph computing library (NetworkX).
[0052] The interval repetition algorithm adopts a progressive interval review strategy of 0 days, 1 day, 7 days, 14 days, 30 days and 90 days. After each review, the user's answer performance determines whether to enter the next interval cycle or reset the interval: if the user's answer accuracy rate reaches or exceeds the preset probability in a certain review, then enter the next interval cycle; if the accuracy rate is lower than the preset probability, then reset to the previous interval cycle and review again.
[0053] Secondly, a smart research and learning system for ancient architecture based on multi-level cascaded detection is proposed to implement the aforementioned smart research and learning method for ancient architecture based on multi-level cascaded detection, including:
[0054] The input and preprocessing module is used to acquire the ancient building images input by the user and perform preprocessing to obtain the preprocessed ancient building images;
[0055] The cascaded recognition module is used to determine the recognition results of ancient building images based on a three-level cascaded recognition strategy that combines target detection, contextual feature inference, and heuristic backoff.
[0056] The cultural interpretation generation module is used to construct prompt words based on the recognition results of ancient building images, and generate multi-level, multi-dimensional, and multilingual cultural interpretation content through a large language model.
[0057] The knowledge graph module is used to construct a dual-track knowledge graph;
[0058] The learning path generation module is used to perform association queries on the recognition results of ancient building images using a dual-track knowledge graph architecture and to recommend personalized learning paths based on the query results.
[0059] The spaced repetition module is used to perform personalized learning based on the personalized learning path recommendation; during the personalized learning process, review tasks are generated based on the spaced repetition rule to dynamically adjust the priority of learning tasks and review tasks.
[0060] The degradation processing module is used to implement degradation processing strategies.
[0061] The beneficial effects of this invention are as follows:
[0062] This invention employs a three-level cascaded recognition strategy combining object detection, contextual feature inference, and heuristic backoff to determine the type of ancient buildings or the category of components. First, the object detection model can quickly identify ancient building images in most standard scenarios, providing efficient first-level recognition capabilities. Second, when the confidence level of the object detection model is insufficient, weighted scoring is performed by extracting color histograms, texture GLCM, and aspect ratio contextual features. Multi-dimensional image information is used to correct low-confidence results, effectively improving the robustness of ancient building image recognition under varying lighting conditions, shooting angles, and local building component input scenarios. Finally, when contextual inference still cannot provide reliable results, a fallback recognition is performed using heuristic backoff rules based on brightness, texture density, and edge proportion, progressively improving recall and ensuring the system can output recognition results in various scenarios, thereby improving the stability and comprehensiveness of ancient building recognition.
[0063] This invention uses the results of ancient building identification as constraints to generate multi-level cultural interpretation content, which is then mapped to corresponding nodes in a dual-track knowledge graph. Based on the semantic relationships between nodes, personalized learning paths and spaced repetition tasks are generated, forming a continuous learning loop. First, by injecting the identification results as constraints into the cultural interpretation generation process, the generated content is kept consistent with the architectural type or component features corresponding to the user-uploaded images, avoiding the problem of content generated by general large language models deviating from the actual identification object, thus improving the accuracy and relevance of the cultural interpretation content. Second, through the dual-track knowledge graph architecture, architectural types, components, dynasties, regions, and comparative relationships between Chinese and foreign architecture are organized into a queryable semantic network, enabling the system to expand from single identification to associative and comparative learning, thereby improving the systematicness and relevance of the learning content. Finally, by combining spaced repetition rules and user answer accuracy to dynamically adjust the difficulty of the learning content and the priority of repetition, a one-time identification result is transformed into a continuous learning task, thereby improving the learning continuity and personalization of intelligent ancient building learning. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0065] Figure 1The flowchart shows the intelligent research and study method for ancient buildings based on multi-level cascaded detection according to the present invention.
[0066] Figure 2 This is a flowchart of the three-level cascaded identification process of the present invention;
[0067] Figure 3 This is a schematic diagram of the image context feature extraction and weighted scoring method of the present invention;
[0068] Figure 4 A flowchart generated for the cultural interpretation of this invention;
[0069] Figure 5 This is a schematic diagram of the dual-track knowledge graph architecture of the present invention;
[0070] Figure 6 This is a flowchart illustrating the personalized learning and spaced repetition process of the present invention.
[0071] Figure 7 This is a flowchart of the degradation process of the present invention. Detailed Implementation
[0072] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0073] Example 1
[0074] A multi-level cascaded detection-based intelligent learning method for ancient architecture combines image recognition, cultural interpretation, knowledge graph association, and spaced repetition to provide users with a complete learning experience, from single architectural identification to continuous cultural learning. This intelligent learning approach not only helps lower the cognitive threshold for cross-cultural architecture but also enhances learning depth through the systematic association of knowledge graphs and improves learning effectiveness through spaced repetition, thereby promoting the digital protection and dissemination of ancient architectural cultural heritage. Therefore, constructing an intelligent learning method for ancient architecture that integrates multi-level recognition, cultural interpretation, knowledge graphs, and a learning closed loop has significant practical implications. Figure 1 As shown, it includes:
[0075] S1: Obtain the ancient building image input by the user, and perform preprocessing to obtain the preprocessed ancient building image.
[0076] In this embodiment of the application, users can upload images of ancient buildings or enter text descriptions.
[0077] Specifically, this invention supports two input methods to trigger the building recognition process: image input via the front-end interface and text description input. Image input supports common image formats such as JPG, PNG, and WEBP. Text description input allows users to input building names (e.g., "Hall of Supreme Harmony in the Forbidden City"), feature (component) keywords (e.g., "dougong" or "flying eaves"), or natural language descriptions (e.g., "a red palace building with dragon patterns on the roof"). When a user inputs a text description, the text is directly mapped to the corresponding node in the knowledge graph through text matching, skipping the image recognition stage and proceeding to step S6.
[0078] In this embodiment of the application, the ancient building image is preprocessed, including image size normalization, format conversion, noise suppression, and input validity verification.
[0079] Specifically, preprocessing includes four sub-steps: image size normalization, which uniformly scales the input image to the input size required by the target detection model (e.g., 640×640 pixels), maintaining the image aspect ratio during scaling, and filling any insufficient areas with black; format conversion, which uniformly converts images of different formats to the format supported by the model; noise suppression, which uses Gaussian filtering (kernel size 3×3) or median filtering to remove noise from the image and improve the accuracy of subsequent recognition; and input validity verification, which checks whether the image is a valid image file, whether the image size is within the allowed range (e.g., minimum size not less than 32×32 pixels), and whether the image content is empty or corrupted.
[0080] S2: The recognition result of ancient building images is determined by a three-level cascaded recognition strategy that combines object detection, contextual feature inference and heuristic backoff.
[0081] In the embodiments of this application, such as Figure 2 As shown, step S2 specifically includes:
[0082] S21: Use a pre-trained target detection model to identify the pre-processed ancient building image to obtain the identified ancient building image, and obtain the first candidate recognition result, bounding box position and first confidence score. When the first confidence score reaches the preset first threshold, output the first candidate recognition result as the final recognition result of the ancient building image.
[0083] Specifically, the YOLOv8 object detection model is used for object detection. YOLOv8 (You Only Look Once Version 8) is a single-stage object detection model that treats object detection as a regression problem. It predicts the bounding box position and class probability simultaneously through a single forward propagation, featuring fast detection speed and good real-time performance, making it suitable for the fast recognition response requirements in ancient architecture research scenarios. As an alternative, a two-stage object detection model, Faster R-CNN (Faster Region-based Convolutional Neural Network), can also be used. This model first generates candidate regions and then performs classification and bounding box regression, achieving higher detection accuracy but relatively slower speed.
[0084] The training process of the model is as follows:
[0085] S211. Obtain a training dataset containing ancient building image samples, label the building types and components in the ancient building image samples, and generate labeled images;
[0086] S212. Divide the labeled images into training set, validation set and test set, and keep the training set evenly distributed in the three dimensions of lighting conditions, shooting angle and season.
[0087] S213. Initialize the target detection model based on pre-trained weights, freeze the pre-set number of layers of the model backbone network to retain the general feature extraction capability, and only fine-tune the detection head to adapt to the specific feature space of the ancient architecture field.
[0088] S214. Input the training set into the object detection model, calculate the model loss through forward propagation, and update the model parameters through back propagation until the object detection model reaches the preset performance index on the validation set.
[0089] S215. Evaluate the performance of the object detection model using the test set and output the trained object detection model.
[0090] In this embodiment, for step S211, the dataset contains over 2000 ancient building image samples. Building types include traditional residences, government buildings, palaces, bridges, gardens, tombs, pagodas, city gates, memorial archways, roof ridges, and key components such as brackets and eaves. Image annotation tools (such as LabelImg) are used to annotate the targets in the building image samples, generating annotation files containing bounding box coordinates and category labels. The annotation format uses YOLO or COCO format.
[0091] For step S212, to ensure the model's generalization ability across various scenarios, the dataset is evenly distributed across three dimensions: lighting conditions (strong light, weak light, backlight), shooting angle (front, side, top view, bottom view), and season (spring, summer, autumn, winter). The labeled images are divided into training, validation, and test sets in an 8:1:1 ratio. Simultaneously, data augmentation is performed on the training set, including random horizontal flipping, random scaling (0.5-1.5x), color jitter (brightness, contrast, and saturation ±20% each), and Mosaic stitching enhancement, to improve the model's adaptability to complex scenes.
[0092] For step S213, the object detection model is initialized with weights pre-trained on the Common Objects in Context (COCO) dataset. During transfer learning, the first 10 layers of the backbone network are frozen to retain general feature extraction capabilities, and only the detection head is fine-tuned to adapt the model to the specific feature space of the ancient architecture domain. This strategy can achieve good training results on a limited dataset while avoiding overfitting. A cosine annealing learning rate scheduling strategy is used during training, with an initial learning rate of 0.01, a minimum learning rate of 0.0001, a training period of 300 epochs, and a batch size of 16.
[0093] It should be noted that this invention, through transfer learning and fine-tuning training, enables the object detection model to achieve good ancient building recognition performance on a limited dataset. Simultaneously, by freezing the pre-set number of layers in the backbone network, it retains the general feature extraction capability and avoids overfitting. Furthermore, by designing a dataset with a balanced distribution across lighting conditions, shooting angle, and season, the model's generalization ability in various real-world scenarios is improved.
[0094] Furthermore, the preprocessed ancient building image is detected using an object detection model to obtain the identified ancient building image, and the first candidate identification result (building type or component category), bounding box position coordinates, and first confidence score are output. When the first confidence score reaches a preset first threshold of 0.75, the identification result is directly used as the final identification result. When the first confidence score is lower than 0.75, the system enters step S22 to perform context feature inference.
[0095] S22: When the first confidence level is lower than the preset first threshold, extract multi-dimensional image context features from the identified ancient building image, calculate the second confidence level based on the multi-dimensional image context features through weighted scoring, and output the corresponding first candidate recognition result (i.e., the candidate building type or component category given by the target detection model in the first level of recognition, which is confirmed after verification by context feature weighted scoring) as the final recognition result of the ancient building image.
[0096] Specifically, such as Figure 3 As shown, step S22 includes:
[0097] S221. Perform HSV color space conversion on the identified ancient building image, and calculate the distribution statistics of each channel after conversion as color histogram features.
[0098] In this embodiment, the ancient building image after target detection and recognition is converted from the RGB color space to the HSV color space. Histograms of the three channels—hue (H), saturation (S), and brightness (V)—are calculated respectively, and distribution statistics, including mean, variance, skewness, and kurtosis, are extracted as color histogram features. The color histogram features can reflect the color characteristics of ancient buildings. For example, imperial palace buildings are mainly red and yellow (H channel concentrated in the 0-30 degree and 330-360 degree ranges), garden buildings are mainly green (H channel concentrated in the 80-150 degree range), and residential buildings are mainly gray and white (S channel values are relatively low).
[0099] S222. The identified ancient building image is converted to grayscale, the multi-directional gray-level co-occurrence matrix is calculated, and the texture GLCM features are extracted. The texture GLCM features include contrast, correlation, energy and homogeneity.
[0100] In this embodiment, the gray-level co-occurrence matrix (GLCM) is constructed by statistically analyzing the frequency of simultaneous occurrence of two pixel gray-level values at specific directions and distances in an image. The identified ancient building image is converted to grayscale, and GLCMs are calculated for four directions (0°, 45°, 90°, and 135°) at a distance of 1 pixel. Four indicators are extracted from the GLCM: contrast (reflecting the degree of local image variation), correlation (reflecting the degree of linear dependence of gray levels), energy (reflecting texture uniformity), and homogeneity (reflecting the local uniformity of gray-level distribution), forming the texture GLCM feature. The texture GLCM feature can reflect the material texture characteristics of the ancient building surface; for example, the texture contrast of a wooden frame is high, the texture energy of a brick and stone structure is high, and the texture homogeneity of roof tiles is high.
[0101] S223. Calculate the aspect ratio of the bounding box region in the identified ancient building image;
[0102] In this embodiment, the aspect ratio feature is the ratio of the width to the height of the bounding box output by the target detection model. Different types of ancient buildings have different aspect ratio features. For example, pagoda-type buildings usually have a small aspect ratio (0.3-0.6, tall and slender), palace-type buildings usually have a large aspect ratio (1.5-3.0, wide and flat), city gate-type buildings have an aspect ratio close to 1.0 (square), and archway-type buildings have a large aspect ratio (2.0-4.0, horizontally spread).
[0103] S224. Calculate the similarity (e.g., cosine similarity) between the color histogram feature, texture GLCM feature, and aspect ratio feature and the reference feature templates of various preset buildings to obtain the color histogram feature score. Texture GLCM feature score Aspect Ratio Feature Score The scores are then weighted to obtain a weighted score. The formula is:
[0104] ;
[0105] in, , , These are the preset weighting coefficients.
[0106] In this embodiment, a feature reference template library for various types of ancient buildings is pre-constructed. Each feature score is calculated by matching the original feature values with various reference feature templates for different types of buildings. Weighting coefficients. Set it to 0.3. Set it to 0.5. Set to 0.2. Texture features contribute significantly to the identification of ancient buildings because the texture differences produced by different materials and construction methods are significant and less affected by lighting; color features are the next most important, although they can reflect the overall tone of the building, they are greatly affected by season and lighting; aspect ratio features serve as an auxiliary feature, providing only reference information at the shape level.
[0107] S225, Weighted scoring The second confidence level is obtained by mapping the segmented threshold to the 0-1 interval through the segmented threshold mapping function. When the second confidence level reaches the preset second threshold, the corresponding first candidate recognition result is output.
[0108] The specific mapping rules are as follows: when the overall score is greater than 0.8, the second confidence level is set to 0.82; when the overall score is greater than 0.5, the second confidence level is set to 0.72; when the overall score is greater than 0.2, the second confidence level is set to 0.62; when the overall score is greater than 0.05, the second confidence level is set to 0.55; and when the overall score is less than or equal to 0.05, the second confidence level is set to 0.45.
[0109] Specifically, when the second confidence level reaches the preset second threshold of 0.65, the corresponding first candidate recognition result is output as the final recognition result of the ancient building image. When the second confidence level is still lower than the second threshold of 0.65, the process proceeds to step S23 to perform heuristic backtracking recognition.
[0110] It should be noted that when the confidence level of the target detection model is insufficient, this invention corrects low-confidence results by extracting the color histogram, texture GLCM, and aspect ratio contextual features of the image for weighted scoring, thus utilizing multi-dimensional image information. Firstly, the color histogram feature reflects the overall tonal characteristics of the ancient building, providing an intuitive ability to distinguish different building types. Secondly, the texture GLCM feature reflects the material texture of the ancient building surface and has good robustness to changes in lighting, making it the most reliable contextual feature for ancient building recognition. Finally, the aspect ratio feature provides auxiliary discriminative information from a geometric dimension. The combination of these three features forms a complementary multi-dimensional feature system, effectively improving the robustness of ancient building image recognition in complex scenes.
[0111] S23: When the second confidence level is lower than the preset second threshold, a heuristic backoff rule is used to identify the identified ancient building image to obtain the final identification result of the ancient building image.
[0112] Specifically, step S23 includes:
[0113] S231. Calculate the overall average brightness of the identified ancient building image, and determine the candidate set of building types based on the interval in which the average brightness value is located;
[0114] In this embodiment, the overall average brightness of the ancient building image is divided into five intervals: [0, 51] is the extremely dark interval, corresponding to the candidate set of palace buildings mainly made of dark wood; [52, 102] is the slightly dark interval, corresponding to the candidate set of government buildings mainly made of blue bricks and gray tiles; [103, 153] is the medium interval, corresponding to the candidate set of traditional dwellings mainly made of wooden frames; [154, 204] is the slightly bright interval, corresponding to the candidate set of Jiangnan dwellings mainly made of white walls; and [205, 255] is the extremely bright interval, corresponding to the candidate set of bridges or mausoleums mainly made of stone. Each interval corresponds to a set of candidate building types, narrowing the scope of subsequent judgment.
[0115] S232. Use a high-pass filter to extract the high-frequency texture components of the identified ancient building image, and perform binarization processing on the high-frequency texture components with a preset threshold to obtain a binary map of the high-frequency texture region. Calculate the proportion of the area of the high-frequency texture region to the total area as the texture density.
[0116] In this embodiment, high-frequency components of the image are extracted using a high-pass filter (such as the Sobel operator or the Laplacian operator). These high-frequency components are then binarized using a preset threshold (specifically 128 in this application). The proportion of the area of the high-frequency texture region to the total area is then used as the texture density. Texture density reflects the complexity of the building surface. For example, the texture density of the bracket area is typically high (0.6-0.8) because the bracket is composed of multiple small components with fine and complex textures; while the texture density of the roof area is relatively low (0.2-0.4) because the roof tiles are arranged more regularly and flat.
[0117] S233. Use an edge detection algorithm to extract the image edges of the identified ancient building image, and calculate the proportion of edge pixels to the total pixels to obtain the edge percentage.
[0118] In this embodiment, the Canny edge detection algorithm is used to extract image edges, with a high-to-low threshold ratio of 2:1 and a low threshold of 50. The proportion of edge pixels to the total number of pixels is used as the edge percentage. The edge percentage reflects the complexity of the building outline. For example, the edge percentage of eaves is usually high (0.15-0.25) because eaves have an upward-curving outline and rich edges; while the edge percentage of roof ridges is relatively low (0.05-0.10) because the roof ridge outline is relatively straight and simple.
[0119] S234: By using a preset rule mapping table, the feature combination of average brightness, texture density, and edge proportion is mapped to building type or component category, generating the final recognition result of the ancient building image.
[0120] In this embodiment, the rule mapping table (preferably with all points provided for a more realistic appearance) is pre-constructed by analyzing the statistical patterns of various ancient building images. The rule mapping table maps combinations of brightness mean intervals, texture density intervals, and edge proportion intervals to corresponding building types or component categories.
[0121] In this embodiment, the rule mapping table is as follows: when the average brightness is in the extremely dark range [0, 51], the texture density is in the medium-high range [0.4, 0.6], and the edge proportion is in the medium-low range [0.10, 0.15], it is determined to be a "palace building"; when the average brightness is in the slightly dark range [52, 102], the texture density is in the high range [0.6, 0.8], and the edge proportion is in the medium-high range [0.15, 0.25], it is determined to be a "dougong" component; when the average brightness is in the slightly dark range [52, 102], the texture density is in the medium-high range [0.10, 0.15], and the edge proportion is in the medium-high range [0.10, 0.15], it is determined to be a "dougong" component; when the average brightness is in the slightly dark range [52, 102], the texture density is in the medium-high range [0.6, 0.8], and the edge proportion is in the medium-high range [0.15, 0.25], it is determined to be a "dougong" component; when the average brightness is in the slightly dark range [52, 102], the texture density is in the medium-high range [0.10, 0.15], and the edge proportion is in the medium-high range [0.10, 0.15], it is determined to be a "dougong" component. When the brightness is in the low range [0.2, 0.4] and the edge proportion is in the low range [0.05, 0.10], it is identified as "official building"; when the average brightness is in the medium range [103, 153], the texture density is in the low range [0.2, 0.4], and the edge proportion is in the low range [0.05, 0.10], it is identified as a "roof ridge" component; when the average brightness is in the medium range [103, 153], the texture density is in the medium-high range [0.4, 0.6], and the edge proportion is in the medium-high range [0.15, 0.25], it is identified as... "Traditional dwellings"; when the average brightness is in the bright range [154,204], the texture density is in the low-to-medium range [0.2,0.4], and the edge proportion is in the medium range [0.10,0.15], it is judged as "Jiangnan dwellings"; when the average brightness is in the bright range [205,255], the texture density is in the low range [0.2,0.4], and the edge proportion is in the low range [0.05,0.10], it is judged as "bridge architecture"; when the average brightness is in the bright range [205,255], the texture density is in the high-to-medium range [… ... When the average brightness is in the dark range [0.4, 0.6] and the edge proportion is in the medium range [0.10, 0.15], it is judged as a "tomb building"; when the average brightness is in the dark range [52, 102], the texture density is in the high range [0.6, 0.8] and the edge proportion is in the high range [0.25, 0.35], it is judged as a "flying eaves" component; when the average brightness is in the medium range [103, 153], the texture density is in the medium-low range [0.2, 0.4] and the edge proportion is in the medium-high range [0.15, 0.25], it is judged as a "memorial archway".
[0122] It should be noted that when the target detection model and context feature inference fail to provide reliable results, this invention employs a fallback identification method based on heuristic backoff rules using average brightness, texture density, and edge proportion. First, average brightness narrows down the candidate range for building types from the perspective of overall brightness, providing a foundation for subsequent judgment. Second, texture density further refines the judgment from the perspective of surface complexity, distinguishing between components with fine textures and those with simple textures. Finally, edge proportion provides supplementary discriminative information from the perspective of contour complexity. These three factors combine to form a complete rule-based classification system. A pre-defined rule mapping table maps feature combinations to building types or component categories, ensuring the system can still output recognition results even in extreme scenarios. Adhering to the design principle of "functional usability takes precedence over functional completeness," this improves the system's usability and robustness.
[0123] S3: Using the recognition results of ancient building images as constraints, prompt words are constructed, and multi-level, multi-dimensional, and multilingual cultural interpretation content is generated through a large language model.
[0124] Specifically, such as Figure 4 As shown, step S3 specifically includes:
[0125] S31. Construct a prompt word template using the recognition results of the final ancient building image as constraints. The prompt word template includes building type constraints, component category constraints, and recognition confidence constraints.
[0126] In this embodiment, the prompt word template is designed as follows: The system first extracts the building type (e.g., "royal palace architecture"), component category (e.g., "dougong"), and recognition confidence (e.g., 0.85) from the recognition result into three structured fields: building type field (building_type, string type, value is a preset building type enumeration value), component category field (component_type, string type, value is a preset component category enumeration value, this field is empty when the recognition result is an overall building), and recognition confidence field (confidence, floating-point type, value range is 0 to 1), and then injects them into the preset prompt word template. The prompt word template contains the following constraints: building type constraint, specifying that the generated content must revolve around this type of building; component category constraint, specifying that the generated content must cover the technical features and cultural significance of the component; recognition confidence constraint, when the confidence is lower than the preset third threshold of 0.65, the prompt "The following interpretation is for reference only" is added to the generated content. This design ensures that the generated content is consistent with the building type or component features corresponding to the user-uploaded image, avoiding the generated content deviating from the actual recognition object.
[0127] S32. Call the large language model to generate at least three levels of cultural interpretation content based on the prompt word template, the three levels of depth including the initial level, the understanding level and the in-depth level;
[0128] In this embodiment, the initial understanding level is for users encountering this architectural type for the first time, providing an architectural overview and basic cultural information, including the building name, construction date, geographical location, basic functions, and a one-sentence cultural summary, with a reading time of approximately 1 minute. The comprehension level is for users who already understand the basic information, providing a deeper cultural background and historical context, including the evolution of architectural form, characteristics of construction techniques, changes in social functions, and cultural symbolism, with a reading time of approximately 3 minutes. The in-depth level is for users who wish to study in depth, providing professional architectural analysis and cross-cultural comparisons, including structural mechanics analysis, interpretation of decorative patterns, comparative analysis with contemporary Western architecture, and a review of academic research, with a reading time of approximately 5 minutes. The three levels of depth are progressive, and users can choose the appropriate level according to their own level.
[0129] S33. The cultural interpretation content at each depth level shall cover at least seven dimensions: architectural overview summary, sensory narrative, comparative stories of Chinese and Western architecture, learning suggestions, discussion guidance questions, bilingual summary, and mnemonic devices.
[0130] In this embodiment, the architectural summary provides basic information and historical background of the building; the sensory narrative describes the building's features through visual (e.g., "Looking up at the golden glazed tile roof of the Hall of Supreme Harmony, sunlight flows across the dragon-patterned ridge beasts"), tactile (e.g., "Gently touching the wooden components of the brackets, feeling the warmth of the thousand-year-old wood grain"), and spatial (e.g., "Passing through the Gate of Supreme Harmony, the view suddenly opens up, and the Hall of Supreme Harmony stands majestically on a three-tiered white marble platform"); the Sino-Western architectural comparison story compares and analyzes ancient Chinese architecture with Western architecture (e.g., comparing the Hall of Supreme Harmony with the Palace of Versailles in terms of spatial organization, structural methods, and cultural significance); the learning suggestions provide users with directions for subsequent learning and resource recommendations; the discussion guides questions to stimulate users' thinking and discussion (e.g., "What inspiration can the earthquake-resistant principle of the brackets provide for modern architecture?"); the bilingual summary provides a Chinese-English bilingual summary of the architectural culture; and the mnemonic rhyme helps users remember the key points of the architectural culture through rhythmic text (e.g., "Layered brackets with projecting eaves, mortise and tenon joints for earthquake resistance, majestic in the Tang and Song dynasties, elegant in the Ming and Qing dynasties, a thousand-year-old wooden construction technique").
[0131] S34 offers three output modes: Chinese, English, and bilingual. The bilingual mode is specifically designed for international students studying in China, displaying Chinese content in the left column and English content in the right column on the same page. It also supports terminology highlighting and click-to-lookup functions to help them overcome language barriers and understand the cultural connotations of ancient Chinese architecture.
[0132] It should be noted that this invention injects the recognition results as constraints into the cultural interpretation generation process, ensuring that the generated content remains consistent with the user-uploaded images. Firstly, the constraints on building type and component category in the prompt word template ensure that the generated content revolves around the actual recognition object, avoiding the problem of content generated by general-purpose language models deviating from the actual recognition object. Secondly, the three-level depth design provides differentiated cultural interpretation content for learners of different levels; the initial level lowers the entry barrier, while the in-depth level meets the needs of professional learning. Finally, the seven-dimensional content structure constructs a complete cultural interpretation system from multiple levels, including knowledge transfer (architectural overview), sensory experience (sensory narrative), cross-cultural understanding (Chinese-Western comparison), learning guidance (learning suggestions and discussion questions), language assistance (bilingual summary), and memory reinforcement (mnemonic devices), improving the relevance and systematic nature of the study tour content.
[0133] S4: A dual-track knowledge graph architecture is used to perform related queries on the recognition results of ancient building images and to recommend personalized learning paths based on the query results.
[0134] Specifically, the dual-track knowledge graph architecture includes a first-track professional engine and a second-track learning engine;
[0135] The first professional engine is built on a graph database (Neo4j), and the specific processing flow is as follows:
[0136] Input: Recognition results of ancient building images (building type or component category);
[0137] Processing method: The recognition results of ancient building images are mapped to corresponding nodes in the knowledge graph. The native graph traversal capability of the graph database is utilized to perform multi-hop association queries and shortest path queries through the Cypher query language. Adjacent nodes are traversed along semantic relationship edges (COMPARES_TO, SIMILAR_TO, CONTAINS, INFLUENCES, PARALLEL_TO). The association weight of each node is calculated based on the shortest path length. The shorter the path, the higher the association weight. Specifically, the association weight = 1 / the number of hops in the shortest path.
[0138] Output: A list of associated nodes and the association weights of each node, used for knowledge graph visualization and comparative analysis of Chinese and Western architecture.
[0139] The second-track learning engine is built on relational databases and graph computing libraries. The specific processing flow is divided into two stages: data storage and learning path recommendation.
[0140] Data storage phase: Relational databases store the following three types of data:
[0141] (1) Architectural professional nodes and their associated weights: These are queried by the first professional engine and output and written as the data basis for learning path recommendation;
[0142] (2) Knowledge node difficulty coefficient: preset value, ranging from 1 to 5, where 1 is the simplest and 5 is the most difficult, pre-marked according to the cognitive difficulty of architectural knowledge;
[0143] (3) Structured data of user learning behavior: including learning time, learning duration, answer records (including accuracy), review frequency and mastery level (three states: not learning, learning, and mastered).
[0144] Learning path recommendation stage: The graph computing library reads the above three types of structured data from the relational database, constructs a directed graph of learning paths starting from the nodes corresponding to the recognition results, and scores and ranks adjacent knowledge nodes based on the following four factors:
[0145] (1) User's historical learning record: Unlearned nodes have higher priority than learned nodes, and learned but not mastered nodes have lower priority.
[0146] (2) Knowledge node difficulty: Nodes with a difficulty coefficient of 2-4 have the highest priority, while nodes with a difficulty coefficient of 1 or 5 have a lower priority.
[0147] (3) Node association weight: The higher the association weight of a node (i.e., the closer the semantic relationship with the current recognition result), the higher the priority;
[0148] (4) User test results: Knowledge points with a test accuracy rate of less than 60% will be given priority for review;
[0149] Output: A sequence of knowledge nodes arranged in descending order of overall score, i.e., a personalized learning path.
[0150] Dual-track collaborative workflow:
[0151] When using a dual-track knowledge graph, the specific workflow is as follows:
[0152] Step 1: The recognition results of the ancient building images are input into the first professional engine. The graph database maps the recognition results into knowledge graph nodes, performs multi-hop association queries, and outputs a list of associated nodes and the association weight of each node.
[0153] Step 2: The list of associated nodes and associated weights output from the first track are written into the MySQL database of the second track as the data basis for the learning path recommendation;
[0154] Step 3: The graph computation library of the second track reads the list of associated nodes, association weights, knowledge node difficulty coefficients and user learning behavior data from the relational database, constructs a directed graph of learning paths, calculates the comprehensive score of each adjacent knowledge node, sorts them in descending order of score, and outputs personalized learning paths.
[0155] Step 4: The system pushes learning content to users according to their personalized learning paths. User learning behavior and test results are written to the MySQL database in real time for dynamic updates of the next round of learning path recommendations.
[0156] In the embodiments of this application, such as Figure 5 As shown, the first track uses a graph database (such as Neo4j) as its professional engine, utilizing its native graph storage and query capabilities to support multi-hop association queries and shortest path queries using the Cypher query language. The knowledge graph includes eight types of nodes: Chinese architectural nodes (such as the Hall of Supreme Harmony in the Forbidden City and the Hall of Prayer for Good Harvests in the Temple of Heaven), Western architectural nodes (such as the Palace of Versailles and the Parthenon), architectural component nodes (such as brackets, eaves, and column bases), dynastic nodes (such as Tang, Song, Ming, and Qing), regional nodes (such as Beijing, Suzhou, and Shanxi), architectural feature nodes (such as axial symmetry, mortise and tenon structure, and bracket support), cultural content nodes (such as symbols of ritual, feng shui concepts, and hierarchical systems), and nodes comparing Chinese and foreign structures (such as Chinese timber frame vs. Western stone frame). Nodes are connected by five semantic relationship edges: comparison (COMPARES_TO, e.g., Hall of Supreme Harmony COMPARES_TO Palace of Versailles), similarity (SIMILAR_TO, e.g., Yingxian Wooden Pagoda SIMILAR_TO Leaning Tower of Pisa), containment (CONTAINS, e.g., Imperial palace architecture CONTAINS dougong), influence (INFLUENCES, e.g., Tang Dynasty architecture INFLUENCES Japanese ancient architecture), and parallelism (PARALLEL_TO, e.g., Forbidden City in Beijing PARALLEL_TO Shenyang Imperial Palace). This track is used for knowledge graph visualization and systematic comparative analysis of Chinese and Western architecture.
[0157] In the embodiments of this application, such as Figure 5As shown, the second track uses a relational database (such as MySQL) to store structured data of architectural professional nodes and semantic relationship edges. It works in conjunction with a graph computing library (such as NetworkX) for learning path recommendation (i.e., calculating and ranking the comprehensive score of each knowledge node based on the user's historical learning records, knowledge node difficulty, node association weights, and user test results, and outputting a personalized learning path). The second track additionally stores user learning behavior data, including learning time, learning duration, answer records, review frequency, and mastery level, to drive the learning path recommendation algorithm. This dual-track architecture allows professional graph querying and learning path recommendation to use optimal technical solutions independently: the first track utilizes the native graph traversal capabilities of the graph database to achieve efficient multi-hop association queries, while the second track utilizes the transaction processing capabilities of the relational database and the algorithm library of the graph computing library to achieve personalized learning path recommendations.
[0158] In this embodiment, for example, when the identification result is "Imperial Palace Architecture," the system queries the "Dougong" node (CONTAINS), the "Ming and Qing Dynasties" node (INFLUENCES), the "Beijing" region node (CONTAINS), and the "Western Palaces" node (COMPARES_TO) associated with that node. The system determines whether the user has already learned the relevant knowledge points based on their learning history: if the user has not yet learned about "Dougong," the system adds it to the priority queue of the recommended learning path; if the user has learned about "Dougong" but not about "Central Axis Symmetry," the system recommends "Central Axis Symmetry" as the next learning node. Based on the comparative data of Chinese and foreign architecture in the knowledge graph, a comparative report of Chinese and foreign architecture is generated from multiple dimensions, including spatial organization, structural methods, and cultural significance. In this embodiment, the system has 22 sets of comparative data on Chinese and foreign architecture built in. Using the COMPARES_TO relationship data in the knowledge graph, it generates a comparative report from multiple dimensions such as spatial organization (e.g., axial symmetry vs. free layout), structural method (e.g., timber frame vs. stone frame) and cultural significance (e.g., ritual symbolism vs. religious symbolism), to help users understand the differences and connections between Chinese and Western architecture.
[0159] It should be noted that this invention expands single-image recognition results to include relational and comparative learning by constructing a dual-track knowledge graph architecture. First, the first track, a professional engine, utilizes the native graph storage and query capabilities of graph databases, supporting multi-hop relational queries and shortest path queries. This allows the system to automatically expand from a single recognition result to related buildings, components, dynasties, regions, and comparative objects from both China and abroad, forming a systematic knowledge network. Second, the second track, a learning engine, leverages the transaction processing capabilities of relational databases and the algorithm library of graph computing libraries, combined with user learning behavior data to drive learning path recommendations. This allows the recommended content to be dynamically adjusted based on the user's learning progress and mastery level. Finally, the dual-track architecture enables professional graph querying and learning path recommendation to use optimal technical solutions independently, improving the system's flexibility and scalability.
[0160] S5: Based on the personalized learning path recommendation, perform personalized learning and set downgrade processing strategies; during the personalized learning process, generate review tasks based on the interval repetition rule to dynamically adjust the priority of learning tasks and review tasks.
[0161] Specifically, such as Figure 6 As shown, step S5 includes:
[0162] S51. Based on the knowledge points of the user's current learning content in the personalized learning path recommendation, query the learning progress record and determine whether the knowledge point has entered the review cycle.
[0163] In this embodiment, the learning progress record stores the learning status (not learned, learning, mastered), number of reviews, last review time, and next review time for each knowledge point. Each time a user logs in, the system generates a list of tasks to be reviewed for the day based on a comparison between the current date and the next review time for each knowledge point, and sorts them according to their urgency.
[0164] S52. If the knowledge point enters the review cycle, a corresponding review task is generated. The review task includes three types of questions: true / false, multiple choice, and short answer. If the knowledge point does not enter the review cycle, the next knowledge point is recommended for learning according to the personalized learning path.
[0165] In this embodiment, the question types for the review tasks are dynamically selected based on the difficulty of the knowledge points and the number of reviews. The first review mainly consists of true / false and multiple-choice questions to reduce difficulty and enhance user confidence; the second review increases the proportion of multiple-choice questions; and the third and subsequent reviews gradually increase the proportion of short-answer questions to test the user's in-depth understanding. The question content is automatically generated based on the related content of the knowledge point in the knowledge graph. For example, for the knowledge point of "dougong" (bracket set), a true / false question might be "Dougong only serves a decorative purpose and does not have a structural function" (false); a multiple-choice question might be "Which of the following building components constitutes a dougong? A. Beam + Column B. Dou + Arch C. Rafter + Purlin D. Fang + Pad"; and a short-answer question might be "Briefly describe the earthquake resistance principle of dougong and its inspiration for modern architecture."
[0166] S53. Dynamically adjust the difficulty and review priority of subsequent learning content based on the user's correct answer rate. When the user's correct answer rate is lower than the preset lower threshold, reduce the difficulty and shorten the review interval. When the user's correct answer rate is higher than the preset upper threshold, increase the difficulty and extend the review interval.
[0167] In this embodiment, when a user's accuracy rate on a certain knowledge point is below 60%, the system reduces the difficulty of subsequent recommended content (e.g., from in-depth to understanding level) and shortens the review interval for that knowledge point to the previous cycle (e.g., from 7 days to 1 day), increasing the review frequency to strengthen memory. When the accuracy rate is above 90%, the system increases the difficulty of subsequent recommended content (e.g., from understanding level to in-depth level) and extends the review interval to the next cycle (e.g., from 14 days to 30 days), reducing unnecessary repetitive review. When the accuracy rate is between 60% and 90%, the current difficulty and interval remain unchanged. This adaptive adjustment mechanism allows the learning path to be dynamically optimized based on the user's learning performance.
[0168] S54. Based on the Ebbinghaus forgetting curve, design an interval repetition algorithm to schedule the next review. The interval repetition algorithm adopts a progressive interval review strategy of 0 days, 1 day, 7 days, 14 days, 30 days and 90 days, repeating step S51.
[0169] In this embodiment, each knowledge point is reviewed at progressive intervals of 0 days (same-day review), 1 day, 7 days, 14 days, 30 days, and 90 days after learning. After each review, the user's performance on the questions determines whether to enter the next interval cycle or reset the interval: if the user's correct answer rate reaches 80% or more in a review, the user enters the next interval cycle; if the correct answer rate is below 80%, the user is reset to the previous interval cycle for review.
[0170] It should be noted that this invention connects image recognition, cultural interpretation, knowledge graph query, learning path generation, and spaced repetition tasks into a continuous process, allowing users to enter a continuous learning process from a single image recognition session. First, a spaced repetition algorithm based on the Ebbinghaus forgetting curve is used to schedule reviews, reinforcing the learning content before the forgetting threshold and improving memory retention. Second, a dynamic question selection mechanism lowers the barrier to entry with simple questions in the initial review, gradually increasing the difficulty in subsequent reviews, conforming to the principle of gradual learning. Finally, an adaptive adjustment mechanism based on answer accuracy dynamically optimizes the difficulty of the learning content and the priority of reviews according to the user's learning effect, enabling the learning path to be personalized to different users' learning abilities, forming a complete research and learning closed loop of "recognition, interpretation, learning, review, and testing."
[0171] Embodiments of the present invention also include a degradation processing step, such as... Figure 7 As shown, the details are as follows:
[0172] When the object detection model service is unavailable, the system switches to a heuristic image feature analysis mode, using image brightness, texture density, and edge proportion for fallback identification. Specifically, after detecting an anomaly in the object detection model service, the system skips the object detection step in S3 and proceeds to the heuristic fallback identification rules in step S5. It generates identification results based on the image's average brightness, texture density, and edge proportion features, ensuring basic building recognition functionality is still available even when the model is unavailable.
[0173] When the large language model service is unavailable, the system reverts to a local template generation mechanism, generating basic cultural interpretation content based on preset cultural interpretation templates and recognition results. Specifically, after detecting an anomaly in the large language model service, the system retrieves a template corresponding to the recognition results from its local preset cultural interpretation template library, fills in the building type and component information, and generates basic cultural interpretation content. Each building type and component in the template library has a pre-stored summary description, basic cultural information, and brief comparison content. Although the content depth is less than that generated by the large language model, it ensures that basic cultural interpretation services are still provided when the model is unavailable.
[0174] The system pushes real-time analysis progress status to the client via the WebSocket protocol. This progress includes stages such as model loading, inference, and interpretation generation. Specifically, during AI analysis, the system pushes status information of the current processing stage to the client via a long-lived WebSocket connection, including states such as "model loading," "image inference," and "cultural interpretation generation," allowing users to understand the analysis progress in real time and avoid confusion caused by waiting.
[0175] It should be noted that this invention employs a degradation processing mechanism to switch to an alternative processing mode when the AI service malfunctions, ensuring that the core functions of the system remain usable even in abnormal situations. First, when the object detection model is unavailable, it switches to a heuristic image feature analysis mode. Although the recognition accuracy is slightly reduced, basic architectural recognition functions remain continuously available. Second, when the large language model is unavailable, it switches to a local template generation mechanism. While the depth and personalization of the generated content are reduced, basic cultural interpretation services remain continuously available. Finally, the analysis progress status is pushed in real time via the WebSocket protocol, allowing users to understand the current processing stage while waiting for AI analysis, thus improving the user experience. This degradation design principle of "functional availability over functional completeness" improves the system's availability and robustness in abnormal situations.
[0176] Example 2
[0177] A smart research and learning system for ancient buildings based on multi-level cascaded detection includes:
[0178] The input and preprocessing module is used to acquire the ancient building images input by the user and perform preprocessing to obtain the preprocessed ancient building images;
[0179] The cascaded recognition module is used to determine the recognition results of ancient building images based on a three-level cascaded recognition strategy that combines target detection, contextual feature inference, and heuristic backoff.
[0180] The cultural interpretation generation module is used to construct prompt words based on the recognition results of ancient building images, and generate multi-level, multi-dimensional, and multilingual cultural interpretation content through a large language model.
[0181] The knowledge graph module is used to construct a dual-track knowledge graph;
[0182] The learning path generation module is used to perform association queries on the recognition results of ancient building images using a dual-track knowledge graph architecture and to recommend personalized learning paths based on the query results.
[0183] The spaced repetition module is used to perform personalized learning based on the personalized learning path recommendation; during the personalized learning process, review tasks are generated based on the spaced repetition rule to dynamically adjust the priority of learning tasks and review tasks.
[0184] The degradation processing module is used to implement degradation processing strategies.
[0185] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for intelligent research and learning of ancient buildings based on multi-level cascaded detection, characterized in that, include: S1: Obtain the ancient building image input by the user, and perform preprocessing to obtain the preprocessed ancient building image; S2: The recognition result of ancient building images is determined by a three-level cascaded recognition strategy that combines object detection, contextual feature inference and heuristic backoff; S3: Using the recognition results of ancient building images as constraints, construct prompt words and generate multi-level, multi-dimensional, and multilingual cultural interpretation content through a large language model; S4: A dual-track knowledge graph architecture is used to perform association queries on the recognition results of ancient building images and to recommend personalized learning paths based on the query results; S5: Based on the personalized learning path recommendation, perform personalized learning and set downgrade processing strategies; In the personalized learning process, review tasks are generated based on the interval repetition rule to dynamically adjust the priority of learning tasks and review tasks.
2. The intelligent research and study method for ancient buildings based on multi-level cascaded detection according to claim 1, characterized in that, The three-level cascaded identification strategy includes: S21: Use a pre-trained target detection model to identify the pre-processed ancient building image to obtain the identified ancient building image, and obtain the first candidate identification result, bounding box position and first confidence score. When the first confidence score reaches the preset first threshold, output the first candidate identification result as the identification result of the final ancient building image. The identification result of the final ancient building image includes building type or component category. S22: When the first confidence level is lower than the preset first threshold, extract multi-dimensional image context features from the identified ancient building image, calculate the second confidence level based on the multi-dimensional image context features through weighted scoring, and output the corresponding first candidate recognition result as the final recognition result of the ancient building image when the second confidence level reaches the preset second threshold. S23: When the second confidence level is lower than the preset second threshold, a heuristic backoff rule is used to identify the identified ancient building image to obtain the final identification result of the ancient building image.
3. The intelligent research and study method for ancient buildings based on multi-level cascaded detection according to claim 2, characterized in that, Step S22 includes: S221. Perform HSV color space conversion on the identified ancient building image, and calculate the distribution statistics of each channel after conversion as color histogram features; the distribution statistics include at least mean, variance, skewness, and kurtosis. S222. The identified ancient building image is converted to grayscale, a multi-directional gray-level co-occurrence matrix is calculated, and texture GLCM features are extracted; the texture GLCM features include at least contrast, correlation, energy, and homogeneity; S223. Calculate the aspect ratio of the bounding box region in the identified ancient building image; S224. Calculate the similarity between the color histogram feature, texture GLCM feature, and aspect ratio feature and the preset reference feature templates for various types of buildings, and obtain the color histogram feature score. Texture GLCM feature score Aspect Ratio Feature Score The scores are then weighted to obtain a weighted score. ; S225, Weighted scoring The second confidence level is obtained by mapping the segmented threshold to the 0-1 interval through the segmented threshold mapping function. When the second confidence level reaches the preset second threshold, the corresponding first candidate recognition result is output.
4. The intelligent research and study method for ancient buildings based on multi-level cascaded detection according to claim 3, characterized in that, Step S23 includes: S231. Calculate the overall average brightness of the identified ancient building image; S232. Use a high-pass filter to extract the high-frequency texture components of the identified ancient building image, and perform binarization processing on the high-frequency texture components with a preset threshold to obtain a binary map of the high-frequency texture region. Calculate the proportion of the area of the high-frequency texture region to the total area as the texture density. S233. Use an edge detection algorithm to extract the image edges of the identified ancient building image, and calculate the proportion of edge pixels to the total pixels to obtain the edge proportion. S234: By using a preset rule mapping table, the feature combination of average brightness, texture density, and edge proportion is mapped to building type or component category, generating the final recognition result of the ancient building image.
5. The intelligent research and study method for ancient buildings based on multi-level cascaded detection according to claim 4, characterized in that, Step S3 includes: S31. The recognition result of the final ancient building image is used as a constraint to construct a prompt word template. The prompt word template includes building type constraint, component category constraint and recognition confidence constraint. The building type constraint specifies that the generated content must revolve around the building type. The component category constraint specifies that the generated content must cover the technical features and cultural significance of the component. When the recognition confidence constraint is lower than the preset third threshold, the prompt "The following interpretation is for reference only" is added to the generated content. S32. Call the large language model to generate at least three levels of cultural interpretation content based on the prompt word template. The three levels of depth include the initial understanding level, the comprehension level, and the in-depth exploration level. The cultural interpretation content of each level of depth covers at least seven dimensions: architectural overview summary, sensory narrative, comparative stories of Chinese and Western architecture, learning suggestions, discussion guidance questions, bilingual summary, and mnemonic devices. Three output modes are adopted: Chinese, English, and bilingual.
6. The intelligent research and study method for ancient buildings based on multi-level cascaded detection according to any one of claims 1-5, characterized in that, The dual-track knowledge graph architecture includes a first-track professional engine and a second-track learning engine. The first professional engine is built on a graph database and is used to map the recognition results of ancient building images to corresponding nodes in the knowledge graph. Through multi-hop association query and shortest path query, it traverses adjacent nodes along semantic relationship edges, calculates the association weight of each node based on the shortest path hop count, and obtains the association node list of the building professional node. Association weight = 1 / shortest path hop count. The second-track learning engine is built on relational databases and graph computing libraries, and consists of two stages: data storage and learning path recommendation. Data storage stage: Store three types of structured data from the architectural professional nodes of the first track professional engine: the list of related nodes and the related weights of each node, the difficulty coefficient of the preset knowledge nodes, and user learning behavior. User learning behavior includes at least learning time, learning duration, answer records, review frequency, and mastery level. Mastery level includes at least three states: not learning, learning in progress, and mastered. Learning path recommendation stage: The graph computing library reads the three types of structured data from the relational database, constructs a directed graph of learning paths starting from the nodes corresponding to the recognition results, and comprehensively scores and sorts adjacent knowledge nodes based on user's historical learning records, knowledge node difficulty, node association weight, and user test results. The personalized learning paths are obtained by arranging them in descending order of comprehensive scores.
7. The intelligent research and study method for ancient buildings based on multi-level cascaded detection according to claim 6, characterized in that, In step S5, during the personalized learning process, review tasks are generated based on spaced repetition rules to dynamically adjust the priority of learning and review tasks, including: S51. Based on the knowledge points of the user's current learning content in the personalized learning path recommendation, query the learning progress record and determine whether the current knowledge point has entered the review cycle. S52. If the current knowledge point enters the review cycle, a corresponding review task is generated. The review task includes three types of questions: true / false, multiple choice, and short answer. If the current knowledge point has not entered the review cycle, the next knowledge point is recommended for learning according to the personalized learning path. S53. Dynamically adjust the difficulty and review priority of subsequent learning content based on the user's correct answer rate. When the user's correct answer rate is lower than the preset lower threshold, reduce the difficulty and shorten the review interval. When the user's correct answer rate is higher than the preset upper threshold, increase the difficulty and extend the review interval. S54. Based on the Ebbinghaus forgetting curve, design an interval repetition algorithm to schedule the next review, repeating step S51 to form a closed loop of learning, review, and testing.
8. The intelligent research and study method for ancient buildings based on multi-level cascaded detection according to any one of claims 1-5 or 7, characterized in that, Degradation strategies include: When the target detection model service is unavailable, switch to the heuristic image feature analysis mode and perform fallback identification based on heuristic backoff rules; When the large language model service is unavailable, it will be downgraded to the local template generation mechanism, which generates basic cultural interpretation content based on the preset cultural interpretation template and recognition results. The analysis progress status is pushed to the client in real time via the WebSocket protocol. The analysis progress status includes the stages of model loading, inference, and interpretation generation.
9. The intelligent research and study method for ancient buildings based on multi-level cascaded detection according to claim 7, characterized in that, Step S1 also includes a text description input method, including inputting the building type, component type, or a natural language description of the ancient building image; The target detection model in step S21 is either the YOLOv8 target detection model or the Faster R-CNN target detection model. The high-pass filter in step S232 uses either the Sobel operator or the Laplacian operator; The edge detection algorithm in step S233 adopts the Canny edge detection algorithm; The mapping rule for the segmented threshold mapping function in step S225 is as follows: when the comprehensive score is greater than 0.8, the second confidence level is set to 0.82; when the comprehensive score is greater than 0.5, the second confidence level is set to 0.72; when the comprehensive score is greater than 0.2, the second confidence level is set to 0.
62. When the overall score is greater than 0.05, the second confidence level is set to 0.55; when the overall score is less than or equal to 0.05, the second confidence level is set to 0.
45. The graph database used during the construction of the first professional engine is Neo4j graph database; The second learning engine uses a relational database (MySQL) and a graph computing library (NetworkX). The interval repetition algorithm adopts a progressive interval review strategy of 0 days, 1 day, 7 days, 14 days, 30 days and 90 days. After each review, the user's answer performance determines whether to enter the next interval cycle or reset the interval: if the user's answer accuracy rate reaches or exceeds the preset probability in a certain review, then enter the next interval cycle; if the accuracy rate is lower than the preset probability, then reset to the previous interval cycle and review again.
10. A smart research and learning system for ancient architecture based on multi-level cascaded detection, used to implement the smart research and learning method for ancient architecture based on multi-level cascaded detection as described in any one of claims 1-9, characterized in that, include: The input and preprocessing module is used to acquire the ancient building images input by the user and perform preprocessing to obtain the preprocessed ancient building images; The cascaded recognition module is used to determine the recognition results of ancient building images based on a three-level cascaded recognition strategy that combines target detection, contextual feature inference, and heuristic backoff. The cultural interpretation generation module is used to construct prompt words based on the recognition results of ancient building images, and generate multi-level, multi-dimensional, and multilingual cultural interpretation content through a large language model. The knowledge graph module is used to construct a dual-track knowledge graph; The learning path generation module is used to perform association queries on the recognition results of ancient building images using a dual-track knowledge graph architecture and to recommend personalized learning paths based on the query results. The spaced review module is used for personalized learning based on the personalized learning path recommendation. In the personalized learning process, review tasks are generated based on spaced repetition rules to dynamically adjust the priority of learning and review tasks; The degradation processing module is used to implement degradation processing strategies.
