# Interior Space Design and Automatic Layout Method Based on CNN

Authors: WeiPing Wu; Yanshun Feng
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

With the rapid rise in the number of people buying houses, the demand for interior space design has also increased accordingly. The diversification of existing room types and the diversity of the public’s perception of fashion make interior designers in short supply. The future of computer science and technology in the field of automatic design of indoor areas will be immeasurable. This paper proposes an automatic layout method for spatial area design based on convolutional neural networks (CNN). CNN methods are a fast and efficient method. By mimicking the designer’s design process, it proposes a two-stage algorithm that defines the room first and the wall later, and the algorithm also provides a large-scale dataset called RPLAN that contains more than 80,000 interior layout plans from real residential buildings. Starting from the prediction living room, the automatic layout of the indoor areas is completed by iteration. A large number of empirical results show that the interior area design effect of this method is comparable to the interior design floor plan of professional designers.


---

## Body

## 1. Introduction

In the long history of 5,000 years, China has formed a unique set of architectural styles and concepts of its own, and China’s architectural style and interior design have been influencing neighboring countries since the feudal society. Today’s Chinese society continues to grow and develop; with the improvement of China’s international status, China’s traditional architecture is more valued and imitated by famous designers across the country. Chinese interior design style symbolizes traditional Chinese culture, and many contemporary designs make it possible to integrate popular elements into modern Chinese interior design while inheriting traditional Chinese architectural Wenhua, forming a new style, and promoting the development of modern interior design [1]. The automatic layout of the indoor automatic area design should consider the location of the indoor area wall and, more importantly, consider the needs of the occupants. For example, when designing a psychiatric hospital, there is a positive impact on the health of patients [2]. In the automatic layout of interior design, the public’s emphasis on natural elements has become an indispensable part of the interior landscape. To this end, the automatic layout design should add the way natural elements are reflected in the indoor landscape and the principle of using natural elements in the indoor landscape [3]. When building children’s boarding schools in rural areas, it is necessary to carry out scientific automatic layout of the indoor space environment of teaching buildings, dormitories, school canteens, toilets, and activity rooms of “residual children’s homes” based on psychological and behavioral psychology and architectural space theory [4] according to the purpose of promoting children’s physical and mental development. In this paper, in the case of the actual floor area of the house, this paper expounds on the calculation basis and system operation process of automatic generation of interior design, puts forward the overall system design and database structure design, and summarizes the characteristics of the automatic generation system of interior decoration area [5]. Although virtual reality technology is widely used in the automatic layout of interior design today, interior design is still a difficult field to master, without a strong, mature model to compete with the expertise of the industry. Moving away from the virtual reality trend, this paper proposes an end-to-end concept, based on a learning scoring function, to implement applications and their learning techniques to actually assess the quality of professional and realistic room furniture layouts, including different interior design guidelines, ergonomics, and common sense signs [6]. We further presented a proof of concept based on simulated annealing techniques for random optimization, aiming to generate new, reasonable, and pleasing furniture layouts that meet the strict regulations of interior design. This software tool will eventually prove that professional-quality furniture layouts in the real world can be obtained in a way that is at least semiautomatic. Using the energy function, the interdependencies of various furniture functions and styles, common practices of relative furniture positioning in the room, and other ergonomic factors that contribute to the acquisition of pleasant, livable rooms are analytically represented as cost items. Using machine learning, the ranking function parameters adapted to various types of rooms and complex furniture objects allow the method to be extended in complex interior design knowledge modeling [7]. First of all, the feature-based graphic recognition technology is modeled, the replanning of the internal space is realized by adding an automatic layout algorithm, and finally, the HTML5 Canvas 2D API is used for online graphic drawing, which realizes the allocation and management of indoor space and establishes the empty order of the internal space in partition management and timing [8]. In the era of the rise of computers, a new technology—virtual reality—has become a common and important application in people’s lives. The technology mainly imitates a real scene, reflecting the changing form of the entity so that people have a more intuitive feeling. The complex and diversified characteristics of interior design are to apply virtual reality technology as a major technology; through this technology, the design enables them to show the scene image of their own design, which makes the interior design continue to develop and progress [9]. The placement of parameter servers is an important part of distributed deep learning global model training. For the placement strategy of PSs, the training time of distributed deep learning under the minimum conditions is proposed. The whole phase is divided into two parts, the first part uses the approximation algorithm and the rounding algorithm to solve the problem, and the second part proposes to adjust algorithm 1, which reduces the amount of time spent training the global model by continuously improving the decision of the placement strategy of the PSs. Experiments have shown that both the approximation algorithm and the rounding algorithm are superior to existing algorithms [10] in terms of training time for global models. When selecting various application areas for information processing, general deep learning methods mainly consider the following three indicators: professional knowledge or knowledge of the author; the application area has successfully used deep learning techniques, such as speech recognition; and the application area is likely to receive a significant impact on progressive learning [11]. Deep learning requires first examining the encoder-decoder concept of conformity and then classifying with spatially dominant information. Finally, the two features are merged using the new deep learning framework. From this, we can see the highest classification accuracy. The framework is a hybrid of principal component analysis (PCA), deep learning architecture, and logistic regression. Specifically, as a deep learning architecture, stacked autoencoders are designed to gain useful advanced features [12]. The latest deep learning frameworks typically use deep convolutional neural networks (CNNs) to extract image features, which are then converted into hundreds of code markers through the recurrent neural network- (RNN-) based code generators, making them through encoders. The decoder framework makes it possible to automatically convert the graphical user interface (GUI) into code. But the implementation of the framework must overcome two challenges: one is how to take full advantage of the GUI and the information contained in the Domain Specified Language (DSL) code, for which this paper addresses a model called HGui2Code, which integrates GUI features that support visual attention (extracted by CNN). It supports semantic features of DSL attention (LSTM extraction); another is how to make the build DSL code conform to syntax rules, and in response to this problem, this paper proposes the SGui2Code model, which uses the ON-LSTM network to generate syntactic correctness DSL code. Although the model does not have a big improvement on IOS and Android datasets, it is generated by the model. The DSL code is very close to the component layout [13] in the corresponding GUI. This paper mainly discusses the topology layout of wireless sensor networks and the visualization of node data, and the overall complexity of the visualization algorithm is 2O (n). The hardware design and execution part of this paper are based on the algorithm to automatically provide the main load optimization of the visual automatic layout algorithm, network control and design, module network-based research, and analysis of module serial port UART and WSN network joint monitoring platform [14]. Data representation determines the success of machine learning, and domain knowledge and learning can be used to aid design, and more, the public’s quest for artificial intelligence is inspiring the design of more powerful representation learning algorithms. Recent work in the field of unsupervised feature learning and deep learning includes probabilistic models, manifold learning, and deep learning. These works raise long-unanswered questions about the appropriate goal of learning good representations, computational representations (i.e., reasoning), and representing the geometric connections between learning, density estimation, and manifold learning [2].


## 2. Deep Learning Analysis

### 2.1. Convolutional Neural Networks (CNN)

Convolutional neural network is a representative neural network in the field of deep learning technology. Compared with traditional image processing algorithms, the advantage of convolutional neural network is that it avoids the complex image preprocessing process, and convolutional neural network can directly input the original image for work [1].Convolutional neural networks contain convolutional operations and depth structures.


#### 2.1.1. Convolution Operations Are at the Heart of Convolutional Neural Networks

(1)W=w11w12⋯w1nw21w22⋯w2n⋯⋯wm1wm2⋯wmnm×n.The process of convoluting imageX is to multiply each w in the convolutional kernel W with the corresponding pixel x in the original image X to be covered and then summed.(2)z=w1x1+w2x2+⋯wmnxmn=∑k=1mnwkxk=WTX.In Figure1, for example, a convolutional kernel overlays 9 pixels of the original image each time and slides four times, resulting in 2 × 2 two-dimensional data. Obviously, for a raw image with a convolution kernel of n, after f-convolution operations, the output image is sized n-f +1.Figure 1
Schematic diagram of the standard 2D convolution operation process.


#### 2.1.2. Step

The convolutional step size is the spacing of the slide, and after combining the step size operation, the output image size is(3)p=n−fs+1,s=step⋅length,where stride = 1 indicates that the convolutional kernel of the standard convolutional mode slides over the distance of each adjacent pixel is 1, stride = 2 indicates that the movement step is 2, the adjacent pixels are skipped, and the output image is the original 1/2. By analogy, when stride = 3, the image is reduced to 1/3 of the original.


#### 2.1.3. Padding

For the problem that the image loses a lot of information at the edges each time it is zoomed out, the edges of the image can be filled with “fake” pixels [15]. Assuming the fill pixel is p, n becomes n+2p, and the dimensions of its output image are(4)p=n+2p−fs+1.Fill pixels generally have two options: valid convolution and same convolution. The valid image will be reduced after calculation, and the output size is(5)p=n+2p−fs+1.The same convolutional image output size remains the same; according to the above formula, the same convolutional image output size is(6)n+2p−fs+1=n,where P can be described by the following formula:(7)p=n−1s−n+f2.Whens = 1,(8)p=f−12.


### 2.2. Deep Learning Model Framework and Design

This paper uses graph neural networks (GNNs) to learn plan diagrams and uses both supervised and unsupervised learning strategies [16]. The system flow is shown in Figure 2.(1)
Sample floor plans are encoded into graphs, which are data structures such as procedure 1. The nodes in the diagram represent rooms, and the edges represent the types of adjacency between rooms.(2)
Supervised learning: use the graph neural network to embed the nodes and subgraphs in the graph to obtain the corresponding vector representation and the overall vector representation of each graph. After the training, you can extract subgraphs that have a large impact on the score as a good design, such as procedures 2 and 3.(3)
Unsupervised learning: use GNN to map all sample plots to high-dimensional spaces and visualize them, as in procedure 4.(4)
Structure combination: by adding new variables to combine some nodes and further using additional nodes to add new designs, manual judgment of the effectiveness of the design is required.(5)
Generate the final conceptual design: a new drawing (graph) that conforms to the design is obtained and converted to a floor plan.Figure 2
The overall process framework of the model.Figure3 illustrates the graph neural network architecture used to discover the build subgraph.Figure 3
Neural network structure.Figure4 is end-to-end learning that does not require input features and, more importantly, considers the relatively large fragments in the graph, that is, extracting the r-radius subgraph [14]. M in the graph is the number of subgraphs of all r radii in a graph; of course, we need to update the subgraph vectors(9)xit+1=xit+∑j∈Nixijt.Figure 4
Extracting all of its subgraphs for each room and initializing each subgraph with a random vector.


### 2.3. Algorithm Optimization

This paper uses the Adam algorithm to improve the algorithm model; as the name suggests, Adam integrates the first-order momentum of SGD and the second-order momentum of RMSProp.(10)mwt+1=β1mwt+1−β1∇Lt,where m is a first-order moment estimate,(11)vwt+1=β2mwt1−β2∇Lt2;where v is a second-order moment estimation,(12)m^w=mwt+11−β1t+1.Estimation correction to achieve unbiased estimation is as follows:(13)v^w=vwt+11−β2t+1wt+1←=wt−ηm^wv^w+θ.The gradient method is used to optimize the parameters of the model, which can speed up the training.The conjugate gradient method optimizes the prediction model to obtain the optimal parameter matrix of the network model, the essence of which is that the mean square error reaches the minimum value, and the definition of the mean square error is as follows:(14)MSE=EeTe=Eod−oTod−o,where od is the model predicts the output and o is the actual output, which is the error od−o between the model prediction output and the actual output [17]. The weights of the model are adjusted according to the following equation until the parameters are optimal.(15)wk+1=wk+akdk,where the search direction is k times dk during the training of the model and the step ak size.When optimizing the weight matrix and paranoid matrix of the model using the conjugate gradient method, the initial value of the search direction is calculated(16)d0=−∇MSEw0=−g0.As the number of iterations increases, the search direction fork+1 is as follows:(17)dk+1=−gk+βkdk,where βk is the conjugate gradient algorithm that updates the parameters when optimizing the model, and the calculation formula is as follows:(18)βkgk+12gk2.


## 2.1. Convolutional Neural Networks (CNN)

Convolutional neural network is a representative neural network in the field of deep learning technology. Compared with traditional image processing algorithms, the advantage of convolutional neural network is that it avoids the complex image preprocessing process, and convolutional neural network can directly input the original image for work [1].Convolutional neural networks contain convolutional operations and depth structures.


### 2.1.1. Convolution Operations Are at the Heart of Convolutional Neural Networks

(1)W=w11w12⋯w1nw21w22⋯w2n⋯⋯wm1wm2⋯wmnm×n.The process of convoluting imageX is to multiply each w in the convolutional kernel W with the corresponding pixel x in the original image X to be covered and then summed.(2)z=w1x1+w2x2+⋯wmnxmn=∑k=1mnwkxk=WTX.In Figure1, for example, a convolutional kernel overlays 9 pixels of the original image each time and slides four times, resulting in 2 × 2 two-dimensional data. Obviously, for a raw image with a convolution kernel of n, after f-convolution operations, the output image is sized n-f +1.Figure 1
Schematic diagram of the standard 2D convolution operation process.


### 2.1.2. Step

The convolutional step size is the spacing of the slide, and after combining the step size operation, the output image size is(3)p=n−fs+1,s=step⋅length,where stride = 1 indicates that the convolutional kernel of the standard convolutional mode slides over the distance of each adjacent pixel is 1, stride = 2 indicates that the movement step is 2, the adjacent pixels are skipped, and the output image is the original 1/2. By analogy, when stride = 3, the image is reduced to 1/3 of the original.


### 2.1.3. Padding

For the problem that the image loses a lot of information at the edges each time it is zoomed out, the edges of the image can be filled with “fake” pixels [15]. Assuming the fill pixel is p, n becomes n+2p, and the dimensions of its output image are(4)p=n+2p−fs+1.Fill pixels generally have two options: valid convolution and same convolution. The valid image will be reduced after calculation, and the output size is(5)p=n+2p−fs+1.The same convolutional image output size remains the same; according to the above formula, the same convolutional image output size is(6)n+2p−fs+1=n,where P can be described by the following formula:(7)p=n−1s−n+f2.Whens = 1,(8)p=f−12.


## 2.1.1. Convolution Operations Are at the Heart of Convolutional Neural Networks

(1)W=w11w12⋯w1nw21w22⋯w2n⋯⋯wm1wm2⋯wmnm×n.The process of convoluting imageX is to multiply each w in the convolutional kernel W with the corresponding pixel x in the original image X to be covered and then summed.(2)z=w1x1+w2x2+⋯wmnxmn=∑k=1mnwkxk=WTX.In Figure1, for example, a convolutional kernel overlays 9 pixels of the original image each time and slides four times, resulting in 2 × 2 two-dimensional data. Obviously, for a raw image with a convolution kernel of n, after f-convolution operations, the output image is sized n-f +1.Figure 1
Schematic diagram of the standard 2D convolution operation process.


## 2.1.2. Step

The convolutional step size is the spacing of the slide, and after combining the step size operation, the output image size is(3)p=n−fs+1,s=step⋅length,where stride = 1 indicates that the convolutional kernel of the standard convolutional mode slides over the distance of each adjacent pixel is 1, stride = 2 indicates that the movement step is 2, the adjacent pixels are skipped, and the output image is the original 1/2. By analogy, when stride = 3, the image is reduced to 1/3 of the original.


## 2.1.3. Padding

For the problem that the image loses a lot of information at the edges each time it is zoomed out, the edges of the image can be filled with “fake” pixels [15]. Assuming the fill pixel is p, n becomes n+2p, and the dimensions of its output image are(4)p=n+2p−fs+1.Fill pixels generally have two options: valid convolution and same convolution. The valid image will be reduced after calculation, and the output size is(5)p=n+2p−fs+1.The same convolutional image output size remains the same; according to the above formula, the same convolutional image output size is(6)n+2p−fs+1=n,where P can be described by the following formula:(7)p=n−1s−n+f2.Whens = 1,(8)p=f−12.


## 2.2. Deep Learning Model Framework and Design

This paper uses graph neural networks (GNNs) to learn plan diagrams and uses both supervised and unsupervised learning strategies [16]. The system flow is shown in Figure 2.(1)
Sample floor plans are encoded into graphs, which are data structures such as procedure 1. The nodes in the diagram represent rooms, and the edges represent the types of adjacency between rooms.(2)
Supervised learning: use the graph neural network to embed the nodes and subgraphs in the graph to obtain the corresponding vector representation and the overall vector representation of each graph. After the training, you can extract subgraphs that have a large impact on the score as a good design, such as procedures 2 and 3.(3)
Unsupervised learning: use GNN to map all sample plots to high-dimensional spaces and visualize them, as in procedure 4.(4)
Structure combination: by adding new variables to combine some nodes and further using additional nodes to add new designs, manual judgment of the effectiveness of the design is required.(5)
Generate the final conceptual design: a new drawing (graph) that conforms to the design is obtained and converted to a floor plan.Figure 2
The overall process framework of the model.Figure3 illustrates the graph neural network architecture used to discover the build subgraph.Figure 3
Neural network structure.Figure4 is end-to-end learning that does not require input features and, more importantly, considers the relatively large fragments in the graph, that is, extracting the r-radius subgraph [14]. M in the graph is the number of subgraphs of all r radii in a graph; of course, we need to update the subgraph vectors(9)xit+1=xit+∑j∈Nixijt.Figure 4
Extracting all of its subgraphs for each room and initializing each subgraph with a random vector.


## 2.3. Algorithm Optimization

This paper uses the Adam algorithm to improve the algorithm model; as the name suggests, Adam integrates the first-order momentum of SGD and the second-order momentum of RMSProp.(10)mwt+1=β1mwt+1−β1∇Lt,where m is a first-order moment estimate,(11)vwt+1=β2mwt1−β2∇Lt2;where v is a second-order moment estimation,(12)m^w=mwt+11−β1t+1.Estimation correction to achieve unbiased estimation is as follows:(13)v^w=vwt+11−β2t+1wt+1←=wt−ηm^wv^w+θ.The gradient method is used to optimize the parameters of the model, which can speed up the training.The conjugate gradient method optimizes the prediction model to obtain the optimal parameter matrix of the network model, the essence of which is that the mean square error reaches the minimum value, and the definition of the mean square error is as follows:(14)MSE=EeTe=Eod−oTod−o,where od is the model predicts the output and o is the actual output, which is the error od−o between the model prediction output and the actual output [17]. The weights of the model are adjusted according to the following equation until the parameters are optimal.(15)wk+1=wk+akdk,where the search direction is k times dk during the training of the model and the step ak size.When optimizing the weight matrix and paranoid matrix of the model using the conjugate gradient method, the initial value of the search direction is calculated(16)d0=−∇MSEw0=−g0.As the number of iterations increases, the search direction fork+1 is as follows:(17)dk+1=−gk+βkdk,where βk is the conjugate gradient algorithm that updates the parameters when optimizing the model, and the calculation formula is as follows:(18)βkgk+12gk2.


## 3. Space Layout Design

We extract design constraints from real houses, generate complex layout forms, and then use the hierarchical algorithm of complex layout structures to complete the layout design.


### 3.1. Constraint Modeling

Constraints are crucial to the layout design of indoor spaces, and there are mainly the following constraints.


#### 3.1.1. Dimension Constraints

The size of the room has the range of room sizes and the specific target size of the room. Dimension range constraintsCsize are defined as(19)wi¯≤wi≤wi,¯di¯≤di≤di¯,where (wi¯, di¯) and (wi¯) are the maximum and minimum values of the di¯ room size, respectively.


#### 3.1.2. Scale Constraints

Use the scale constraint of the roomCoverlap to avoid generating a room length and width incongruity. We set a secondary binary variable for each room to represent the orientation of the room rectangle, horizontal wi (>) di, or vertical (<). widi scale constraints are defined as(20)r¯i⋅di≤wi+M⋅σi,ri¯⋅di≥wi−M⋅σi,r¯i⋅wi≤di+M⋅1−σi,ri¯⋅wi≥di−M⋅1−σi,where (r¯i) is r¯i the maximum and minimum ratio between room wiidi and r¯i≥1. σi  = 0 indicates that room i is horizontal, the range of scales is r¯i,r¯i, and σi  = 1 indicates that the room is vertical.


#### 3.1.3. Position Constraints

Interior space design usually requires specifying the approximate location of the room, and we represent the guided location of the room as some points (x∗, y∗) (one or more). The position constraint of each point requires that the Cpos room area covers the point.(21)xi≤x∗≤xi+wi,yi≤y∗≤yi+di⋅,


#### 3.1.4. Boundary Constraints

Lighting conditions are important to boundary constraints, and to achieve this constraint, we added boundaryCboundary constraints.(22)yi≤y+M⋅1−ρk,xi≤x2−wi+M⋅1−ρk,xi≥x1−M⋅1−ρk,∑k=1ρk≥1,where ρk is the auxiliary binary variable, n is the number of edges of the specified boundary, and ρk  = 1 indicates that the constrained room is adjacent to the edge k.


#### 3.1.5. Adjacency Constraints

Suppose thatxirooms iyi (wi, di) and room xjjyi (wi) di are adjacent, the overlap of the two rooms is implemented first, and then the nonoverlapping constraint is combined. Coverlap is also necessary to constrain the minimum overlapping length c of the common edge between two adjacent rooms, called the contact length. Adjacency constraints Cadj can be written as(23)xi≤xj+wj−c⋅θi⋅j,xi+wj≥xj+c⋅θi⋅j,yi≤yj+dj−c⋅1−θi⋅j,yi+dj≥yj+c⋅1−θi⋅j,where θi⋅j is an auxiliary binary variable that determines the adjacent direction. θi⋅j  = 1 indicates vertical neighbor; otherwise, it indicates horizontal neighbor.


#### 3.1.6. Extend the Target Function

The final optimization problem is defined as(24)minL,σ,θ,ρλcoverEcoverL+λsizeEsizeL.L = {(xi, yiwi, di)} is a rectangular tuple of rooms. σ, θ, and ρ are binary variables. λcover is the weight that λsize balances between the area Ecover term and the size error term. In this document, Esize is set λcover  =  = 1.


### 3.2. Multilevel Algorithms

Our multilevel algorithm is equivalent to further improving the details of the resulting interior space layout by extending the basic algorithm, with the advantage of being fast and efficient [18].


#### 3.2.1. Polygon Layout Area Representation

A set of rectangles is used to describe the layout area of a polygon, the rectangular area marked as an obstacle cannot overlap any room, and the rectangular area marked as an obstacle remains unchanged.


#### 3.2.2. Subregion Selection

If there is an indoor area that is not filled, then we will select this subarea to continue optimization.


#### 3.2.3. Initialize

For a rectangular room of subarea, we randomly divide it into two subelements of the same size as shown in Figure5, and the subelement inherits the parent rectangle label.Figure 5
Room decomposition in a multilevel algorithm.


#### 3.2.4. Constraint Updates

For the newly given layout area, we make the following constraint update. Start by updating the internal constraints and nonoverlapping constraints with the new layout area and the initialCinsideCoverlap layout. Second, for a room with a location constraint Cpos, you need to set a new location constraint for its subfolders and update the boundary constraint in the same way. Then, we add an adjacency constraint Cboundary to each sublevel, making sure that there are no neighbors to the sublevel. Finally, add a subdivision constraint for each pair of child rectangles Crefine to replace the dimension constraints of the parent rectangle. The main goal Csize is to avoid major changes in the layout of the interior space that is eventually generated. Assuming a vertically oriented decomposition, as shown in the image above, the segmentation constraint is Crefine defined as(25)xi1≥xi−δxi1≤xiyi1≥yi−δyi1≤yiyi1+di1≥yi+diyi1+di1≤yi+di+δxi2+wi2≥xi+wixi2+wi2≤xi+wi+δ,yi2≥yi−δyi2≤yiyi2+di2≥yi+diyi2+di2≤yi+di+δ.For horizontal decomposition, the subdivision constraint for dimensions is defined(26)xi1≥xi−δxi1≤xixi1+wi1≥xi+wixi1+wi1≤xi+wi+δyi1+di1≥yi+diyi1+di1≤yi+di+δxi2≥xi−δxi2≤xiyi2≥yi−δyi2≤yixi2+wi2≥xi+wixi2+wi2≤xi+wi+δ,where (xi1, yi1, wi1) is the shape parameter of di1 the subfold i1 ( xi2yi2) is the shape parameter of the wi2 subpolar di2 i2, and δ is the range of variation of the size breakdown.


#### 3.2.5. Optimize

We represent the objective function as equation (24), which also requires that the update constraint on the subarea be satisfied [19]. Once all subregions have been subdivided and optimized, proceed to the next iteration process. The rational hierarchy algorithm framework performs indoor space layout generation. When each room size is less than the threshold, stop iteration. Merge rectangular rooms with the same labels to get the final layout result.


## 3.1. Constraint Modeling

Constraints are crucial to the layout design of indoor spaces, and there are mainly the following constraints.


### 3.1.1. Dimension Constraints

The size of the room has the range of room sizes and the specific target size of the room. Dimension range constraintsCsize are defined as(19)wi¯≤wi≤wi,¯di¯≤di≤di¯,where (wi¯, di¯) and (wi¯) are the maximum and minimum values of the di¯ room size, respectively.


### 3.1.2. Scale Constraints

Use the scale constraint of the roomCoverlap to avoid generating a room length and width incongruity. We set a secondary binary variable for each room to represent the orientation of the room rectangle, horizontal wi (>) di, or vertical (<). widi scale constraints are defined as(20)r¯i⋅di≤wi+M⋅σi,ri¯⋅di≥wi−M⋅σi,r¯i⋅wi≤di+M⋅1−σi,ri¯⋅wi≥di−M⋅1−σi,where (r¯i) is r¯i the maximum and minimum ratio between room wiidi and r¯i≥1. σi  = 0 indicates that room i is horizontal, the range of scales is r¯i,r¯i, and σi  = 1 indicates that the room is vertical.


### 3.1.3. Position Constraints

Interior space design usually requires specifying the approximate location of the room, and we represent the guided location of the room as some points (x∗, y∗) (one or more). The position constraint of each point requires that the Cpos room area covers the point.(21)xi≤x∗≤xi+wi,yi≤y∗≤yi+di⋅,


### 3.1.4. Boundary Constraints

Lighting conditions are important to boundary constraints, and to achieve this constraint, we added boundaryCboundary constraints.(22)yi≤y+M⋅1−ρk,xi≤x2−wi+M⋅1−ρk,xi≥x1−M⋅1−ρk,∑k=1ρk≥1,where ρk is the auxiliary binary variable, n is the number of edges of the specified boundary, and ρk  = 1 indicates that the constrained room is adjacent to the edge k.


### 3.1.5. Adjacency Constraints

Suppose thatxirooms iyi (wi, di) and room xjjyi (wi) di are adjacent, the overlap of the two rooms is implemented first, and then the nonoverlapping constraint is combined. Coverlap is also necessary to constrain the minimum overlapping length c of the common edge between two adjacent rooms, called the contact length. Adjacency constraints Cadj can be written as(23)xi≤xj+wj−c⋅θi⋅j,xi+wj≥xj+c⋅θi⋅j,yi≤yj+dj−c⋅1−θi⋅j,yi+dj≥yj+c⋅1−θi⋅j,where θi⋅j is an auxiliary binary variable that determines the adjacent direction. θi⋅j  = 1 indicates vertical neighbor; otherwise, it indicates horizontal neighbor.


### 3.1.6. Extend the Target Function

The final optimization problem is defined as(24)minL,σ,θ,ρλcoverEcoverL+λsizeEsizeL.L = {(xi, yiwi, di)} is a rectangular tuple of rooms. σ, θ, and ρ are binary variables. λcover is the weight that λsize balances between the area Ecover term and the size error term. In this document, Esize is set λcover  =  = 1.


## 3.1.1. Dimension Constraints

The size of the room has the range of room sizes and the specific target size of the room. Dimension range constraintsCsize are defined as(19)wi¯≤wi≤wi,¯di¯≤di≤di¯,where (wi¯, di¯) and (wi¯) are the maximum and minimum values of the di¯ room size, respectively.


## 3.1.2. Scale Constraints

Use the scale constraint of the roomCoverlap to avoid generating a room length and width incongruity. We set a secondary binary variable for each room to represent the orientation of the room rectangle, horizontal wi (>) di, or vertical (<). widi scale constraints are defined as(20)r¯i⋅di≤wi+M⋅σi,ri¯⋅di≥wi−M⋅σi,r¯i⋅wi≤di+M⋅1−σi,ri¯⋅wi≥di−M⋅1−σi,where (r¯i) is r¯i the maximum and minimum ratio between room wiidi and r¯i≥1. σi  = 0 indicates that room i is horizontal, the range of scales is r¯i,r¯i, and σi  = 1 indicates that the room is vertical.


## 3.1.3. Position Constraints

Interior space design usually requires specifying the approximate location of the room, and we represent the guided location of the room as some points (x∗, y∗) (one or more). The position constraint of each point requires that the Cpos room area covers the point.(21)xi≤x∗≤xi+wi,yi≤y∗≤yi+di⋅,


## 3.1.4. Boundary Constraints

Lighting conditions are important to boundary constraints, and to achieve this constraint, we added boundaryCboundary constraints.(22)yi≤y+M⋅1−ρk,xi≤x2−wi+M⋅1−ρk,xi≥x1−M⋅1−ρk,∑k=1ρk≥1,where ρk is the auxiliary binary variable, n is the number of edges of the specified boundary, and ρk  = 1 indicates that the constrained room is adjacent to the edge k.


## 3.1.5. Adjacency Constraints

Suppose thatxirooms iyi (wi, di) and room xjjyi (wi) di are adjacent, the overlap of the two rooms is implemented first, and then the nonoverlapping constraint is combined. Coverlap is also necessary to constrain the minimum overlapping length c of the common edge between two adjacent rooms, called the contact length. Adjacency constraints Cadj can be written as(23)xi≤xj+wj−c⋅θi⋅j,xi+wj≥xj+c⋅θi⋅j,yi≤yj+dj−c⋅1−θi⋅j,yi+dj≥yj+c⋅1−θi⋅j,where θi⋅j is an auxiliary binary variable that determines the adjacent direction. θi⋅j  = 1 indicates vertical neighbor; otherwise, it indicates horizontal neighbor.


## 3.1.6. Extend the Target Function

The final optimization problem is defined as(24)minL,σ,θ,ρλcoverEcoverL+λsizeEsizeL.L = {(xi, yiwi, di)} is a rectangular tuple of rooms. σ, θ, and ρ are binary variables. λcover is the weight that λsize balances between the area Ecover term and the size error term. In this document, Esize is set λcover  =  = 1.


## 3.2. Multilevel Algorithms

Our multilevel algorithm is equivalent to further improving the details of the resulting interior space layout by extending the basic algorithm, with the advantage of being fast and efficient [18].


### 3.2.1. Polygon Layout Area Representation

A set of rectangles is used to describe the layout area of a polygon, the rectangular area marked as an obstacle cannot overlap any room, and the rectangular area marked as an obstacle remains unchanged.


### 3.2.2. Subregion Selection

If there is an indoor area that is not filled, then we will select this subarea to continue optimization.


### 3.2.3. Initialize

For a rectangular room of subarea, we randomly divide it into two subelements of the same size as shown in Figure5, and the subelement inherits the parent rectangle label.Figure 5
Room decomposition in a multilevel algorithm.


### 3.2.4. Constraint Updates

For the newly given layout area, we make the following constraint update. Start by updating the internal constraints and nonoverlapping constraints with the new layout area and the initialCinsideCoverlap layout. Second, for a room with a location constraint Cpos, you need to set a new location constraint for its subfolders and update the boundary constraint in the same way. Then, we add an adjacency constraint Cboundary to each sublevel, making sure that there are no neighbors to the sublevel. Finally, add a subdivision constraint for each pair of child rectangles Crefine to replace the dimension constraints of the parent rectangle. The main goal Csize is to avoid major changes in the layout of the interior space that is eventually generated. Assuming a vertically oriented decomposition, as shown in the image above, the segmentation constraint is Crefine defined as(25)xi1≥xi−δxi1≤xiyi1≥yi−δyi1≤yiyi1+di1≥yi+diyi1+di1≤yi+di+δxi2+wi2≥xi+wixi2+wi2≤xi+wi+δ,yi2≥yi−δyi2≤yiyi2+di2≥yi+diyi2+di2≤yi+di+δ.For horizontal decomposition, the subdivision constraint for dimensions is defined(26)xi1≥xi−δxi1≤xixi1+wi1≥xi+wixi1+wi1≤xi+wi+δyi1+di1≥yi+diyi1+di1≤yi+di+δxi2≥xi−δxi2≤xiyi2≥yi−δyi2≤yixi2+wi2≥xi+wixi2+wi2≤xi+wi+δ,where (xi1, yi1, wi1) is the shape parameter of di1 the subfold i1 ( xi2yi2) is the shape parameter of the wi2 subpolar di2 i2, and δ is the range of variation of the size breakdown.


### 3.2.5. Optimize

We represent the objective function as equation (24), which also requires that the update constraint on the subarea be satisfied [19]. Once all subregions have been subdivided and optimized, proceed to the next iteration process. The rational hierarchy algorithm framework performs indoor space layout generation. When each room size is less than the threshold, stop iteration. Merge rectangular rooms with the same labels to get the final layout result.


## 3.2.1. Polygon Layout Area Representation

A set of rectangles is used to describe the layout area of a polygon, the rectangular area marked as an obstacle cannot overlap any room, and the rectangular area marked as an obstacle remains unchanged.


## 3.2.2. Subregion Selection

If there is an indoor area that is not filled, then we will select this subarea to continue optimization.


## 3.2.3. Initialize

For a rectangular room of subarea, we randomly divide it into two subelements of the same size as shown in Figure5, and the subelement inherits the parent rectangle label.Figure 5
Room decomposition in a multilevel algorithm.


## 3.2.4. Constraint Updates

For the newly given layout area, we make the following constraint update. Start by updating the internal constraints and nonoverlapping constraints with the new layout area and the initialCinsideCoverlap layout. Second, for a room with a location constraint Cpos, you need to set a new location constraint for its subfolders and update the boundary constraint in the same way. Then, we add an adjacency constraint Cboundary to each sublevel, making sure that there are no neighbors to the sublevel. Finally, add a subdivision constraint for each pair of child rectangles Crefine to replace the dimension constraints of the parent rectangle. The main goal Csize is to avoid major changes in the layout of the interior space that is eventually generated. Assuming a vertically oriented decomposition, as shown in the image above, the segmentation constraint is Crefine defined as(25)xi1≥xi−δxi1≤xiyi1≥yi−δyi1≤yiyi1+di1≥yi+diyi1+di1≤yi+di+δxi2+wi2≥xi+wixi2+wi2≤xi+wi+δ,yi2≥yi−δyi2≤yiyi2+di2≥yi+diyi2+di2≤yi+di+δ.For horizontal decomposition, the subdivision constraint for dimensions is defined(26)xi1≥xi−δxi1≤xixi1+wi1≥xi+wixi1+wi1≤xi+wi+δyi1+di1≥yi+diyi1+di1≤yi+di+δxi2≥xi−δxi2≤xiyi2≥yi−δyi2≤yixi2+wi2≥xi+wixi2+wi2≤xi+wi+δ,where (xi1, yi1, wi1) is the shape parameter of di1 the subfold i1 ( xi2yi2) is the shape parameter of the wi2 subpolar di2 i2, and δ is the range of variation of the size breakdown.


## 3.2.5. Optimize

We represent the objective function as equation (24), which also requires that the update constraint on the subarea be satisfied [19]. Once all subregions have been subdivided and optimized, proceed to the next iteration process. The rational hierarchy algorithm framework performs indoor space layout generation. When each room size is less than the threshold, stop iteration. Merge rectangular rooms with the same labels to get the final layout result.


## 4. Algorithm Examples and Result Analysis

### 4.1. Experimental Procedure

The 12 types of room types that appear in a typical indoor space are summarized in Table1.Table 1
Room types.
Serial numberRoom nameRemark0Living roomLiving room1Master bedroomOne of the bedrooms of each type of apartment must be the size of a master bedroom, generally with a separate bathroom, which is the largest bedroom2Second bedroomBedrooms other than the master bedroom generally do not have a bathroom3RestaurantGenerally connected to the kitchen4ToiletWhen there is only one bathroom in the home, you must choose a larger bathroom5Laundry room6Storage room7WardrobeGenerally designed in the master bedroom8StudioDen9CorridorExtra rectangular space connecting the room10TerraceA platform that extends out of the outdoors11Maid’s roomRoom positioning: the living room is an essential part, often as a core area, connected to other rooms. So first predict the living room location, as shown in Figure6. The room connectivity of the indoor space is obtained by detecting the adjacent relationship between the living room and other rooms. Through comparison, it is found that the living room prediction model alone helps to improve the prediction accuracy and the overall rationality of the indoor space layout.Figure 6
An iterative model of room types and locations.Wall positioning: the next step is to use the method of constraint satisfaction to locate the wall, using the position of the room as a design constraint to allocate a reasonable space for each room. Since too many design constraints can lead to unworkable optimization problems, we need to use a prediction-based positioning strategy at a time, as shown in Figure7 [20]. Specifically, the encoder-decoder network is used to predict the pixel-level wall based on the input ring and room position, and then the predicted wall is converted into a vector representation through some postprocessing.Figure 7
Convert a prediction wall to a vector.User research: for floor plans with the same screenplay as a group, we mandate users to compare and choose a better floor plan. The actual number of participants was 100, and people of different ages and different jobs voted for the designer works and the deep learning network automatic layout works, recording the votes of the two teams. It is shown in Table2.Table 2
User votes.
Designer votesDeep learning votesCumulative votesVoting users4258100


### 4.2. Evaluation Indicators

In this paper, two evaluation indicators are introduced, mean squared error (MSE) and mean relative error (MAE), to measure the performance of the deep confidence network model in spatial design layout prediction so as to illustrate the prediction ability of the model [21].(27)MSEy,y^=∑i=1nyi−y^i2nMAEy,y^=∑i=1nyi−y^i2.


### 4.3. Analysis of Experimental Results

According to the above experimental and evaluation indicators, we can know the difference between the overall effect before and after optimization. It shown in Figures8–18.Figure 8
The correct rate of the strategy model before and after optimization.Figure 9
Algorithm advantages and disadvantages.Figure 10
Comparison of user satisfaction.Figure 11
Oral-type bedroom MAE.Figure 12
Type bedroom MSE indicator.Figure 13
MAE index of type L bedroom.Figure 14
MSE indicator of type L bedroom.Figure 15
MAE index of vertical hall-type living room.Figure 16
MSE index of vertical hall-type living room.Figure 17
The MAE index of the horizontal hall-type living room.Figure 18
MSE index of the horizontal hall-type living room.It can be seen that, after using the conjugate gradient method, the correct rate of the model converges quickly during training, and the accuracy rate is the best.The complexity of traditional machine algorithms is high compared with traditional machine learning methods; the popularity of deep learning image processing is much higher than that of traditional algorithms because the current operation speed of traditional machine algorithms is much lower than the speed of deep learning, which makes deep learning have better development prospects, and the following figure shows why deep learning gradually replaces traditional machine learning.Through the survey, we can get the results as shown in the figure. Ordinary users of the design of the space area prefer the deep learning network design of the interior space, mainly because the design professionals will spend more cost, slower time, and less space utilization.The layout models of different types of bedrooms are evaluated experimentally according to MSE and MAE.(1)
Mouth-shaped bedroom.(2)
L-type bedroom.(3)
Vertical hall-type living room.(4)
Cross-hall-type living room.From the experimental comparison, Tables3–6, it can be seen that the number of network iterations converges significantly after 5 to 10 times, the MAE and MSE evaluation indicators gradually decrease, and the error of the model is very small and tends to be stable [22].Table 3
Oral-type bedroom evaluation index table.
ParameterMAEMSEBed_point7.168.7Bed_vec0.60.04Wardrobe_point1.80.5Wardrobe_vec0.50.03Table 4
L-type bedroom evaluation indicators table.
ParameterMAEMSEBed_point7.577.9Bed_vec0.90.09Wardrobe_point1.11.8Wardrobe_vec0.40.01Table 5
Evaluation index table of vertical hall-type living room.
ParameterMAEMSEBed_point6.967.7Bed_vec0.430.42Wardrobe_point0.360.2Wardrobe_vec0.150.039Table 6
Evaluation indicators of horizontal hall living room.
ParameterMAEMSEBed_point7.987.8Bed_vec0.180.01Wardrobe_point0.411.4Wardrobe_vec0.170.04


## 4.1. Experimental Procedure

The 12 types of room types that appear in a typical indoor space are summarized in Table1.Table 1
Room types.
Serial numberRoom nameRemark0Living roomLiving room1Master bedroomOne of the bedrooms of each type of apartment must be the size of a master bedroom, generally with a separate bathroom, which is the largest bedroom2Second bedroomBedrooms other than the master bedroom generally do not have a bathroom3RestaurantGenerally connected to the kitchen4ToiletWhen there is only one bathroom in the home, you must choose a larger bathroom5Laundry room6Storage room7WardrobeGenerally designed in the master bedroom8StudioDen9CorridorExtra rectangular space connecting the room10TerraceA platform that extends out of the outdoors11Maid’s roomRoom positioning: the living room is an essential part, often as a core area, connected to other rooms. So first predict the living room location, as shown in Figure6. The room connectivity of the indoor space is obtained by detecting the adjacent relationship between the living room and other rooms. Through comparison, it is found that the living room prediction model alone helps to improve the prediction accuracy and the overall rationality of the indoor space layout.Figure 6
An iterative model of room types and locations.Wall positioning: the next step is to use the method of constraint satisfaction to locate the wall, using the position of the room as a design constraint to allocate a reasonable space for each room. Since too many design constraints can lead to unworkable optimization problems, we need to use a prediction-based positioning strategy at a time, as shown in Figure7 [20]. Specifically, the encoder-decoder network is used to predict the pixel-level wall based on the input ring and room position, and then the predicted wall is converted into a vector representation through some postprocessing.Figure 7
Convert a prediction wall to a vector.User research: for floor plans with the same screenplay as a group, we mandate users to compare and choose a better floor plan. The actual number of participants was 100, and people of different ages and different jobs voted for the designer works and the deep learning network automatic layout works, recording the votes of the two teams. It is shown in Table2.Table 2
User votes.
Designer votesDeep learning votesCumulative votesVoting users4258100


## 4.2. Evaluation Indicators

In this paper, two evaluation indicators are introduced, mean squared error (MSE) and mean relative error (MAE), to measure the performance of the deep confidence network model in spatial design layout prediction so as to illustrate the prediction ability of the model [21].(27)MSEy,y^=∑i=1nyi−y^i2nMAEy,y^=∑i=1nyi−y^i2.


## 4.3. Analysis of Experimental Results

According to the above experimental and evaluation indicators, we can know the difference between the overall effect before and after optimization. It shown in Figures8–18.Figure 8
The correct rate of the strategy model before and after optimization.Figure 9
Algorithm advantages and disadvantages.Figure 10
Comparison of user satisfaction.Figure 11
Oral-type bedroom MAE.Figure 12
Type bedroom MSE indicator.Figure 13
MAE index of type L bedroom.Figure 14
MSE indicator of type L bedroom.Figure 15
MAE index of vertical hall-type living room.Figure 16
MSE index of vertical hall-type living room.Figure 17
The MAE index of the horizontal hall-type living room.Figure 18
MSE index of the horizontal hall-type living room.It can be seen that, after using the conjugate gradient method, the correct rate of the model converges quickly during training, and the accuracy rate is the best.The complexity of traditional machine algorithms is high compared with traditional machine learning methods; the popularity of deep learning image processing is much higher than that of traditional algorithms because the current operation speed of traditional machine algorithms is much lower than the speed of deep learning, which makes deep learning have better development prospects, and the following figure shows why deep learning gradually replaces traditional machine learning.Through the survey, we can get the results as shown in the figure. Ordinary users of the design of the space area prefer the deep learning network design of the interior space, mainly because the design professionals will spend more cost, slower time, and less space utilization.The layout models of different types of bedrooms are evaluated experimentally according to MSE and MAE.(1)
Mouth-shaped bedroom.(2)
L-type bedroom.(3)
Vertical hall-type living room.(4)
Cross-hall-type living room.From the experimental comparison, Tables3–6, it can be seen that the number of network iterations converges significantly after 5 to 10 times, the MAE and MSE evaluation indicators gradually decrease, and the error of the model is very small and tends to be stable [22].Table 3
Oral-type bedroom evaluation index table.
ParameterMAEMSEBed_point7.168.7Bed_vec0.60.04Wardrobe_point1.80.5Wardrobe_vec0.50.03Table 4
L-type bedroom evaluation indicators table.
ParameterMAEMSEBed_point7.577.9Bed_vec0.90.09Wardrobe_point1.11.8Wardrobe_vec0.40.01Table 5
Evaluation index table of vertical hall-type living room.
ParameterMAEMSEBed_point6.967.7Bed_vec0.430.42Wardrobe_point0.360.2Wardrobe_vec0.150.039Table 6
Evaluation indicators of horizontal hall living room.
ParameterMAEMSEBed_point7.987.8Bed_vec0.180.01Wardrobe_point0.411.4Wardrobe_vec0.170.04


## 5. Conclusion

Under the current wave of rapid development of computer networks, the industrial structure of home improvement design will also usher in an upgrade point. Based on today’s scientific and technological trends and the needs of people’s home decoration design, this paper has studied the automatic layout of indoor space design, Li Yong machine deep learning, imitating designers to create and carry out more scientific typography design, so that the public can get the best creative combination of interior design. First of all, this paper introduces the basic theory of deep learning, then establishes an interior design model based on deep confidence network, conducts research experiments on the model, analyzes the results, and explores the application of deep learning in interior design.Although the deep learning in this paper has achieved some results in the field of interior area design, there are still some shortcomings in this research:(1)
Further optimization of the deep confidence network structure is needed.(2)
Data characteristics and processing need to be improved.(3)
Although the deep confidence network in this paper has achieved good theoretical results, there are still many mainstream methods to be tried.



---

*Source: 8006069-2022-04-19.xml*