Methods, systems, equipment and media for identifying types of building materials of traditional residential buildings
Through the target detection algorithm based on the YOLOv8x-seg model, it is subdivided into 34 types of traditional residential building materials, which solves the problem of full-domain recognition, realizes the rapid and accurate recognition and distribution research of traditional Chinese residential building materials, and improves the recognition accuracy and model applicability.
Patent Information
- Application Number
- CN202510056934.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-01-14
AI Technical Summary
Existing technologies lack a systematic identification method for the types of building materials of traditional residential buildings across China, especially in rural areas, and have failed to conduct detailed material classification research. They mainly rely on remote sensing images and ground photos, and lack nationwide datasets and detection models.
Using the target detection algorithm based on the YOLOv8x-seg pre-trained model, by constructing training and validation sets, the types of building materials of traditional Chinese residential buildings are identified. They are divided into roofing and wall materials, which are further subdivided into 34 types. The model is trained and optimized in combination with independently collected image datasets to identify traditional residential building materials across the country.
It achieves rapid and accurate identification of traditional residential building materials across the country, provides full-area coverage of identification results, supports research on the distribution of traditional residential building material types, reduces research costs, and improves identification accuracy and model generalization capabilities.
Smart Images

Figure CN119810566B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of traditional building material identification, and specifically relates to a method, system, electronic equipment and storable medium for identifying the type of traditional residential building materials based on a target detection algorithm. Background Art
[0002] my country currently possesses a vast number of extant traditional dwellings from various historical periods. These samples are numerous and widely distributed, utilizing a rich variety of building materials and diverse construction techniques. Existing research often focuses on the types and morphologies of traditional dwellings in a specific region, but rarely systematically examines traditional dwellings across the country from the perspective of material type. Consequently, a comprehensive understanding of existing traditional dwelling building materials is lacking, and identifying these building material types presents challenges. Furthermore, current research on traditional dwellings struggles to systematically and comprehensively survey and collect samples nationwide, making it difficult to characterize the distribution of material types across the entire population through field surveys. Therefore, it is necessary to establish a detection model that can quickly and easily identify the material types of traditional dwellings in rural areas.
[0003] The main problems with the current detection methods for building material types of traditional Chinese residential buildings:
[0004] (1) No detection methods for traditional residential building materials have been proposed. Existing technologies focus on the identification of buildings, bridges, roads and other facilities in remote sensing images, as well as the detection of urban construction and municipal pipeline safety. There is a lack of identification and detection of traditional building materials in rural areas.
[0005] (2) No method for detecting the types of building materials used in traditional Chinese residential buildings has been proposed. Existing research on material types in China, on the one hand, focuses on local areas and is mostly based on the perspective of construction techniques. On the other hand, the depth of material type research remains at the level of relatively broad natural material categories such as stone and wood, without detailed research on specific stone types and wood types.
[0006] (3) No detection method that uses a combination of ground photos and drone-viewed photos as a dataset has been proposed. Existing detection methods mainly use ground photos or remote sensing images as basic datasets. Summary of the Invention
[0007] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a method, system, electronic device and storable medium for identifying the types of building materials for traditional residential buildings based on a target detection algorithm. This identification method first classifies the building materials for traditional Chinese residential buildings according to the material application enclosure parts during the construction process, that is, the roof and wall are used as identification parts to divide the material types, and classification standards for building material types are formulated respectively. Secondly, by controlling and adjusting the model parameters of the training set and the validation set, an optimized model for identifying the types of building materials for traditional Chinese residential buildings is obtained based on the YOLOv8x-seg pre-trained weight model, and the national traditional residential image dataset is input to obtain the recognition results. This method can be used for the rapid and accurate identification of traditional residential building materials with different materials and construction methods in various regions across China, and the recognition results can serve as a demonstration support for the study of the distribution of building material types for traditional residential buildings across China.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] In a first aspect, the present invention provides a method for identifying the types of building materials of traditional residential buildings based on a target detection algorithm. The identification method is targeted at identifying a traditional Chinese residential building, and the identification part is the building's enclosure, including the roof and walls, and comprises the following steps:
[0010] S1. Establish a standard for the types of building materials for traditional Chinese residential buildings: Based on public literature and material characteristics, the types of building materials for traditional Chinese residential buildings are summarized and classified into 30 types, including 12 types of roofing materials and 18 types of wall materials, with a total of 34 material sub-categories.
[0011] S2. Create training and validation sets: Collect images from public image data websites using the keyword "material type + traditional dwellings". Split the collected dataset into a training set T and a validation set Y in an 8:2 ratio. Both training set T and validation set Y contain 30 material types. Annotate the building material types in the images in training set T and validation set Y.
[0012] S3. Train the recognition model: Use the training set T created in the previous step to train the YOLOv8x-seg pre-trained model and verify it on the validation set Y to obtain a model for identifying the types of building materials in traditional Chinese residential buildings.
[0013] S4. Input the image containing the traditional Chinese residential building to be tested into the traditional residential building material type recognition model for recognition, and obtain the building material type recognition result in the image by calculation.
[0014] Furthermore, in step S1, through the review of existing historical data and documents, it was discovered that natural materials were first used by ancient working people and corresponding construction techniques were developed. Subsequently, bricks and tiles appeared and were widely used in the construction of traditional residential buildings through processing. Based on this, a classification framework covering the types of materials used in traditional residential buildings in various regions of China was formed, namely the classification of traditional craft building materials such as bricks and tiles and natural materials such as stone, earth, wood, tiles, grass and bamboo. Traditional residential building materials were classified into a secondary level based on factors such as the characteristics, shape, type and construction technology of each material. 12 types of roofing materials and 18 types of wall materials were formed. In addition, due to the differences in color and construction techniques of different building materials during the training process, the image characteristics of the same material type will vary greatly, thus affecting the accuracy of model recognition. Therefore, based on the original basic material types, some secondary material types were subdivided into smaller categories, ultimately resulting in 34 subdivided material types.
[0015] Specifically, the characteristics of each type of material are:
[0016] (1) Roofing materials:
[0017] The first type of roofing material is grey tiles. They are characterized by their greyish-blue color, fired form, and curved surface. This is denoted as WM_W_QW.
[0018] The second type of roofing material is red tiles. They are characterized by their reddish-brown color, fired form, and curved surface. This is denoted as WM_W_HW.
[0019] The third type of roofing material is glazed tile. Its characteristics are: it is made from fired tiles with a colored glaze applied to the surface. The colors are mostly golden or green, and the glaze gives the tile a glossy finish. It is denoted as WM_W_LLW. Because it comes in two colors, it is further subdivided into two subcategories: WM_W_LLW_HS and WM_W_LLW_LS.
[0020] The fourth type of roofing material is Burmese tiles. They are characterized by a bluish-gray color, a slightly curved surface, a square shape, and are unglazed. This is denoted as WM_W_MW.
[0021] The fifth roofing material type is seagrass. Its characteristics are: whitish-gray color and soft texture. It is denoted as WM_C_HC.
[0022] The sixth type of roofing material is thatch. Its characteristics are: yellow or golden yellow in color, and the stems used for the roof are straight and spike-like. This is denoted as WM_C_MC.
[0023] The seventh roofing material type is wheat straw. Its characteristics are: it is black in color due to its susceptibility to mold, and the roof is mostly composed of straw. This is denoted as WM_C_MJC.
[0024] The eighth type of roofing material is wood panels. Its characteristics are: brown or wood-colored, slightly longer than tiles, and in the form of long strips. This is denoted as WM_M_MBP.
[0025] The ninth roofing material type is bark. Its characteristics are: brown or white in color, long, flake-like shapes, and it's mostly made from the bark of fir or cypress trees. This material is denoted as WM_M_SP.
[0026] The tenth type of roofing material is plaster. Its characteristics are: yellowish-brown or light yellow in color, and a fine surface texture. It is denoted as WM_T_MN.
[0027] The eleventh roofing material type is sandstone. Its characteristics are: reddish-brown or red, a fine, frosted surface, and rectangular flakes. This is denoted as WM_S_SY.
[0028] The 12th roofing material type is shale. Its characteristics are: grayish white or grayish black color, and thin flaky layers. It is denoted as WM_S_YY.
[0029] (2) Wall materials:
[0030] The first type of wall material is blue brick. Its characteristics are: blue-gray color, and it is a fired brick. It is denoted as QM_Z_QZ.
[0031] The second wall material type is red brick. Its characteristics are: reddish-brown color, and it is a fired brick. It is denoted as QM_Z_HZ.
[0032] The third wall material type is wood. Its characteristics are: brown or tan color, wood texture and grain, heartwood and sapwood, and long strips. This is denoted as QM_M_MB.
[0033] The fourth wall material type is logs. Its characteristics are: brown or brown color, wood texture and grain, and it is composed of 10-20cm round logs, denoted as QM_M_MZ.
[0034] The fifth type of wall material is rammed earth. Its characteristics are: it is made of compressed mud blocks, the wall surface is relatively complete with no traces of masonry, and its color is khaki. This is denoted as QM_T_HT.
[0035] The sixth wall material type is adobe. Its characteristics are: it is made of bricks made of mud, has a yellowish-brown color, and has gaps in the wall. This is denoted as QM_T_TP.
[0036] The seventh wall material type is bamboo strips. Its characteristics are: it is woven from bamboo strips, has a net-like texture, and is light yellow or yellow in color. It is denoted as QM_Z_ZM.
[0037] The eighth wall material type is bamboo poles. Its characteristics are: they are made from split bamboo and bundled together, with columnar texture and a light yellow color. This material is denoted as QM_Z_ZG.
[0038] The ninth type of wall covering material is felt. Its characteristics are: made from the hair or skin of nomadic livestock, it's often black or dark yellow in color, and has a rough surface. This material is denoted as QM_B_ZB. Based on its characteristics, it is further divided into three subcategories: QM_B_ZHB_FBB, QM_B_ZHB_HZ, and QM_B_ZHB_SJZZ.
[0039] The tenth wall material is woven fabric. Its characteristics are: made of cotton, linen, and textiles, mostly white, with patterns, and a smooth surface. This material is denoted as QM_B_ZB. It is divided into two subcategories based on these characteristics: QM_B_ZB_MGB and QM_B_ZB_HZ.
[0040] The eleventh wall material is granite. Its characteristics include a uniform texture, primarily yellow, white, and black, and a dense, even, speckled texture due to the presence of quartz. Its shapes are mostly blocks and strips. This material is denoted as QM_S_HGS.
[0041] The 12th wall material is marble. Its characteristics include a fine matrix, uneven particle size, and a striped texture due to the presence of banded minerals. Its colors range from gray, white, cyan, and yellow. Its shapes are mostly blocks and stripes. It is denoted as QM_S_DLS.
[0042] The 13th wall material is sandstone. Its characteristics include a light brown or red color, a fine surface, a stable texture, no impurities, and a frosted feel. It is often shaped like blocks or strips. It is denoted as QM_S_SS.
[0043] The 14th wall material is slate. Its characteristics are: its structure results in a plate-like or flattened surface with an uneven surface. Its color is often cyan or gray. It is denoted as QM_S_BS.
[0044] The 15th wall material is pebbles. Their characteristics are: Due to river erosion, their shapes are mostly round or oval, with no sharp corners. Their surface is smooth, and their colors are mostly yellow or white. This is denoted as QM_S_LS.
[0045] The 16th wall material is volcanic stone. Its characteristics are: a porous surface with a honeycomb pattern, a predominantly black color, and a mostly blocky shape. This material is designated QM_S_HSS.
[0046] The 17th wall material is oyster shell. Its characteristics are: the wall is mostly grayish white in color. It is denoted as QM_TS_HK.
[0047] The 18th wall material is bark. Its characteristics are: it is made from the bark of trees such as birch and fir, and its color is grayish white or dark brown. It is denoted as QM_M_SP.
[0048] Furthermore, the image requirements for the training set T, validation set Y, and test dataset D used in step S2 are as follows:
[0049] (1) YOLOv8 is a target detection algorithm that analyzes and processes input images to identify target objects and their location information. The default image size in the model algorithm is set to 640 pixels. If the image pixels used for training recognition are lower than this precision, the accuracy of the model recognition will be affected. In addition, to ensure that the characteristics of traditional building materials can be accurately identified, the photos should clearly show the color, material, texture, etc. of each type of material. Therefore, when constructing dataset D, the image size is selected to be no less than 640*640, and the image format is jpg.
[0050] (2) Since the recognition method of the present invention is a recognition method for building materials, the recognition subject is traditional Chinese residential buildings, and the recognition parts are the building's enclosure parts, namely the roof and walls. In order to avoid the difficulty in identifying the characteristics of the building materials in the image due to the small area of the characteristic pixels of the building materials in the training process, it is necessary to ensure that the collected image content should contain one or more complete walls and roofs.
[0051] (3) Since the traditional residential building materials to be identified and detected are mainly the walls and roofs of the buildings, the selection of image angle is the key. To ensure the final recognition effect, the selected images should be mainly front-facing photos, and the angle of side photos should not exceed 30°. Images with too tilted shooting angles will not be used as training set data.
[0052] Furthermore, in step S2, since there is currently no public dataset of Chinese traditional residential building material types for use in the present invention, the present invention collects and produces a training set T and a verification set Y of traditional residential building material types.
[0053] The image collection process is as follows: Based on the characteristics and composition of the above-mentioned types of materials, determine the image examples of building material types ( Figure 2a and Figure 2b ), enter "building material type + traditional dwellings / residential buildings" as keywords on the public image data platform, and compare the identified image examples to obtain images of traditional residential buildings containing one or more material types. Because collected data images often contain multiple materials, a single image can form multiple training sample labels. Therefore, when calculating the training data sample size for each secondary classification, images are categorized according to the material with the largest proportion in the image, ensuring that each secondary classification contains at least 120 images. In other words, the total image data volume of the final training set T and validation set Y is at least 3,600.
[0054] The collected dataset was annotated using the LabelMe image annotation tool. LabelMe is an open-source image annotation tool designed to help users create image datasets, particularly for image annotation in computer vision tasks. It provides an intuitive graphical user interface (GUI) that allows users to easily annotate objects in images with shapes such as rectangles, circles, and polygons. LabelMe supports multiple annotation methods, including object classification, bounding box annotation, and segmentation annotation, and is widely used in fields such as object detection, image segmentation, and deep learning model training. LabelMe annotation results are typically saved in JSON format, containing the coordinates and category information of each annotated object.
[0055] Specifically, all wall and roof materials appearing in each image are annotated according to their outer contours. Because the final detection is based on the segmentation function of the YOLO series, the image mask formed by the outer contours is crucial for recognition accuracy. Furthermore, the annotated coordinate anchor points must be within the image bounds to prevent out-of-bounds errors during data loading or expansion.
[0056] Furthermore, in step S3, the YOLOv8-seg pre-trained weight model selected is a publicly available object detection and image segmentation model. There are many versions of the YOLOv8-seg pre-trained weight model, among which the YOLOv8x-seg series of pre-trained weight models performs best in terms of accuracy, detection precision, and performance, and is suitable for scenarios requiring high-precision target detection. The present invention is used in the identification of building material types in traditional Chinese residential buildings. The image scenes are complex, and the materials are rich in color and diverse in shape. Using YOLOv8x-seg can improve the precision and accuracy of model recognition. To obtain the YOLOv8x-seg pre-trained weight model: Download the YOLOv8 network data configuration file from the official website of the code and software development platform GitHub.
[0057] Specifically, the network structure of the YOLOv8 model includes the input end, the backbone network, the neck network, and the head output end connected in sequence. The training set T, the validation set Y, and the image set D to be identified are input into the YOLOv8 network model for model training as follows:
[0058] (1) Input: Image preprocessing. The labeled training set and validation set are fed into the input of the model. The input preprocesses the images in the training set. The preprocessing includes adaptive image resizing, converting segmentation labels into masks, and performing normalization.
[0059] (2) Backbone network: Image feature extraction. The preprocessed image enters the Backbone network, which includes the CBS module, C2F module, and SPPF module. The CBS module performs convolution on the input image, the C2F module extracts image features, and the SPPF module performs data splicing. Finally, three feature maps of different scales are obtained.
[0060] (3) Neck network: image feature fusion. The three feature maps of different scales obtained in the previous step are input for feature fusion. Using the FPN+PAN method, the features extracted by the feature extraction module are used to enable the model to obtain feature maps of three scales.
[0061] (4) Prediction output: The feature map obtained in the previous step is input to the head output end, thereby obtaining the position of the mask, the position of the prediction box, the category and the confidence level; in the training phase, the prediction box is matched with the real box to obtain positive and negative samples, and then the weight parameters are adjusted by calculating the loss function. In the verification phase, the prediction box is screened by weighted non-maximum suppression, and the model parameters are continuously optimized by calculating the accuracy and average precision.
[0062] Furthermore, in step S3, the transfer learning training process for training and acquiring the Chinese traditional residential building material type recognition model is as follows:
[0063] (1) Custom configuration file: Customize the YOLOv8 network model data configuration file wjm2.yaml, including filling in the dataset path, the number of categories nc, and the identification category names;
[0064] (2) Tuning parameters and training model: Place the set wjm2.yaml file into a computer with a configured environment; load the YOLOv8x-seg pre-trained weight model, whose format is yolov8x-seg.pt, and obtain the network model initialization parameters; load the training set T and the validation set Y, set the YOLOv8x-seg pre-trained weight model hyperparameters, set the number of training iterations to 500 generations, the initial learning rate to 0.01, the weight decay rate to 0.001, the batch size to 30 and start training; repeat the training process to make the YOLOv8x-seg pre-trained weight model gradually converge, and continuously adjust the data set through the test of the validation set to make it have generalization ability and improve accuracy.
[0065] (3) Model acquisition: During the training process, the validation set Y verification result data is observed in real time. After the training is completed, the optimal model BEST.pt is saved and recorded as the Chinese traditional residential building material type recognition model.
[0066] S5. Create a test dataset: Collect images from public image data websites in the form of "county-level administrative units + traditional dwellings" to form a test dataset D;
[0067] S6. Test the model for identifying building material types of traditional Chinese residential buildings: input the images in the test dataset D into the model for identifying building material types of traditional residential buildings for identification; set the image to be saved in txt document, and obtain the building material type identification results and txt document results of each traditional residential image through calculation. The image recognition results include material type labels, detection frames, masks, and confidence scores. Each detection frame corresponds to a material type, mask, and confidence score. The detection frame defines the rectangular boundary of the material type area, the mask represents the specific shape and position of the building material appearing in the image, and the confidence represents the probability of the material existing in the detection frame and the degree of certainty that the existing material belongs to a certain category; the txt document results include the category and the location information of the detection frame.
[0068] Furthermore, in step S5, the test dataset D is composed of images of traditional dwellings of various county-level administrative units in China. The images are collected using a public image data website, and the keywords "name of China's county-level unit" + "traditional dwellings" are input for search. The images of traditional dwellings of the county-level administrative unit are verified and obtained, and the images are named after the county-level unit to produce a test dataset D with geographic semantic information. The use of county-level administrative units is mainly due to the following considerations: First, the purpose of the present invention is to identify the building materials of various types of traditional dwellings in China, and the images must have the semantics of national geographic spatial information. Secondly, at the scale of counties, the materials used for building construction are similar. At larger administrative units such as provinces and cities, the geographical environment range is too large, which easily leads to weak characteristic distribution of types. At the smaller township level, there are fewer sources of available image datasets, and obtaining comprehensive data is difficult and time-consuming.
[0069] In step S6, the images in the test dataset D are input into the Chinese traditional residential building material type recognition model for calculation. The result is saved as a txt file, resulting in image recognition results and txt file results for each traditional residential building. The image recognition results include a material type label, a detection frame, a mask, and a confidence score. Each detection frame corresponds to a category, mask, and confidence score. The detection frame defines the rectangular boundary of the material type, the mask represents the specific shape and location of the building material appearing in the image, and the confidence score represents the probability of the material existing within the detection frame and the degree of confidence that the material belongs to a certain category. The txt file results include the category and the detection frame's location information.
[0070] Specifically, the image recognition results for each traditional dwelling are written into a separate txt file, with the file name consistent with the source image. Each txt file contains one or more records, with each record corresponding to the category recognition result and mask location information for an object within a detection box in the image recognition results. Specifically, each record contains the following information:
[0071] ① Category. 0, corresponding to QM_B_ZB_MGB; 1, corresponding to QM_B_ZB_HZ; 2, QM_B_ZHB_HZ; 3, corresponding to QM_B_ZHB_SJZZ; 4, corresponding to QM_B_ZHB_FBB; 5, corresponding to QM_M_MB; 6, corresponding to QM_M_MZ; 7, corresponding to QM_T_HT; 8, corresponding to QM_T_TP; 9, corresponding to QM_Z_QZ; 10, corresponding to QM_Z_HZ; 11, corresponding to QM_S_DLS; 12, corresponding to QM_S_SS; 13, corresponding to QM_S_HGS; 14, corresponding to QM_S_BS; 15, corresponding to QM_S_HSS; 16, corresponding to QM_S_LS; 17, corresponding to Q M_Z_ZM; 18, corresponds to QM_Z_ZG; 19, corresponds to QM_TS_HK; 20, corresponds to QM_S_XWY; 21, corresponds to WM_W_MW; 22, corresponds to WM_W_HW; 23, corresponds to WM_W_QW; 24, corresponds to WM_W_LLW_HS; 25, corresponds to WM_W_LLW_LS; 26, corresponds to WM_S_SY; 27, corresponds to WM_S_YY; 28, corresponds to WM_C_MJC; 29, corresponds to WM_C_HC; 30, corresponds to WM_C_MC; 31, corresponds to WM_M_MBP; 32, corresponds to WM_M_SP; 33, corresponds to WM_T_MN; 34, corresponds to QM_M_SP.
[0072] ② Mask coordinate points. These record the specific location and shape of a particular building material type within the image. They can be used to calculate spatial characteristics such as the area, shape, and proportion of the material type. Retaining the txt file containing the coordinate points enriches the recognition results for traditional residential building material types and serves as an important basis for subsequent practical applications and research.
[0073] In a second aspect, the present invention provides a light traditional residential building material type identification system for executing the above-mentioned traditional residential building material type identification method, the traditional residential building material type identification system comprising:
[0074] The building material type standard construction module is used to summarize and summarize the types of building materials for traditional Chinese residential buildings based on public literature and material characteristics. The building materials for traditional Chinese residential buildings are divided into 30 types, including 12 types of roofing materials and 18 types of wall materials.
[0075] The training set and validation set creation module is used to collect images from public image data websites using the keyword "material type + traditional dwellings", divide the collected data set into a training set T and a validation set Y in an 8:2 ratio, and annotate the building material types in the images of the training set T and validation set Y.
[0076] The recognition model training module is used to train the training set T created by the previous training set and validation set creation module based on the YOLOv8x-seg pre-trained model and verify it on the validation set Y to obtain a model for identifying the types of building materials in traditional Chinese residential buildings.
[0077] The residential building image recognition module is used to input an image containing a traditional Chinese residential building to be tested into a traditional residential building material type recognition model for recognition, and obtain the building material type recognition result in the image through calculation.
[0078] In a third aspect, the present invention provides an electronic device comprising a processor and a memory for storing a program executable by the processor, wherein when the processor executes the program stored in the memory, the method for identifying the type of building materials of traditional residential buildings described above is implemented.
[0079] In a fourth aspect, the present invention provides a storage medium storing a program, which, when executed by a processor, implements the above-mentioned method for identifying the type of building materials of traditional residential buildings.
[0080] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0081] (1) The method of the present invention is based on the YOLOv8x-seg pre-trained model and combined with the independently collected building residential data set to propose an innovative model specifically for the rapid identification and detection of building residential materials. This method fills the current gap in the field of traditional building material image recognition and provides technical support for the efficient and accurate identification of various building materials. By deeply optimizing the YOLOv8x-seg pre-trained model and adjusting it to the particularity of traditional residential building materials, we modify the hyperparameters and optimize the model structure to make it more suitable for material identification and detection tasks in this field. During the model optimization process, the weight decay rate is particularly adjusted to enhance the generalization ability of the model. This improvement enables the model to show higher recognition accuracy in different types of building materials and different building parts. Through this optimization, we can more accurately identify various material types in traditional residential buildings, which not only improves the accuracy of detection but also expands the application scope of the model. The application of this technology will greatly promote the digital protection and restoration of traditional building materials.
[0082] (2) The method of the present invention comprehensively applies the classification theories of multiple disciplines such as architecture, typology, botany, and materials science to carry out a fine subdivision of the types of building materials of traditional Chinese residential buildings. By referring to a large number of relevant literatures and combining actual survey data, 30 representative types of traditional building materials are systematically summarized and extracted. These material types cover the types of traditional residential building materials in various regions of the country. For each material type, corresponding image data are carefully selected, and a high-quality training data set is constructed. This data set contains image data of 30 types of traditional residential building materials, covering traditional material types in different regions, different architectural styles and usage scenarios, and has strong representativeness and wide adaptability. Through training with these data, the present invention realizes the accurate identification of traditional residential building materials across the country, ensuring that all types of traditional materials in traditional residential buildings can be effectively identified and classified, and achieving the full coverage effect of the identification of traditional residential building material types across the country.
[0083] (3) The technology of this invention can be used for the rapid identification and detection of traditional residential building materials across the country. By utilizing the detection model formed by this technology and drawing on data from public image data websites, the distribution of different types of traditional residential building materials across the country can be effectively studied. This greatly reduces the human and material costs required for research. Ultimately, the research results will contribute to the application of traditional building materials with regional characteristics in the protection and restoration of traditional residential buildings across the country. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0085] Figure 1 This is a flowchart of the steps of a method for identifying the types of building materials of traditional Chinese residential buildings based on a target detection algorithm disclosed in the present invention;
[0086] Figure 2a This is an example diagram of some roofing material types among the 30 types of building materials disclosed in this invention. Figure 2b This is an example diagram of another part of the wall material types among the 30 types of building materials disclosed in the present invention;
[0087] Figure 3a This is a record of some optimal model training parameters obtained after multiple experiments in Example 1 of the present invention; Figure 3b This is another part of the optimal model training parameter record diagram obtained after multiple experiments in Example 1 of the present invention;
[0088] Figure 4 is a partial image recognition result of the input recognition model of the image set D to be recognized in Example 1 of the present invention;
[0089] Figure 5a is a schematic diagram comparing some recognition results of the models in Examples 1 and 2 of the present invention. Figure 5b is a schematic diagram comparing another part of the recognition results of the models in Examples 1 and 2 of the present invention, Figure 5c 2 is a schematic diagram comparing another part of the recognition results of the models in Examples 1 and 2 of the present invention;
[0090] Figure 6 This is a structural block diagram of a system for identifying building material types of traditional Chinese residential buildings in Example 3 of the present invention;
[0091] Figure 7 It is a structural block diagram of an electronic device in embodiment 4 of the present invention. DETAILED DESCRIPTION
[0092] To make the implementation objectives, technical solutions, and advantages of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0093] Example 1
[0094] This embodiment specifically discloses a method for identifying the types of building materials of traditional Chinese residential buildings based on a target detection algorithm. Figure 1 As shown, this identification method includes the following steps:
[0095] S1. Establish a standard for building materials for traditional Chinese residential buildings: The types of building materials for traditional Chinese residential buildings were obtained by sorting out public literature data. According to the standard for building materials for traditional Chinese residential buildings, the materials were classified into 12 types of roofing materials and 18 types of wall materials.
[0096] In step S1 of this embodiment, the construction of traditional Chinese residential building material types is based on a combination of extensive literature review and expert opinions, forming a classification covering 30 major traditional residential building material types in various regions of China. Building materials are classified according to the characteristics, color, shape, construction application method, and type of each type of material. Due to the differences in color and construction techniques of different building materials, the image characteristics of the same material type will vary greatly, thus affecting the accuracy of model recognition. Therefore, based on the original basic material types, some material types are subdivided into subcategories. Ultimately, the 34 subdivided material types are obtained, as shown in Table 1.
[0097] Table 1. Information on building materials of traditional residential buildings
[0098]
[0099] The training set T for this example contains 3,599 sample images of 34 sub-types of traditional dwellings, for a total of 19,086 samples. The validation set Y for this example contains 900 sample images of 34 target types of traditional dwellings, for a total of 5,323 samples. The collected dataset was annotated using the Labelme image annotation tool. Specifically, all wall and roof materials appearing in each image were labeled according to their outer contours.
[0100] S3. Train the recognition model: Use the training set T created in the previous step to train the model based on the YOLOv8x pre-trained weight model and verify it on the validation set Y to obtain a model for identifying the types of building materials in traditional Chinese residential buildings.
[0101] In step S4 of this embodiment, the transfer learning training process for training and acquiring the Chinese traditional residential building material type recognition model is as follows:
[0102] (1) Custom configuration file: Customize the YOLOv8 network model data configuration file wjm2.yaml, including filling in the path of the dataset, the number of categories nc is 34, and the identification category names names are QM_B_ZB_MGB; QM_B_ZB_HZ; QM_B_ZHB_HZ; QM_B_ZHB_SJZZ; QM_B_ZHB_FBB; QM_M_MB; QM_M_MZ; QM_T_HT; QM_T_TP; QM_Z_QZ; QM_Z_HZ; QM_S_DLS;QM_S_SS;QM_S_HGS;QM_S_BS;QM_S_HSS;QM_S_LS;QM_Z_ZM;QM_Z_ZG;QM_TS_HK; _W_QW;WM_W_LLW_HS;WM_W_LLW_LS;WM_S_SY;WM_S_YY;WM_C_MJC;WM_C_HC;WM_C_MC;WM_M_MBP;WM_M_SP;WM_T_MN;QM_M_SP
[0103] (2) Tuning parameters and training model: Place the set wjm2.yaml file into a computer with a configured environment; load the YOLOv8x-seg pre-trained weight model, whose format is yolov8x-seg.pt, and obtain the network model initialization parameters; load the training set T and the validation set Y, set the YOLOv8x pre-trained weight model hyperparameters, set the number of training iterations to 500 generations, the initial learning rate to 0.01, the weight decay rate to 0.001, the batch size to 30 and start training; repeat the training process to make YOLOv8 gradually converge, and continuously adjust the data set through the test of the validation set to make it have generalization ability and improve accuracy.
[0104] (3) Model acquisition: During the training process, the validation set Y validation results are observed in real time. After the training is completed, the optimal model BEST.pt is saved and recorded as the Chinese traditional residential roof type recognition model. The training results of the Chinese traditional residential roof type recognition model on the validation set are as follows: the detection box (Box) Precision is 0.70, Recall is 0.65, mAP@0.5 is 0.66, and mAP@0.5:0.95 is 0.53. The mask (Mask) Precision is 0.70, Recall is 0.66, mAP@0.5 is 0.67, and mAP@0.5:0.95 is 0.50. After the training is completed, the optimal model BEST.pt is saved; the Precision value represents the precision rate, the Recall value represents the recall rate, the mAP@0.5 value represents the average precision value, and the mAP@0.5:0.95 value represents the average precision value at different intersection-over-union thresholds.
[0105] Figure 3a and Figure 3b This is a record of the optimal model training parameters obtained after multiple experiments in Example 1 of the present invention. Figure 3a Here, train / box_loss represents the loss function result of the detection box during training; train / seg_loss represents the loss function result of the segmentation mask during training; train / cls_loss represents the loss function result of the classification during training; train / dfl_loss represents the loss function result of the feature point during training; accordingly, val / box_loss, val / seg_loss, val / cls_loss, and val / dfl_loss represent the loss function results of the detection box, segmentation mask, classification, and feature points in prediction, respectively. Figure 3b In the table, metrics / precision (B) represents the precision of the bounding box; metrics / recall (B) represents the recall of the bounding box; metrics / mAP50 (B) represents the mean average precision of the bounding box when the IoU threshold is greater than 50; and metrics / mAP50-95 (B) represents the mean average precision of the bounding box when the IoU threshold is between 50 and 95. Correspondingly, metrics / precision (M), metrics / recall (M), metrics / mAP50-95 (M), and metrics / mAP50-95 (M) represent the precision, recall, and mean average precision of the mask. The y-axis of the parameter graph represents the training result, and the x-axis represents the number of training epochs.
[0106] Figure 3aThe training curves of the four loss indicators associated with "train / " show a downward trend, indicating that the training effect is gradually improving and the loss value is showing a downward trend. Specifically, the curve of train / cls_loss converges after 100 rounds, indicating that under the current data and optimization conditions, the classification training of traditional residential building materials has reached a good state. train / dfl_loss converges after 150 rounds, indicating that the focus capture of the characteristics of various types of traditional residential materials during training is good. These two indicators demonstrate the scientific nature and effectiveness of this method in the classification of traditional residential building materials. The curves of train / box_loss and train / seg_loss do not converge until 200 rounds, indicating that under the current data and optimization conditions, the model converges slowly. The indicators associated with "val / " also demonstrate that the verification effect is average due to incomplete data or some feature differences in some traditional residential building materials. Figure 3b The accuracy metrics associated with "metrics / " in the figure show that the current model has high detection precision and good recall. The recall of the mask is slightly higher than that of the bounding box, indicating that the model is more capable of capturing objects in segmentation tasks. This also proves that the training of a model for identifying building material types in traditional Chinese residential buildings is indeed more suitable for training related recognition and detection using a segmentation model. At an Intersection over Union (IoU) threshold of 0.5, the average precision is high, indicating that the model has good localization capabilities at this standard threshold. However, as the IoU threshold increases, the model's recognition performance decreases significantly, indicating that the model's ability to predict boundaries and details is insufficient.
[0107] Overall, Figure 3a and Figure 3b The indicators demonstrate the correctness of the segmentation model used in this research method and its scientific and effective application in classifying traditional residential building material types. The model trained under the current data and optimized conditions achieves good recognition results and is capable of general recognition and detection tasks. However, due to the limited sample size, the model's performance is weak under higher precision requirements and its generalization ability is insufficient, requiring further improvement.
[0108] S4. Obtain images of traditional Chinese dwellings: Obtain images of traditional Chinese dwellings from a public image data website to form an image set D to be identified;
[0109] In step S4 of this embodiment, the image set D to be identified consists of images of traditional dwellings from various county-level administrative units in China. First, images of traditional Chinese dwellings are downloaded from public websites such as Bing, Google, and Baidu. A search is performed using the keywords "name of Chinese county-level unit" + "traditional dwellings." Images of traditional dwellings from these county-level administrative units are verified and retrieved, and then named after the county-level unit to create the image set D with geographic semantic information. To avoid missing images due to a lack of pixel count for small-scale traditional Chinese residential buildings after convolution, the image set in step S1 must ensure that the main body of the traditional residential buildings accounts for at least 50% of the image pixels. The images are in jpg format. In this embodiment, a total of 69,169 images of traditional dwellings from 2,843 county-level administrative units in China are obtained.
[0110] S5. Identify the types of building materials of traditional Chinese residential buildings: Input the images in the image set D to be identified into the traditional residential building material type identification model for identification, and obtain the building material type identification results in each image through calculation.
[0111] In step S5 of this embodiment, the images in the to-be-identified image set D are input into the Chinese Traditional House Building Material Type Recognition Model for calculation. Saving the results in a txt file is enabled, resulting in image recognition results and txt file results for each traditional house. The image recognition results include a material type label, a detection frame, a mask, and a confidence score. Each detection frame corresponds to a category, mask, and confidence score. The detection frame defines the rectangular boundary of the material type area, the mask represents the specific shape and location of the building material appearing in the image, and the confidence score indicates the probability of the material within the detection frame and the degree of confidence that the material belongs to a certain category. The txt file results include the category and the detection frame's location information.
[0112] Specifically, the image recognition results for each traditional dwelling are written into a separate txt file, with the file name consistent with the source image. Each txt file contains one or more records, with each record corresponding to the category recognition result and mask location information for an object within a detection box in the image recognition results. Specifically, each record contains the following information:
[0113] ① Category. 0, corresponding to QM_B_ZB_MGB; 1, corresponding to QM_B_ZB_HZ; 2, QM_B_ZHB_HZ; 3, corresponding to QM_B_ZHB_SJZZ; 4, corresponding to QM_B_ZHB_FBB; 5, corresponding to QM_M_MB; 6, corresponding to QM_M_MZ; 7, corresponding to QM_T_HT; 8, corresponding to QM_T_TP; 9, corresponding to QM_Z_QZ; 10, corresponding to QM_Z_HZ; 11, corresponding to QM_S_DLS; 12, corresponding to QM_S_SS; 13, corresponding to QM_S_HGS; 14, corresponding to QM_S_BS; 15, corresponding to QM_S_HSS; 16, corresponding to QM_S_LS; 17, corresponding to Q M_Z_ZM; 18, corresponds to QM_Z_ZG; 19, corresponds to QM_TS_HK; 20, corresponds to QM_S_XWY; 21, corresponds to WM_W_MW; 22, corresponds to WM_W_HW; 23, corresponds to WM_W_QW; 24, corresponds to WM_W_LLW_HS; 25, corresponds to WM_W_LLW_LS; 26, corresponds to WM_S_SY; 27, corresponds to WM_S_YY; 28, corresponds to WM_C_MJC; 29, corresponds to WM_C_HC; 30, corresponds to WM_C_MC; 31, corresponds to WM_M_MBP; 32, corresponds to WM_M_SP; 33, corresponds to WM_T_MN; 34, corresponds to QM_M_SP.
[0114] ② Mask coordinate points. Mask coordinate points that record the type of segmented material.
[0115] Example 2
[0116] The method of this embodiment is roughly the same as that of the provided embodiment 1, with the main difference being that in step S4, the weight decay rate is adjusted to 0.0005 in the hyperparameter setting of the YOLOv8x-seg pre-trained weight model. The weight decay rate is a regularization term applied to the model parameters each time the model weights are updated to prevent the model from overfitting. The total loss function is expressed as:
[0117]
[0118] Among them, L_total is the total loss function; L is the original loss function, which is used to measure the gap between the model detection result and the actual result; λ is the weight decay rate; is the sum of the squares of all model weights; represents the regularization term, Represents the i-th weight parameter in the model, which is used to control the complexity of the model and reduce the weight decay rate to 0.0005.
[0119] The total number of samples and the total number of samples in the original training set T in this embodiment are the same as those in Example 1. The training set T is input into the YOLOv8 network model for model training and verified by the validation set Y. The obtained optimal model is saved as BEST2.pt. The comparison with the model evaluation data of Example 1 is shown in Table 2:
[0120] Table 2. Comparison of model evaluation data between Example 1 and Example 2
[0121]
[0122] Where Box is the detection box, Mask is the mask, Precision represents the precision, Recall represents the recall, mAP@0.5 represents the average precision, and mAP@0.5:0.95 represents the average precision at different intersection-over-union (IoU) thresholds.
[0123] In Example 2, the weight decay rate in the model parameters was reduced, causing the model to maintain a relatively large weight during training. This approach increased the model's dependence on specific training samples and reduced the model's generalization ability. Therefore, compared to the high-weight training model, the recognition performance of the model trained in Example 2 was slightly reduced. When tested on the validation set Y, the precision of Box and Mask increased slightly, while the recall rate decreased slightly. The confidence level of the image recognition results decreased slightly (as shown in Table 2).
[0124] like Figure 5a As shown, the left picture shows the image recognition result of a certain image in the prediction set D to be identified in Example 1, and 2 parts of materials are identified, namely roof tile materials and wall brick materials, with confidence levels of 0.84 and 0.36 respectively; the right picture shows the image recognition result of Example 2 for the same image, and 4 parts of materials are identified. The confidence levels of the materials in the same parts as Example 1 are 0.78 and 0.38, and the confidence levels of 2 more wall brick materials are identified, which are 0.61 and 0.82. On the one hand, it shows that reducing the weight decay rate enhances the generalization ability of the model and improves the recognition ability, and identifies the building materials that were not identified by the model in Example 1. On the other hand, it also shows that reducing the weight decay rate will increase the confidence scores of the originally identified materials with low scores and decrease those with high scores. In general, the recognition ability is improved. Similarly, Figure 5b This also demonstrates the improved recognition capability of Example 2, correctly identifying building roofing materials that were not recognized in Example 1. The left image shows the image recognition results of an image in the prediction set D to be recognized in Example 1, identifying two parts of the tile material. The right image shows the image recognition results of Example 2 for the same image, identifying three parts of the tile material.
[0125] In addition, reducing the weight decay rate will also cause the problem of misidentification due to the enhanced generalization ability. Figure 5c As shown, the left image shows the image recognition results for an image in the prediction set D to be identified in Example 1. After verification, the Best.pt model correctly identified the rammed earth wall material type and area shape. The right image shows the image recognition results for the same image in Example 2. After verification, the Best2.pt model incorrectly identified the building wall foundation in the lower right corner of the image as rammed earth, expanding the area of rammed earth material recognition.
[0126] Example 3
[0127] Reference Figure 6 The present invention provides a light traditional residential building material type identification system for executing the above-mentioned traditional residential building material type identification method. The traditional residential building material type identification system comprises: a building material type standard construction module 601, a training set and verification set preparation module 602, a recognition model training module 603, and a residential building image recognition module 604, which are connected in sequence.
[0128] Building material type standard construction module 601 is used to summarize and obtain the types of building materials of traditional Chinese residential buildings based on public literature and material characteristics, and divide the building materials of traditional Chinese residential buildings into 30 types, including 12 types of roofing materials and 18 types of wall materials;
[0129] The training set and validation set preparation module 602 is configured to collect images from a public image data website using the keyword "material type + traditional dwellings", divide the collected data set into a training set T and a validation set Y in a ratio of 8:2, wherein each of the training set T and the validation set Y contains 30 material types, and annotate the building material types in the images of the training set T and the validation set Y;
[0130] The recognition model training module 603 is used to use the training set T created by the previous training set and validation set creation module to train on the basis of the YOLOv8x-seg pre-trained model and to perform validation on the validation set Y to obtain a recognition model for the types of building materials of traditional Chinese residential buildings;
[0131] The residential building image recognition module 604 is used to input an image containing a traditional Chinese residential building to be tested into a traditional residential building material type recognition model for recognition, and obtain a recognition result of the building material type in the image by calculation.
[0132] Example 4
[0133] This embodiment provides an electronic device, which may be a computer, such as Figure 7As shown, a processor 702, a memory, an input device 703, a display 704, and a network interface 705 are connected via a system bus 701. The processor is used to provide computing and control capabilities. The memory includes a non-volatile storage medium 706 and an internal memory 707. The non-volatile storage medium 706 stores an operating system, a computer program, and a database. The internal memory 707 provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the processor 702 executes the computer program stored in the memory, a method for identifying the type of light traditional residential building materials proposed in the above-mentioned embodiment 1 is implemented. The method for identifying the type of traditional residential building materials includes the following steps:
[0134] S1. Establish a standard for the types of building materials for traditional Chinese residential buildings: Based on public literature and material characteristics, the types of building materials for traditional Chinese residential buildings are summarized and classified into 30 types, including 12 types of roofing materials and 18 types of wall materials, with a total of 34 material sub-categories.
[0135] S2. Create training and validation sets: Collect images from public image data websites using the keyword "material type + traditional dwellings". Split the collected dataset into a training set T and a validation set Y in an 8:2 ratio. Both training set T and validation set Y contain 30 material types. Annotate the building material types in the images in training set T and validation set Y.
[0136] S3. Train the recognition model: Use the training set T created in the previous step to train the YOLOv8x-seg pre-trained model and verify it on the validation set Y to obtain a model for identifying the types of building materials in traditional Chinese residential buildings.
[0137] S4. Input the image containing the traditional Chinese residential building to be tested into the traditional residential building material type recognition model for recognition, and obtain the building material type recognition result in the image by calculation.
[0138] Example 5
[0139] This embodiment provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the method for identifying the type of traditional residential building materials proposed in the above embodiment 1 is implemented. The method for identifying the type of traditional residential building materials includes the following steps:
[0140] S1. Establish a standard for the types of building materials for traditional Chinese residential buildings: Based on public literature and material characteristics, the types of building materials for traditional Chinese residential buildings are summarized and classified into 30 types, including 12 types of roofing materials and 18 types of wall materials, with a total of 34 material sub-categories.
[0141] S2. Create training and validation sets: Collect images from public image data websites using the keyword "material type + traditional dwellings". Split the collected dataset into a training set T and a validation set Y in an 8:2 ratio. Both training set T and validation set Y contain 30 material types. Annotate the building material types in the images in training set T and validation set Y.
[0142] S3. Train the recognition model: Use the training set T created in the previous step to train the YOLOv8x-seg pre-trained model and verify it on the validation set Y to obtain a model for identifying the types of building materials in traditional Chinese residential buildings.
[0143] S4. Input the image containing the traditional Chinese residential building to be tested into the traditional residential building material type recognition model for recognition, and obtain the building material type recognition result in the image by calculation.
[0144] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0145] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0146] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.
Claims
1. A method for identifying the types of traditional residential building materials based on a target detection algorithm, characterized in that: The method for identifying the type of building materials of traditional residential buildings is targeted at identifying traditional Chinese residential buildings, and the identification part is the building's enclosure including the roof and walls, and includes the following steps: S1. Construct the type standard of building materials for traditional residential buildings: Based on the public literature and material characteristics, the types of building materials for traditional Chinese residential buildings are summarized and summarized, and the building materials for traditional Chinese residential buildings are divided into 30 types, including 12 types of roofing materials and 18 types of wall materials. Among them, the classification of building materials for traditional Chinese residential buildings is based on the material application and enclosure parts during the construction process as the dividing blocks, and the roof and wall are used as the identification parts to divide the material types. Based on the classification of 6 natural materials and 2 traditional Chinese building materials, a type classification including 12 types of roofing materials and 18 types of wall materials is constructed, among which, (1) Roofing materials: The first type of roofing material is green tiles, recorded as WM_W_QW; the second type of roofing material is red tiles, recorded as WM_W_HW; the third type of roofing material is glazed tiles, recorded as WM_W_LLW; the fourth type of roofing material is Burmese tiles, recorded as WM_W_MW; the fifth type of roofing material is seaweed, recorded as WM_C_HC; the sixth type of roofing material is thatch, recorded as WM_C_M C; the seventh roofing material type is wheat straw, recorded as WM_C_MJC; the eighth roofing material type is wood chips, recorded as WM_M_MBP; the ninth roofing material type is bark, recorded as WM_M_SP; the tenth roofing material type is plaster, recorded as WM_T_MN; the eleventh roofing material type is sandstone, recorded as WM_S_SY; the twelfth roofing material type is shale, recorded as WM_S_YY; (2) Wall materials: The first type of wall material is green brick, recorded as QM_Z_QZ; the second type of wall material is red brick, recorded as QM_Z_HZ; the third type of wall material is wood board, recorded as QM_M_MB; the fourth type of wall material is log, recorded as QM_M_MZ; the fifth type of wall material is rammed earth, recorded as QM_T_HT; the sixth type of wall material is adobe, recorded as QM_T_TP; the seventh type of wall material is bamboo strips, recorded as QM_Z_ZM; the eighth type of wall material is bamboo poles, recorded as QM_Z_ZG; the ninth type of wall material is felt cloth, recorded as QM_ B_ZH; the 10th wall material is woven cloth, recorded as QM_B_ZB; the 11th wall material is granite, recorded as QM_S_HGS; the 12th wall material is marble, recorded as QM_S_DLS; the 13th wall material is sandstone, recorded as QM_S_SS; the 14th wall material is slate, recorded as QM_S_BS; the 15th wall material is pebble, recorded as QM_S_LS; the 16th wall material is volcanic stone, recorded as QM_S_HSS; the 17th wall material is oyster shell, recorded as QM_TS_HK; the 18th wall material is tree bark, recorded as QM_M_SP; S2. Create a training set and a validation set: Collect images from a public image data website using the keyword "material type + traditional dwellings" and divide the collected data set into a training set T and a validation set Y in a ratio of 8:
2. Both the training set T and the validation set Y contain 30 material types. Annotate the building material types in the images of the training set T and the validation set Y. The selected images should mainly be front-facing photos, and the angle of side photos should not exceed 30°. Photos with excessively tilted shooting angles will not be used as training set data. When calculating the sample size of each secondary classification training data, classify the images according to the material that accounts for the largest proportion in the image, and ensure that the number of images for each secondary classification is no less than 120. That is, the total image data volume of the final training set T and validation set Y is no less than 3,600. S3. Train the recognition model: Use the training set T created in the previous step to train the YOLOv8x-seg pre-trained model and verify it on the validation set Y to obtain a model for identifying the types of building materials in traditional Chinese residential buildings. S4. Input the image containing the traditional Chinese residential building to be tested into the traditional residential building material type recognition model for recognition, and obtain the building material type recognition result in the image by calculation.
2. The method for identifying the type of traditional residential building materials according to claim 1, characterized in that: The images collected in the data set in step S2 should have the following characteristics: ① the image content of a single image should include the roof or wall part of a traditional building, and the appearance ratio should not be less than 30% of the image area; ② the image size is ≥640*640, and the image format is jpg.
3. The method for identifying the type of building materials of traditional residential buildings according to claim 1, characterized in that: In step S2, the labeling method of the building material types in the images of the training set and the validation set is implemented by the Labelme image labeling tool. The labeling process includes the following stages: ① image loading and preprocessing; ② labeling the parts of the image belonging to the building roof and wall; Roof annotation forms a closed polygon along the outer contour of a single building roof. Each building roof forms a separate label. Multiple building roofs in the image need to be labeled separately. Wall annotation forms different polygons according to the boundaries of the wall areas of different materials. Each wall forms a polygon label. Different walls need to be labeled separately; ③ Avoid non-building objects; ④ Save and export annotation results: After the annotation is completed, the results are saved as a JSON format file, which contains the coordinates and label information of each annotation area.
4. The method for identifying the type of building materials of traditional residential buildings according to claim 1, characterized in that: The process of training and obtaining the Chinese traditional residential building material type recognition model in step S3 is as follows: S31. Set the initial parameters of the network data configuration file of the YOLOv8x-seg pre-training model and input the pre-training model; S32, use the pre-trained weight parameters of the YOLOv8x-seg pre-trained model; S33. Set the hyperparameters of the YOLOv8x-seg pre-training model, set the number of training iterations to 500, the initial learning rate to 0.01, the weight decay rate to 0.001, and the batch size to 30, and then start training. S34. The trained model is verified on the verification set Y, and finally a Chinese traditional residential roof type recognition model is obtained.
5. The method for identifying the type of building materials of traditional residential buildings according to claim 1, characterized in that: The method for identifying the type of building materials of traditional residential buildings further comprises the following steps: S5. Create a test dataset: Collect images from public image data websites in the "county-level administrative unit + traditional dwelling" format to form a test dataset D. S6. Test the model for identifying building material types of traditional Chinese residential buildings: input the images in the test dataset D into the model for identifying building material types of traditional residential buildings; set the setting to save the txt document results, and obtain the building material type identification results and txt document results of each traditional residential image through calculation. The image recognition results include material type labels, detection frames, masks, and confidence scores. Each detection frame corresponds to a material type, mask, and confidence score. The detection frame defines the rectangular boundary of the material type area, the mask represents the specific shape and position of the building material appearing in the image, and the confidence score represents the probability of the material existing in the detection frame and the degree of certainty that the existing material belongs to a certain category; the txt document results include the category and the location information of the detection frame.
6. A light traditional residential building material type identification system, used to implement the traditional residential building material type identification method according to any one of claims 1 to 5, characterized in that: The traditional residential building material type identification system includes: The building material type standard construction module is used to summarize and summarize the types of building materials for traditional Chinese residential buildings based on public literature and material characteristics. The building materials for traditional Chinese residential buildings are divided into 30 types, including 12 types of roofing materials and 18 types of wall materials. The training set and validation set creation module is used to collect images from public image data websites using the keyword "material type + traditional dwellings". The collected data set is divided into a training set T and a validation set Y in an 8:2 ratio. The training set T and validation set Y both contain 30 material types. The building material types in the images in the training set T and validation set Y are annotated. The recognition model training module is used to train the training set T created by the previous training set and validation set creation module based on the YOLOv8x-seg pre-trained model and verify it on the validation set Y to obtain a model for identifying the types of building materials in traditional Chinese residential buildings. The residential building image recognition module is used to input an image containing a traditional Chinese residential building to be tested into a traditional residential building material type recognition model for recognition, and obtain the building material type recognition result in the image through calculation.
7. An electronic device comprising a processor and a memory for storing a program executable by the processor, characterized in that: When the processor executes the program stored in the memory, it implements the method for identifying the type of traditional residential building materials described in any one of claims 1 to 5.
8. A storage medium storing a program, characterized in that: When the program is executed by a processor, the method for identifying the type of traditional residential building materials described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Roof type identification method and device based on multi-source geographic information and remote sensing image
CN117746247A
Computer Vision Systems and Methods for Segmenting and Classifying Building Components, Contents, Materials, and Attributes
US20230185839A1