Similar house type detection method and device, electronic equipment and storage medium

By using a method based on attribute graphs and autoencoders to generate difference vectors, combined with a cross-attention model, the problems of insufficient generalization ability and poor accuracy in floor plan similarity detection are solved, and high-accuracy floor plan similarity detection is achieved.

CN114299314BActive Publication Date: 2026-05-29KE COM (BEIJING) TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
KE COM (BEIJING) TECHNOLOGY CO LTD
Filing Date
2021-12-24
Publication Date
2026-05-29

Smart Images

  • Figure CN114299314B_ABST
    Figure CN114299314B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a similar house type detection method and device, electronic equipment and a storage medium. The method comprises: determining a first difference degree of a first target house type and each reference house type in a reference house type set based on an attribute graph of the first target house type and an attribute graph of each reference house type; combining the first difference degrees into a first vector representing the first target house type; determining a second difference degree of a second target house type and each reference house type in the reference house type set based on an attribute graph of the second target house type and an attribute graph of each reference house type; combining the second difference degrees into a second vector representing the second target house type; and determining a similarity of the first target house type and the second target house type based on the first vector and the second vector. The embodiments of the present application can improve the detection accuracy of similar house types.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of housing analysis technology, and more specifically, to a method, apparatus, electronic device and storage medium for detecting similar housing types. Background Technology

[0002] The widespread adoption and development of randomized computing technology has made it easier and faster for people to access housing information. Currently, on real estate transaction platforms, each property is accompanied by a corresponding floor plan. The floor plan describes the overall attributes of the property, providing a clear view of its layout, planning, orientation, and size. Since there are many floor plans on real estate transaction platforms, users typically search for floor plans similar to their desired ones. Similar floor plan detection is based on manually defined or deep learning-based floor plan layout features. It sorts sets of floor plans that meet certain conditions (same city, same neighborhood, or same room, etc.) according to their layout similarity. Similar floor plans also include identical floor plans (floors in the same building or different buildings, etc.). Besides applications such as finding properties by floor plan and recommending similar floor plans, it can also be applied to home decoration scenarios such as finding design schemes based on floor plans and recommending floor plan designs.

[0003] Whether floor plans are similar to each other usually depends on whether the extracted layout features are accurate and comprehensive enough. The layout features of the floor plans need to have three invariants: translation, rotation and symmetry. The layout feature extraction algorithms mainly include: (1) traditional feature extraction algorithms, including graphic features (such as room coordinates, room angles, etc.), image features or attribute graph features, etc., but the generalization ability of this method is not strong; (2) deep learning feature extraction algorithms. With the development of artificial intelligence technology, it has gradually replaced manual features and become the mainstream method. In particular, neural network features can effectively extract floor plan features, but this method is difficult to accurately compare the matching of room types, and the accuracy is poor. Summary of the Invention

[0004] The present invention provides a method, apparatus, electronic device and storage medium for detecting similar apartment layouts.

[0005] The technical solution of the embodiments of the present invention is as follows:

[0006] A method for detecting similar apartment layouts includes:

[0007] Based on the attribute map of the first target apartment type and the attribute map of each reference apartment type in the reference apartment type set, a first degree of difference between the first target apartment type and each reference apartment type is determined;

[0008] The first difference degree is combined into a first vector representing the first target apartment type;

[0009] Based on the attribute map of the second target apartment type and the attribute map of each reference apartment type in the reference apartment type set, a second degree of difference between the second target apartment type and each reference apartment type is determined;

[0010] The second difference degree is combined into a second vector characterizing the second target apartment type;

[0011] Based on the first vector and the second vector, the similarity between the first target apartment type and the second target apartment type is determined.

[0012] In an exemplary implementation, determining the first degree of difference between the first target apartment type and each reference apartment type includes:

[0013] Based on the attribute graph of each reference apartment type, the predicted adjacent nodes of the first target apartment type are determined;

[0014] Based on the attribute graph of the first target apartment type, determine the adjacent nodes of the first target apartment type;

[0015] The first difference between the adjacent nodes of the first target apartment type and the predicted adjacent nodes of the first target apartment type is determined as the first difference degree between the first target apartment type and each reference apartment type.

[0016] In an exemplary implementation, determining the second degree of difference between the second target apartment type and each reference apartment type includes:

[0017] Based on the attribute graph of each reference apartment type, the predicted adjacent nodes of the second target apartment type are determined;

[0018] Based on the attribute graph of the second target apartment type, determine the adjacent nodes of the second target apartment type;

[0019] The second difference between the adjacent nodes of the second target apartment type and the predicted adjacent nodes of the second target apartment type is determined as the second difference degree between the second target apartment type and each reference apartment type.

[0020] In an exemplary implementation, determining the predicted neighboring nodes of the first target apartment type based on the attribute graph of each reference apartment type includes:

[0021] Based on the attribute graph of the first target apartment type and the attribute graph of each reference apartment type in the reference apartment type set, attention is paid to each reference apartment type using the first target apartment type, resulting in an attention matrix corresponding to the first target apartment type for each reference apartment type.

[0022] Based on the attention matrix of each reference unit corresponding to the first target unit type and the attribute graph of each reference unit type, the adjacent nodes of each reference unit type are determined.

[0023] Based on the neighboring nodes of each reference unit type and the attribute graph of the first target unit type, attention matrix corresponding to each reference unit type and the first target unit type is obtained by focusing on the first target unit type using each reference unit type.

[0024] Based on the attention matrix of the first target apartment type corresponding to each reference apartment type and the attribute graph of the first target apartment type, the predicted neighboring nodes of the first target apartment type corresponding to each reference apartment type are obtained.

[0025] In an exemplary implementation, determining the predicted neighboring nodes of the second target unit type based on the attribute graph of each reference unit type includes:

[0026] Based on the attribute graph of the second target apartment type and the attribute graph of each reference apartment type in the reference apartment type set, attention is paid to each reference apartment type using the second target apartment type, resulting in an attention matrix corresponding to the second target apartment type for each reference apartment type.

[0027] Based on the attention matrix of each reference unit corresponding to the second target unit type and the attribute graph of each reference unit type, the adjacent nodes of each reference unit type are determined.

[0028] Based on the neighboring nodes of each reference unit and the attribute graph of the second target unit, attention matrices corresponding to each reference unit and the second target unit are obtained by focusing on the second target unit using each reference unit.

[0029] Based on the attention matrix of the second target apartment type corresponding to each reference apartment type and the attribute graph of the second target apartment type, the predicted neighboring nodes of the second target apartment type corresponding to each reference apartment type are obtained.

[0030] In an exemplary implementation, determining the similarity between the first target apartment type and the second target apartment type based on the first vector and the second vector includes:

[0031] The Euclidean distance between the first vector and the second vector is determined as the similarity between the first target apartment type and the second target apartment type; or

[0032] The cosine distance between the first vector and the second vector is determined as the similarity between the first target apartment type and the second target apartment type.

[0033] A similar apartment layout detection device includes:

[0034] The first determining module is used to determine the first degree of difference between the first target apartment type and each of the reference apartment types based on the attribute map of the first target apartment type and the attribute map of each reference apartment type in the reference apartment type set.

[0035] The first combination module is used to combine the first difference degree into a first vector representing the first target apartment type;

[0036] The second determining module is used to determine a second degree of difference between the second target apartment type and each of the reference apartment types based on the attribute map of the second target apartment type and the attribute map of each reference apartment type in the reference apartment type set;

[0037] The second combination module is used to combine the second difference degree into a second vector representing the second target apartment type;

[0038] The third determining module is used to determine the similarity between the first target apartment type and the second target apartment type based on the first vector and the second vector.

[0039] In an exemplary embodiment, the first determining module is configured to determine the predicted neighboring nodes of the first target unit based on the attribute map of each reference unit type; determine the neighboring nodes of the first target unit type based on the attribute map of the first target unit type; and determine the first difference between the neighboring nodes of the first target unit type and the predicted neighboring nodes of the first target unit type as the first difference degree between the first target unit type and each reference unit type.

[0040] In an exemplary embodiment, the second determining module is configured to determine the predicted neighboring nodes of the second target unit based on the attribute map of each reference unit type; determine the neighboring nodes of the second target unit type based on the attribute map of the second target unit type; and determine the second difference between the neighboring nodes of the second target unit type and the predicted neighboring nodes of the second target unit type as the second difference degree between the second target unit type and each reference unit type.

[0041] In an exemplary embodiment, the first determining module is configured to: focus on each reference apartment type using the first target apartment type based on the attribute graph of the first target apartment type and the attribute graph of each reference apartment type in the reference apartment type set, to obtain an attention matrix corresponding to the first target apartment type and for each reference apartment type; determine the neighboring nodes of each reference apartment type based on the attention matrix corresponding to the first target apartment type and the attribute graph of each reference apartment type; focus on the first target apartment type using each reference apartment type based on the neighboring nodes of each reference apartment type and the attribute graph of the first target apartment type, to obtain an attention matrix corresponding to each reference apartment type and for the first target apartment type; and obtain predicted neighboring nodes corresponding to each reference apartment type and for the first target apartment type based on the attention matrix corresponding to each reference apartment type and the attribute graph of the first target apartment type.

[0042] In an exemplary embodiment, the second determining module is configured to: focus on each reference apartment type using the second target apartment type based on the attribute graph of the second target apartment type and the attribute graph of each reference apartment type in the reference apartment type set, to obtain an attention matrix corresponding to the second target apartment type and for each reference apartment type; determine the neighboring nodes of each reference apartment type based on the attention matrix corresponding to the second target apartment type and the attribute graph of each reference apartment type; focus on the second target apartment type using each reference apartment type based on the neighboring nodes of each reference apartment type and the attribute graph of the second target apartment type, to obtain an attention matrix corresponding to each reference apartment type and for the second target apartment type; and obtain predicted neighboring nodes corresponding to each reference apartment type and for the second target apartment type based on the attention matrix corresponding to each reference apartment type and the attribute graph of the second target apartment type.

[0043] In an exemplary embodiment, the third determining module is used to determine the Euclidean distance between the first vector and the second vector as the similarity between the first target apartment type and the second target apartment type; or, to determine the cosine distance between the first vector and the second vector as the similarity between the first target apartment type and the second target apartment type.

[0044] A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, can perform the steps of the similar apartment type detection method as described in any of the preceding claims.

[0045] An electronic device comprising:

[0046] processor;

[0047] Memory used to store the processor's executable instructions;

[0048] The processor is configured to read the executable instructions from the memory and execute the instructions to implement the similar apartment layout detection method as described in any of the preceding claims.

[0049] A computer program product includes computer instructions that, when executed by a processor, implement the similar apartment type detection method as described in any of the preceding claims.

[0050] As can be seen from the above technical solution, in the embodiments of the present invention, based on the attribute map of the first target apartment type and the attribute map of each reference apartment type in the reference apartment type set, a first difference degree between the first target apartment type and each reference apartment type is determined; the first difference degree is combined into a first vector representing the first target apartment type; based on the attribute map of the second target apartment type and the attribute map of each reference apartment type in the reference apartment type set, a second difference degree between the second target apartment type and each reference apartment type is determined; the second difference degree is combined into a second vector representing the second target apartment type; based on the first vector and the second vector, the similarity between the first target apartment type and the second target apartment type is determined. Therefore, the embodiments of the present invention generate vectors representing target apartment types based on the comparison process of multiple reference apartment types, and then accurately determine similar apartment types based on vector distance, thereby improving the detection accuracy of similar apartment types.

[0051] Furthermore, the embodiments of the present invention utilize a cross-attention model between the target apartment type and the reference apartment type to represent the degree of alignment (similarity) between the two apartment types; the attributes of each node can be used to further improve the accuracy of automatic alignment of the attention model, effectively representing the room matching situation of the target apartment type and the reference apartment type, and further improving the detection accuracy of similar apartment types. Attached Figure Description

[0052] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1 This is an exemplary flowchart of a similar apartment layout detection method according to an embodiment of the present invention.

[0054] Figure 2 This is an exemplary schematic diagram illustrating the determination of apartment attribute diagrams based on apartment vector diagrams according to an embodiment of the present invention.

[0055] Figure 3 This is a typical schematic diagram of a reference apartment type according to an embodiment of the present invention.

[0056] Figure 4 This is a diagram illustrating the similar apartment layout detection process according to an embodiment of the present invention.

[0057] Figure 5 This is an exemplary structural diagram of a similar apartment layout detection device according to an embodiment of the present invention.

[0058] Figure 6 This is an exemplary structural diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0059] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings.

[0060] For the sake of brevity and intuitiveness, the following description uses several representative embodiments to illustrate the solution of the present invention. Numerous details in the embodiments are only used to aid in understanding the solution of the present invention. However, it is obvious that the technical solution of the present invention can be implemented without being limited to these details. To avoid unnecessarily obscuring the solution of the present invention, some embodiments are not described in detail, but only a framework is given. In the following text, "comprising" means "including but not limited to," and "according to..." means "at least according to..., but not limited to only according to...". Due to Chinese language habits, unless the quantity of a component is specifically indicated below, it means that the component can be one or more, or can be understood as at least one.

[0061] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of the embodiments of the present invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the present invention described herein can be implemented, for example, in orders other than those illustrated or described herein.

[0062] Floor plan similarity detection involves taking any set of floor plans or a set of floor plans that meet certain conditions, sorting all floor plans in the set according to the vector features of the target floor plan, and finding a subset of floor plans with the same or similar layout as the target floor plan.

[0063] The applicant found that while manually defined apartment layout features offer good interpretability, they suffer from poor generalization ability, meaning it's difficult to describe the overall layout characteristics using rules or simple features. Furthermore, learnable deep apartment layouts exhibit good generalization ability but suffer from poor feature interpretability, failing to accurately compare room-to-room matching. This disclosure, based on traditional attribute graphs, adds autoencoding processing for reference apartment layouts and dual attention processing from target apartment layouts to reference apartment layouts, enabling accurate similarity detection for various apartment layout types.

[0064] Figure 1 This is an exemplary flowchart of a similar apartment layout detection method according to an embodiment of the present invention.

[0065] like Figure 1 As shown, the method includes:

[0066] Step 101: Based on the attribute map of the first target apartment type and the attribute map of each reference apartment type in the reference apartment type set, determine the first degree of difference between the first target apartment type and each reference apartment type.

[0067] Here, an attribute map of the first target apartment type can be generated based on its vector graphic, and an attribute map of each reference apartment type in the reference apartment type set can be generated based on its vector graphic. The attribute map contains nodes and edges connecting the nodes. Nodes specifically represent functional spaces in the apartment type map, such as kitchen, bathroom, master bedroom, secondary bedroom, living room, balcony, etc. Edges represent the connections between adjacent nodes.

[0068] An exemplary process for generating attribute maps from vector graphics includes:

[0069] (1) Define any functional space of the house as a node in the attribute graph. If any two functional spaces are connected (for example, there is a door through which they can pass), then add an edge between the two nodes.

[0070] (2) Divide each functional space into geometric shapes (usually square or circular) and establish an XY two-dimensional coordinate system according to the north and south directions to obtain the geometric center of each functional space as well as the length, width and area of ​​each functional space.

[0071] (3) Construct node attributes. The node attributes here reflect the characteristics of each functional space and can be customized by the user. For example, node attributes may include the coordinates, length, width, area of ​​the functional space, the number of windows in the room, the coordinates of the windows, the type of the room, etc.

[0072] (4) Constructing connection attributes. The connection attributes here reflect the orientation, distance, etc. between connected functional spaces, and can be customized by the user.

[0073] Figure 2 This is an exemplary schematic diagram illustrating the determination of apartment attribute diagrams based on apartment vector diagrams according to an embodiment of the present invention.

[0074] exist Figure 2 In the diagram, the floor plan vector map 10 contains multiple functional spaces (such as rooms) 21. These functional spaces may include a kitchen, bathroom, master bedroom, secondary bedroom, living room, balcony, and so on. Correspondingly, the floor plan attribute map 20 generated based on the floor plan vector map 10 also contains multiple nodes 60, where each node corresponds to its respective functional space. Furthermore, the nodes in the floor plan attribute map 20 are connected by edges as shown by dashed lines.

[0075] Although the generation of a floor plan attribute diagram is described exemplarily using a floor plan vector diagram as an example in the embodiments of this disclosure, it should be understood that the embodiments of this disclosure are not limited thereto, and in other embodiments, floor plan vector diagrams can also be generated based on any form of floor plan diagram.

[0076] Figure 3 This is a typical schematic diagram of a reference apartment type according to an embodiment of the present invention.

[0077] exist Figure 3 In the diagram, the left side shows reference apartment type 31 (H-type), the middle side shows reference apartment type 32 (7-type), and the right side shows reference apartment type 33 (8-type). Houses with a structure and shape resembling the letter "H" are called "H" type apartments; houses with a structure and shape resembling the letter "7" are called "7" type apartments; and houses with a structure and shape resembling the letter "8" are called "8" type apartments.

[0078] The above illustrative description illustrates typical scenarios for generating attribute maps and reference floor plans. Those skilled in the art will recognize that this description is merely illustrative and is not intended to limit the scope of protection of the embodiments of the present invention.

[0079] Here, step 101, determining the first difference between the first target apartment type and each reference apartment type, includes: determining the predicted neighboring nodes of the first target apartment type based on the attribute map of each reference apartment type; determining the neighboring nodes of the first target apartment type based on the attribute map of the first target apartment type; and determining the first difference between the neighboring nodes of the first target apartment type and the predicted neighboring nodes of the first target apartment type as the first difference between the first target apartment type and each reference apartment type. Specifically, an artificial neural network can be used to determine the predicted neighboring nodes of the first target apartment type based on the attribute map of each reference apartment type. Furthermore, the specific method for determining neighboring nodes based on the attribute map of the first target apartment type can be: inputting the attribute map of the first target apartment type into an autoencoder, so that the autoencoder determines the neighboring nodes of the first target apartment type based on the autoencoder processing. The autoencoder model mainly consists of an encoder and a decoder, and its main purpose is to transform the input x into an intermediate variable y, and then transform y into... Then compare the input x and the output. Make the input x and output Two that are infinitely close.

[0080] In one implementation, determining the predicted adjacent nodes of the first target apartment type based on the attribute graph of each reference apartment type specifically includes:

[0081] Based on the attribute graph of the first target apartment type and the attribute graph of each reference apartment type in the reference apartment type set, attention is paid to each reference apartment type using the first target apartment type to obtain an attention matrix corresponding to the first target apartment type and for each reference apartment type. Based on the attention matrix corresponding to the first target apartment type and for each reference apartment type and the attribute graph of each reference apartment type, the neighboring nodes of each reference apartment type are determined. Based on the neighboring nodes of each reference apartment type and the attribute graph of the first target apartment type, attention is paid to the first target apartment type using each reference apartment type to obtain an attention matrix corresponding to each reference apartment type and for the first target apartment type. Based on the attention matrix corresponding to each reference apartment type and for the first target apartment type and the attribute graph of the first target apartment type, predicted neighboring nodes corresponding to each reference apartment type and for the first target apartment type are obtained.

[0082] Step 102: Combine the first difference degree into a first vector representing the first target apartment type.

[0083] The number of first differences generated in step 101 corresponds to the number of reference apartment types in the reference apartment type set. For example, assuming there are n reference apartment types in the reference apartment type set, then n first differences can be generated in step 101. Accordingly, in step 102, these n first differences are combined into an n-dimensional vector (i.e., the first vector) representing the first target apartment type.

[0084] Step 103: Based on the attribute map of the second target apartment type and the attribute map of each reference apartment type in the reference apartment type set, determine the second degree of difference between the second target apartment type and each reference apartment type.

[0085] Here, step 103, determining the second difference degree between the second target apartment type and each of the reference apartment types, includes: determining the predicted neighboring nodes of the second target apartment type based on the attribute map of each reference apartment type; determining the neighboring nodes of the second target apartment type based on the attribute map of the second target apartment type; and determining the second difference between the neighboring nodes of the second target apartment type and the predicted neighboring nodes of the second target apartment type as the second difference degree between the second target apartment type and each of the reference apartment types. Specifically, an artificial neural network can be used to determine the predicted neighboring nodes of the second target apartment type based on the attribute map of each reference apartment type. Furthermore, the specific method for determining neighboring nodes based on the attribute map of the second target apartment type can be: inputting the attribute map of the second target apartment type into an autoencoder, so that the autoencoder determines the neighboring nodes of the second target apartment type based on autoencoding processing.

[0086] In one implementation, determining the predicted neighbor nodes of the second target apartment type based on the attribute graph of each reference apartment type specifically includes: based on the attribute graph of the second target apartment type and the attribute graph of each reference apartment type in the reference apartment type set, using the second target apartment type to focus on each reference apartment type to obtain an attention matrix corresponding to the second target apartment type and for each reference apartment type; based on the attention matrix corresponding to the first target apartment type and the attribute graph of each reference apartment type, determining the neighbor nodes of each reference apartment type; based on the neighbor nodes of each reference apartment type and the attribute graph of the second target apartment type, using each reference apartment type to focus on the second target apartment type to obtain an attention matrix corresponding to each reference apartment type and for the second target apartment type; and based on the attention matrix corresponding to each reference apartment type and the attribute graph of the second target apartment type and for the second target apartment type, obtaining the predicted neighbor nodes corresponding to each reference apartment type and for the second target apartment type.

[0087] Step 104: Combine the second difference degree into a second vector characterizing the second target apartment type.

[0088] The number of second differences generated in step 103 corresponds to the number of reference apartment types in the reference apartment type set. For example, assuming there are n reference apartment types in the reference apartment type set, n second differences can be generated in step 103. Accordingly, in step 104, these n second differences are combined into an n-dimensional vector (i.e., the second vector) representing the second target apartment type.

[0089] Step 105: Based on the first vector and the second vector, determine the similarity between the first target apartment type and the second target apartment type.

[0090] Based on the first vector and the second vector, determining the similarity between the first target apartment type and the second target apartment type includes:

[0091] The Euclidean distance between the first vector and the second vector is determined as the similarity between the first target apartment type and the second target apartment type, and the cosine distance between the first vector and the second vector is determined as the similarity between the first target apartment type and the second target apartment type.

[0092] As can be seen, in this embodiment of the invention, a reference apartment set containing n reference apartment types is selected, and then an artificial neural network is used to calculate the predicted neighboring nodes of the apartment type attribute map used as training samples for each reference apartment type. Furthermore, an autoencoder is used to determine the neighboring nodes of the apartment type attribute map used as training samples. Specifically, the difference between the neighboring nodes of the apartment type attribute map and the predicted neighboring nodes is used as a self-supervised loss function to iteratively train the artificial neural network. The iteratively trained artificial neural network becomes a similar apartment type detection model for performing similar apartment type detection. Using this similar apartment type detection model, the difference between any input target apartment type and each reference apartment type in the reference apartment set can be determined. For example, the difference between the target apartment type and each reference apartment type in the reference apartment set, Difference(Target|Sourcei), is abbreviated as D(T|Si), where i = 0, 1, ..., n. Then, these n differences (corresponding to n reference apartment types) are concatenated into an n-dimensional vector representing the target apartment type, denoted as D(T) = [D(T|S1), D(T|S2), D(T|S3), ..., D(T|Sn)]. It can be seen that, based on the implementation method of this invention, an n-dimensional vector representing any target apartment type can be generated.

[0093] For a target apartment type Tm, an n-dimensional vector D(Tm) representing the target apartment type Tm can be generated based on the embodiments of the present invention. Similarly, for a target apartment type Tn that is different from the target apartment type Tm, an n-dimensional vector D(Tn) representing the target apartment type Tn can be generated based on the embodiments of the present invention. Then, the distance between the n-dimensional vector D(Tm) and the n-dimensional vector D(Tn) can be calculated using common metrics such as Euclidean distance / cosine distance. The smaller the distance, the greater the similarity between the target apartment type Tm and the target apartment type Tn, indicating that the target apartment type Tm and the target apartment type Tn are more similar. The larger the distance, the smaller the similarity between the target apartment type Tm and the target apartment type Tn, indicating that the target apartment type Tm and the target apartment type Tn are less similar.

[0094] Figure 4 This is a diagram illustrating the similar apartment layout detection process according to an embodiment of the present invention.

[0095] First, in input processing 41, the attribute map of the target apartment type and the attribute map of each reference apartment type in the reference apartment type set containing n reference apartment types are input.

[0096] Furthermore, in the target apartment type-reference apartment type attention model processing 42, the target apartment type is used to focus on each reference apartment type, and a first attention matrix corresponding to the target apartment type and for each reference apartment type is calculated. During the calculation of this first attention matrix, for each node of each target apartment type, nodes with the same node type as each node in each reference apartment type are determined as attention objects based on the attention mechanism. That is, the first attention matrix contains the mapping relationship between each node in the target apartment type and nodes of the same type in the reference apartment types. Based on the first attention matrix, nodes in the reference apartment types that have the same type as any node in the target apartment type can be easily determined. For example, assuming the current node of the target apartment type is living room 81, then in the generated first attention matrix, living room 91 of the reference apartment type (because it has the same node type as living room 81, both being living rooms) is the attention object for living room 81. Therefore, based on the first attention matrix, nodes in the reference apartment types that have the same type as any node in the target apartment type can be easily determined.

[0097] The number of first attention matrices corresponds to the number of reference apartment types in the reference apartment type set. For example, assuming that the number of reference apartment types n in the reference apartment type set is 10, based on the target apartment type-reference apartment type attention model processing 42, first attention matrices corresponding to the target apartment type and their respective reference apartment types can be generated, that is, 10 first attention matrices are obtained, where each first attention matrix contains the mapping relationship between any node in the target apartment type and the corresponding reference apartment type nodes of the same type.

[0098] Here, the attention mechanism can adopt any of the following methods to generate the attention matrix: (1) Top-down attention mechanism, called focus attention; focus attention refers to attention that is intentionally and consciously focused on a certain object with a predetermined purpose and task dependence; (2) Bottom-up attention mechanism, called saliency-based attention, which means that there is no prior attention to a specific object based on a certain purpose or task, but simply when the object exhibits a certain characteristic, such as when the value of a certain object is very large, the attention is turned to the object (for example: Max pooling mechanism or gating mechanism).

[0099] The above description provides a typical example of an attention mechanism. Those skilled in the art will recognize that this description is merely illustrative and is not intended to limit the scope of protection of the embodiments of the present invention.

[0100] In autoencoder processing 43, based on the attention matrix of each reference apartment type and the attribute graph of each reference apartment type output by target apartment type-reference apartment type attention model processing 42, the neighboring nodes of each reference apartment type are calculated. Specifically, in autoencoder processing 43, using the first attention matrix of the reference apartment type, nodes in the reference apartment type that have the same type as the target apartment type are identified. Moreover, for these identified nodes, the neighboring nodes of each node in the attribute graph of the reference apartment type are determined based on the autoencoder mechanism. The determination of the neighboring nodes of a node in the attribute graph based on the autoencoder mechanism is existing technology in this field and will not be elaborated further.

[0101] In the reference-target apartment type attention model processing 44, each reference apartment type is used to focus on the target apartment type. Based on the neighboring nodes of the reference apartment types output by the autoencoder processing 43, a second attention matrix corresponding to each reference apartment type and the target apartment type is calculated. During the calculation of the second attention matrix, for each neighboring node of the reference apartment type output by the autoencoder processing 43, nodes with the same node type as each neighboring node in the target apartment type are identified as attention objects based on the attention mechanism. That is, the second attention matrix contains the mapping relationship between each neighboring node in the reference apartment type and nodes of the same type in the target apartment type. Based on the second attention matrix, nodes in the target apartment type that have the same type as any neighboring node in the reference apartment type can be easily identified.

[0102] For example, assuming the current node of the target apartment type is living room 81, in the first attention matrix generated by the target apartment type-reference apartment type attention model processing 42, living room 91 of the reference apartment type (because it has the same node type as living room 81, both being living rooms) is the focus of attention for living room 81. In the autoencoder processing 43, the adjacent nodes of living room 91 of the reference apartment type are determined to be living room 92 and bathroom 93 of the reference apartment type. The adjacent nodes of living room 91 of the reference apartment type (that is, living room 92 and bathroom 93 of the reference apartment type) are used as input to the reference apartment type-target apartment type attention model processing 43. The reference apartment type-target apartment type attention model processing 43 generates a second attention matrix based on the attention mechanism. In the process of generating the second attention matrix, nodes in the target apartment type that have the same type as the adjacent nodes of living room 91 of the reference apartment type are considered as focus objects. Based on the generated second attention matrix, the first living room 82 and the second living room 83 of the target apartment type can be identified as the attention objects of the living room 92 of the reference apartment type (since they are both living room types), and the bathroom 84 of the target apartment type is the attention object of the bathroom 93 of the reference apartment type. The first living room 82, the second living room 83, and the bathroom 84 of the target apartment type are the predicted neighboring nodes of the current node (living room 81 in the target apartment type) of the target apartment type. Similarly, the predicted neighboring nodes of each node in the target apartment type can be obtained.

[0103] In output processing 45, the predicted neighbor nodes of the target apartment type are received from the reference apartment type-target apartment type attention model processing 44. For example, the neighbor nodes of the living room 81 in the target apartment type include: the first living room 82, the second living room 83, and the bathroom 84 of the target apartment type. Then, output processing 45 sends the predicted neighbor nodes of the target apartment type to interpolation processing 46. In interpolation processing 46, the difference between the predicted neighbor nodes of the target apartment type and the neighbor nodes of the target apartment type determined based on the attribute map of the target apartment type (e.g., the neighbor nodes of the target apartment type obtained by interpolation processing 46 from autoencoder processing 43) is calculated. This difference is used as a self-supervised loss function to iteratively train the overall network including input processing 41, target apartment type-reference apartment type attention model processing 42, autoencoder processing 43, reference apartment type-target apartment type attention model processing 44, output processing 45, and interpolation processing 46.

[0104] After completing iterative training, the overall network, which includes input processing 41, target-reference apartment type attention model processing 42, autoencoder processing 43, reference-target apartment type attention model processing 44, output processing 45, and difference processing 46, can be used to calculate the similarity between any two apartment types to be compared (e.g., referred to as the first and second apartment types to be compared). The calculation process includes:

[0105] (1) Input the attribute map of the first apartment type to be compared into the trained overall network. Based on the interpolation process 46, the first loss value between the predicted neighboring nodes of the first apartment type to be compared and the neighboring nodes determined based on the attribute map of the first apartment type to be compared can be obtained. Since the overall network contains n reference apartment types, the output of the interpolation process 46 is: the first n-dimensional vector representing the n first loss values.

[0106] (2) Input the attribute map of the second apartment type to be compared into the trained overall network. Based on the interpolation process 46, the second loss value between the predicted neighboring nodes of the second apartment type to be compared and the neighboring nodes determined based on the attribute map of the second apartment type to be compared can be obtained. Since the overall network contains n reference apartment types, the output of the interpolation process 46 is: a second n-dimensional vector representing the n second loss values.

[0107] (3) Calculate the Euclidean distance or cosine distance between the first n-dimensional vector and the second n-dimensional vector to obtain the similarity that characterizes the degree of similarity between the first apartment type to be compared and the second apartment type to be compared.

[0108] As can be seen, in this embodiment of the invention, the vector map of the target apartment type is converted into an attribute map, and each node in the attribute map contains custom attributes (such as room area, room angle, distance between the room and the center of gravity of the whole house, etc.). Furthermore, a cross-attention model between the target apartment type nodes and the reference apartment type nodes is used to represent the alignment (similarity) degree between the two apartment types; the attributes of each node are then used to further improve the accuracy of the automatic alignment of the node attention model. Simultaneously, the network alignment operation can effectively represent the room matching situation between the target apartment type and the reference apartment type, increasing the interpretability of the results. Finally, the adjacent nodes of the target apartment type are output. Using the adjacent nodes of the target apartment type as the labels of the training samples and the adjacent nodes of the final output target apartment type as the predicted values, a multi-classification loss function is established to complete the end-to-end training of the entire model. After the apartment types are encoded to generate their respective vectors, the distance between any two vectors can be calculated using Euclidean or cosine equal distance to characterize the similarity between any two apartment types.

[0109] Figure 5 This is an exemplary structural diagram of a similar apartment layout detection device according to an embodiment of the present invention.

[0110] like Figure 5 As shown, the similar apartment type detection device 500 includes:

[0111] The first determining module 501 is used to determine the first degree of difference between the first target apartment type and each of the reference apartment types based on the attribute map of the first target apartment type and the attribute map of each reference apartment type in the reference apartment type set.

[0112] The first combination module 502 is used to combine the first difference degree into a first vector representing the first target apartment type;

[0113] The second determining module 503 is used to determine the second degree of difference between the second target apartment type and each reference apartment type in the reference apartment type set based on the attribute map of the second target apartment type and the attribute map of each reference apartment type in the reference apartment type set.

[0114] The second combination module 504 is used to combine the second difference degree into a second vector representing the second target apartment type;

[0115] The third determining module 505 is used to determine the similarity between the first target apartment type and the second target apartment type based on the first vector and the second vector.

[0116] In an exemplary embodiment, the first determining module 501 is configured to determine the predicted neighboring nodes of the first target unit based on the attribute map of each reference unit type; determine the neighboring nodes of the first target unit type based on the attribute map of the first target unit type; and determine the first difference between the neighboring nodes of the first target unit type and the predicted neighboring nodes of the first target unit type as the first difference degree between the first target unit type and each reference unit type.

[0117] In an exemplary embodiment, the second determining module 503 is configured to determine the predicted neighboring nodes of the second target unit based on the attribute map of each reference unit type; determine the neighboring nodes of the second target unit type based on the attribute map of the second target unit type; and determine the second difference between the neighboring nodes of the second target unit type and the predicted neighboring nodes of the second target unit type as the second difference degree between the second target unit type and each reference unit type.

[0118] In an exemplary embodiment, the first determining module 501 is configured to: focus on each reference apartment type using the first target apartment type based on the attribute graph of the first target apartment type and the attribute graph of each reference apartment type in the reference apartment type set, thereby obtaining an attention matrix corresponding to the first target apartment type and for each reference apartment type; determine the neighboring nodes of each reference apartment type based on the attention matrix corresponding to the first target apartment type and the attribute graph of each reference apartment type; focus on the first target apartment type using each reference apartment type based on the neighboring nodes of each reference apartment type and the attribute graph of the first target apartment type, thereby obtaining an attention matrix corresponding to each reference apartment type and for the first target apartment type; and obtain predicted neighboring nodes corresponding to each reference apartment type and for the first target apartment type based on the attention matrix corresponding to each reference apartment type and the attribute graph of the first target apartment type.

[0119] In an exemplary embodiment, the second determining module 503 is configured to: focus on each reference apartment type using the second target apartment type based on the attribute graph of the second target apartment type and the attribute graph of each reference apartment type in the reference apartment type set, to obtain an attention matrix corresponding to the second target apartment type and for each reference apartment type; determine the neighboring nodes of each reference apartment type based on the attention matrix corresponding to the second target apartment type and the attribute graph of each reference apartment type; focus on the second target apartment type using each reference apartment type based on the neighboring nodes of each reference apartment type and the attribute graph of the second target apartment type, to obtain an attention matrix corresponding to each reference apartment type and for the second target apartment type; and obtain predicted neighboring nodes corresponding to each reference apartment type and for the second target apartment type based on the attention matrix corresponding to each reference apartment type and the attribute graph of the second target apartment type.

[0120] In an exemplary embodiment, the third determining module 505 is used to determine the Euclidean distance between the first vector and the second vector as the similarity between the first target apartment type and the second target apartment type; or, to determine the cosine distance between the first vector and the second vector as the similarity between the first target apartment type and the second target apartment type.

[0121] In summary, in this embodiment of the invention, based on the attribute map of the first target apartment type and the attribute map of each reference apartment type in the reference apartment type set, a first difference degree between the first target apartment type and each reference apartment type is determined; the first difference degree is combined into a first vector representing the first target apartment type; based on the attribute map of the second target apartment type and the attribute map of each reference apartment type in the reference apartment type set, a second difference degree between the second target apartment type and each reference apartment type is determined; the second difference degree is combined into a second vector representing the second target apartment type; based on the first vector and the second vector, the similarity between the first target apartment type and the second target apartment type is determined. This embodiment of the invention generates a vector representing the target apartment type based on a comparison process of multiple reference apartment types, and then accurately determines similar apartment types based on vector distance, thereby improving the detection accuracy of similar apartment types.

[0122] Furthermore, the embodiments of the present invention utilize a cross-attention model between the target apartment type and the reference apartment type to represent the degree of alignment (similarity) between the two apartment types; the attributes of each node can be used to further improve the accuracy of automatic alignment of the attention model, effectively representing the room matching situation of the target apartment type and the reference apartment type, and further improving the detection accuracy of similar apartment types.

[0123] This invention also provides a computer-readable medium storing instructions that, when executed by a processor, can perform the steps of the similar apartment type detection method described above. In practical applications, the computer-readable medium may be included in the device / apparatus / system described in the above embodiments, or it may exist independently without being assembled into that device / apparatus / system. The computer-readable storage medium carries one or more programs, and when one or more programs are executed, the runtime environment simulation method for the small programs described in the above embodiments can be implemented. According to the embodiments disclosed in this invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof, but this is not intended to limit the scope of protection of this invention. In the embodiments disclosed in this invention, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0124] like Figure 6 As shown, embodiments of the present invention also provide an electronic device in which the apparatus for implementing the method of embodiments of the present invention can be integrated. For example... Figure 6 As shown, it illustrates an exemplary structural diagram of an electronic device according to an embodiment of the present invention.

[0125] Specifically, the electronic device may include a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, and a computer program stored in the memory and executable on the processor. When the program in the memory 402 is executed, the aforementioned similar apartment layout detection method can be implemented.

[0126] In practical applications, the electronic device may also include components such as a power supply 403, an input unit 404, and an output unit 405. Those skilled in the art will understand that... Figure 6The structure of the electronic device shown does not constitute a limitation on the electronic device. It may include more or fewer components than shown, or combine certain components, or have different component arrangements. Specifically, processor 401 is the control center of the electronic device, connecting various parts of the entire electronic device via various interfaces and lines. It performs overall monitoring of the electronic device by running or executing software programs and / or modules stored in memory 402, and by calling data stored in memory 402, thereby executing various functions of the server and processing data. Memory 402 can be used to store software programs and modules, i.e., the aforementioned computer-readable storage medium. Processor 401 executes various functional applications and data processing by running the software programs and modules stored in memory 402. Memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created according to the use of the server, etc. Furthermore, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory 402 may also include a memory controller to provide processor 401 with access to memory 402.

[0127] The electronic device also includes a power supply 403 that supplies power to various components. This power supply can be logically connected to the processor 401 via a power management system, enabling functions such as charging, discharging, and power consumption management. The power supply 403 may also include one or more DC or AC power supplies, a recharging system, a power fault detection circuit, a power converter or inverter, a power status indicator, or other arbitrary components. The electronic device may also include an input unit 404, which can receive input digital or character information and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. The electronic device may also include an output unit 405, which can display information input by the user or information provided to the user, as well as various graphical user interfaces, which can be composed of graphics, text, icons, video, and any combination thereof.

[0128] This invention also provides a computer program product comprising computer instructions that, when executed by a processor, implement the method as described in any of the above embodiments.

[0129] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments disclosed in this invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in the order shown in different figures. For example, two blocks shown connected together may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or may be implemented using a combination of dedicated hardware and computer instructions.

[0130] This document describes the principles and implementation methods of the present invention using specific embodiments. These embodiments are merely illustrative of the method and core concepts of the present invention and are not intended to limit the invention. Those skilled in the art can make changes to the specific implementation methods and application scope based on the ideas, spirit, and principles of the present invention. Any modifications, equivalent substitutions, or improvements made should be included within the scope of protection of this invention.

Claims

1. A method for detecting similar apartment layouts, characterized in that, include: Based on the attribute map of the first target apartment type and the attribute map of each reference apartment type in the reference apartment type set, a first degree of difference between the first target apartment type and each reference apartment type is determined; The first difference degree is combined into a first vector representing the first target apartment type; Based on the attribute map of the second target apartment type and the attribute map of each reference apartment type in the reference apartment type set, a second degree of difference between the second target apartment type and each reference apartment type is determined; The second difference degree is combined into a second vector characterizing the second target apartment type; Based on the first vector and the second vector, the similarity between the first target apartment type and the second target apartment type is determined; The attribute graph includes nodes and edges connecting the nodes. The nodes are the functional spaces in the floor plan, and the edges are the connection relationships between adjacent nodes.

2. The method for detecting similar apartment layouts according to claim 1, characterized in that, The determination of the first difference degree between the first target apartment type and each of the reference apartment types includes: Based on the attribute graph of each reference apartment type, the predicted adjacent nodes of the first target apartment type are determined; Based on the attribute graph of the first target apartment type, determine the adjacent nodes of the first target apartment type; The first difference between the adjacent nodes of the first target apartment type and the predicted adjacent nodes of the first target apartment type is determined as the first degree of difference between the first target apartment type and each reference apartment type. In this process, the attribute graph of the first target apartment type is input into the autoencoder so that the autoencoder can determine the adjacent nodes of the first target apartment type based on the autoencoding process.

3. The method for detecting similar apartment layouts according to claim 2, characterized in that, The determination of the second difference degree between the second target apartment type and each of the reference apartment types includes: Based on the attribute graph of each reference apartment type, the predicted adjacent nodes of the second target apartment type are determined; Based on the attribute graph of the second target apartment type, determine the adjacent nodes of the second target apartment type; The second difference between the adjacent nodes of the second target apartment type and the predicted adjacent nodes of the second target apartment type is determined as the second difference degree between the second target apartment type and each reference apartment type. In this process, the attribute graph of the second target apartment type is input into the autoencoder so that the autoencoder can determine the adjacent nodes of the second target apartment type based on the autoencoding process.

4. The method for detecting similar apartment layouts according to claim 2, characterized in that, The step of determining the predicted neighbor nodes of the first target apartment type based on the attribute graph of each reference apartment type includes: Based on the attribute graph of the first target apartment type and the attribute graph of each reference apartment type in the reference apartment type set, attention is paid to each reference apartment type using the first target apartment type, resulting in an attention matrix corresponding to the first target apartment type for each reference apartment type. Based on the attention matrix of each reference unit corresponding to the first target unit type and the attribute graph of each reference unit type, the adjacent nodes of each reference unit type are determined. Based on the neighboring nodes of each reference unit type and the attribute graph of the first target unit type, attention matrix corresponding to each reference unit type and the first target unit type is obtained by focusing on the first target unit type using each reference unit type. Based on the attention matrix of the first target apartment type corresponding to each reference apartment type and the attribute graph of the first target apartment type, the predicted neighboring nodes of the first target apartment type corresponding to each reference apartment type are obtained.

5. The method for detecting similar apartment layouts according to claim 3, characterized in that, The step of determining the predicted neighbor nodes of the second target apartment type based on the attribute graph of each reference apartment type includes: Based on the attribute graph of the second target apartment type and the attribute graph of each reference apartment type in the reference apartment type set, attention is paid to each reference apartment type using the second target apartment type, resulting in an attention matrix corresponding to the second target apartment type for each reference apartment type. Based on the attention matrix of each reference unit corresponding to the second target unit type and the attribute graph of each reference unit type, the adjacent nodes of each reference unit type are determined. Based on the neighboring nodes of each reference unit and the attribute graph of the second target unit, attention matrices corresponding to each reference unit and the second target unit are obtained by focusing on the second target unit using each reference unit. Based on the attention matrix of the second target apartment type corresponding to each reference apartment type and the attribute graph of the second target apartment type, the predicted neighboring nodes of the second target apartment type corresponding to each reference apartment type are obtained.

6. The method for detecting similar apartment layouts according to any one of claims 1-5, characterized in that, Based on the first vector and the second vector, determining the similarity between the first target apartment type and the second target apartment type includes: The Euclidean distance between the first vector and the second vector is determined as the similarity between the first target apartment type and the second target apartment type; or The cosine distance between the first vector and the second vector is determined as the similarity between the first target apartment type and the second target apartment type.

7. A device for detecting similar apartment layouts, characterized in that, include: The first determining module is used to determine the first degree of difference between the first target apartment type and each of the reference apartment types based on the attribute map of the first target apartment type and the attribute map of each reference apartment type in the reference apartment type set. The first combination module is used to combine the first difference degree into a first vector representing the first target apartment type; The second determining module is used to determine a second degree of difference between the second target apartment type and each of the reference apartment types based on the attribute map of the second target apartment type and the attribute map of each reference apartment type in the reference apartment type set; The second combination module is used to combine the second difference degree into a second vector representing the second target apartment type; The third determining module is used to determine the similarity between the first target apartment type and the second target apartment type based on the first vector and the second vector; The attribute graph includes nodes and edges connecting the nodes. The nodes are the functional spaces in the floor plan, and the edges are the connection relationships between adjacent nodes.

8. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the instruction is executed by the processor, it can implement the steps of the similar apartment type detection method according to any one of claims 1-6.

9. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the similar apartment layout detection method according to any one of claims 1-6.

10. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the similar apartment type detection method according to any one of claims 1-6.