A method and device for predicting building thermal comfort based on indoor population
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING UNIV OF POSTS & TELECOMM
- Filing Date
- 2023-04-27
- Publication Date
- 2026-06-19
Smart Images

Figure CN116485026B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of Internet of Things (IoT) technology, specifically relating to a method and device for predicting building thermal comfort based on the number of people indoors. Background Technology
[0002] Against the backdrop of the digital economy, emerging technologies such as the Internet of Things, artificial intelligence, cloud computing, and big data are being combined with architecture, giving rise to the concept of smart buildings. This concept has become an important paradigm for digital technology to empower the traditional construction industry.
[0003] Comfort and energy efficiency are two major goals of smart buildings, and understanding the thermal comfort of occupants within building spaces is key to achieving these goals. It helps heating, ventilation, and air conditioning (HVAC) systems develop green and efficient intervention strategies. Statistics show that buildings account for 40% of global energy consumption, and more than half of that energy is used by HVAC systems to maintain indoor thermal comfort. Despite this significant energy consumption, as many as 62% of occupants are dissatisfied with the thermal environment of their workplaces. Poor indoor thermal conditions can negatively impact health and work efficiency; therefore, accurate thermal comfort prediction is considered a prominent and important issue. However, current thermal comfort prediction still faces the following difficulties and challenges.
[0004] First, human perception of the thermal environment has both a physical basis and subjective differences, meaning that human comfort is influenced by many factors. Currently, most thermal comfort prediction schemes only consider common thermal comfort factors such as temperature and humidity, which is not comprehensive.
[0005] Secondly, there is a complex nonlinear relationship between thermal comfort and its influencing factors, making accurate modeling difficult. Most existing thermal comfort models either use explicit thermal comfort expressions or employ coarse-grained fusion mechanisms to directly link input attributes and thermal comfort, resulting in low prediction accuracy. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a method and apparatus for predicting building thermal comfort based on the number of people indoors. By incorporating the attribute of the number of people indoors, a building thermal comfort prediction model based on the number of people indoors is constructed, which effectively improves the prediction accuracy of building thermal comfort.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] Firstly, a method for predicting building thermal comfort based on the number of people indoors is provided, comprising: collecting indoor environmental data; inputting the collected indoor environmental data into a constructed building thermal comfort prediction model based on the number of people indoors, and outputting the prediction result of building thermal comfort.
[0009] Furthermore, the indoor environmental data includes indoor environmental attributes and indoor occupancy attributes determined based on a finite state machine; the indoor environmental attributes include indoor temperature, indoor relative humidity, clothing thermal resistance, wind speed, age, metabolic rate, and gender.
[0010] Furthermore, the method for determining the indoor number of people includes: collecting infrared array data of target people in a designated area; performing a binarization operation on the collected infrared array data F(x,y,t) at time t to filter out background pixels; and taking the average value of infrared pixels within a local 3×3 range of the pixel as the binarization threshold to obtain a background-free infrared array F1(x,y,t).
[0011]
[0012] Here, threshold is the average value of infrared pixels within a 3×3 area of the local pixel; the target area is enlarged using erosion operations in morphological processing to match the actual target.
[0013]
[0014] Where F′(x,y,t) is the infrared array data at time t after the erosion operation, and B is the structuring element in the erosion operation; the infrared array data is used to extract features using the position information extraction operator to obtain the feature matrix related to the spatial position of the target:
[0015] T(x,y,t)=(T(x,t),T(y,t)) (3)
[0016] T(x,t)=F v *var(x,t)+F m *(maxF(x,y,t)-minF(x,y,t)) (4)
[0017] T(y,t)=F v *var(y,t)+F m *(maxF(x,y,t)-minF(x,y,t)) (5)
[0018] Where T(x,y,t) is the feature matrix of the infrared array data, and the value of T(x,y,t) is positively correlated with the probability weight of the presence of a target at time t (x,y), var(x,t) is the variance of the M infrared array data in the x-th column at time t, maxF(x,y,t) is the maximum infrared array data in the x-th column at time t, minF(x,y,t) is the minimum infrared array data in the x-th column at time t, and F... v F m These are two weighting coefficients, Fv The size is twice that of F m The left target position is calculated using the leftmost M / 2 columns of the feature matrix T(x,y,t). The rightmost column M / 2 calculates the position of the right target.
[0019]
[0020]
[0021]
[0022]
[0023] The mapping relationship between targets A and B in continuous time is determined by calculating the spatial distance between two targets A and B at two time points, thereby obtaining the number of targets and their trajectories; assuming that the positions of targets A and B at time t1 are respectively in These are the x and y coordinates of targets A and B at time t1, respectively. Furthermore, it is detected that targets A and B have two positional information points at their adjacent time t2(t1+Δt). However, it is unknown which specific positions A and B correspond to; among them Let A and B be the coordinates of A and B at time t2; then the formula for calculating the spatial distance is as follows:
[0024]
[0025]
[0026] Among them, DIS space (O1, O3) is the square of the distance between O1 and O3 in adjacent time intervals, DIS space (O1, O4) is the square of the distance between O1 and O4 at adjacent time points, compared with DIS. space (O1,O3) and DIS space (O1, O4), the smaller one, O3 or O4, is the position of target A at time t2. At the same time, the position of target B at time t2 is also obtained by using the elimination method. Based on the number of targets and their movement trajectories, a finite state machine is used to record the trajectory, thereby obtaining the number of people.
[0027] Furthermore, the building thermal comfort prediction model based on the number of people indoors includes: a transferred neural network used to extract features from indoor environmental attributes to obtain first feature information; g 8 A neural network is used to extract features from the indoor occupancy attribute to obtain secondary feature information; the feature fusion network g fusionThe first feature information and the second feature information are fused to obtain fused feature information; the AGBM classifier is used to iteratively predict the fused feature information to obtain the prediction result of building thermal comfort.
[0028] Furthermore, the training method for the transferred neural network includes: training on the source domain using a global thermal comfort database as the source domain, for the source domain dataset:
[0029]
[0030] Here, dataset B is a global thermal comfort database, and N1 represents the amount of data in dataset B. The input data represents different attributes. i represents seven different attributes with values {1,2,3,4,5,6,7}, which correspond to temperature, relative humidity, clothing level, wind speed, age, metabolic rate, and gender, respectively. The label values in the source domain dataset are {-3, -2, -1, 0, 1, 2, 3}, representing cold, cool, slightly cool, moderate, slightly warm, warm, and hot, respectively. The data is passed to a neural network to extract relevant features, and then labeled through a fully connected layer. Training is performed; the loss function for the source domain is defined as:
[0031]
[0032] in, Let θ represent the loss function of the source domain. S For the parameters of the source domain neural network, The loss function is defined as follows:
[0033]
[0034] in, For indicator functions, when When the condition is met, the indicator function is 1; otherwise, it is 0. This represents the output value of class q among all outputs of the source domain neural network; the output after source domain training is completed is the trained source domain neural network; the target domain dataset is:
[0035]
[0036] Where N2 represents the amount of data in dataset A, The input represents different attributes, where n represents 8 different attributes with values {1, 2, 3, 4, 5, 6, 7, 8}, corresponding to temperature, relative humidity, clothing level, wind speed, age, metabolic rate, gender, and number of people indoors, respectively. The labels are the values in the target domain dataset. The difference between the target domain and the source domain is that the target domain has an additional attribute: the number of people indoors. We will train the number of people indoors separately from the other attributes. Using the Deep CORAL method, we add an adaptive layer to address the differences between the source and target domains. The domain difference loss measured by Coral is defined as the distance between the second-order covariances of the source and target domain features.
[0037]
[0038] in, It is the Frobenius norm of the square matrix, d is the feature output dimension, and C is the Frobenius norm. S and C T These are the eigencovariance matrices of the source and target domains, respectively:
[0039]
[0040]
[0041] Where b is the training batch size, D s It is the input data of the source domain. D T The target domain input data {Γ j Temperature, relative humidity, clothing thermal resistance, wind speed, age, metabolic rate, and gender attributes, 1 b It is a column vector of all 1s; when training in the source domain, supervised training is performed using the input and labels of the source domain data to obtain the loss function of the source domain. In the target domain, only the input data of the target domain is used, and the label data of the target domain is not used. Therefore, the input data of the target domain and the source domain data are trained together to calculate L. CORAL The ultimate goal is to reduce the source domain loss function. and L CORAL Optimize together to the minimum; use stochastic gradient descent algorithm to optimize L. CORAL Source domain loss Simultaneously, optimization is performed to minimize the transfer loss and the source domain supervision loss, yielding the parameters θ of all hidden layers in the source domain neural network. S The first p hidden layers of the source domain neural network are transferred to obtain the transferred neural network.
[0042] Furthermore, g 8 The training method for the neural network includes: training the neural network separately for feature extraction on the indoor occupancy attribute portion of the target domain, with the input data being: Input data The input is used to train the neural network, resulting in: Among them, U 8The feature output representing the number of people indoors is extracted after processing by a neural network; this part of the neural network is called... Among them, T 8 The input represents the number of people in the room. Neural network parameters representing the number of people in the room.
[0043] Furthermore, the feature fusion network g fusion The training methods include: first, preparing the dataset for the target domain... The input target domain network, after passing through the first p layers of the transferred neural network, yields... Among them, U 1-7 The first feature information is the feature output extracted from the first seven attributes (excluding the indoor occupancy attribute) after processing by the transferred neural network; simultaneously, the trained target domain indoor occupancy attribute neural network, g... 8 The second feature information U extracted by the neural network 8 The first and second feature information are input into the feature fusion network g. fusion Then, the corresponding output is obtained: Among them, V 1-8 The feature fusion network extracts features representing the number of people indoors, along with seven other attributes, after being processed by a neural network. The complete expression for the feature fusion network is: g fusion (U 1-7 U 8 ;θ f ), where θ f These are the parameters of the feature fusion network.
[0044] Furthermore, the training method for the AGBM classifier includes: the AGBM classifier is g GBM (V 1-8 ), where V 1-8 The overall features of the eight attributes extracted by the feature fusion network mentioned above are represented by the following expression:
[0045]
[0046] Where, x j V represents the feature vector corresponding to the j-th data after feature extraction; 1-8 The feature information is input into the AGBM classifier and trained iteratively several times; the squared loss is chosen as the loss function.
[0047]
[0048] The total loss function is expressed as:
[0049]
[0050] Differentiate the total loss function:
[0051]
[0052] Therefore, the residual is represented by the negative gradient, and the residual expression for each base learner is as follows:
[0053]
[0054] in, Let x be the residual that each base learner needs to fit when the output category is k, l represents different base learners, l=1 represents decision tree; l=2 represents logistic regression; l=3 represents DART, and k is the number of output thermal comfort categories, which have 7 categories: cold, cool, slightly cool, moderate, slightly warm, warm, and hot, i.e., K=7. j For the input features, When the base learner in the target domain dataset A is l after one-hot encoding, and the output class is k, the input x... j The corresponding label value, p(x), is the probability value of the output of the current category after passing through the softmax function; the following operation takes k=1, i.e., the first category, as an example, to optimize the parameter α of the base learner so that the output of the current base learner is closer to the residual value of the previous step:
[0055]
[0056] Where m is the number of iterations. Let α be the output of the current base learner l, and α be the parameters of the current base learner l; optimize the step size parameter ρ to make the total output of this iteration closer to the label value:
[0057]
[0058] Among them, F m-1 (x j Let be the output value of the (m-1)th iteration; calculate the total output value of this iteration, which is the base learner output value of the previous iteration plus the base learner output value of this iteration multiplied by the step size:
[0059]
[0060] After training, compare the loss functions of the three base learners:
[0061]
[0062] The total loss function expression for the base learner is:
[0063]
[0064] in, Let be the label values in the target domain dataset A when the base learner is l. The final output value of the base learner is given. The base learners for other categories are trained in the same way, and finally, a set of K optimal base learners consisting of M optimal base learners for K categories is obtained. The AGBM classifier composed of the trained base learner sets finally outputs the predicted thermal comfort category.
[0065] Secondly, a building thermal comfort prediction device based on the number of people indoors is provided, comprising: a data acquisition module for collecting indoor environmental data; and a building thermal comfort prediction module for inputting the collected indoor environmental data into a constructed building thermal comfort prediction model based on the number of people indoors, and outputting the prediction result of building thermal comfort.
[0066] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0067] (1) This invention collects indoor environmental data; inputs the collected indoor environmental data into a building thermal comfort prediction model based on the number of people in the room, and outputs the prediction results of building thermal comfort, which effectively improves the prediction accuracy of building thermal comfort.
[0068] (2) This invention improves the accuracy of the number of people collected by the infrared array sensor by using a finite state machine, making the data on the number of people more accurate.
[0069] (3) This invention uses transfer learning and neural network to extract features from a large dataset to extract features that affect the thermal comfort of smart buildings, which solves the problem of small scale and high difficulty of the dataset with human population attributes that I collected myself, and effectively improves the model prediction accuracy.
[0070] (4) This invention adds a base learner self-selection method on the basis of the traditional GBM algorithm, which further improves the accuracy of the system in predicting the thermal comfort of smart buildings. Attached Figure Description
[0071] Figure 1 This is a framework diagram of a building thermal comfort prediction method based on the number of people indoors, provided by an embodiment of the present invention.
[0072] Figure 2 This is a trajectory recording state transition diagram of a finite state machine in an embodiment of the present invention;
[0073] Figure 3 This is a schematic diagram of the building thermal comfort prediction model based on the number of people indoors, as described in an embodiment of the present invention.
[0074] Figure 4 This is a comparison chart of the prediction results of the method described in the embodiments of the present invention and the prediction methods in the prior art. Detailed Implementation
[0075] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0076] Example 1:
[0077] like Figures 1-4 As shown, a method for predicting building thermal comfort based on the number of people indoors includes: collecting indoor environmental data; inputting the collected indoor environmental data into a constructed building thermal comfort prediction model based on the number of people indoors; and outputting the predicted results of building thermal comfort. The indoor environmental data includes indoor environmental attributes and indoor occupancy attributes determined based on a finite state machine; the indoor environmental attributes include indoor temperature, indoor relative humidity, clothing thermal resistance, wind speed, age, metabolic rate, and gender.
[0078] The main process for collecting indoor environmental data in this embodiment is as follows.
[0079] Step 1: Use sensors such as temperature and humidity to obtain indoor temperature, humidity and other attributes that affect the thermal comfort of the smart building. Use infrared array sensors to obtain the effective number of people in each frame. Combine this with a finite state machine to determine the number of people in the room. Also, collect the residents' feelings about thermal comfort and establish a small dataset containing the thermal comfort of the number of people in the room.
[0080] (1-1) The infrared array data of the target personnel in the area is collected by the MLX90641 infrared array sensor. The data it collects is a matrix data containing 16×12 temperature values. At the same time, temperature and humidity sensors are used to obtain indoor temperature, humidity and other attributes that affect the thermal comfort of the smart building.
[0081] (1-2) The collected headcount data will be processed by a data processing module, a target positioning module, a mapping module, and a trajectory generation module. First, in the data processing module, the present invention binarizes the collected infrared array data F(x,y,t) into an image similar to an image, filtering out pixels that are clearly background within the 16×12 infrared pixels. The binarization threshold is taken as the average value of the infrared pixels within a local 3×3 area of the pixel, resulting in an infrared array F1(x,y,t) without a significant background.
[0082]
[0083] Where threshold is the average value of infrared pixels within a local 3×3 area of a pixel.
[0084] Due to the deployment angle of the infrared array sensor, in most cases, the infrared intensity of the top of the target's head will be much greater than that of the body parts covered by clothing. In infrared array data, this manifests as a large variance in the infrared intensity at the target's center compared to its surrounding area. This problem can be solved using erosion operations in morphological processing, effectively expanding the target area to match the actual target. The erosion template size is (2×2).
[0085]
[0086] Where F′(x,y,t) is the infrared array data at time t after the corrosion operation, and B is the structuring element in the corrosion operation.
[0087] (1-3) Next is the target localization module. This invention utilizes a location information extraction operator to extract features from each frame of infrared array data, obtaining a feature matrix related to the target's spatial location:
[0088] T(x,y,t)=(T(x,t),T(y,t)) (3)
[0089] T(x,t)=F v *var(x,t)+F m *(maxF(x,y,t)-minF(x,y,t)) (4)
[0090] T(y,t)=F v *var(y,t)+F m *(maxF(x,y,t)-minF(x,y,t)) (5)
[0091] Where T(x,y,t) is the feature matrix of the infrared array data, and the value of T(x,y,t) is positively correlated with the probability weight of the presence of a target at time t (x,y), var(x,t) is the variance of the M infrared array data in the x-th column at time t, maxF(x,y,t) is the maximum infrared array data in the x-th column at time t, minF(x,y,t) is the minimum infrared array data in the x-th column at time t, and F... v F m These are two weighting coefficients, F v The size is twice that of F m The vertical direction is similar.
[0092] In real-world scenarios, when multiple targets pass through a 3m acquisition area without being side-by-side, two valid targets are typically detected within the area. Even if more than two targets appear within the area, this invention only focuses on the two targets closest to the edge, i.e., the targets at the left and right ends of the detection area.
[0093] The basis for ignoring potential targets in the middle is that during real-time observation at a 16Hz refresh rate, assuming the target's movement direction is from left to right, all targets passing through the detection area will inevitably be the leftmost target in the detection area for a certain period of time, and will also inevitably be the rightmost target in the detection area for a certain period of time afterward. Therefore, even if the period when the target is in the middle is ignored, it will not affect the final detection result.
[0094] Another basis is that the 3m detection space is limited, accommodating a maximum of three moving targets, and the time when all three targets appear simultaneously in the detection area is very short. Most of the time, only two targets are present in the detection area. Therefore, this invention only needs to calculate the positions of two targets in the acquisition space, respectively near the left and right edges. and
[0095] The position of the left target is calculated using the leftmost M / 2 columns of the feature matrix T(x,y,t). The rightmost column M / 2 calculates the position of the right target.
[0096]
[0097]
[0098]
[0099]
[0100] It should be added that if there is only a single target in the area, the detection result only considers... That's all.
[0101] (1-4) Next is the mapping relationship module. In this module, the present invention needs to establish the mapping relationship between the location information at different times and the corresponding target, determine which location information at different times belongs to the same target, and then recover the target's motion trajectory based on the time information to obtain the target's motion trajectory information.
[0102] Based on the above detection process, taking two adjacent time points as an example, two targets A and B pass through the detection area sequentially, and their positions are detected at time t1. in These are the x and y coordinates of targets A and B at time t1, with target A corresponding to position O1 and target B corresponding to position O2. Furthermore, it is detected that targets A and B have two positional information points at their adjacent time t2(t1+Δt) (but it is unknown which specific position A and B correspond to). in These are the coordinates of A and B at time t2. It is necessary to determine the mapping relationship between multiple targets over continuous time, that is, to determine whether the position of target A at time t1 corresponds to O3 or O4 at time t2, and to determine the mapping relationship between positions O3 and O4 and targets A and B.
[0103] The analysis can determine the mapping relationship by calculating the spatial distance between targets at two time points. This is because the spatial distance between the same target at time Δt (1 / 16s) is always less than the spatial distance between different targets. This is because the distance the target moves during time Δt is less than the spatial distance between two targets at the same time.
[0104] The formula for calculating spatial distance is as follows:
[0105]
[0106]
[0107] Among them, DIS space (O1, O3) is the square of the distance between O1 and O3 in adjacent time intervals, DIS space (O1, O4) is the square of the distance between O1 and O4 at adjacent time points, compared with DIS. space (O1,O3) and DIS space (O1, O4), the smaller of O3 and O4 corresponds to the position of target A at time t2. Simultaneously, using the elimination method, the position of target B at time t2 is also obtained. Thus, the number of targets in two adjacent frames and their motion trajectories can be obtained.
[0108] (1-5) After obtaining the number of targets and their motion trajectories in two adjacent frames, the final step is the trajectory generation module. This invention generates target trajectories based on a finite state machine model. Based on the coordinates of the target personnel in the acquisition area in all frames, this invention provides a finite state machine-based method for processing the number of people, recording the changes in the number of people indoors through the various states of the finite state machine.
[0109] A state tree is a collection of states that describe the finite state machine, and it forms the backbone of the finite state machine. The state tree is defined as shown in Table 1, and the objective is described by five different states.
[0110] Table 1 State Tree Definition
[0111] state describe <![CDATA[S0]]> System initial state <![CDATA[S1]]> trajectory start state <![CDATA[S2]]> intermediate recording state of the trajectory <![CDATA[S3]]> New trajectory entering state <![CDATA[S4]]> trajectory termination state
[0112] Events serve as inputs to the state machine, acting as stimuli and impetus for its normal operation. The main contents of the event set of the state machine are shown in Table 2.
[0113] Table 2 Event Set
[0114] event describe <![CDATA[Σ0]]> There were no valid location points in the previous frame and there are no valid location points in the current frame. <![CDATA[Σ1]]> There was no valid location point in the previous frame and there is one valid location point in the current frame. <![CDATA[Σ2]]> There were no valid location points in the previous frame and there are two valid location points in the current frame. <![CDATA[Σ3]]> There was a valid location point in the previous frame and there is no valid location point in the current frame. <![CDATA[Σ4]]> There is one valid position point in the previous frame and one valid position point in the current frame. <![CDATA[Σ5]]> The previous frame had one valid location point and the current frame has two valid location points. <![CDATA[Σ6]]> The previous frame had two valid location points and the current frame has no valid location points. <![CDATA[Σ7]]> The previous frame had two valid location points and the current frame has one valid location point. <![CDATA[Σ8]]> The previous frame had two valid location points and the current frame has two valid location points.
[0115] The slot function set is the response of the finite state machine to events. It is the final manifestation of the finite state machine's execution reduction process and an important component of the finite state machine. See Table 3 for the slot function part of the state machine.
[0116] Table 3 Set of Slot Functions
[0117] slot function describe <![CDATA[a0]]> No operation performed; retain current information and proceed to the next frame. <![CDATA[a1]]> New trajectory sequence <![CDATA[a2]]> Add the valid position of the current frame to the current trajectory. <![CDATA[a3]]> Determine the trajectory to which the target belongs based on the target mapping relationship between consecutive frames. <![CDATA[a4]]> Verify the validity and direction of the current trajectory.
[0118] After system initialization, the device is ready to record the trajectory. The state transition process for trajectory data acquisition is as follows: Figure 2 As shown. The system has different events and corresponding slot functions depending on its state. After completing the corresponding action, it will transition to different new states. The specific descriptions of the five states S0 to S4 are as follows:
[0119] 1) When in the initial system state S0, since there were no valid location points in the previous frame, the device is considered to be in an idle state. At this time, depending on whether there are valid location points in the current frame, there are two possibilities:
[0120] 1.1) If there is still no valid position point in the current frame, no other operation is performed, and the current information is retained to prepare to enter the next frame and continue to maintain the system in the initial state S0 in the self-loop.
[0121] 1.2) If there are one or two valid location points in the current frame (at most two valid location points due to spatial reasons), a new trajectory sequence is created, and the trajectory information is prepared to be recorded. The process is then transitioned to the trajectory start state S1.
[0122] 2) When in trajectory start state S1, there are four cases based on the number of valid position points in the previous and current frames:
[0123] 2.1) If there are one or two valid location points in the previous frame and there are no valid location points in the current frame, it is considered that the target has left, and the process is transferred to the trajectory end state S4 to verify the validity and direction of the target trajectory and generate the number of people information;
[0124] 2.2) If there is one valid location point in the previous frame and two valid location points in the current frame, then it is considered that a new target has entered, and the process is transitioned to the new trajectory entry state S3;
[0125] 2.3) If there is one valid position point in the previous frame and one valid position point in the current frame, or if there are two valid position points in the previous frame and two valid position points in the current frame, then add the valid position point of the current frame to the current trajectory and transfer to the intermediate recording state S2 of the trajectory.
[0126] 2.4) If there are two valid location points in the previous frame and only one valid location point in the current frame, the recording state S2 in the middle of the trajectory is still maintained. At this time, it is assumed that one target has left, but there is still one target within the monitoring range. First, the trajectory information of the departing target is generated and recorded. When all targets have left, the trajectory validity and direction are verified together with all targets, and the number of people information is generated.
[0127] 3) When in the middle recording state S2 of the trajectory, there are four cases based on the number of valid position points in the previous and current frames:
[0128] 3.1) If there are one or two valid location points in the previous frame and there are no valid location points in the current frame, it is considered that the target has left, and the process is transferred to the trajectory end state S4 to verify the validity and direction of the target trajectory and generate the number of people information;
[0129] 3.2) If there is one valid location point in the previous frame and two valid location points in the current frame, then it is considered that there is a new target, and the system is transferred to the new trajectory and enters state S3.
[0130] 3.3) If there is one valid position point in the previous frame and one valid position point in the current frame, or if there are two valid position points in the previous frame and two valid position points in the current frame, then add the valid position point of the current frame to the current trajectory and continue to self-loop and maintain the recording state S2 in the middle of the trajectory.
[0131] 3.4) If there are two valid location points in the previous frame and only one valid location point in the current frame, the recording state S2 in the middle of the trajectory is still maintained. At this time, it is assumed that one target has left, but there is still one target within the monitoring range. First, the trajectory information of the departing target is generated and recorded. When all targets have left, the trajectory validity and direction are verified together with all targets, and the number of people information is generated.
[0132] 4) When in the new trajectory entry state S3, since there were two valid position points in the previous frame, we only need to divide it into three cases based on the number of valid position points in the current frame:
[0133] 4.1) If there is no valid location point in the current frame, it is assumed that the target has left, and the process is transferred to the trajectory end state S4 to verify the validity and direction of the target trajectory and generate the number of people information;
[0134] 4.2) If there are two valid position points in the current frame, add the valid position of the current frame to the current trajectory and transfer to the intermediate recording state S2 of the trajectory;
[0135] 4.3) If there is only one valid location point in the current frame, the system still moves to the intermediate recording state S2 of the trajectory. At this time, it is assumed that one target has left, but there is still one target within the monitoring range. First, the trajectory information of the leaving target is generated and recorded. When all targets have left, the trajectory validity and direction are verified together with all targets, and the number of people is generated.
[0136] 5) When the state transitions to the trajectory completion state S4, the validity and direction of all previous targets are first verified, and the number of people is generated. Then, the number of people is increased or decreased based on the output, followed by a state transition. Since there were no valid location points in the previous frame, it is only necessary to divide the situation into two cases based on the number of valid location points in the current frame:
[0137] 5.1) If there is still no valid location point in the current frame, the device is considered to be in an idle state, no other operation is performed, and the current information is retained to prepare to enter the next frame and transfer to the system initial state S0.
[0138] 5.2) If there are one or two valid location points in the current frame, a new trajectory sequence is created, and the trajectory information is prepared to be recorded. The trajectory start state S1 is entered.
[0139] The verification method for target trajectory validity is as follows: First, ensure that the trajectory start and end points are located at the two endpoints of the detection area. Second, the number of valid trajectory points must be greater than the number of samples per second, and there must be no anomalies. Invalid trajectories are not verified for direction. The verification method for target trajectory direction is as follows: Based on the sensor deployment direction and the target movement direction, assuming an overall increase in coordinates indicates entering the room, and an overall decrease indicates leaving the room, the trajectory point increment is calculated. If the increment is positive and greater than the horizontal coordinate span of the sampling area, it is considered entering; otherwise, it is considered leaving the room. The number of people in the room is updated based on the number of valid leaving and entering trajectories. After verification, the results are output in stages, for example: "Four target trajectories were detected, of which one target's trajectory verification was invalid and considered a noise point. The remaining three targets passed the trajectory validity verification. Based on direction verification, two targets entered the room, and one target left the room." Then, the number of people is increased or decreased based on the output, followed by a state transition.
[0140] After verification, the results are output in stages, for example: "Four target trajectories were detected, of which the trajectory verification of one target was invalid and considered a noise point. The remaining three targets passed the trajectory validity verification. According to the direction verification, two targets entered the room and one target left the room." The number of people information is updated based on the output.
[0141] (1-6) After all trajectories have been detected, a dataset of indoor occupancy, temperature, humidity and other attributes of the building during that time period is established, and finally a small thermal comfort scale including the number of people is established.
[0142] Steps (2) and (3) establish a specific thermal comfort prediction model based on transfer learning and the AGBM algorithm (i.e., a building thermal comfort prediction model based on the number of people indoors). The building thermal comfort prediction model based on the number of people indoors includes: a transferred neural network used to extract features of indoor environmental attributes to obtain first feature information; g 8 A neural network is used to extract features from the indoor occupancy attribute to obtain secondary feature information; the feature fusion network g fusion The first feature information and the second feature information are fused to obtain fused feature information; the AGBM classifier is used to iterate the fused feature information to obtain the prediction result of building thermal comfort.
[0143] A schematic diagram of the overall structure of the building thermal comfort prediction model based on indoor occupancy is shown below. Figure 3 As shown, step 2 is as follows:
[0144] Train the transferred neural network;
[0145] (2-1) Train on the source domain (dataset B). For the dataset of the source domain...
[0146]
[0147] Here, dataset B is a global thermal comfort database, and N1 represents the amount of data in dataset B. The input data represents different attributes. i represents seven different attributes with values {1,2,3,4,5,6,7}, which correspond to temperature, relative humidity, clothing level, wind speed, age, metabolic rate, and gender, respectively. The label values in the source domain dataset are {-3,-2,-1,0,1,2,3}, which represent cold, cool, slightly cool, moderate, slightly warm, warm, and hot, respectively.
[0148] Will The data is passed to a neural network to extract relevant features, and then labeled through a fully connected layer. Training is performed; the source domain neural network is a seven-input neural network with seven outputs after passing through hidden layers. The neural network has a total of 6 layers, including 1 input layer, 4 hidden layers, and 1 output layer; the loss function for the source domain is defined as:
[0149]
[0150] in, Let θ represent the loss function of the source domain. s For the parameters of the source domain neural network, The loss function is defined as follows:
[0151]
[0152] in, Represents the input data, y j represent The tag, For indicator functions, when When the condition is met, the indicator function is 1; otherwise, it is 0. This represents the output value of category q among all outputs of the source domain neural network; after the source domain training is completed, the output is the trained source domain neural network.
[0153] (2-2) Migration from the source domain to the target domain, where the target domain dataset is:
[0154]
[0155] Where N2 represents the amount of data in dataset A, The input represents different attributes, where i represents 8 different attributes with values {1, 2, 3, 4, 5, 6, 7, 8}, corresponding to temperature, relative humidity, clothing level, wind speed, age, metabolic rate, gender, and number of people indoors, respectively. The label values are from the target domain dataset. The difference between the target domain and the source domain is that the target domain has an additional attribute: the number of people indoors. We will now train the number of people indoors separately from the other attributes.
[0156] Using the Deep CORAL method, an adaptive layer is added to address the differences between the source and target domains. The adaptive layer makes the data distribution of the source and target domains more similar, thereby improving the migration effect.
[0157] Specifically, this invention adds a new loss function (CORAL loss) to minimize the difference in covariance of cross-domain learned features, allowing it to be seamlessly integrated into different layers or architectures. The domain difference loss measured by Coral is defined as the distance between the second-order statistics (covariance) of the source domain features and the target domain features:
[0158]
[0159] in, It is the Frobenius norm of the square matrix, d is the feature output dimension, and C is the Frobenius norm. S and C T These are the eigencovariance matrices of the source and target domains, respectively:
[0160]
[0161]
[0162] Where b is the training batch size, D sIt is the input data of the source domain. D T The target domain input data, {Γ j} represents temperature, relative humidity, clothing thermal resistance, wind speed, age, metabolic rate, and gender attributes. 1 b It is a column vector consisting entirely of 1s.
[0163] When performing source domain training, this invention uses the input and labels of source domain data for supervised training to obtain the loss function of the source domain. Unlike source domain training, in the target domain, since this invention only uses the input data of the target domain and not the label data of the target domain, this invention requires training with both the input data of the target domain and the data of the source domain to calculate L. CORAL The ultimate goal is to reduce the source domain loss function. and L CORAL The goal is to optimize both to a minimum, which results in more accurate classification of the source domain network and a more similar distribution between the output of the target domain network and the source domain network.
[0164] L was analyzed using the stochastic gradient descent algorithm. CORAL Source domain loss Simultaneous optimization, minimizing both migration loss and source domain supervision loss, can effectively reduce the distributional differences in environmental data between the two domains. After final optimization, this invention can obtain the parameters θ of all hidden layers in the source domain neural network. S The source domain neural network is transferred to the target domain. Here, only the neural network with the first seven attributes of the target domain is transferred. The specific transfer process is as follows: First, continuously optimize the source domain loss. and adaptive layer loss L CORAL The parameters θ of the hidden layers in the source domain are obtained by training the neural network in the source domain. S and the parameters of the first four hidden layers of the target domain Then, for the feature output of the first seven attributes of the target domain after passing through the transferred network, this invention fuses it with the feature output of the pre-trained eighth attribute (number of people indoors) neural network to obtain a feature fusion network, which is then trained simultaneously with the AGBM classifier involved later.
[0165] For g 8 The neural network is trained, specifically for the target domain. For the indoor occupancy attribute portion of the target domain, the neural network is trained separately for feature extraction. Specifically, the input data is:
[0166] Input data The input is used to train the neural network, resulting in: Among them, U 8The feature output representing the number of people indoors is extracted after processing by a neural network; this part of the neural network is called... Among them, T 8 The input represents the number of people in the room. The neural network parameters represent the indoor occupancy attribute. This section outputs the neural networks for the first seven attributes of the target domain, as well as the neural network for the indoor occupancy attribute of the target domain.
[0167] For feature fusion network g fusion Conduct training.
[0168] (2-3) Training the feature fusion network g fusion This refers to the network that fuses the feature outputs of the neural network for the first seven attributes after transfer learning with the feature outputs of the neural network for the indoor number of people attribute. For this part, during training, it is treated as a whole; first, the target domain dataset (the first seven attributes) is... The input target domain network, after passing through the first p layers of the transferred neural network, yields... Among them, U 1-7 The first feature information is the feature output extracted from the first seven attributes (excluding the number of people indoors) after passing through a transferred neural network. This invention uses the first feature information as the input feature information to train the feature fusion network.
[0169] At the same time, the trained neural network for the indoor occupancy attribute of the target domain, namely g 8 The second feature information extracted by the neural network is input into the feature fusion network.
[0170] The feature outputs extracted by the two neural networks are then fused and input into a feature fusion neural network to obtain the corresponding output: Among them, V 1-8 The feature representing the number of people indoors is extracted through its neural network. This invention inputs this feature information into the AGBM classifier. This part of the neural network is called: g fusion (U 1-7 U 8 ;θ f ), where g 8 The features output by the neural network are called the feature fusion network g. fusion Part of the input, denoted as U 8 The feature fusion network g extracts the features from the seven attributes (excluding the number of people indoors) after processing by the transferred neural network. fusion Another part of the input is U 1-7 θ f The parameters represent the feature fusion network.
[0171] This part is trained together with the AGBM classifier mentioned later. Specifically, in this invention, the AGBM classifier part is represented as g. GBM (·), during the training process, when the neural network g represents the number of people in the training room... 8 At that time, the feature fusion network g is first fixed. fusion and AGBM classifier g GBM All parameters in the neural network are analyzed, and then the parameters of the neural network are fine-tuned using the stochastic gradient descent algorithm based on the thermal comfort classification results output by the entire system; similarly, the feature fusion network g is trained. fusion In this case, all parameters of the other two parts are fixed first, and the parameters of the neural network are tuned using the stochastic gradient descent algorithm based on the thermal comfort classification results output by the entire system; the same applies to training the AGBM classifier.
[0172] The following section details the loss function that needs to be optimized in the target domain and the optimization process (only the two networks g in the target domain are discussed here). fusion and g 8 For the feature fusion network g fusion It takes the features from two parts as input. The first part is the feature U extracted from the first seven attributes by the transfer network. 1-7 The second part is the indoor occupancy attribute after g 8 Features extracted by the network U 8 This invention combines the two parts into a single feature vector and inputs it into the network. fusion The output is the feature V of the merged eight attributes. 1-8 The present invention inputs it into the AGBM section g GBM (·) can be used to obtain the final predicted value y. predict According to this process, g in this invention fusion The loss function expression is:
[0173]
[0174] in, Represents the feature fusion network g fusion Output characteristics V 1-8 The final predicted value obtained after inputting into the AGBM classifier. f{·} is the squared loss function, expressed as:
[0175]
[0176] For the neural network g of indoor occupancy attributes 8 Its input is raw population data and labels, and its output is the features extracted by the population attribute neural network. This invention inputs it into the feature fusion network gfusion Finally, g fusion The extracted features are input into g GBM (·), to obtain the final predicted value y predict According to this process, g in this invention 8 The loss function expression is:
[0177]
[0178] in, A neural network g representing the indoor number of people. 8 Output features are input into the feature fusion network g. fusion Subsequently, the output feature V of this feature part is obtained. 1-8 Then, it is input into the AGBM classifier to obtain the final predicted value. f{·} is the squared loss function, expressed as:
[0179]
[0180] In summary, during target domain network training, this invention requires training two neural networks: one is the feature fusion network g. fusion The other is a neural network for indoor occupancy attributes. During training, the parameters of the other two parts (including the AGBM classifier discussed later) of each neural network are fixed, ensuring that only the parameters of the current neural network are trained. It is important to emphasize that this invention treats the target domain network as a whole; that is, when there is a data point and a label input, both parts are trained, rather than training only one part for a single data point and label. This part outputs a feature fusion network g. fusion .
[0181] Train the AGBM classifier.
[0182] Step (3) includes the following steps:
[0183] (3-1) After inputting the feature information from step (2) into the AGBM classifier, we obtain the feature V with eight attributes. 1-8 .
[0184]
[0185] Where, x j V represents the feature vector corresponding to the j-th data after feature extraction; 1-8 The feature information is input into the AGBM classifier and trained through several iterations.
[0186] This invention improves upon the traditional GBM method by proposing the AGBM method. The traditional GBM algorithm uses "negative gradient" to represent "residuals," offering advantages such as high accuracy and suitability for low-dimensional data. However, it relies on a single base learner during computation, lacking flexibility. In multi-class training for thermal comfort prediction, different base learners can be selected for each class's output in each iteration of the classifier. Each base learner has its unique advantages, and combining and flexibly using these advantages can improve GBM performance. Therefore, this invention leverages the individual capabilities of each base learner, implementing an adaptive base learner selection mechanism within GBM. This means that in each iteration of training for each class, the system adaptively selects the optimal base learner, achieving higher prediction accuracy.
[0187] Specifically, based on the specific experimental environment of thermal comfort prediction in a smart building, this invention selected three base learners: logistic regression, decision tree (DT), and dropouts-meeting multiple additive regression trees (DART). The thermal comfort prediction in this invention is a K-classification process (K=7). For an input AGBM feature vector, before final prediction, it outputs the predicted probabilities for each of the K categories, and takes the category with the highest probability as the prediction result. Therefore, it is desirable to have a higher output probability for categories belonging to the feature vector label and a lower output probability for categories not belonging to the feature vector label. This means that during training, for the category belonging to the label, it is necessary to find the base learner with the highest output probability, and for the other six categories not belonging to the label, it is necessary to find the base learner with the lowest output probability. During this training period, if the distribution of some data is closer to linear, logistic regression performs better; if the distribution of some data is more complex, decision tree performs better; and if the distribution of some data is prone to overfitting, DART performs better.
[0188] The specific training process is as follows: Figure 3 As shown in the AGBM algorithm section, the K-class problem is transformed into K binary classification problems, requiring the training of K sets of base learners, with each base learner in each set performing optimally among the three base learners. Therefore, training for each class requires 350 iterations. The following detailed explanation of the training steps uses the m-th iteration, training the first class, as an example:
[0189] Step 311: Select squared loss as the loss function:
[0190]
[0191] The total loss function is expressed as:
[0192]
[0193] Differentiate the total loss function:
[0194]
[0195] Therefore, the residual is represented by the negative gradient, and the residual expression for each base learner is as follows:
[0196]
[0197] in, Let x be the residual that each base learner needs to fit when the output category is k, l represents different base learners, l=1 represents decision tree; l=2 represents logistic regression; l=3 represents DART, and k is the number of output thermal comfort categories, which have 7 categories: cold, cool, slightly cool, moderate, slightly warm, warm, and hot, i.e., K=7. j For the input features, When the base learner in the target domain dataset A is l after one-hot encoding, and the output class is k, the input x... j The corresponding label value (0 or 1), p(x) is the probability value of the output of the current category after passing through the softmax function.
[0198] The following operation takes k=1, i.e., the first category, as an example (the output thermal comfort prediction is the first category: "cold", and the final prediction probability value is the result obtained by calculating the output of all categories through the softmax function).
[0199] Step 312: Optimize the parameter α of the base learner so that the output of the current base learner is closer to the residual value of the previous step:
[0200]
[0201] Where m is the number of iterations. α is the output of the current base learner l, and α is the parameter of the current base learner l;
[0202] Step 313: Optimize the step size parameter ρ to make the total output of this iteration closer to the label value:
[0203]
[0204] Among them, F m-1 (x j ) represents the output value of the (m-1)th iteration; it should be noted that when m=1, this invention first initializes the 0th iteration output of each category to 0, so F0(x) j ) = 0.
[0205] Step 314: Calculate the total output value of this iteration, which is the base learner output value of the previous iteration plus the base learner output value of this iteration multiplied by the step size.
[0206]
[0207] Step 315: After training, compare the loss functions of the three base learners:
[0208]
[0209] Specifically, the squared loss is used as the loss function here to represent the total error of the base learner. The expression for the total loss function of the base learner is:
[0210]
[0211] in, Let be the label values in the target domain dataset A when the base learner is l. This is the final output value of base learner l. The same method is used to train base learners for other categories, ultimately resulting in a set of K optimal base learners, consisting of the M optimal base learners for each of the K categories. The AGBM classifier, composed of these trained base learner sets, then outputs the predicted thermal comfort category.
[0212] For l=1 (the base learner is a decision tree), during training, the output and label value of each data point are substituted into the loss function mentioned above to calculate the loss function of the decision tree as the base learner. Then, for the other two base learners, the same calculation is performed. and Compare the three values and select the base learner with the smallest loss function as the optimal base learner. This completes the m-th iteration, training for category 1, and selecting the optimal base learner for this iteration and category.
[0213] For subsequent iterations after the m-th iteration, the same steps are followed to train categories 2 through K, simply changing k in the formula to 2 through 7. After training all categories once, the m-th iteration is complete, yielding the outputs of all categories and the optimal base learners for each category. Then, the (m+1)-th iteration is performed. After training all categories, the (m+1)-th iteration's outputs and optimal base learners for each category are obtained. Finally, after 350 iterations, seven optimal base learner groups are obtained, consisting of 350 optimal base learners for each of the seven categories. The AGBM classifier, composed of these trained base learner groups, outputs the predicted thermal comfort category. Through this method, the current optimal g can be obtained. GBM(·) Output, which is the probability output for each thermal comfort level:
[0214] F K (x)={F1(x),F2(x),F3(x),F4(x),F5(x),F6(x),F7(x)} (32)
[0215] Where K = 7, representing seven levels of thermal comfort, and F1(x) to F7(x) are the output probabilities of the first to seventh levels of thermal comfort. The thermal comfort level with the highest probability is taken as the final output.
[0216] (3-2) Obtain the optimal g GBM After (·), the entire system is merged to form a complete prediction model. When new prediction data arrives, the data is first divided into two parts: the first seven attributes and the indoor number of people attribute, which are then input into the transferred neural network and g, respectively. 8 The neural network extracts features, and the extracted features are then fed into the feature fusion network g. fusion The fused feature information is then input into the AGBM classifier. After 350 iterations, the prediction result of the base learner group consisting of 350 base learners is obtained.
[0217] The experimental results below show that, compared with existing methods, the present invention has a high accuracy in obtaining indoor occupancy information based on finite state machines, and the present invention achieves even higher thermal comfort prediction accuracy by combining occupancy information with the AGBM algorithm.
[0218] This embodiment uses the dataset (dataset A) containing indoor occupancy information collected in this invention. This dataset includes eight thermal comfort factors: occupancy, temperature, wind speed, relative humidity, clothing thermal resistance (CLO), metabolic rate (MET), gender, and age. It also includes seven user thermal comfort feedback options—7-point Thermal Sensation Vote—with choices: Cold (-3), Cool (-2), Slightly cool (-1), Neutral (0), Slightly warm (+1), Warm (+2), and Hot (+3). The following three experiments were conducted for the smart building thermal comfort prediction method based on indoor occupancy proposed in this invention:
[0219] Experiment 1: Compare the proposed finite state machine-based infrared array sensor method for detecting people with other people detection methods. Other methods include: the frequentist maximum likelihood (FML) algorithm (using CO2 parameters) in the paper "Blind identification strategies for room occupancy estimation" (authors: A. Ebadat, G. Bottegal, D. Varagnolo, B. Wahlberg, H. Hjalmarsson and KH Johansson); the Hidden Markov model algorithm (using passive infrared sensors) in the paper "Occupancy inference using pyroelectric infrared sensors through hidden markov models" (authors: P. Liu, S.-K. Nguang and A. Partridge); and the method in "Sensing and Data Acquisition" (authors: B. Dong, MB). In addition to the method of using a camera to detect the number of people in M. De Simone, HB Gunay, W. O'Brien, D. Mora, J. Dziedzic and J. Zhao, two other methods using infrared array sensors were also selected: patent "Non-invasive People Detection Method, Device and System Based on Infrared Array Sensor" (Wei Xin, Jia Zhihao, Zhou Liang, Fan Qianlan, Patent No. ZL202110668180.0), hereinafter referred to as "FIR1"; and patent "A Non-invasive People Detection Method and System Based on Infrared Array Sensor" (Wang Hongfei, Liao Junqi, Tang Juemin, Wei Xin, Application No. 202211361323.4), hereinafter referred to as "FIR2".
[0220] The experiments discussed the accuracy, ability to detect trajectories, cost, and privacy attributes of each algorithm, and considered two different scenarios (office and classroom).
[0221] Table 4 shows the experimental results of Experiment 1.
[0222]
[0223]
[0224] In office scenarios, the total number of people is small, the frequency of personnel entry and exit is low, and the change in the number of people is slow, resulting in relatively high accuracy for all algorithms. However, in classroom scenarios, the number of people is large, and the flow of people is concentrated during breaks, increasing the detection difficulty for each algorithm and reducing their accuracy. Table 4 shows that in both scenarios, the algorithm of this invention significantly improves accuracy compared to CO2 and PIR sensor algorithms, and can detect the target's trajectory. Furthermore, compared to the other two infrared array sensor detection methods, this invention incorporates a finite state machine to collect and effectively process continuous and complex states, resulting in higher accuracy in both scenarios. Compared to camera detection methods, the algorithm of this invention has a very low computational cost and does not infringe on the target's privacy.
[0225] Experiment 2: A thermal comfort model was built using common machine learning methods, and the predictive performance was compared before and after incorporating the number of people indoors. Specific machine learning methods included: Deep Neural Networks (DNN), Decision Trees (DT), K-Nearest Neighbors (KNN), Support Vector Machines (SVM), and Random Forests (RF).
[0226] Table 5 shows the experimental results of Experiment 2.
[0227] Deep Neural Networks Decision Tree K-Nearest Neighbors Algorithm Support Vector Machine Random Forest Number of people indoors not included 57.86% 52.71% 53.67% 45.92% 60.35% Including indoor numbers 65.12% 60.45% 61.23% 52.14% 67.35%
[0228] As shown in Table 5, the accuracy of the five thermal comfort prediction quasi-models, including DNN, improved after incorporating the number of people indoors, with an average increase in precision of 7.09%. This result demonstrates the necessity of incorporating the number of people indoors into thermal comfort prediction models.
[0229] Experiment 3: The accuracy performance of the proposed indoor occupancy-based building thermal comfort prediction method (using occupancy attributes, combined with transfer learning, feature extraction and fusion, and the AGBM method) is compared with other algorithms. Other algorithms include: Deep Neural Network (DNN), Decision Tree (DT), K-Nearest Neighbor Node (KNN), Support Vector Machine (SVM), Random Forest (RF), Gradient Boosting Decision Tree (GBDT), and Natural Gradient Boosting (NGBoost). Additionally, an occupancy-based detection method is selected: A Smart Building Thermal Comfort Assessment Method and System Based on Indoor Occupancy (Fan Qianlan, Miao Zizhu, Tang Juemin, Wei Xin, Application No.: 202211360940.2), hereinafter referred to as "Method 1".
[0230] Figure 4 This is a presentation of the experimental results from Experiment 3. Figure 4As can be seen from other algorithms, the algorithm of this invention has a significant advantage in prediction accuracy, exhibiting excellent prediction performance with an accuracy of 79.04% and an F1-score of 79.14%. Furthermore, compared to Method 1 which uses indoor population data, the accuracy is significantly higher due to the use of the independently developed AGBM algorithm.
[0231] Example 2:
[0232] Based on the method for predicting building thermal comfort based on the number of people indoors as described in Embodiment 1, this embodiment provides a device for predicting building thermal comfort based on the number of people indoors, including: a data acquisition module for acquiring indoor environmental data; and a building thermal comfort prediction module for inputting the acquired indoor environmental data into a constructed building thermal comfort prediction model based on the number of people indoors, and outputting the prediction result of building thermal comfort.
[0233] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for predicting building thermal comfort based on the number of people indoors, characterized in that, include: Collect indoor environmental data; The collected indoor environmental data is input into the constructed building thermal comfort prediction model based on the number of people indoors, and the predicted results of building thermal comfort are output. The indoor environmental data includes indoor environmental attributes and indoor occupancy attributes determined based on a finite state machine; the indoor environmental attributes include indoor temperature, indoor relative humidity, clothing thermal resistance, wind speed, age, metabolic rate, and gender. The method for determining the number of people indoors includes: Collect infrared array data of target personnel in a designated area; Collected Infrared array data at any time Perform binarization to filter out background pixels within the infrared pixels; the binarization threshold is taken as the average value of the infrared pixels within a local 3×3 area of the pixel, resulting in a background-free infrared array. ; (1) wherein, is the mean value of the infrared pixels in the local 3x3 range of the pixel point; The erosion operation in morphological processing is used to expand the target area to match the actual target. (2) wherein, is the result of a corrosion operation the infrared array data at the moment, is a structuring element in the corrosion operation; The infrared array data is used to extract features using a location information extraction operator, resulting in a feature matrix related to the target's spatial location. (3) (4) (5) in, It is the feature matrix of infrared array data. The value and Time point The probability of a target existing is positively correlated with its weight. yes Time of the first List The variance of the infrared array data yes Time of the first The largest infrared array data of the column, yes Time of the first The smallest infrared array data of the column, , These are two weighting coefficients. The size is twice as big. ; Utilizing a feature matrix left edge column to calculate a left target position right edge column to calculate a right target position ; (6) (7) (8) (9) The mapping relationship between targets A and B in continuous time is determined by calculating the spatial distance between two targets A and B at two different time points, thereby obtaining the number of targets and their trajectories; assuming targets A and B are in... The time and position are respectively , ,in , They are targets A and B respectively. The horizontal and vertical coordinate values at time t, and the detection of targets A and B at t. Adjacency time There are two location information at the time. , However, it is unknown which specific positions A and B correspond to; among them Are A and B in Given the coordinates at a given time, the formula for calculating spatial distance is as follows: (10-1) (10-2) in, Within adjacent time intervals The square of the distance, Within adjacent time intervals The square of the distance, compare and The smaller one corresponds to or That is, target A at time... The corresponding position, and by using the process of elimination, also yielded the target B at time [time]. The corresponding position; Based on the number of targets and their movement trajectories, a finite state machine is used to record the trajectories, thereby obtaining the number of people. The building thermal comfort prediction model based on the number of people indoors includes: A neural network has been transferred to extract features from indoor environmental attributes to obtain the first feature information; a neural network for feature extraction on the indoor people attribute to obtain second feature information; Feature fusion network for fusing the first feature information and the second feature information to obtain fused feature information; The AGBM classifier is used to iteratively predict the thermal comfort of a building by using fused feature information.
2. The method for predicting building thermal comfort based on the number of indoor occupants according to claim 1, characterized in that, Training methods for transferred neural networks include: Using the global thermal comfort database as the source domain, the dataset is trained. (11) Among them, dataset It is a global thermal comfort database. Represents the dataset The amount of data, , representing input data with different attributes, It represents seven different attributes, with values {1,2,3,4,5,6,7}, corresponding to temperature, relative humidity, clothing thermal resistance, wind speed, age, metabolic rate, and gender, respectively. The label values in the source domain dataset are {-3,-2,-1,0,1,2,3}, which represent cold, cool, slightly cool, moderate, slightly warm, warm, and hot, respectively. Will pass into the neural network to extract relevant features, and then through the fully connected layer with the label Training; the loss function of the source domain is defined as: (12) wherein, a loss function representing the source domain, parameters of the source domain neural network, a loss function defined as shown below: (13) wherein, is an indicator function, which is 1 when , and 0 otherwise, represents the output value of the class in the output of each class of the source domain neural network; and the source domain neural network outputted after the training of the source domain is completed. The dataset for the target domain is: (14) in, Represents the dataset The amount of data, Inputs representing different attributes, This represents 8 different attributes, with values {1, 2, 3, 4, 5, 6, 7, 8}, corresponding to temperature, relative humidity, clothing thermal resistance, wind speed, age, metabolic rate, gender, and number of people indoors, respectively. The label values are from the target domain dataset. The difference between the target domain and the source domain is that the target domain has an additional attribute: the number of people indoors. We will now train the number of people indoors separately from the other attributes. Using the Deep CORAL method, an adaptive layer is added to address the difference between the source and target domains. The domain difference loss measured by Coral is defined as the distance between the second-order covariances of the source and target domain features: (15) where, is the squared matrix Frobenius norm, d is the feature output dimension, and are the source and target domain feature covariance matrices, respectively, given by: (16) (17) wherein, is the batch size for training, is the input data of the source domain is the target domain input data temperature, relative humidity, clothing thermal resistance, wind speed, age, metabolic rate, and gender attributes, is a column vector of all 1s; When training in the source domain, supervised training is performed using the input and labels of the source domain data to obtain the loss function for the source domain. In the target domain, only the input data of the target domain is used, and the label data of the target domain is not used. Therefore, the input data of the target domain and the source domain data must be trained together to compute... The ultimate goal is to reduce the source domain loss function. and Optimize together to minimize; Using the stochastic gradient descent algorithm and source domain loss Simultaneously, optimization is performed to minimize the transfer loss and source domain supervision loss, yielding the parameters of all hidden layers in the source domain neural network. ; front of the source domain neural network One hidden layer is transferred over to obtain the transferred neural network.
3. The method for predicting building thermal comfort based on the number of indoor occupants according to claim 2, characterized in that, A method of training a neural network, comprising: The neural network is trained separately for feature extraction of the indoor population attribute part of the target domain, and the input data is: ; Input data The input data is input into a neural network for training, and the output is obtained: ; wherein, represents the feature output extracted after the indoor population attribute passes through the neural network; the neural network in this part is called ; wherein, represents the input of the indoor population attribute part, represents the neural network parameters of the indoor population attribute.
4. The method for predicting building thermal comfort based on the number of indoor occupants according to claim 3, characterized in that, Feature fusion network The training method comprises: First, the data set of the target domain is obtained The input target domain network is input into the pre migrated neural network, and the output of the first feature information is obtained , wherein represents the feature output extracted after the first seven attributes excluding the indoor population attribute pass through the migrated neural network, that is, the first feature information At the same time, the trained neural network for the indoor occupancy attribute of the target domain, i.e. Second feature information extracted by neural network The first feature information and the second feature information are input into the feature fusion network. Then, the corresponding output is obtained: ,in, The feature fusion network extracts features representing the number of people indoors, along with seven other attributes, after being processed by a neural network. The complete expression for the feature fusion network is: ,in These are the parameters of the feature fusion network. 5.The building thermal comfort prediction method based on indoor people number according to claim 4, wherein, Training methods for the AGBM classifier include: The AGBM classifier is wherein, represents the overall features of the eight attributes extracted in the foregoing feature fusion network, and the specific expression is: (22) wherein, represent the feature vectors corresponding to the first data; and input the as the feature information into the AGBM classifier for several times of iterative training. Choose squared loss as the loss function: (23) The total loss function is expressed as: (24) Differentiate the total loss function: (25) Therefore, the residual is represented by the negative gradient, and the residual expression for each base learner is as follows: (26) in, For each base learner, in the output category The residuals that need to be fitted at that time Representing different base learners, Represents a decision tree; Represents logistic regression; Represents DART, The output thermal comfort category has 7 categories: cold, cool, slightly cool, moderate, slightly warm, warm, and hot. , For the input features, Target domain dataset after one-hot encoding The middle-base learner is The output category is Input time The corresponding tag value, This represents the probability value of the output of the current category after applying the softmax function. The following operations are based on Taking the first category as an example, Optimize the parameters of the base learner This makes the output of the current base learner closer to the residual value from the previous step: (27) in, For the number of iterations, This is the output of the current base learner l. These are the parameters of the current base learner l; Optimize step size parameters This will make the total output of this iteration closer to the label value: (28) in, For the first The output value of the next iteration; The total output value for this iteration is calculated by adding the base learner output value from the previous iteration to the base learner output value from the current iteration multiplied by the step size. (29) After training, compare the loss functions of the three base learners: (30) The total loss function expression for the base learner is: (31) in, For the target domain dataset The base learner is The label value at that time, The final output value of the base learner; The same method was used to train base learners for other categories, ultimately yielding... Under each category Composed of 1 optimal base learner The AGBM classifier, composed of several optimal base learner sets and trained base learner sets, finally outputs the predicted thermal comfort category.
6. A building thermal comfort prediction device based on the number of people indoors, characterized in that, The apparatus for performing the building thermal comfort prediction method based on indoor occupancy as described in any one of claims 1 to 5, comprising: The data acquisition module is used to collect indoor environmental data; The building thermal comfort prediction module is used to input the collected indoor environmental data into the building thermal comfort prediction model based on the number of people indoors, and output the prediction results of building thermal comfort.
Citation Information
Patent Citations
CN113611012B
CN116090857A
CN116363048A