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 semantic gap and insufficient information integration problems of environmental image segmentation in traditional methods are solved, and more accurate image segmentation and evaluation are achieved.
Patent Information
- Application Number
- CN202510374098.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-03-27
AI Technical Summary
Traditional shelter environment assessment methods are difficult to integrate low-level and high-level features of environmental images in complex scenarios, resulting in inaccurate segmentation results and it is difficult to capture global context and local detailed information at the same time.
The depth and shallow fusion module and the improved attention visual transformer model are adopted. Through the fusion of shallow and deep features, combined with multi-scale feature aggregation and improved attention mechanism, an environmental image segmentation model is built to integrate local details and global layout features.
It 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 CN119888240B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of environmental data processing for emergency shelters, and specifically refers to an environmental assessment method for urban emergency shelters based on image enhancement. Background Art
[0002] The environmental assessment of urban emergency shelters is a comprehensive assessment of the places used for emergency shelters in the city, 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 guarantee, and environmental conditions of the place, it is ensured that the place can meet the shelter needs of the population and provide necessary survival support.
[0003] However, the traditional environmental assessment method for shelters has technical problems that when performing image segmentation, it is difficult to fuse the semantic gap between the low-level features and high-level features of the environmental image, and there is insufficient integration of high-level semantic information in complex shelter environmental scenarios; when performing image segmentation, the traditional environmental assessment method for shelters has technical problems that in the face of the complex structure and layout of the shelter environment, it is difficult to accurately capture local details while understanding the layout of the overall scene and the relationship between objects to capture global context information, resulting in inaccurate segmentation results. Summary of the Invention
[0004] In view of the above situation, to overcome the defects of the prior art, the present invention provides an environmental assessment method for urban emergency shelters based on image enhancement. Aiming at the technical problems that the traditional environmental assessment method for shelters has when performing image segmentation, it is difficult to fuse the semantic gap between the low-level features and high-level features of the environmental image, and there is insufficient integration of high-level semantic information in complex shelter environmental scenarios, this solution creatively uses a deep and 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 multi-scale features of the environmental image, the semantic gap between the encoder and the decoder is effectively reduced, and the accuracy of environmental image segmentation is improved; aiming at the technical problems that the traditional environmental assessment method for shelters has when performing image segmentation, in the face of the complex structure and layout of the shelter environment, it is difficult to accurately capture local details while understanding the layout of the overall scene and the relationship between objects to capture global context information, resulting in inaccurate segmentation results, this solution creatively uses an improved attention vision 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 environmental assessment method for urban emergency shelters based on image enhancement, and this method includes the following steps:
[0006] Step S1: Image acquisition;
[0007] Step S2: Image preprocessing;
[0008] Step S3: Construction of an environmental image segmentation model;
[0009] Step S4: Construction of an environmental assessment model;
[0010] Step S5: Environmental assessment of the shelter.
[0011] Further, in step S1, the image acquisition is used to collect image data required for assessing the environment of urban emergency shelters. Specifically, it is to collect original environmental image sets by collecting images from the shelter monitoring system;
[0012] The original environmental image sets specifically include 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 and images of shelter facilities under different lighting conditions. The historical original image set also includes scene category labels for training the image segmentation model and quality grade labels for training the environmental assessment model.
[0013] Further, in step S2, the image preprocessing is used to preprocess the collected original environmental images, and specifically includes the following steps:
[0014] Step S21: Image cleaning, which is used to clean the original environmental image data. Specifically, it is to remove the noise in the historical original image set and the current original image set and crop irrelevant regions to obtain a historical roughly processed image set and a current roughly processed image set;
[0015] Step S22: Image augmentation, which is used to augment the roughly processed image data. Specifically, it is to perform random geometric transformation and random brightness adjustment on the historical roughly processed image set and the current roughly processed image set and augment the images to obtain a historical augmented image set and a current augmented image set;
[0016] Step S23: Image enhancement, which is used to enhance the contrast of the augmented image data. Specifically, it is to enhance the image contrast of the historical augmented image set and the current augmented image set by using the histogram equalization method to obtain a historical enhanced image set and a to-be-processed image set;
[0017] Step S24: Image set segmentation, which is used to segment the image set. Specifically, it is to segment the historical enhanced image set to obtain a preliminary training set and a preliminary test set;
[0018] Step S25: Perform preprocessing. Specifically, preprocess the current original image set through the image cleaning, image augmentation, and image enhancement to obtain a to-be-processed image set. Preprocess the historical original image set through the image cleaning, image augmentation, image enhancement, and image set segmentation to obtain a preliminary training set and a preliminary test set.
[0019] Further, in step S3, the environmental image segmentation model construction is used to construct a model required for segmenting the refuge environmental image. Specifically, construct an improved attention vision transformer model as the environmental image segmentation model;
[0020] The improved attention vision transformer model is specifically an encoder-decoder structure. The encoder structure is specifically a three-level structure. The first two levels of structures both specifically include an improved vision transformer module and a patch fusion layer. The third-level structure is specifically an improved vision transformer module. The decoder structure is specifically a three-level structure. Each level of structure specifically includes an improved vision transformer module and a patch fusion layer. Finally, the image segmentation result is output by the output layer;
[0021] The construction of the environmental image segmentation model specifically includes the following steps:
[0022] Step S31: Construct an improved vision transformer module. The improved vision transformer module specifically includes an improved self-attention mechanism and a channel attention mechanism. The steps for constructing the improved vision 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 for refining the attention score, represents element-wise multiplication;
[0026] Step S312: Design a channel attention mechanism, and 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: Obtain the output of the improved vision transformer module, and the steps include:
[0030] Step S3131: Calculate the output of the upper branch, and the formula used is as follows:
[0031] ;
[0032] In the formula, represents the input of the improved vision transformer module, represents the upper branch calculation function of the improved vision transformer module, represents the feed-forward network function, represents the layer normalization function;
[0033] Step S3132: Calculate the output of the lower branch, and the formula used is as follows:
[0034] ;
[0035] In the formula, represents the cross self-attention query of the lower branch of the improved vision transformer module, represents the cross self-attention key of the lower branch of the improved vision transformer module, represents the cross self-attention value of the lower branch of the improved vision transformer module, represents the cross self-attention query transformation matrix of the lower branch of the improved vision transformer module, represents the cross self-attention key transformation matrix of the lower branch of the improved vision transformer module, represents the cross self-attention value transformation matrix of the lower branch of the improved vision transformer module, represents the cross self-attention calculation function, represents the lower branch calculation function of the improved vision transformer module;
[0036] Step S3133: Calculate the output of the improved vision transformer module, and the formula used is as follows:
[0037] ;
[0038] In the formula, represents the output calculation function of the improved vision transformer module, represents the connection operation function;
[0039] Step S32: Construction of the shallow-depth fusion module. The shallow-depth fusion module is used to fuse shallow features and deep features. The steps for constructing the shallow-depth fusion module include:
[0040] Step S321: Calculation of the upper path output. The steps include:
[0041] Step S3211: Feature segmentation. The formula used is as follows:
[0042] ;
[0043] In the formula, represents the j-th fusion feature, represents the output function of the j-th segmentation feature, represents the output of the i-th level structure of the decoder structure, represents the output of the (i - 1)-th 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 coefficient of 1, represents the convolution operation function with a convolution kernel size of 3×3 and an expansion coefficient of 2, represents the convolution operation function with a convolution kernel size of 3×3 and an expansion coefficient of 5, represents the convolution operation function with a convolution kernel size of 3×3 and an expansion coefficient 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. The formula used is as follows:
[0048] ;
[0049] In the formula, represents the upper path output of the shallow-depth fusion module;
[0050] Step S322: Calculate the output of the lower path. The formula used is as follows:
[0051] ;
[0052] In the formula, represents the output of the lower path 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] In the formula, DSF represents the output of the deep and shallow fusion module, which is used as the input of the (i - 1)-th level structure of the decoder structure;
[0056] Step S33: Design the loss function. Specifically, combine 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 value of the loss function of the model, represents the control weight of the loss function, represents the value of the cross-entropy loss function, represents the value of the Dice loss function;
[0059] Step S34: Construct and train the model. Specifically, construct the improved attention vision transformer model through the constructed improved vision transformer module, the constructed deep and shallow fusion module, and the designed loss function, and train the model based on the preliminary training set and verify the model performance based on the preliminary test set to obtain the environmental image segmentation model.
[0060] Furthermore, in step S4, the construction of the environmental evaluation model is used to construct the model required for evaluating the environment of the emergency shelter. Specifically, construct a support vector machine model as the environmental evaluation model;
[0061] The construction of the environmental evaluation model specifically includes the following steps:
[0062] Step S41: Image segmentation. Specifically, use the environmental image segmentation model to perform image segmentation on the preliminary training set and the preliminary test set to obtain the evaluation training set and the evaluation test set;
[0063] Step S42: Construct and train the model. Specifically, construct a support vector machine model, train the model based on the evaluation training set, and verify the model performance based on the evaluation test set to obtain the environmental evaluation model.
[0064] Further, in step S5, the shelter environment assessment specifically uses the environmental image segmentation model to segment the to-be-processed image set, takes the segmented image set as the input of the environmental assessment model for environmental assessment, obtains the reference data of the shelter environment level, and comprehensively evaluates the urban emergency shelter environment based on the reference data of the shelter environment level.
[0065] The beneficial effects achieved by the present invention using the above solution are as follows:
[0066] (1) Aiming at the technical problems existing in the traditional shelter environment assessment method that when performing image segmentation, it is difficult to fuse the semantic gap between the low-level features and high-level features of the environmental image, and there is insufficient integration of high-level semantic information in complex shelter environment scenarios, this solution creatively uses a shallow-deep 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 reduced, and the accuracy of environmental image segmentation is improved.
[0067] (2) Aiming at the technical problems existing in the traditional shelter environment assessment method that when performing image segmentation, in the face of the complex structure and layout of the shelter environment, it is difficult to accurately capture local details while understanding the layout of the overall scene and the relationship between objects to capture global context information, resulting in inaccurate segmentation results. This solution creatively uses an improved attention vision 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 It is a schematic flowchart of the method for evaluating the urban emergency shelter environment based on image enhancement provided by the present invention;
[0069] Figure 2 It is a schematic flowchart of the image preprocessing in step S2;
[0070] Figure 3 It is a schematic flowchart of the construction of the environmental image segmentation model in step S3;
[0071] Figure 4 It is a schematic flowchart of the construction of the improved vision transformer module in step S31;
[0072] Figure 5 It is a schematic diagram of the environmental image segmentation model in the construction of the environmental image segmentation model in step S3.
[0073] The accompanying drawings are used to provide a further understanding of the present invention and form a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention. Detailed Embodiments
[0074] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0075] In the description of the present invention, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", etc. indicating the orientation or positional relationship are based on the orientation or positional relationship shown in the accompanying drawings. They 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 orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation to the present invention.
[0076] Embodiment 1, refer to 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 includes the following steps:
[0077] Step S1: Image acquisition;
[0078] Step S2: Image preprocessing;
[0079] Step S3: Construction of an environmental image segmentation model;
[0080] Step S4: Construction of an environmental evaluation model;
[0081] Step S5: Evaluation of the environment of the shelter.
[0082] Embodiment 2, refer to Figure 1 , in Step S1, the image acquisition is used to acquire the image data required for evaluating the environment of urban emergency shelters. Specifically, the original environmental image set is obtained by acquiring images from the shelter monitoring system.
[0083] The original environmental 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 facilities under different lighting conditions. The historical original image set also includes scene category labels for training the image segmentation model and quality grade labels for training the environmental assessment model. The images of shelter areas under different lighting conditions specifically include images of shelter entrances and exits, shelter passageways, shelter halls, and shelter obstacles. The images of shelter facilities under different lighting conditions specifically include images of shelter lighting facilities, shelter sanitation facilities, shelter fire-fighting facilities, shelter first-aid facilities, and shelter ventilation facilities. The scene category labels specifically include entrances and exits, passageways, halls, obstacles, lighting facilities, sanitation facilities, fire-fighting facilities, first-aid facilities, and ventilation facilities. The quality grade labels specifically include unqualified, qualified, good, and excellent.
[0084] Embodiment 3. Refer to Figure 1 and Figure 2 Based on the above embodiment, in step S2, the image preprocessing is used to preprocess the collected original environmental images, and specifically includes the following steps:
[0085] Step S21: Image cleaning, which is used to clean the original environmental image data, specifically to remove the noise in the historical original image set and the current original image set and crop the irrelevant areas to obtain a historical roughly processed image set and a current roughly processed image set;
[0086] Step S22: Image augmentation, which is used to augment the roughly processed image data, specifically to perform random geometric transformations and random brightness adjustments on the historical roughly processed image set and the current roughly processed image set and augment the images to obtain a historical augmented image set and a current augmented image set;
[0087] Step S23: Image enhancement, which is used to enhance the contrast of the augmented image data, specifically to use the histogram equalization method to enhance the image contrast of the historical augmented image set and the current augmented image set to obtain a historical enhanced image set and an image set to be processed;
[0088] Step S24: Image set segmentation, which is used to segment the image set, specifically to segment the historical enhanced image set to obtain a preliminary training set and a preliminary test set;
[0089] Step S25: Perform preprocessing. Specifically, preprocess the current original image set through the image cleaning, image augmentation, and image enhancement to obtain the image set to be processed, and preprocess the historical original image set through the image cleaning, image augmentation, image enhancement, and image set segmentation to obtain the preliminary training set and the preliminary test set.
[0090] Example 4, refer to Figure 1 、 Figure 3 、 Figure 4 and Figure 5 , this example is based on the above example. In step S3, the environmental image segmentation model is constructed to build a model required for segmenting the refuge environmental image. Specifically, an improved attention vision transformer model is constructed as the environmental image segmentation model;
[0091] The improved attention vision transformer model is specifically an encoder-decoder structure. The encoder structure is specifically a three-level structure. The first two levels of structures both specifically include an improved vision transformer module and a patch fusion layer. The third-level structure is specifically an improved vision transformer module. The decoder structure is specifically a three-level structure. Each level of structure specifically includes an improved vision transformer module and a patch fusion layer. Finally, the image segmentation result is output by the output layer;
[0092] The construction of the environmental image segmentation model specifically includes the following steps:
[0093] Step S31: Construction of the improved vision transformer module. The improved vision transformer module specifically includes an improved self-attention mechanism and a channel attention mechanism. The steps for constructing the improved vision transformer module include:
[0094] Step S311: Design the 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 for refining the attention score, Denotes element-wise multiplication;
[0097] Step S312: Design a channel attention mechanism, and the formula used is as follows:
[0098] ;
[0099] In the formula, Denotes the channel attention calculation function, Denotes the input of the channel attention mechanism, Denotes the sigmoid function, Denotes the convolution operation function, Denotes the GELU activation function, Denotes the global pooling function;
[0100] Step S313: Obtain the output of the improved vision transformer module, and the steps include:
[0101] Step S3131: Calculate the output of the upper branch, and the formula used is as follows:
[0102] ;
[0103] In the formula, Denotes the input of the improved vision transformer module, Denotes the upper branch calculation function of the improved vision transformer module, Denotes the feed-forward network function, Denotes the layer normalization function;
[0104] Step S3132: Calculate the output of the lower branch, and the formula used is as follows:
[0105] ;
[0106] In the formula, Denotes the cross self-attention query of the lower branch of the improved vision transformer module, Denotes the cross self-attention key of the lower branch of the improved vision transformer module, Denotes the cross self-attention value of the lower branch of the improved vision transformer module, Denotes the cross self-attention query transformation matrix of the lower branch of the improved vision transformer module, Denotes the cross self-attention key transformation matrix of the lower branch of the improved vision transformer module, Denotes the cross self-attention value transformation matrix of the lower branch of the improved vision transformer module, Denotes the cross self-attention calculation function, Denotes the lower branch calculation function of the improved vision transformer module;
[0107] Step S3133: Calculate the output of the improved vision transformer module, and the formula used is as follows:
[0108] ;
[0109] In the formula, represents the output calculation function of the improved vision transformer module, represents the connection operation function;
[0110] Step S32: Construction of the shallow and deep fusion module. The shallow and deep fusion module is used to fuse shallow features and deep features. The steps for constructing the shallow and deep fusion module include:
[0111] Step S321: Calculation of the output of the upper path. The steps include:
[0112] Step S3211: Feature segmentation. The formula used is as follows:
[0113] ;
[0114] In the formula, represents the j-th fused feature, represents the output function of the j-th segmented feature, represents the output of the i-th level structure of the decoder structure, represents the output of the (i - 1)-th 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 aggregated feature, represents the convolution operation function with a convolution kernel size of 3×3 and an expansion coefficient of 1, represents the convolution operation function with a convolution kernel size of 3×3 and an expansion coefficient of 2, represents the convolution operation function with a convolution kernel size of 3×3 and an expansion coefficient of 5, represents the convolution operation function with a convolution kernel size of 3×3 and an expansion coefficient of 7, represents the first fused feature, represents the second fused feature, represents the third fused feature, represents the fourth fused feature;
[0118] Step S3213: Calculate the output of the upper path. The formula used is as follows:
[0119] ;
[0120] In the formula, represents the output of the upper path of the shallow and deep fusion module;
[0121] Step S322: Calculate the output of the lower path. The formula used is as follows:
[0122] ;
[0123] In the formula, represents the output of the lower path of the shallow and deep fusion module, represents element-wise addition;
[0124] Step S323: Calculate the output of the shallow and deep fusion module. The formula used is as follows:
[0125] ;
[0126] In the formula, DSF represents the output of the shallow and deep fusion module, which is used as the input of the (i - 1)-th level structure of the decoder structure;
[0127] By performing the above operations, aiming at the technical problems of the traditional shelter environment assessment method that it is difficult to fuse the semantic gap between the low-level features and high-level features of the environmental image during image segmentation, and there is insufficient integration of high-level semantic information in complex shelter environment scenarios, this solution creatively uses a shallow and deep 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 reduced, and the accuracy of environmental image segmentation is improved;
[0128] Step S33: Design the loss function. Specifically, combine 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 value of the model loss function, represents the control weight of the loss function, represents the value of the cross-entropy loss function, represents the value of the Dice loss function;
[0131] Step S34: Construct and train the model. Specifically, construct the improved attention vision transformer model through the construction of the improved vision transformer module, the construction of the shallow and deep fusion module, and the design of the loss function, and train the model based on the preliminary training set and verify the model performance based on the preliminary test set to obtain the environmental image segmentation model.
[0132] By performing the above operations, in view of the technical problem that in the traditional method for evaluating the environment of a shelter, when performing image segmentation, it is difficult to capture global context information while understanding the layout of the overall scene and the relationships between objects in the complex structure and layout of the shelter environment, and accurately capture local details, resulting in inaccurate segmentation results, this solution creatively uses an improved attention vision 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. Refer to Figure 1 , based on the above example, in step S4, the construction of the environmental assessment model is used to build a model required for evaluating the environment of an emergency shelter, specifically, a support vector machine model is built 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: Build and train the model, specifically, build a support vector machine model, train the model based on the evaluation training set, and verify the model performance based on the evaluation test set to obtain an environmental assessment model.
[0137] Example 6. Refer to Figure 1 , based on the above example, in step S5, the evaluation of the shelter environment 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 evaluation to obtain reference data on the environmental level of the shelter, and comprehensively evaluate the environment of urban emergency shelters based on the reference data on the environmental level of the shelter.
[0138] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device.
[0139] Although embodiments of the present invention have been shown and described, those of ordinary skill in the art will understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention.
[0140] The present invention and its embodiments have been described above. Such description is not restrictive. What is shown in the drawings is only one of the embodiments of the present invention, and the actual structure is not limited thereto. Generally speaking, if those of ordinary skill in the art are inspired by it and, without departing from the gist of the present invention, creatively design structural modes and embodiments similar to the technical solution, they shall fall within the protection scope of the present invention.
Claims
1. An environmental assessment method for urban emergency shelters based on image enhancement, characterized in that: The method includes the following steps: Step S1: Image acquisition. Through image acquisition, an original environment image set is obtained. 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, an image set to be processed, a preliminary training set, and a preliminary test set are obtained. Step S3: Construction of an environmental image segmentation model. Specifically, an improved attention vision transformer model is constructed as the environmental image segmentation model. Step S4: Construction of an environmental assessment model. Specifically, a support vector machine model is constructed as the environmental assessment model. Step S5: Refuge site environmental assessment. Specifically, based on the environmental image segmentation model and the environmental assessment model, a refuge site environmental assessment is carried out to obtain refuge site environmental grade reference data. In step S3, the improved attention vision transformer model is specifically an encoder-decoder structure. The encoder structure is specifically a three-level structure. The first two levels of the structure both specifically include an improved vision transformer module and a patch fusion layer. The third level of the structure is specifically an improved vision transformer module. The decoder structure is specifically a three-level structure. Each level of the structure specifically includes an improved vision transformer module and a patch fusion layer. Finally, the image segmentation result is output by the output layer. The improved vision transformer module includes designing an improved self-attention mechanism, and 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 for refining the attention scores, represents element-wise multiplication; In the improved attention vision transformer model, the construction of a deep and shallow fusion module. The deep and shallow fusion module is used to fuse shallow features and deep features. The steps for constructing the deep and shallow fusion module include: Step S321: Calculation of the upper path output. The steps include: Step S3211: Feature segmentation. The formula used is as follows: ; In the formula, represents the j-th fusion feature, represents the output function of the j-th segmentation feature, represents the output of the i-th level structure of the decoder structure, represents the output of the (i - 1)-th level structure of the encoder structure; Step S3212: Multi-scale convolution. The formula used is as follows: ; Wherein, Fu represents the multi-scale aggregation feature, represents a convolution operation function with a convolution kernel size of 3×3 and an expansion coefficient of 1, represents a convolution operation function with a convolution kernel size of 3×3 and an expansion coefficient of 2, represents a convolution operation function with a convolution kernel size of 3×3 and an expansion coefficient of 5, represents a convolution operation function with a convolution kernel size of 3×3 and an expansion coefficient of 7, represents the first fusion feature, represents the second fusion feature, represents the third fusion feature, represents the fourth fusion feature; Step S3213: Calculation of the upper path output. The formula used is as follows: ; In the formula, represents the output of the upper path of the deep and shallow fusion module; Step S322: Calculation of the lower path output. The formula used is as follows: ; In the formula, represents the output of the path under the deep and shallow fusion module, represents element-wise addition; Step S323: Calculation of the output of the deep and shallow fusion module. The formula used is as follows: ; In the formula, DSF represents the output of the deep and shallow fusion module and serves as the input to the (i - 1)-th level structure of the decoder structure.
2. The method for evaluating the environment of urban emergency shelters based on image enhancement according to claim 1, wherein: The construction of the environmental image segmentation model specifically includes the following steps: Step S31: Construction of an improved vision transformer module. The improved vision transformer module specifically includes an improved self-attention mechanism and a channel attention mechanism. The steps for constructing the improved vision transformer module include: Step S311: Design an improved self-attention mechanism. Step S312: Design a channel attention mechanism. The formula used is as follows: ; Wherein, 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: Obtain the output of the improved vision transformer module. The steps include: Step S3131: Calculation of the upper branch output. The formula used is as follows: ; In the formula, represents the input of the improved vision transformer module, represents the calculation function of the upper branch of the improved vision transformer module, represents the feed-forward network function, represents the layer normalization function; Step S3132: Calculation of the lower branch output. The formula used is as follows: ; In the formula, represents the cross - attention query of the lower branch of the improved vision transformer module, represents the cross - attention key of the lower branch of the improved vision transformer module, represents the cross - attention value of the lower branch of the improved vision transformer module, represents the cross - attention query transformation matrix of the lower branch of the improved vision transformer module, represents the cross - attention key transformation matrix of the lower branch of the improved vision transformer module, represents the cross - attention value transformation matrix of the lower branch of the improved vision transformer module, represents the cross - attention calculation function, represents the calculation function of the lower branch of the improved vision transformer module; Step S3133: Calculation of the output of the improved vision transformer module. The formula used is as follows: ; In the formula, represents the output calculation function of the improved vision transformer module, represents the connection operation function; Step S32: Construction of a deep and shallow fusion module. Step S33: Design a loss function. Specifically, a combination of a cross-entropy loss function and a Dice loss function is used as the loss function of the model. The formula used is as follows: ; Where Loss represents the value of the model loss function, represents the control weight of the loss function, represents the value of the cross-entropy loss function, represents the value of the Dice loss function; Step S34: Construct and train a model. Specifically, construct an improved attention vision transformer model through the construction of the improved vision transformer module, the construction of the deep and shallow fusion module, and the design of the loss function. Then train the model based on the preliminary training set and verify the model performance based on the preliminary test set to obtain an environmental image segmentation model.
3. The method for evaluating the environment of urban emergency shelters based on image enhancement according to claim 1, characterized in that: In step S4, construct an environmental evaluation model for constructing a model required to evaluate the environment of an emergency shelter. Specifically, construct a support vector machine model as the environmental evaluation model. The construction of the environmental evaluation model specifically includes the following steps: Step S41: Image segmentation. Specifically, use 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: Construct and train a model. Specifically, construct a support vector machine model, train the model based on the evaluation training set, and verify 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, wherein: In step S1, perform image acquisition for acquiring image data required to evaluate the environment of an urban emergency shelter. Specifically, acquire the original environmental image set by collecting images from the shelter monitoring system. The original environmental 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 the shelter area under different lighting conditions and images of the shelter equipment under different lighting conditions. The historical original image set also includes scene category labels for training the image segmentation model and quality level labels for training the environmental evaluation model.
5. The method for evaluating the environment of urban emergency shelters based on image enhancement according to claim 1, wherein: In step S2, perform image preprocessing for preprocessing the collected original environmental images. Specifically, it includes the following steps: Step S21: Image cleaning for cleaning the original environmental image data. Specifically, remove the noise in the historical original image set and the current original image set and crop the irrelevant regions to obtain a historical roughly processed image set and a current roughly processed image set. Step S22: Image augmentation for augmenting the roughly processed image data. Specifically, perform random geometric transformation and random brightness adjustment on the historical roughly processed image set and the current roughly processed image set and augment the images to obtain a historical augmented image set and a current augmented image set. Step S23: Image enhancement for enhancing the contrast of the augmented image data. Specifically, use the histogram equalization method to enhance the image contrast of the historical augmented image set and the current augmented image set to obtain a historical enhanced image set and a to-be-processed image set. Step S24: Image set segmentation for segmenting the image set. Specifically, perform image set segmentation on the historical enhanced image set to obtain a preliminary training set and a preliminary test set. Step S25: Perform preprocessing, specifically, preprocess the current original image set through the image cleaning, the image augmentation, and the image enhancement to obtain a to-be-processed image set, and preprocess the historical original image set through the image cleaning, the image augmentation, the image enhancement, and the image set segmentation to obtain a preliminary training set and a preliminary test set.
6. The method for evaluating the environment of urban emergency shelters based on image enhancement according to claim 1, wherein: In step S5, the shelter environment assessment specifically uses the environment image segmentation model to perform image segmentation on the to-be-processed image set, takes the segmented image set as the input of the environment assessment model and conducts an environment assessment to obtain shelter environment level reference data, and comprehensively evaluates the urban emergency shelter environment based on the shelter environment level reference data.
Citation Information
Patent Citations
Light-weight eye fundus blood vessel image segmentation model based on Mama
CN119479021A
Urban emergency refuge congestion risk assessment method and system based on image enhancement
CN119672549A