Real-time segmentation method of building component fire damage based on FastSAM-P
Through the improvement of FastSAM-P network architecture, the accuracy and speed problems in fire damage detection of building components are solved, efficient fire loss recognition and real-time segmentation are realized, flexible detection and edge computing of multi-modal image acquisition terminals are supported, and high-precision damage feature data are provided.
Patent Information
- Application Number
- CN202510294697.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-03-13
AI Technical Summary
The existing fire damage detection technology for building components has problems such as limited detection accuracy, slow segmentation speed and poor applicability, which is difficult to meet the needs of fast response and high accuracy.
The real-time fire loss segmentation method of building components based on FastSAM-P is adopted, and the damage recognition accuracy and real-time performance are improved through the construction of data sets, multi-stage optimization strategies and modular network architecture, including the introduction of DSCConv, RFB and PPSM modules.
It realizes the coordinated optimization of segmentation accuracy and inference speed of fire loss recognition of building components, supports real-time detection of multi-modal image acquisition terminals, reduces dependence on cloud computing, provides end-to-end edge computing capabilities and dynamic deployment adaptability, and outputs high-precision damage feature data.
Smart Images

Figure CN120147643B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fire damage detection methods, and in particular to a FastSAM-P-based real-time segmentation method for fire damage of building components. Background Art
[0002] Damage detection technology for building components can be roughly divided into two categories: non-destructive testing and destructive testing. Within the scope of non-destructive testing, the hammer-rebound method is a landmark method. It applies a hammer to the surface of the building component and quantifies the damage condition of the concrete based on the rebound depth. However, this technology is based on the premise that the surface of the component must remain relatively flat. It is incapable of detecting the surface of the component with concrete cracking. In addition, the detection efficiency of the hammer-rebound method is relatively low, and it is time-consuming and labor-intensive, which limits its widespread application.
[0003] In the field of destructive testing, core sampling is a typical example. This method uses a drill to take samples of damaged components at the disaster site. The samples are then transferred to a laboratory, where professional technicians use precision equipment to conduct in-depth analysis of the samples to accurately determine the extent of damage. Despite this, the core sampling method is not perfect. Its testing cycle is long, generally taking 2 to 3 weeks, and it is very easy to cause additional damage to the components during the sampling process, posing a potential threat to the safety of on-site testing personnel.
[0004] At present, although deep learning-based image detection technology has made certain progress, it still faces a series of challenges, mainly including limited detection accuracy, slow segmentation speed and poor applicability. These factors seriously restrict its potential for widespread application. Specifically, these technologies often find it difficult to achieve high precision requirements in practical applications, the processing speed is insufficient to meet the needs of rapid response, and they show low adaptability when faced with diverse scenarios, thus limiting their effective deployment in a wider range of fields.
[0005] Therefore, it is particularly important to develop an automatic, real-time and non-destructive technology for detecting damage to building components after fire, in order to significantly improve the detection efficiency and meet the urgent needs in practical applications. Summary of the Invention
[0006] The present invention provides a real-time segmentation method for building component fire damage based on FastSAM-P. This method can realize automatic real-time damage segmentation of concrete structures after fire, providing technical support for subsequent damage quantification and deployment to drones.
[0007] In order to achieve the above object, the technical solution of the present invention is:
[0008] The real-time segmentation method of building component fire damage based on FastSAM-P includes the following steps:
[0009] Step 1: Identify the types and characteristics of two types of damage after fire: concrete cracking and exposed steel bars on the surface of RC structural components, and construct corresponding datasets for network training and verification;
[0010] Step 2: Develop training strategies and evaluation indicators;
[0011] Step 3: Construct a real-time segmentation network architecture for building component fire damage based on FastSAM-P.
[0012] Preferably, the step 1 includes the following specific steps:
[0013] The dataset consists of 1,500 images taken from fire scenes and fire laboratories. These images clearly illustrate the types and characteristics of two types of damage: concrete cracking and exposed steel bars on the surface of RC structural components after fire. The images were taken with the image size set to a 1:1 square. The images were then imported into the labelme software for annotation. The generated JSON files were converted to XML files. Through data augmentation, the dataset was expanded to 8 times its original size and divided into training, validation, and test sets in a ratio of 7:2:1.
[0014] Preferably, in step 2, a multi-stage optimization strategy is used to train the FastSAM-P segmentation model to improve the recognition accuracy of post-fire concrete structure bursting and exposed reinforcement damage; during the training process, the batch size is set to 16, the total number of iterations is 100, and 500 rounds of training are performed, and staged learning rate regulation is implemented: a linear warm-up strategy is used to alleviate gradient oscillation in the early stage, and a cosine annealing algorithm is used to gradually reduce the learning rate after the training is stable; in order to suppress overfitting, an L2 regularization term is introduced into the network optimization objective, and the model complexity is reduced and the generalization ability is improved by constraining the L2 norm of the weight parameter; the loss function adopts a weighted combination of BCE Loss + Dice Loss. Through this combination strategy, the pixel-level classification accuracy, i.e., the advantage of BCE loss, is maintained, and the regional structure consistency, i.e., the characteristic of Dice loss, is enhanced, as shown in formula (3):
[0015] (3);
[0016] In formula (3), λ is a hyperparameter used to balance the weight between BCE loss and Dice loss.
[0017] Preferably, in the step 2, a multi-dimensional quantitative index system is used to systematically evaluate the performance of the FastSAM-P model, specifically as follows: 1) the average intersection-over-union ratio is used as the core segmentation accuracy indicator, and the average overlap between the predicted area and the real labeled area in each category is calculated to quantitatively characterize the positioning accuracy of the model for the fire damage area; 2) the parameter quantity is used as a model complexity evaluation indicator to reflect the model storage requirements and computing resource consumption, providing a basis for the feasibility of edge device deployment; 3) the frame rate is used as a real-time evaluation indicator to measure the average inference time of a single image in the NVIDIA RTX 3090 graphics card environment to evaluate the application potential of the model in real-time detection scenarios at fire scenes.
[0018] Preferably, the step 3 includes the following contents: (1) selecting the FastSAM network as the baseline network, replacing the C2F module with the DSCConv module in the backbone part of YOLOv8; based on the SCConv module, forming the DSCConv module by adding the Deformable Convolution module; (2) replacing the SPPF module with the RFB module in the backbone part of YOLOv8; (3) replacing the FPN module in the FastSAM network with the PPSM module: based on the pyramid pooling module, forming the PPSM by adding the attention module, extracting rich contextual information through multi-scale pooling operations, thereby enhancing the network's recognition ability of multi-scale targets in the concrete fire damage segmentation task.
[0019] Preferably, in step 3, PPSM performs global pooling operations of different scales on the input feature map to generate multi-scale feature representation, quickly extracts features through the attention module, and fuses them with the original feature map through upsampling, ultimately realizing the organic combination of global context information and local detail features; PPSM generates context information of multiple scales by performing pooling operations of different scales on the feature map, specifically including the following four scales of pooling: (31) Global pooling (1×1): Global average pooling is performed on the feature map to capture the global context information of the entire image. information; (32) Medium-scale pooling (2×2): Divide the feature map into 2×2 sub-regions and perform pooling to extract semantic information of larger areas; (33) Smaller-scale pooling (3×3 or 4×4): Divide the feature map into 3×3 or 4×4 sub-regions and perform pooling to focus on feature extraction in smaller areas; (34) Original-scale features: Retain the original unpooled feature map to retain high-resolution detail information; PPSM then restores the pooled features of different scales to the size of the original feature map through upsampling operations, and then performs pixel-by-pixel splicing with the original feature map.
[0020] Preferably, the step (34) includes the following specific steps: the pooled feature map of each scale is upsampled by bilinear interpolation to restore it to the same resolution as the original feature map, and then the upsampled multi-scale feature map is spliced with the original feature map in the channel dimension to form a fused feature representation, and finally, by fusing global context information and local detail features, the model processes large wall areas and narrow boundary areas at the same time, thereby improving the segmentation accuracy.
[0021] The beneficial effects of the FastSAM-P-based real-time segmentation method for building component fire damage are as follows: Compared with traditional segmentation networks, the present invention achieves the coordinated optimization of segmentation accuracy and inference speed in building fire damage identification tasks, possesses significant technological advancement and industrial application value, and its application advantages are as follows:
[0022] 1. Seamless adaptability to multi-source heterogeneous devices: Supports instant access to multimodal image acquisition terminals such as mobile phones, high-definition cameras, and drones. Through a lightweight model architecture design, it enables standardized preprocessing and real-time inference of cross-platform image data, meeting the flexible detection needs in complex fire scene environments.
[0023] 2. End-to-end edge computing capabilities: The optimized FastSAM-P network has reduced parameter size, enabling real-time segmentation of 1080P images at 65.11fps on mobile devices such as drones equipped with edge computing modules, significantly reducing reliance on cloud computing.
[0024] 3. Engineering adaptability for dynamic deployment: We provide multi-level deployment solutions, from embedded devices to server clusters. We develop a dedicated inference acceleration interface specifically for drone inspection systems, enabling an automated closed-loop operation of aerial image acquisition, damage identification, and result transmission.
[0025] 4. Data foundation for damage quantification analysis: The output pixel-level segmentation results are stored in a structured data format, accurately locating key damage features such as the area of concrete cracks and the shape of exposed steel bars, providing high-precision input data for subsequent damage level assessment and structural bearing capacity calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is the Labelme image annotation interface.
[0027] Figure 2 It is the FastSAM network architecture (in the figure, YOLOv8-Seg Backbone: YOLOv8-Seg backbone network;
[0028] FPN: Feature Pyramid Network; Detect Branch: detection branch; Mask Branch: mask branch; P3, P4, P5: P3, P4, P5 (level, unchanged); Mask Coeff.: mask coefficient; Detect: detection; NMS: non-maximum suppression; Crop: cropping; Pred: prediction; Threshold: threshold; Image Encode: image encoding; Text Encoder: text encoding; Point-prompt: point prompt; Box-prompt: box prompt; Text-prompt: text prompt).
[0029] Figure 3 This is the DSConv module network architecture (in the figure: Spatial and Channel reconstructionConvolution: spatial and channel reconstruction convolution; Previous ConvBlock: previous convolution block; NextConvBlock: next convolution block; 1×1 Conv: 1×1 convolution; Input Feature: input feature; Spatial-Refined Feature: spatial optimization feature; Channel-Refined Feature: channel optimization feature; ResBlock + SCConv: residual block + SCConv; DFConv: deformable convolution).
[0030] Figure 4 It is the RFB module network architecture (in the figure: 3×3Conv Rate=1: 3×3 convolution rate=1; Concat 1×1Conv: connecting 1×1 convolution; Spatial array of pRF in hV4: spatial array of pRF in hV4; Finalspatial array of receptive field: the final receptive field spatial array).
[0031] Figure 5 This is a comparison of the backbone network structure before and after improvement (in the figure: Conv: convolutional layer; SCConv: spatial and channel reconstruction convolution).
[0032] Figure 6 This is the PPSM module structure diagram (in the figure: POOL: pooling layer; UPSAMPLE: upsampling layer).
[0033] Figure 7It is the improved FastSAM-P network architecture (in the figure: Detect Branch: detection branch; MaskBranch: mask branch; Mask Coeff: mask coefficient; Detect: detection; Crop: cropping; Pred: prediction; Threshold: threshold; Image Encode: image encoding; Text Encoder: text encoding; Point-prompt: point prompt; Box-prompt: box prompt; Text-prompt: text prompt).
[0034] Figure 8 This is a performance comparison between FastSAM-P and FastSAM networks (Figure a is the MIoU comparison; Figure b is the Params and FPS comparison).
[0035] Figure 9 This is a comparison of different network segmentation effects. DETAILED DESCRIPTION
[0036] The following describes in detail the implementation methods of the present invention in a step-by-step manner. This description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
[0037] In the description of the present invention, it should be noted that the terms "up", "down", "left", "right", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings. They are only for describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, and a specific orientation structure and operation. Therefore, they cannot be understood as limiting the present invention.
[0038] Example 1: A real-time segmentation method for building component fire damage based on FastSAM-P, comprising the following steps:
[0039] Step 1: Identify the types and characteristics of two types of damage after fire: concrete cracking and exposed steel bars on the surface of RC structural components, and construct corresponding datasets for network training and verification;
[0040] Step 2: Develop training strategies and evaluation indicators;
[0041] Step 3: Construct a real-time segmentation network architecture for building component fire damage based on FastSAM-P.
[0042] Example 2: Based on Example 1, this example discloses that step 1 includes the following specific steps:
[0043] Currently, there is little research on the segmentation of RC structural damage after fire, and there is a lack of benchmark datasets for post-fire damage segmentation. Therefore, this paper constructs a dataset for post-fire damage segmentation of building components. The dataset is taken from the fire scene and the fire laboratory, with a total of 1500 images. These images clearly define the types and characteristics of two types of damage on the surface of RC structural components after fire: concrete bursting and exposed steel bars. When taking pictures, the image size is set to 1:1 square, and then the image is imported into the labelme software ( Figure 1 ) for annotation, convert the generated json file into an XML file, expand the dataset to 8 times of the original amount through data augmentation, and divide the expanded dataset into training set, validation set and test set in the ratio of 7:2:1.
[0044] Example 3: Based on Examples 1 and 2, this example discloses that in step 2, the training strategy is as follows: the FastSAM-P network is trained on a custom workstation equipped with a GeForce RTX 3090 graphics card with 24GB of VRAM and CUDA acceleration for network training; in addition, the workstation integrates two E5 2699 v3 CPUs, each with a working frequency of 2.3 GHz, with 64 cores and 128 threads; the network architecture was developed using the Python-based PyCharm integrated development environment and the PyTorch library for deep learning applications; a multi-stage optimization strategy was used to train the FastSAM-P segmentation model to improve the recognition accuracy of post-fire concrete structure bursting and exposed reinforcement damage; during the training process, the batch size was set to 16, the total number of iterations was 100, and 500 rounds of training were performed, and a staged learning rate control was implemented: a linear warm-up strategy was used to alleviate gradient oscillation in the early stage, and the cosine annealing algorithm was used to gradually reduce the learning rate after the training stabilized; to suppress overfitting, an L2 regularization term was introduced into the network optimization objective to reduce the model complexity and improve the generalization ability by constraining the L2 norm of the weight parameters; BCE Loss (Binary Cross Entropy Loss) refers to pixel-by-pixel classification, which measures the difference between the predicted segmentation mask and the true label. When the dataset is unbalanced, different weights can be applied to the losses of different categories to mitigate the impact of category imbalance. Its calculation method is shown in formula (1); Dice Loss (Dice Coefficient Loss is a loss function widely used in image segmentation tasks, especially suitable for pixel-level binary or multi-classification tasks. Its calculation formula is shown in formula (2). The loss function of the present invention adopts a weighted combination of BCE Loss + Dice Loss. Through this combination strategy, it not only maintains the pixel-level classification accuracy (BCE loss advantage) but also strengthens the regional structural consistency (Dice loss characteristics). For the segmentation task of concrete structure bursting and exposed reinforcement damage after fire, this method effectively improves the model's ability to capture fine-grained features and regional consistency. The specific form is shown in formula 3:
[0045] (1);
[0046] (2);
[0047] (3);
[0048] In formula (1), N is the number of samples, y i is the true label of the i-th sample, p i is the probability that the i-th sample predicted by the model is a positive class; in formula (2), Pi and G i Represent the predicted result and the true label value at the i-th pixel respectively; in formula (3), λ is a hyperparameter used to balance the weight between BCE loss and Dice loss.
[0049] Example 4: Based on Examples 1, 2, and 3, this example discloses: in step 2, a multidimensional quantitative index system is used to systematically evaluate the performance of the FastSAM-P model, specifically as follows: 1) Mean Intersection over Union (MIoU) is used as the core segmentation accuracy indicator to quantitatively characterize the positioning accuracy of the model for the fire damage area by calculating the average overlap between the predicted area and the true labeled area in each category; 2) Parameters are used as a model complexity evaluation indicator to reflect the model storage requirements and computing resource consumption, providing a basis for the feasibility of edge device deployment; 3) Frames Per Second (FPS) is used as a real-time evaluation indicator to measure the average inference time of a single image in the NVIDIA RTX 3090 graphics card environment to evaluate the application potential of the model in real-time detection scenarios at fire scenes. This index system takes into account the assessment of the model's accuracy-efficiency balance: MIoU verifies the model's ability to identify fine-grained features such as concrete cracks and exposed rebar from the perspective of pixel-level segmentation accuracy; the parameter quantity index reflects the model's lightweight level and proves the algorithm's applicability on mobile terminals; the FPS index quantifies the model's actual deployment value in disaster emergency scenarios.
[0050] Example 5: Based on Examples 1, 2, 3, and 4, this example discloses: Step 3 includes: In order to accurately detect and segment the bursting and exposed reinforcement damage of concrete structures after fire, and to achieve real-time detection, the present invention selects the FastSAM (Fast Segment Anything) network as the baseline network; FastSAM is an acceleration alternative proposed by the Institute of Automation, Chinese Academy of Sciences, which aims to solve the problems of SAM (Segment Anything Model) in computing speed and resource usage; while maintaining performance comparable to SAM, FastSAM increases the inference speed by 50 times, realizing a real-time "segment everything" function; FastSAM is based on the instance segmentation of YOLOv8-seg, integrates the instance segmentation branch during detection, and adopts a two-stage algorithm of "full instance segmentation + instruction-based mask output"; in the first stage, a convolutional neural network (CNN) is used to perform full instance segmentation to generate segmentation masks for all instances in the image; in the second stage, the corresponding segmented area is output based on the prompts provided by the user (such as points, boxes, text, etc.); its network framework is as follows Figure 2 As shown in Figure 2, this design not only improves computational efficiency but also maintains performance comparable to SAM.
[0051] In the backbone architecture of YOLOv8, the traditional C2F module is replaced by the advanced Deformable-Spatial and Channel reconstruction Convolution (DSCConv) module. This improvement is as follows Figure 3 As shown in the figure, the model aims to significantly improve the segmentation accuracy of complex damage features such as concrete bursting and exposed rebar after fire. Although the C2F module effectively reduces model parameters and accelerates the training process through its unique cross-stage local connection mechanism, its convolution kernel based on fixed geometric structure shows limitations in its ability to capture fine-grained features when faced with damage detection tasks such as exposed rebar on the concrete surface, which have significant local deformation and highly complex texture features. In addition, traditional convolution operations are limited by fixed sampling positions and it is difficult to flexibly adjust the receptive field to adapt to the actual shape of the damaged target, which not only leads to spatial redundancy in the feature map, but also may cause the loss of key information. To address this challenge, the DSCConv module is introduced, which cleverly integrates the Deformable Convolution ( Figure 2) and the Spatial Channel Reconstruction Convolution (SCConv) to construct a feature extraction framework with highly adaptive perception capabilities. Through the learnable spatial offset parameters introduced by the deformable convolution layer, DSCConv can dynamically adjust the receptive field distribution according to the actual morphology of the damage target, thereby significantly enhancing the ability to capture and characterize irregular structural features. This is particularly critical for identifying complex damage such as concrete cracking and exposed rebar after fire. In terms of spatial feature optimization, the Spatial Reconstruction Unit (SRU) in the DSCConv module effectively suppresses redundant features through a feature weight separation mechanism, while using a feature recalibration method to strengthen the spatial attention of key areas, further improving the spatial discrimination of the feature map, enabling the model to more accurately identify the specific location and morphology of concrete damage. In terms of channel dimension optimization, the Channel Reconstruction Unit (CRU) in the DSCConv module constructs a lightweight channel attention mechanism through innovative channel splitting transformation and feature fusion strategies. This mechanism significantly reduces channel redundancy while effectively reducing the model's computational complexity, ensuring the model's efficiency and real-time performance when processing complex damage features.
[0052] In summary, the introduction of the DSCConv module not only overcomes the limitations of traditional convolution when dealing with complex damage features, but also significantly improves the performance of the network in the task of segmenting concrete cracking and exposed reinforcement damage after fire through adaptive perception capabilities and refined feature optimization strategies. Figure 3 As shown;
[0053] Secondly, the SPPF module is replaced with the Receptive Field BlockModified (RFB) module in the backbone part of YOLOv8. Its network architecture is as follows: Figure 4As shown in the figure; First, the RFB module simulates the receptive field structure of the human visual system, combines convolution kernels of different sizes and dilated convolution, and can extract multi-scale features on a single level; because the width, length and shape of exposed rebar vary greatly, there are both small micro-exposed rebars and large structural exposed rebars; the multi-scale feature extraction capability of the RFB module enables the model to capture the features of exposed rebars of different sizes at the same time, thereby improving the integrity and accuracy of segmentation; secondly, the RFB module fuses features of different receptive fields through a multi-branch structure, enhancing the feature expression ability; in the concrete cracking and exposed rebar segmentation task, exposed rebars may have complex shapes (such as crosses) and cracks may have irregular edges, and the RFB module can better capture The RFB module captures these details, improving the model's segmentation accuracy for cracks and exposed rebar. Furthermore, the concrete surface after a fire may contain noise (such as stains and blackening) or complex textures. The RFB module's multi-branch feature fusion capability helps distinguish damage from background interference, reducing false detections and missed detections. Finally, compared with the pooling operation of the SPPF module, the RFB module retains more spatial information through convolution operations, reducing information loss. This is particularly important for the task of concrete structure damage segmentation, as exposed rebar is often slender, and spatial details (such as the width and direction of the exposed rebar) are crucial to the segmentation results. The RFB module can better preserve the detailed information of exposed rebar, especially small exposed rebar, avoiding incomplete segmentation due to information loss.
[0054] In summary, in the backbone part of YOLOv8, replacing the C2F module and SPPF module with the SCConv module and RFB module respectively significantly improves the segmentation performance and robustness of the model. The backbone network structure before and after the improvement is as follows Figure 5 As shown;
[0055] The improvement of the present invention also includes: replacing FPN with PPSM, specifically: based on the Pyramid Pooling Module (PPM), by adding the Shuffle-Attention module to form a Pyramid Pooling Shuffle Module (PPSM), which extracts rich contextual information through multi-scale pooling operations, thereby enhancing the model's ability to recognize multi-scale targets in the concrete fire damage segmentation task; specifically, PPSM performs global pooling operations at different scales on the input feature map to generate multi-scale feature representations, quickly extracts features through the Shuffle-Attention module, and fuses them with the original feature map through upsampling, ultimately achieving an organic combination of global contextual information and local detail features; PPSM generates contextual information at multiple scales by performing pooling operations on the feature map at different scales; specifically, it includes the following four scales of pooling:
[0056] (1) Global pooling (1×1): Global average pooling is performed on the feature map to capture the global context information of the entire image; this global information helps the model understand the overall distribution and structure of the wall;
[0057] (2) Medium-scale pooling (2×2): Divide the feature map into 2×2 sub-regions and perform pooling to extract semantic information of larger areas; this scale is suitable for identifying large wall areas;
[0058] (3) Smaller scale pooling (3×3 or 4×4): Divide the feature map into 3×3 or 4×4 sub-regions and perform pooling to focus on feature extraction in smaller regions; this scale helps identify narrow burst boundaries or local details;
[0059] (4) Original scale features: retain the original unpooled feature map to preserve high-resolution detail information; this original feature is crucial for accurately segmenting wall edges and small-scale structures;
[0060] (5) PPSM restores the pooled features of different scales to the size of the original feature map through upsampling operation, and then splices them pixel by pixel with the original feature map. The specific steps are as follows: the pooled feature map of each scale is upsampled by bilinear interpolation to restore it to the same resolution as the original feature map; then the upsampled multi-scale feature map is spliced with the original feature map in the channel dimension to form a fused feature representation; finally, by fusing global context information and local detail features, the model can simultaneously process large wall areas and narrow boundary areas, thereby improving segmentation accuracy; therefore, PPSM can capture rich context information from global to local, and adapt to the needs of wall segmentation at different scales; the retention of the original feature map ensures that high-resolution detail information is not lost, thereby improving the accuracy of edge segmentation of burst and exposed reinforcement damage; the introduction of global context information enhances the adaptability of the model to complex scenes, enabling it to better handle challenges such as occlusion and illumination changes; in summary, the added Shuffle-Attention mechanism has a simple structure and is computationally efficient; the specific network structure is as follows Figure 6 As shown;
[0061] In summary, based on the FastSAM network structure, by improving the backbone and optimizing the network modules, the model has improved the detection and segmentation accuracy, reduced the model size, and significantly shortened the inference time. The improved FastSAM-P network architecture is as follows: Figure 7 shown.
[0062] Example 6: Ablation Test: The present invention relates to an improved image segmentation model based on multi-module collaborative optimization. The effectiveness and synergistic advantages of each technical module are verified through systematic ablation experiments. The experiment uses the FastSam model as a benchmark and gradually introduces the DSCConv module, RFB module, and PPSM module to quantitatively analyze the impact of each module on the model parameters, segmentation accuracy (MIoU), and processing speed (FPS). The experimental results are shown in Table 1. The specific analysis is as follows:
[0063] (1) Analysis of independent functions of modules:
[0064] DSCConv (No. 2): After its introduction, MIoU increased by 10.5% (68.4% → 78.9%), but the number of parameters increased by 0.38M (12.10M → 12.48M), and the FPS decreased by 5.11 frames / s (45.23 → 40.12). This shows that this module significantly improves segmentation accuracy by increasing model complexity, but at the expense of inference speed.
[0065] RFB (No. 3): MIoU increased by 10.7% (68.4% → 79.1%), the number of parameters decreased by 1.83M (12.10M → 10.27M), and the FPS increased significantly by 13.55 frames / s (45.23 → 58.78). This shows that the RFB module significantly improves accuracy and speed while optimizing model lightweighting (reducing parameters by 15.1%), and has efficient feature expression capabilities.
[0066] PPSM (No. 4): MIoU increased by 7.1% (68.4% → 75.5%), the number of parameters decreased by 1.95M (12.10M → 10.15M), and the FPS increased by 14.0 frames / s (45.23 → 59.21). This module performs best in terms of speed optimization, but its accuracy gain is weaker than that of the RFB module. It may be more suitable for scenarios with higher real-time requirements.
[0067] (2) Module collaborative optimization effect:
[0068] DSCConv+RFB (No. 5): MIoU reaches 81.2%, a 12.8% improvement over the baseline, but the FPS is lower than using RFB alone (56.52 vs. 58.78), indicating that the complexity of DSCConv offsets some of its speed advantage;
[0069] DSCConv+PPSM (No. 6): MIoU significantly improved to 85.7%, and the FPS remained at 58.27 frames / s. This shows that PPSM effectively alleviated the speed loss of DSCConv, and the two synergistically improved the balance between accuracy and efficiency.
[0070] RFB+PPSM (No. 7): MIoU reaches 86.1%, with the lowest parameter count (9.31M) and the highest FPS (69.18 frames / s). This combination performs best in lightweighting and speed optimization, validating the complementarity of RFB and PPSM.
[0071] Full module combination (No. 8): MIoU reaches 92.0%, a 23.6% improvement over the baseline, but the FPS drops to 65.11 frames / s. Although the number of parameters (9.90M) is lower than the baseline, the stacking of multiple modules increases the computational load, indicating that the ultimate performance of the model requires a balance between accuracy and speed requirements.
[0072] Table 1 Ablation test results:
[0073] ;
[0074] This paper solves the contradiction between model lightweighting and accuracy improvement through modular design. Specifically, the DSCConv module reduces redundant parameters through dynamic channel compression; the RFB module enhances feature discriminability through multi-level receptive fields; and the PPSM module optimizes inference speed through parallel computing. Experimental data show that the synergistic effect of the three modules breaks through the performance limitations of a single module (for example, the MIoU and FPS of the dual-module combination in Experiments 6-7 are both lower than those in Experiment 8), forming a complete technical solution with significant technical gains.
[0075] Example 7: Comparative test: Comparison of the accuracy performance of the improved FastSAM-P network of the present invention and the original FastSAM model Figure 8 As shown in Figure 2, to further verify the technical advantages of the FastSAM-P model, this paper selects four existing advanced segmentation models, YOLOv11, MB-SPPF-UNet, OCRNet and SegFormer, as comparison benchmarks, and uses the same dataset and the same training strategy to train and test the models respectively. The experimental results show that the improved FastSAM-P model significantly outperforms the existing technical solutions in terms of segmentation accuracy. The comparison of the prediction results of each model is shown in Figure 2. Figure 9 shown by Figure 9 It can be seen that compared with other network models, FastSAM-P has the best segmentation effect and can segment bursts and exposed ribs of different sizes, which is significantly higher than the unimproved model FastSAM.
[0076] Working principle of the present invention:
[0077] 1. Network Architecture Optimization Module: To address the shortcomings of the traditional FastSAM network in building damage segmentation tasks, we propose replacing the original C2F module with the SCConv module in the Backbone architecture. This effectively reduces redundant feature computation through spatial and channel recalibration mechanisms. Furthermore, we replace the SPPF module with the RFB module, utilizing dilated convolution to enhance multi-scale feature fusion capabilities. This improves the recognition accuracy of exposed reinforcement and crack edges and morphology, reducing the number of parameters while improving feature expression capabilities.
[0078] 2. Feature Pyramid Reconstruction Unit: This innovatively improves the standard Feature Pyramid Network (FPN) into a Pyramid Segmentation Module (PPSM) that incorporates the Shuffle-Attention module. This utilizes a learnable multi-scale feature aggregation mechanism to achieve efficient cross-level feature fusion, significantly improving the ability to capture subtle damage features such as concrete cracking and exposed rebar.
[0079] 3. Real-time inference acceleration mechanism: By optimizing the structure of the above modules, a new FastSAM-P network architecture is built. While maintaining pixel-level segmentation accuracy, it achieves a real-time processing speed of 65.11 FPS for 1080P resolution images on mobile devices.
[0080] 4. Dedicated dataset construction method: A semantic segmentation dataset containing fire-damaged building components in multiple scenarios is established. A database of damaged images with pixel-level annotations is generated through data augmentation strategies to provide a domain-adapted benchmark dataset for model training.
[0081] Compared with traditional segmentation networks, this invention achieves the coordinated optimization of segmentation accuracy and inference speed in the task of building fire damage identification, and has significant technological advancement and industrial application value.
Claims
1. A real-time segmentation method for building component fire damage based on FastSAM-P, characterized by comprising the following steps: Step 1: Identify the types and characteristics of two types of damage after fire: concrete cracking and exposed steel bars on the surface of RC structural components, and construct corresponding datasets for network training and verification; Step 2: Develop training strategies and evaluation indicators; Step 3: Construct a real-time segmentation network architecture for building component fire damage based on FastSAM-P; The step 3 includes the following contents: (1) replacing the C2F module with the DSCConv module in the backbone part of YOLOv8; based on the SCConv module, the Deformable Convolution module is added to form the DSCConv module; (2) replacing the SPPF module with the RFB module in the backbone part of YOLOv8; (3) replacing the FPN module in the FastSAM network with the PPSM module: based on the pyramid pooling module, the attention module is added to form the PPSM, and rich context information is extracted through multi-scale pooling operations, thereby enhancing the network's recognition ability of multi-scale targets in the concrete fire damage segmentation task; In step 3, PPSM performs global pooling operations of different scales on the input feature map to generate multi-scale feature representations, quickly extracts features through the attention module, and fuses them with the original feature map through upsampling, ultimately realizing the organic combination of global context information and local detail features; PPSM generates context information of multiple scales by performing pooling operations of different scales on the feature map, specifically including the following four scales of pooling: (31) Global pooling 1×1: Global average pooling is performed on the feature map to capture the global context information of the entire image; (32) Medium scale pooling 2×2: The feature map is divided into 2×2 sub-regions and pooled to extract semantic information of larger regions; (33) Smaller scale pooling 3×3 or 4×4: The feature map is divided into 3×3 or 4×4 sub-regions and pooled to focus on feature extraction of smaller regions; (34) Original scale features: The original unpooled feature map is retained to preserve high-resolution detail information; then PPSM restores the pooled features of different scales to the size of the original feature map through upsampling operations, and then performs pixel-by-pixel splicing with the original feature map; The step (34) includes the following specific steps: the pooled feature map of each scale is upsampled by bilinear interpolation to restore it to the same resolution as the original feature map, and then the upsampled multi-scale feature map is spliced with the original feature map in the channel dimension to form a fused feature representation. Finally, by fusing global context information and local detail features, the model processes large wall areas and narrow boundary areas at the same time, thereby improving segmentation accuracy.
2. The method for real-time segmentation of building component fire damage based on FastSAM-P as claimed in claim 1, wherein step 1 comprises the following specific steps: The dataset consists of 1,500 images taken from fire scenes and fire laboratories. These images clearly illustrate the types and characteristics of two types of damage: concrete cracking and exposed steel bars on the surface of RC structural components after fire. The images were taken with the image size set to a 1:1 square. The images were then imported into the labelme software for annotation. The generated JSON files were converted to XML files. Through data augmentation, the dataset was expanded to 8 times its original size and divided into training, validation, and test sets in a ratio of 7:2:
1.
3. The method for real-time segmentation of building component fire damage based on FastSAM-P as claimed in claim 2, wherein: In step 2, a multi-stage optimization strategy is used to train the FastSAM-P segmentation model to improve the recognition accuracy of post-fire concrete structure cracking and exposed reinforcement damage; During training, the batch size is set to 16, the total number of iterations is 100, and training is carried out for 500 rounds. A phased learning rate control is implemented: a linear warm-up strategy is used to alleviate gradient oscillations in the early stage, and a cosine annealing algorithm is used to gradually reduce the learning rate after the training is stable. In order to suppress overfitting, the L2 regularization term is introduced into the network optimization objective. By constraining the L2 norm of the weight parameters, the model complexity is reduced and the generalization ability is improved. The loss function adopts a weighted combination of BCE Loss + Dice Loss. Through this combination strategy, the pixel-level classification accuracy, i.e., the advantage of BCE loss, is maintained, while the regional structure consistency, i.e., the characteristic of Dice loss, is strengthened, as shown in Equation (3): (3); In formula (3), λ is a hyperparameter used to balance the weight between BCE loss and Dice loss.
4. The FastSAM-P-based real-time segmentation method for building components with fire damage as described in claim 3 is characterized in that, in step 2, a multidimensional quantitative indicator system is used to systematically evaluate the performance of the FastSAM-P model, specifically as follows: 1) the average intersection-over-union ratio is used as the core segmentation accuracy indicator, and the average overlap between the predicted area and the true annotated area in each category is calculated to quantitatively characterize the model's positioning accuracy for the fire damage area; 2) the parameter quantity is used as a model complexity evaluation indicator to reflect the model's storage requirements and computing resource consumption, providing a basis for the feasibility of edge device deployment; 3) the frame rate is used as a real-time evaluation indicator, and the average inference time of a single image is measured in the NVIDIA RTX 3090 graphics card environment to evaluate the model's application potential in real-time fire scene detection scenarios.