Method and device for scheme design of shear wall structure based on generative adversarial network
A method for the scheme design of shear wall structure based on a generative adversarial network includes: obtaining an architectural drawing; extracting key elements from the architectural drawing, coding the key elements by colors, and generating image features; inputting the image features into a pre-trained structural-design-oriented generative adversarial network model for processing to generate a structural drawing.
1 . A method for the scheme design of shear wall structure based on a generative adversarial network, comprising:
obtaining, via an input interface of an electronic device, an architectural drawing of a high-rise shear wall residential building;
extracting, via a processor of the electronic device, key elements from the architectural drawing and coding, using a mapping relationship between key elements and colors stored in a local memory of the electronic device, the key elements by colors to generate image features; and
inputting, via the processor of the electronic device, the image features into a pre-trained structural-design-oriented generative adversarial network model for processing to generate and output, via an output interface of the electronic device, a structural drawing;
wherein the structural-design-oriented generative adversarial network model is tested and evaluated based on a test set by:
dividing a generative image and a target image into multiple sub-images;
extracting one or more shear walls from each sub-image, and obtaining contour coordinates of the one or more shear walls;
obtaining an intersection area and a union area of the shear walls contained in the generative image and the target image, wherein the intersection area is an area of an intersection between generated shear walls contained in the generative image and target shear walls contained in the target image, and the union area is a difference by subtracting the intersection area from a sum of an area of generated shear walls contained in the generative image and an area of target shear walls contained in the target image; and
obtaining a second evaluation metric based on the intersection area and the union area, to output a qualified generative image satisfying the second evaluation metric.
2 . The method of claim 1 , further comprising:
obtaining pairs of architectural drawing samples and structural drawing samples;
extracting architectural sample elements from the architectural drawing samples and coding the architectural sample elements by colors to generate architectural image features;
extracting structural sample elements from the structural drawing samples and coding the structural sample elements by colors to generate structural image features;
dividing the architectural image features and the structural image features into a training set and the test set; and
inputting the training set into a generative adversarial network to train the generative adversarial network and obtaining the structural-design-oriented generative adversarial network model after the training.
3 . The method of claim 1 , wherein extracting the key elements from the architectural drawing and coding the key elements by colors comprises:
extracting a shear wall, an infill wall, an indoor window, and an outdoor gate from the architectural drawing; and
coding the shear wall, the infill wall, the indoor window, and the outdoor gate by different colors, where red represents the shear wall, gray represents the infill wall, green represents the indoor window, and blue represents the outdoor gate.
4 . The method of claim 2 , wherein dividing the architectural image features and the structural image features into the training set and the test set comprises:
dividing the architectural image features and the structural image features in the training set and the test set into a sub-training set and a sub-test set, respectively, based on structural height and structural seismic design intensity.
5 . The method of claim 1 , wherein the structural-design-oriented generative adversarial network mode is tested and evaluated based on the test set by:
classifying each pixel of a generative image and each pixel of a target image, based on a value range of pixel color of the generative image and a value range of pixel color of the target image; and
generating a confusion matrix based on classified pixels, and obtaining a first evaluation metric based on the confusion matrix.
6 . The method of claim 1 , wherein the structural-design-oriented generative adversarial network model is tested and evaluated based on the test set by:
classifying each pixel of a generative image and each pixel of a target image based on a value range of pixel color of the generative image and a value range of pixel color of the target image;
generating a confusion matrix based on classified pixels, and generating a first evaluation metric based on the confusion matrix;
dividing the generative image and the target image into multiple sub-images;
extracting one or more shear walls from each sub-image and obtaining contour coordinates of the one or more shear walls; and
obtaining an intersection area and a union area of the shear walls contained in the generative image and the target image, and generating a second evaluation metric based on the intersection area and the union area;
wherein the method further comprises:
determining a weight coefficient based on the first evaluation metric and the second evaluation metric; and
performing an evaluation based on a weighted metric.
7 . An electronic device, comprising an input interface, an output interface, a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the processor is configured to:
obtain an architectural drawing via the input interface;
extract key elements from the architectural drawing and code using a mapping relationship between key elements and colors stored in the memory, the key elements by colors to generate image features; and
input the image features into a pre-trained structural-design-oriented generative adversarial network model for processing to generate and output, via the output interface, a structural drawing;
wherein the processor is further configured to:
divide a generative image and a target image into multiple sub-images;
extract one or more shear walls from each sub-image, and obtain contour coordinates of the one or more shear walls;
obtain an intersection area and a union area of the shear walls contained in the generative image and the target image, wherein the intersection area is an area of an intersection between generated shear walls contained in the generative image and target shear walls contained in the target image, and the union area is a difference by subtracting the intersection area from a sum of an area of generated shear walls contained in the generative image and an area of target shear walls contained in the target image; and
obtain a second evaluation metric based on the intersection area and the union area, to output a qualified generative image satisfying the second evaluation metric.
8 . The electronic device of claim 7 , wherein the processor is further configured to:
obtain pairs of architectural drawing samples and structural drawing samples;
extract architectural sample elements from the architectural drawing samples and code the architectural sample elements by colors to generate architectural image features;
extract structural sample elements from the structural drawing samples and code the structural sample elements by colors to generate structural image features;
divide the architectural image features and the structural image features into a training set and the test set; and
input the training set into a generative adversarial network to train the generative adversarial network and obtain the structural-design-oriented generative adversarial network model after the training.
9 . The electronic device of claim 7 , wherein the processor is further configured to:
extract a shear wall, an infill wall, an indoor window, and an outdoor gate from the architectural drawing; and
code the shear wall, the infill wall, the indoor window, and the outdoor gate by different colors, where red represents the shear wall, gray represents the infill wall, green represents the indoor window, and blue represents the outdoor gate.
10 . The electronic device of claim 7 , wherein the processor is further configured to:
divide the architectural image features and the structural image features in the training set and the test set into a sub-training set and a sub-test set, respectively, based on structural height and structural seismic design intensity.
11 . The electronic device of claim 7 , wherein the processor is further configured to:
classify each pixel of a generative image and each pixel of a target image based on a value range of pixel color of the generative image and a value range of pixel color of the target image; and
generate a confusion matrix based on classified pixels, and obtain a first evaluation metric based on the confusion matrix.
12 . The electronic device of claim 7 , wherein the processor is further configured to:
classify each pixel of a generative image and each pixel of a target image based on a value range of pixel color of the generative image and a value range of pixel color of the target image;
generate a confusion matrix based on classified pixels, and generate a first evaluation metric based on the confusion matrix;
divide the generative image and the target image into multiple sub-images;
extract one or more shear walls from each sub-image and obtain contour coordinates of the one or more shear walls;
obtain an intersection area and a union area of the shear walls contained in the generative image and the target image, and generate a second evaluation metric based on the intersection area and the union area;
determine a weight coefficient based on the first evaluation metric and the second evaluation metric; and
perform an evaluation based on a weighted metric.
13 . A non-transitory computer-readable storage medium, having a computer program stored thereon, wherein when the computer program is executed by a processor of an electronic device, a method for the scheme design of shear wall structure based on a generative adversarial network is implemented, wherein the method comprises:
obtaining, via an input interface of the electronic device, an architectural drawing of a high-rise shear wall residential building;
extracting key elements from the architectural drawing and coding, using a mapping relationship between key elements and colors stored in a local memory of the electronic device, the key elements by colors to generate image features; and
inputting the image features into a pre-trained structural-design-oriented generative adversarial network model for processing to generate and output, via an output interface of the electronic device, a structural drawing;
wherein the structural-design-oriented generative adversarial network model is tested and evaluated based on a test set by:
dividing a generative image and a target image into multiple sub-images;
extracting one or more shear walls from each sub-image, and obtaining contour coordinates of the one or more shear walls;
obtaining an intersection area and a union area of the shear walls contained in the generative image and the target image, wherein the intersection area is an area of an intersection between generated shear walls contained in the generative image and target shear walls contained in the target image, and the union area is a difference by subtracting the intersection area from a sum of an area of generated shear walls contained in the generative image and an area of target shear walls contained in the target image; and
obtaining a second evaluation metric based on the intersection area and the union area, to output a qualified generative image satisfying the second evaluation metric.
14 . The non-transitory computer-readable storage medium of claim 13 , wherein the method further comprises:
obtaining pairs of architectural drawing samples and structural drawing samples;
extracting architectural sample elements from the architectural drawing samples and coding the architectural sample elements by colors to generate architectural image features;
extracting structural sample elements from the structural drawing samples and coding the structural sample elements by colors to generate structural image features;
dividing the architectural image features and the structural image features into a training set and the test set; and
inputting the training set into a generative adversarial network to train the generative adversarial network and obtaining the structural-design-oriented generative adversarial network model after the training.
15 . The non-transitory computer-readable storage medium of claim 14 , wherein extracting the key elements from the architectural drawing and coding the key elements by colors comprises:
extracting a shear wall, an infill wall, an indoor window, and an outdoor gate from the architectural drawing; and
coding the shear wall, the infill wall, the indoor window, and the outdoor gate by different colors, where red represents the shear wall, gray represents the infill wall, green represents the indoor window, and blue represents the outdoor gate.
16 . The non-transitory computer-readable storage medium of claim 14 , wherein dividing the architectural image features and the structural image features into the training set and the test set comprises:
dividing the architectural image features and the structural image features in the training set and the test set into a sub-training set and a sub-test set, respectively, based on structural height and structural seismic design intensity.