Urban emergency shelter environment assessment method based on image enhancement
Through the depth and shallow fusion module and the improved attention visual transformer model, the balance problem of traditional methods in fusion of low-level and high-level features and global context and local details is solved, which significantly improves the accuracy and model performance of environmental image segmentation in refuge places.
Patent Information
- Application Number
- CN202510374098.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-27
AI Technical Summary
The traditional shelter environment assessment method is difficult to integrate low-level features and high-level features of environmental images, resulting in insufficient integration of high-level semantic information in complex scenarios, and it is difficult to find a balance between global context and local details, resulting in inaccurate segmentation results.
The deep and shallow fusion module is used to fusion of shallow features and deep features. By segmenting and aggregating the deep features of the decoder and the shallow features of the encoder, the semantic gap between the encoder and the decoder is narrowed. At the same time, the improved attention visual transformer model is used to integrate local detail features and global scene layout features.
It effectively improves the accuracy of environmental image segmentation, balances the global context and local details, and improves the performance of the segmentation model.
Smart Images

Figure CN119888240A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of shelter environment data processing, and in particular to an urban emergency shelter environment assessment method based on image enhancement. Background Art
[0002] The environmental assessment of urban emergency shelters is a comprehensive assessment of emergency shelters in cities, aiming to analyze their availability, suitability and safety in the event of natural disasters, accidents or other emergencies; by evaluating factors such as the spatial layout, traffic accessibility, infrastructure support and environmental conditions of the shelters, ensure that the shelters can meet the shelter needs of the population and provide the necessary survival support.
[0003] However, traditional shelter environment assessment methods have the technical problem that when performing image segmentation, it is difficult to integrate the semantic gap between the low-level features and the high-level features of the environmental image, and the high-level features of the environmental image are not integrated enough in complex shelter environment scenes; traditional shelter environment assessment methods have the technical problem that when performing image segmentation, it is difficult to accurately capture local details while understanding the layout of the overall scene and the relationship between objects to capture global contextual information, resulting in inaccurate segmentation results due to the complex structure and layout of the shelter environment. Summary of the invention
[0004] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides an urban emergency shelter environment assessment method based on image enhancement. In view of the technical problem that the traditional shelter environment assessment method has the problem of difficulty in integrating the semantic gap between the low-level features of the environmental image and the high-level features of the environmental image when performing image segmentation, and insufficient integration of high-level semantic information in complex shelter environment scenes, this solution creatively adopts a deep-shallow fusion module to fuse shallow features and deep features, and effectively narrows the semantic gap between the encoder and the decoder by segmenting the deep features of the decoder and the shallow features of the encoder, and aggregating multi-scale features of the environmental image, thereby improving the accuracy of environmental image segmentation; in view of the technical problem that the traditional shelter environment assessment method has the problem of difficulty in understanding the layout of the overall scene and the relationship between objects to capture global context information while accurately capturing local details when performing image segmentation in the face of the complex structure and layout of the shelter environment, resulting in inaccurate segmentation results, this solution creatively adopts an improved attention visual transformer model for environmental image segmentation, effectively integrating local detail features and global overall scene layout features, balancing global context and local detail information, and improving the performance of the environmental image segmentation model.
[0005] The technical solution adopted by the present invention is as follows: The present invention provides an urban emergency shelter environment assessment method based on image enhancement, the method comprising the following steps:
[0006] Step S1: image acquisition;
[0007] Step S2: image preprocessing;
[0008] Step S3: constructing an environment image segmentation model;
[0009] Step S4: Environmental assessment model construction;
[0010] Step S5: Environmental assessment of the shelter.
[0011] Furthermore, in step S1, the image acquisition is used to acquire image data required for evaluating the environment of an urban emergency shelter, specifically by acquiring images from a shelter monitoring system to obtain an original environment image set;
[0012] The original environment image set specifically includes a historical original image set and a current original image set. Both the historical original image set and the current original image set specifically include images of shelter areas under different lighting conditions and images of shelter equipment under different lighting conditions. The historical original image set also includes scene category labels for image segmentation model training and quality grade labels for environmental assessment model training.
[0013] Furthermore, in step S2, the image preprocessing is used to preprocess the collected original environment image, and specifically includes the following steps:
[0014] Step S21: image cleaning, which is used to clean the original environment image data, specifically to remove noise in the historical original image set and the current original image set and to crop irrelevant areas to obtain a historical rough-processed image set and a current rough-processed image set;
[0015] Step S22: image expansion, used to expand the roughly processed image data, specifically, performing random geometric transformation and random brightness adjustment on the historical roughly processed image set and the current roughly processed image set and expanding the images to obtain a historical expanded image set and a current expanded image set;
[0016] Step S23: image enhancement, which is used to enhance the contrast of the expanded image data, specifically, using a histogram equalization method to enhance the image contrast of the historical expanded image set and the current expanded image set, to obtain a historical enhanced image set and a to-be-processed image set;
[0017] Step S24: image set segmentation, used to segment the image set, specifically performing image set segmentation on the historical enhanced image set to obtain a preliminary training set and a preliminary test set;
[0018] Step S25: performing preprocessing, specifically, preprocessing the current original image set through the image cleaning, the image expansion and the image enhancement to obtain the image set to be processed, and preprocessing the historical original image set through the image cleaning, the image expansion, the image enhancement and the image set segmentation to obtain the preliminary training set and the preliminary test set.
[0019] Further, in step S3, the environmental image segmentation model is constructed to construct a model required for segmenting the environmental image of the shelter, specifically by constructing an improved attention visual transformer model as the environmental image segmentation model;
[0020] The improved attention visual transformer model is specifically an encoder-decoder structure, the encoder structure is specifically a three-level structure, the first two levels of the structure specifically include an improved visual transformer module and a patch fusion layer, the third level of the structure is specifically an improved visual transformer module, the decoder structure is specifically a three-level structure, each level of the structure specifically includes an improved visual transformer module and a patch fusion layer, and finally the output layer outputs the image segmentation result;
[0021] The construction of the environmental image segmentation model specifically includes the following steps:
[0022] Step S31: constructing an improved visual transformer module, wherein the improved visual transformer module specifically includes improving the self-attention mechanism and the channel attention mechanism. The steps of constructing the improved visual transformer module include:
[0023] Step S311: Design an improved self-attention mechanism. The formula used is as follows:
[0024] ;
[0025] In the formula, represents the improved self-attention query, represents the improved self-attention key, Represents the improved self-attention value, represents the improved self-attention query transformation matrix, represents the improved self-attention key transformation matrix, represents the improved self-attention value transformation matrix, represents the input of the improved self-attention mechanism, represents the improved self-attention calculation function, represents the softmax function, represents a randomly generated learnable tensor used to refine the attention scores, represents element-wise multiplication;
[0026] Step S312: Design a channel attention mechanism. The formula used is as follows:
[0027] ;
[0028] In the formula, represents the channel attention calculation function, represents the input of the channel attention mechanism, represents the sigmoid function, represents the convolution operation function, represents the GELU activation function, Represents the global pooling function;
[0029] Step S313: Obtaining the output of the improved visual transformer module, the steps include:
[0030] Step S3131: Upper branch output calculation, the formula used is as follows:
[0031] ;
[0032] In the formula, represents the input of the improved visual transformer module, represents the branch calculation function on the improved visual transformer module, represents the feedforward network function, Representation layer normalization function;
[0033] Step S3132: The lower branch output is calculated, and the formula used is as follows:
[0034] ;
[0035] In the formula, It represents the cross self-attention query under the improved visual transformer module. Represents the cross self-attention key of the lower branch of the improved visual transformer module, Represents the cross self-attention value of the lower branch of the improved visual transformer module, represents the cross self-attention query transformation matrix of the lower branch of the improved visual transformer module, represents the cross-self-attention key transformation matrix of the lower branch of the improved visual transformer module, Represents the cross-self-attention value transformation matrix of the improved visual transformer module. represents the cross self-attention calculation function, Represents the branch calculation function under the improved visual transformer module;
[0036] Step S3133: Calculate the output of the improved visual transformer module, using the following formula:
[0037] ;
[0038] In the formula, represents the improved visual transformer module output calculation function, Represents the connection operation function;
[0039] Step S32: constructing a deep-shallow fusion module, the deep-shallow fusion module is used to fuse shallow features and deep features. The deep-shallow fusion module is constructed by the following steps:
[0040] Step S321: upper path output calculation, the steps include:
[0041] Step S3211: feature segmentation, the formula used is as follows:
[0042] ;
[0043] In the formula, represents the jth fusion feature, represents the j-th segmentation feature output function, represents the output of the i-th level structure of the decoder structure, Represents the output of the i-1th level structure of the encoder structure;
[0044] Step S3212: multi-scale convolution, the formula used is as follows:
[0045] ;
[0046] In the formula, Fu represents the multi-scale aggregation feature, Represents the convolution operation function with a convolution kernel size of 3×3 and an expansion factor of 1. represents the convolution operation function with a convolution kernel size of 3×3 and an expansion factor of 2. represents the convolution operation function with a convolution kernel size of 3×3 and an expansion factor of 5. represents the convolution operation function with a convolution kernel size of 3×3 and an expansion factor of 7. represents the first fusion feature, represents the second fusion feature, represents the third fusion feature, represents the fourth fusion feature;
[0047] Step S3213: Calculate the upper path output using the following formula:
[0048] ;
[0049] In the formula, Represents the path output of the deep and shallow fusion module;
[0050] Step S322: Calculate the output of the lower path, using the following formula:
[0051] ;
[0052] In the formula, It represents the path output of the deep and shallow fusion module. represents element-wise addition;
[0053] Step S323: Calculate the output of the deep and shallow fusion module. The formula used is as follows:
[0054] ;
[0055] Where DSF represents the output of the deep and shallow fusion module, which is used as the input of the i-1th level structure of the decoder structure;
[0056] Step S33: Design a loss function, specifically combining the cross entropy loss function and the Dice loss function as the loss function of the model. The formula used is as follows:
[0057] ;
[0058] In the formula, Loss represents the model loss function value, represents the loss function controlling the weight, represents the cross entropy loss function value, Represents the Dice loss function value;
[0059] Step S34: constructing a model and training it, specifically, constructing an improved attention visual transformer model through the improved visual transformer module construction, the deep and shallow fusion module construction and the designed loss function, and training the model based on a preliminary training set, verifying the model performance based on a preliminary test set, and obtaining an environmental image segmentation model.
[0060] Further, in step S4, the environmental assessment model is constructed to construct a model required for assessing the environment of the emergency shelter, specifically, a support vector machine model is constructed as the environmental assessment model;
[0061] The construction of the environmental assessment model specifically includes the following steps:
[0062] Step S41: image segmentation, specifically, using the environmental image segmentation model to perform image segmentation on the preliminary training set and the preliminary test set to obtain an evaluation training set and an evaluation test set;
[0063] Step S42: constructing a model and training it, specifically constructing a support vector machine model, and training the model based on the evaluation training set, and verifying the model performance based on the evaluation test set to obtain an environmental evaluation model.
[0064] Furthermore, in step S5, the shelter environment assessment is specifically to use the environmental image segmentation model to perform image segmentation on the image set to be processed, use the segmented image set as input of the environmental assessment model and perform environmental assessment, obtain shelter environment level reference data and conduct a comprehensive evaluation of the urban emergency shelter environment based on the shelter environment level reference data.
[0065] The beneficial effects achieved by the present invention using the above scheme are as follows:
[0066] (1) In order to address the technical issues of traditional shelter environment assessment methods, such as difficulty in integrating the semantic gap between low-level features and high-level features of environmental images during image segmentation, and insufficient integration of high-level semantic information in complex shelter environment scenes, this solution creatively uses a deep-shallow fusion module to fuse shallow features with deep features. By segmenting the deep features of the decoder and the shallow features of the encoder, and aggregating multi-scale features of the environmental image, the semantic gap between the encoder and decoder is effectively narrowed, thereby improving the accuracy of environmental image segmentation.
[0067] (2) In view of the technical problem that traditional methods for assessing shelter environments have problems with image segmentation, such as difficulty in understanding the overall scene layout and the relationship between objects to capture global context information while accurately capturing local details in the face of the complex structure and layout of the shelter environment, resulting in inaccurate segmentation results, this solution creatively adopts an improved attention visual transformer model for environmental image segmentation, effectively integrating local detail features and global overall scene layout features, balancing global context and local detail information, and improving the performance of the environmental image segmentation model. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 A schematic diagram of the process of the method for environmental assessment of urban emergency shelters based on image enhancement provided by the present invention;
[0069] Figure 2 It is a schematic diagram of the process of image preprocessing in step S2;
[0070] Figure 3 A schematic diagram of the process of constructing the environment image segmentation model in step S3;
[0071] Figure 4 A schematic diagram of the process of improving the visual transformer module construction in step S31;
[0072] Figure 5 This is a schematic diagram of the environment image segmentation model in step S3 of building the environment image segmentation model.
[0073] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION
[0074] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0075] In the description of the present invention, it should be understood that terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “top”, “bottom”, “inside” and “outside” indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the present invention.
[0076] Example 1, see Figure 1 The technical solution adopted by the present invention is as follows: The method for evaluating the environment of urban emergency shelters based on image enhancement provided by the present invention comprises the following steps:
[0077] Step S1: image acquisition;
[0078] Step S2: image preprocessing;
[0079] Step S3: constructing an environment image segmentation model;
[0080] Step S4: Environmental assessment model construction;
[0081] Step S5: Environmental assessment of the shelter.
[0082] Example 2, see Figure 1 In step S1, the image acquisition is used to acquire image data required for evaluating the environment of urban emergency shelters, specifically by acquiring images from the shelter monitoring system to obtain an original environment image set;
[0083] The original environment image set specifically includes a historical original image set and a current original image set. The historical original image set and the current original image set both specifically include images of shelter areas under different lighting conditions and images of shelter equipment under different lighting conditions. The historical original image set also includes scene category labels for image segmentation model training and quality grade labels for environmental assessment model training. The shelter area images under different lighting conditions specifically include images of shelter entrances and exits, images of shelter passages, images of shelter halls, and images of shelter obstacles. The shelter equipment images under different lighting conditions specifically include images of shelter lighting equipment, images of shelter sanitary facilities, images of shelter firefighting equipment, images of shelter first aid facilities, and images of shelter ventilation equipment. The scene category labels specifically include entrances and exits, passages, halls, obstacles, lighting equipment, sanitary facilities, firefighting equipment, first aid facilities, and ventilation equipment. The quality grade labels specifically include unqualified, qualified, good, and excellent.
[0084] Example 3, see Figure 1 and Figure 2 This embodiment is based on the above embodiment. In step S2, the image preprocessing is used to preprocess the collected original environment image, and specifically includes the following steps:
[0085] Step S21: image cleaning, which is used to clean the original environment image data, specifically to remove noise in the historical original image set and the current original image set and to crop irrelevant areas to obtain a historical rough-processed image set and a current rough-processed image set;
[0086] Step S22: image expansion, used to expand the roughly processed image data, specifically, performing random geometric transformation and random brightness adjustment on the historical roughly processed image set and the current roughly processed image set and expanding the images to obtain a historical expanded image set and a current expanded image set;
[0087] Step S23: image enhancement, which is used to enhance the contrast of the expanded image data, specifically, using a histogram equalization method to enhance the image contrast of the historical expanded image set and the current expanded image set, to obtain a historical enhanced image set and a to-be-processed image set;
[0088] Step S24: image set segmentation, used to segment the image set, specifically performing image set segmentation on the historical enhanced image set to obtain a preliminary training set and a preliminary test set;
[0089] Step S25: performing preprocessing, specifically, preprocessing the current original image set through the image cleaning, the image expansion and the image enhancement to obtain the image set to be processed, and preprocessing the historical original image set through the image cleaning, the image expansion, the image enhancement and the image set segmentation to obtain the preliminary training set and the preliminary test set.
[0090] Example 4, see Figure 1 , Figure 3 , Figure 4 and Figure 5 , this embodiment is based on the above embodiment. In step S3, the environmental image segmentation model is constructed to construct a model required for segmenting the environmental image of the shelter, specifically by constructing an improved attention visual transformer model as the environmental image segmentation model;
[0091] The improved attention visual transformer model is specifically an encoder-decoder structure, the encoder structure is specifically a three-level structure, the first two levels of the structure specifically include an improved visual transformer module and a patch fusion layer, the third level of the structure is specifically an improved visual transformer module, the decoder structure is specifically a three-level structure, each level of the structure specifically includes an improved visual transformer module and a patch fusion layer, and finally the output layer outputs the image segmentation result;
[0092] The construction of the environmental image segmentation model specifically includes the following steps:
[0093] Step S31: constructing an improved visual transformer module, wherein the improved visual transformer module specifically includes improving the self-attention mechanism and the channel attention mechanism. The steps of constructing the improved visual transformer module include:
[0094] Step S311: Design an improved self-attention mechanism. The formula used is as follows:
[0095] ;
[0096] In the formula, represents the improved self-attention query, represents the improved self-attention key, Represents the improved self-attention value, represents the improved self-attention query transformation matrix, represents the improved self-attention key transformation matrix, represents the improved self-attention value transformation matrix, represents the input of the improved self-attention mechanism, represents the improved self-attention calculation function, represents the softmax function, represents a randomly generated learnable tensor used to refine the attention scores, represents element-wise multiplication;
[0097] Step S312: Design a channel attention mechanism. The formula used is as follows:
[0098] ;
[0099] In the formula, represents the channel attention calculation function, represents the input of the channel attention mechanism, represents the sigmoid function, represents the convolution operation function, represents the GELU activation function, Represents the global pooling function;
[0100] Step S313: Obtaining the output of the improved visual transformer module, the steps include:
[0101] Step S3131: Upper branch output calculation, the formula used is as follows:
[0102] ;
[0103] In the formula, represents the input of the improved visual transformer module, represents the branch calculation function on the improved visual transformer module, represents the feedforward network function, Representation layer normalization function;
[0104] Step S3132: The lower branch output is calculated, and the formula used is as follows:
[0105] ;
[0106] In the formula, It represents the cross self-attention query under the improved visual transformer module. Represents the cross self-attention key of the lower branch of the improved visual transformer module, Represents the cross self-attention value of the lower branch of the improved visual transformer module, represents the cross self-attention query transformation matrix of the lower branch of the improved visual transformer module, represents the cross-self-attention key transformation matrix of the lower branch of the improved visual transformer module, represents the cross self-attention value transformation matrix of the lower branch of the improved visual transformer module, represents the cross self-attention calculation function, Represents the branch calculation function under the improved visual transformer module;
[0107] Step S3133: Calculate the output of the improved visual transformer module, using the following formula:
[0108] ;
[0109] In the formula, represents the improved visual transformer module output calculation function, Represents the connection operation function;
[0110] Step S32: constructing a deep-shallow fusion module, the deep-shallow fusion module is used to fuse shallow features and deep features. The deep-shallow fusion module is constructed by the following steps:
[0111] Step S321: upper path output calculation, the steps include:
[0112] Step S3211: feature segmentation, the formula used is as follows:
[0113] ;
[0114] In the formula, represents the jth fusion feature, represents the j-th segmentation feature output function, represents the output of the i-th level structure of the decoder structure, Represents the output of the i-1th level structure of the encoder structure;
[0115] Step S3212: multi-scale convolution, the formula used is as follows:
[0116] ;
[0117] In the formula, Fu represents the multi-scale aggregation feature, Represents the convolution operation function with a convolution kernel size of 3×3 and an expansion factor of 1. represents the convolution operation function with a convolution kernel size of 3×3 and an expansion factor of 2. represents the convolution operation function with a convolution kernel size of 3×3 and an expansion factor of 5. represents the convolution operation function with a convolution kernel size of 3×3 and an expansion factor of 7. represents the first fusion feature, represents the second fusion feature, represents the third fusion feature, represents the fourth fusion feature;
[0118] Step S3213: Calculate the upper path output using the following formula:
[0119] ;
[0120] In the formula, Represents the path output of the deep and shallow fusion module;
[0121] Step S322: Calculate the output of the lower path, using the following formula:
[0122] ;
[0123] In the formula, It represents the path output of the deep and shallow fusion module. represents element-wise addition;
[0124] Step S323: Calculate the output of the deep and shallow fusion module. The formula used is as follows:
[0125] ;
[0126] Where DSF represents the output of the deep and shallow fusion module, which is used as the input of the i-1th level structure of the decoder structure;
[0127] By performing the above operations, in view of the technical problems that the traditional shelter environment assessment method has difficulty in integrating the semantic gap between the low-level features and the high-level features of the environmental image during image segmentation, and the insufficient integration of high-level semantic information in complex shelter environment scenes, this solution creatively adopts a deep-shallow fusion module to fuse shallow features and deep features. By segmenting the deep features of the decoder and the shallow features of the encoder, and aggregating the multi-scale features of the environmental image, the semantic gap between the encoder and the decoder is effectively narrowed, and the accuracy of environmental image segmentation is improved;
[0128] Step S33: Design a loss function, specifically combining the cross entropy loss function and the Dice loss function as the loss function of the model. The formula used is as follows:
[0129] ;
[0130] In the formula, Loss represents the model loss function value, represents the loss function controlling the weight, represents the cross entropy loss function value, Represents the Dice loss function value;
[0131] Step S34: constructing a model and training it, specifically, constructing an improved attention visual transformer model through the improved visual transformer module construction, the deep and shallow fusion module construction and the designed loss function, and training the model based on a preliminary training set, verifying the model performance based on a preliminary test set, and obtaining an environmental image segmentation model.
[0132] By performing the above operations, the traditional shelter environment assessment method has the problem that when performing image segmentation, it is difficult to understand the layout of the overall scene and the relationship between objects to capture global context information while accurately capturing local details in the face of the complex structure and layout of the shelter environment, resulting in inaccurate segmentation results. This solution creatively adopts an improved attention visual transformer model for environmental image segmentation, effectively integrating local detail features and global overall scene layout features, balancing global context and local detail information, and improving the performance of the environmental image segmentation model.
[0133] Example 5, see Figure 1 , this embodiment is based on the above embodiment, in step S4, the environmental assessment model is constructed to construct a model required for assessing the environment of the emergency shelter, specifically, a support vector machine model is constructed as the environmental assessment model;
[0134] The construction of the environmental assessment model specifically includes the following steps:
[0135] Step S41: image segmentation, specifically, using the environmental image segmentation model to perform image segmentation on the preliminary training set and the preliminary test set to obtain an evaluation training set and an evaluation test set;
[0136] Step S42: constructing a model and training it, specifically constructing a support vector machine model, and training the model based on the evaluation training set, and verifying the model performance based on the evaluation test set to obtain an environmental evaluation model.
[0137] Example 6, see Figure 1 This embodiment is based on the above embodiment. In step S5, the shelter environment assessment is specifically to use the environmental image segmentation model to perform image segmentation on the image set to be processed, use the segmented image set as the input of the environmental assessment model and perform environmental assessment, obtain shelter environment level reference data and conduct a comprehensive evaluation of the urban emergency shelter environment based on the shelter environment level reference data.
[0138] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0139] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the invention.
[0140] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.
Claims
1. An urban emergency shelter environment assessment method based on image enhancement, characterized by: The method comprises the following steps: Step S1: image acquisition, obtaining an original environment image set through image acquisition, wherein the original environment image set specifically includes a historical original image set and a current original image set; Step S2: image preprocessing, through image preprocessing, obtaining a to-be-processed image set, a preliminary training set and a preliminary test set; Step S3: constructing an environment image segmentation model, specifically by constructing an improved attention visual transformer model as the environment image segmentation model; Step S4: constructing an environmental assessment model, specifically constructing a support vector machine model as an environmental assessment model; Step S5: evaluating the environment of the refuge site, specifically, evaluating the environment of the refuge site based on the environmental image segmentation model and the environmental assessment model to obtain reference data of the environmental grade of the refuge site; In step S3, the improved attention visual transformer model is specifically an encoder-decoder structure, the encoder structure is specifically a three-level structure, the first two levels of the structure specifically include an improved visual transformer module and a patch fusion layer, the third level of the structure is specifically an improved visual transformer module, the decoder structure is specifically a three-level structure, each level of the structure specifically includes an improved visual transformer module and a patch fusion layer, and finally the output layer outputs the image segmentation result.
2. The method for evaluating the environment of urban emergency shelters based on image enhancement according to claim 1 is characterized in that: The construction of the environmental image segmentation model specifically includes the following steps: Step S31: constructing an improved visual transformer module, wherein the improved visual transformer module specifically includes improving the self-attention mechanism and the channel attention mechanism. The steps of constructing the improved visual transformer module include: Step S311: Design an improved self-attention mechanism. The formula used is as follows: ; In the formula, represents the improved self-attention query, represents the improved self-attention key, Represents the improved self-attention value, represents the improved self-attention query transformation matrix, represents the improved self-attention key transformation matrix, represents the improved self-attention value transformation matrix, represents the input of the improved self-attention mechanism, represents the improved self-attention calculation function, represents the softmax function, represents a randomly generated learnable tensor used to refine the attention scores, represents element-wise multiplication; Step S312: Design a channel attention mechanism. The formula used is as follows: ; In the formula, represents the channel attention calculation function, represents the input of the channel attention mechanism, represents the sigmoid function, represents the convolution operation function, represents the GELU activation function, Represents the global pooling function; Step S313: Obtaining the output of the improved visual transformer module, the steps include: Step S3131: Upper branch output calculation, the formula used is as follows: ; In the formula, represents the input of the improved visual transformer module, represents the branch calculation function on the improved visual transformer module, represents the feedforward network function, Representation layer normalization function; Step S3132: The lower branch output is calculated, and the formula used is as follows: ; In the formula, It represents the cross self-attention query under the improved visual transformer module. Represents the cross self-attention key of the lower branch of the improved visual transformer module, Represents the cross self-attention value of the lower branch of the improved visual transformer module, represents the cross self-attention query transformation matrix of the lower branch of the improved visual transformer module, represents the cross-self-attention key transformation matrix of the lower branch of the improved visual transformer module, Represents the cross-self-attention value transformation matrix of the improved visual transformer module. represents the cross self-attention calculation function, Represents the branch calculation function under the improved visual transformer module; Step S3133: Calculate the output of the improved visual transformer module, using the following formula: ; In the formula, represents the improved visual transformer module output calculation function, Represents the connection operation function; Step S32: constructing a deep-shallow fusion module, the deep-shallow fusion module is used to fuse shallow features and deep features. The deep-shallow fusion module is constructed by the following steps: Step S321: upper path output calculation, the steps include: Step S3211: feature segmentation, the formula used is as follows: ; In the formula, represents the jth fusion feature, represents the j-th segmentation feature output function, represents the output of the i-th level structure of the decoder structure, Represents the output of the i-1th level structure of the encoder structure; Step S3212: multi-scale convolution, the formula used is as follows: ; In the formula, Fu represents the multi-scale aggregation feature, Represents the convolution operation function with a convolution kernel size of 3×3 and an expansion factor of 1. represents the convolution operation function with a convolution kernel size of 3×3 and an expansion factor of 2. represents the convolution operation function with a convolution kernel size of 3×3 and an expansion factor of 5. represents the convolution operation function with a convolution kernel size of 3×3 and an expansion factor of 7. represents the first fusion feature, represents the second fusion feature, represents the third fusion feature, represents the fourth fusion feature; Step S3213: Calculate the upper path output using the following formula: ; In the formula, Represents the path output of the deep and shallow fusion module; Step S322: Calculate the output of the lower path, using the following formula: ; In the formula, Represents the path output of the deep and shallow fusion module, represents element-wise addition; Step S323: Calculate the output of the deep and shallow fusion module. The formula used is as follows: ; Where DSF represents the output of the deep and shallow fusion module, which is used as the input of the i-1th level structure of the decoder structure; Step S33: Design a loss function, specifically combining the cross entropy loss function and the Dice loss function as the loss function of the model. The formula used is as follows: ; In the formula, Loss represents the model loss function value, represents the loss function controlling the weight, represents the cross entropy loss function value, Represents the Dice loss function value; Step S34: constructing a model and training it, specifically, constructing an improved attention visual transformer model through the improved visual transformer module construction, the deep and shallow fusion module construction and the designed loss function, and training the model based on a preliminary training set, verifying the model performance based on a preliminary test set, and obtaining an environmental image segmentation model.
3. The method for evaluating the environment of urban emergency shelters based on image enhancement according to claim 1 is characterized in that: In step S4, the environmental assessment model is constructed to construct a model required for assessing the environment of the emergency shelter, specifically, a support vector machine model is constructed as the environmental assessment model; The construction of the environmental assessment model specifically includes the following steps: Step S41: image segmentation, specifically, using the environmental image segmentation model to perform image segmentation on the preliminary training set and the preliminary test set to obtain an evaluation training set and an evaluation test set; Step S42: constructing a model and training it, specifically constructing a support vector machine model, and training the model based on the evaluation training set, and verifying the model performance based on the evaluation test set to obtain an environmental evaluation model.
4. The method for evaluating the environment of urban emergency shelters based on image enhancement according to claim 1, characterized in that: In step S1, the image acquisition is used to acquire image data required for evaluating the environment of urban emergency shelters, specifically by acquiring images from the shelter monitoring system to obtain an original environment image set; The original environment image set specifically includes a historical original image set and a current original image set. Both the historical original image set and the current original image set specifically include images of shelter areas under different lighting conditions and images of shelter equipment under different lighting conditions. The historical original image set also includes scene category labels for image segmentation model training and quality grade labels for environmental assessment model training.
5. The method for evaluating the environment of urban emergency shelters based on image enhancement according to claim 1 is characterized in that: In step S2, the image preprocessing is used to preprocess the collected original environment image, and specifically includes the following steps: Step S21: image cleaning, which is used to clean the original environment image data, specifically to remove noise in the historical original image set and the current original image set and to crop irrelevant areas to obtain a historical rough-processed image set and a current rough-processed image set; Step S22: image expansion, used to expand the roughly processed image data, specifically, performing random geometric transformation and random brightness adjustment on the historical roughly processed image set and the current roughly processed image set and expanding the images to obtain a historical expanded image set and a current expanded image set; Step S23: image enhancement, which is used to enhance the contrast of the expanded image data, specifically, using a histogram equalization method to enhance the image contrast of the historical expanded image set and the current expanded image set, to obtain a historical enhanced image set and a to-be-processed image set; Step S24: image set segmentation, used to segment the image set, specifically performing image set segmentation on the historical enhanced image set to obtain a preliminary training set and a preliminary test set; Step S25: performing preprocessing, specifically, preprocessing the current original image set through the image cleaning, the image expansion and the image enhancement to obtain the image set to be processed, and preprocessing the historical original image set through the image cleaning, the image expansion, the image enhancement and the image set segmentation to obtain the preliminary training set and the preliminary test set.
6. The method for evaluating the environment of urban emergency shelters based on image enhancement according to claim 1, characterized in that: In step S5, the shelter environment assessment is specifically to use the environmental image segmentation model to perform image segmentation on the image set to be processed, use the segmented image set as the input of the environmental assessment model and perform environmental assessment, obtain shelter environment level reference data and conduct a comprehensive evaluation of the urban emergency shelter environment based on the shelter environment level reference data.
Citation Information
Patent Citations
Brain tumor segmentation method based on improved scale fusion
CN119027429A
Light-weight eye fundus blood vessel image segmentation model based on Mama
CN119479021A
Cloth defect detection method and system based on multi-scale feature fusion and diffusion pyramid network
CN119515861A
Lightweight bearing surface defect detection method and system based on improved YOLOv10n
CN119624897A
Urban emergency refuge congestion risk assessment method and system based on image enhancement
CN119672549A
Cited By
System and method for safe arrangement of archives based on preposition of archive elements
CN120510622A