Indoor scene classification and identification method fusing spatial topological relation
Through the PCA algorithm and naive Bayes classifier combined with spatial topological relationship, the problem of misjudgment of adjacent scene recognition in indoor positioning technology is solved, the accuracy and reliability of indoor scene recognition are improved, and more efficient scene perception and Identify.
Patent Information
- Application Number
- CN202411106715.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing indoor positioning technology is difficult to achieve accurate scene recognition in complex environments, especially the small difference in signal characteristics of adjacent scenes leads to misjudgment, which reduces the accuracy of scene recognition.
The PCA algorithm is used for data compression and dimensionality reduction, and wireless signals are trained using naive Bayes classifiers. By constructing a scene unit matrix and table of spatial topological relationships, scene recognition is assisted and recognition accuracy is improved.
Through the combination of topological relationship constraints and machine learning algorithms, the accuracy and reliability of indoor scene recognition are improved, confusion of adjacent scenes is reduced, recognition accuracy is improved, and identification algorithm is dynamically adjusted through real-time data acquisition and model update , improves the accuracy of recognition.
Smart Images

Figure CN119094997A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of indoor positioning technology, and in particular to an indoor scene classification and recognition method integrating spatial topological relationships. Background Art
[0002] In recent years, with the development of Internet of Things technology, location information has become an important foundation for the Internet of Everything, and indoor positioning technology has played an important role in emergency response, firefighting, rescue and other security fields. Indoor positioning is closely related to indoor scenes. In the shielded and semi-shielded environments represented by indoors, there are characteristics such as complex spatial structures and diverse building materials, which profoundly affect the propagation and expression of various positioning signals, forming complex and changeable indoor scenes. How to make full use of scene information, enhance indoor scene perception and recognition, and realize hybrid positioning in complex indoor environments has become a research hotspot and development trend.
[0003] Existing research on indoor scene recognition focuses on using deep learning algorithms to extract and train features of complex indoor environment images, or integrating wireless signals and air pressure signals to achieve scene classification and recognition. Deep learning algorithms with different structures have high requirements on the number, quality, transmission and computing resources of images, and are difficult to deploy on existing terminals. It is also challenging to obtain scene recognition results in real time. At present, WiFi and Bluetooth devices are widely deployed in indoor environments to transmit wireless signals to support the Internet of Everything. Their signals are affected by the environment during propagation. Shadows, fading, multipath and other phenomena will occur during the propagation process, making signals in different scenes have different characteristics, which provides a possibility for scene recognition methods based on wireless signals. However, in order to increase the signal coverage range, existing WiFi and Bluetooth devices mostly use omnidirectional antennas. The signal characteristics of scenes that are close and adjacent in physical space, especially the signal strength, are less different. In some special scenes, it is easy to cause misjudgment of scene recognition and reduce the accuracy of scene recognition.
[0004] In response to the above problems, the present invention proposes an indoor scene perception and recognition method that integrates spatial topological relationship constraints from the perspective of making full use of scene information while taking into account the efficiency of scene recognition, to assist scene recognition, thereby improving the accuracy of scene recognition and achieving positioning enhancement. Summary of the invention
[0005] 1. Technical issues to be solved
[0006] In view of the shortcomings of the existing technology, the present invention provides an indoor scene classification and recognition method that integrates spatial topological relationships. It has the advantages of solving the problems of the above-mentioned technologies by addressing the problem of misjudgment that is easily caused by adjacent scene recognition, constructing spatial topological constraints, assisting scene recognition, and improving scene recognition accuracy.
[0007] (II) Technical solution
[0008] To achieve the above object, the present invention provides the following technical solution: a method for classifying indoor scenes integrating spatial topological relationships, wherein the steps of the classification method are as follows:
[0009] Step 1: Divide the current complex indoor scene into scene units, collect, process and store data in different scenes to form training data sets and test data sets;
[0010] Step 2: Data compression strategy based on PCA algorithm, using PCA algorithm to perform data compression and dimension reduction with 95% reconstruction threshold index;
[0011] Step 3: Use the naive Bayes classifier to train and classify wireless signals in different scenarios.
[0012] The specific process of step 1 is as follows:
[0013] The scene unit definition table is:
[0014]
[0015]
[0016] The data is stored in the form of a table:
[0017]
[0018] where c i Indicates the scene unit name, Mac(i) indicates the Mac address, Indicates the c i The mth signal strength in the scenario.
[0019] Preferably, the specific process of step 1 is:
[0020] S1.1. Indoor scenes have different building materials, spatial layout structures, etc., and are composed of fixed elements, moving elements, and attribute elements;
[0021] S1.2, Complex scenes are composed of single scene units, and different elements are combined into scene units;
[0022] S1.3. According to the scene definition, the current complex indoor scene is divided into scene units, and WiFi and Bluetooth wireless signal strength data are collected, processed and stored in different scene units to form training data sets respectively;
[0023] D={x1,x2,…,x m}
[0024] and test set
[0025] D'={x1',x2',…,x m '}.
[0026] Preferably, the specific process of step 2 is:
[0027] S2.1. Data preprocessing of PCA algorithm:
[0028] Input sample set D = {x1, x2, ..., x m}, where x i is a sample, the number of its data is D, and then the following calculation steps are taken on the data:
[0029] S2.1.1. Centralize all samples:
[0030] S2.1.2. Calculate the sample covariance matrix XX T ;
[0031] S2.1.3. Covariance matrix XX T Perform eigenvalue decomposition;
[0032] S2.1.4. Take the eigenvectors w1, w2, ..., w corresponding to the largest d' eigenvalues d' ;
[0033] S2.1.5, output projection matrix W = (w1, w2, ..., w d' );
[0034] S2.2. Data compression and dimensionality reduction based on reconstruction threshold index:
[0035] From the perspective of reconstruction, a reconstruction threshold t is set to determine the proportion of original information retained to be 95%. Then, the data dimension d' value after data compression is determined based on the threshold t. The reconstruction threshold formula is expressed as:
[0036]
[0037] Preferably, the specific process of step 3 is:
[0038] S3.1, let the sample data set D = x1, x2, ..., x m , sample x i =(x i1 ,x i2 ,…,x id ) is a d-dimensional attribute vector, with the categories labeled y=c1,c2,…,c N , the sample set data D is divided into N categories. Based on Bayes' theorem, the posterior probability of the sample is expressed as:
[0039]
[0040] Where P(c) is the prior probability of the class, P(x i |c) is the sample x i The conditional probability of class c, P(x i ) is the sample x i The total probability, for any scenario, the total probability formula remains the same;
[0041] S3.2. For wireless signal data, the prior probability P(c) and conditional probability P(x i,j |c) The solution steps are as follows:
[0042]
[0043]
[0044] In the formula, |D c | represents the number of samples in the cth class, |D| represents the total number of samples, μ c,j and are the mean and variance of the c-th sample on the j-th attribute;
[0045] S3.3, in the training phase, based on the training data set D, calculate and store various prior probabilities P(c); based on the c-type sample data set D c , calculate the mean μ of the c-class samples on the j-th attribute c,j and variance and and store;
[0046] S3.4. In the classification stage, based on real-time data, the sample category is inferred according to the maximum likelihood estimation. The formula for maximum likelihood estimation is:
[0047]
[0048] A method for indoor scene recognition integrating spatial topological relationships, the method for recognition is used in the scene classification method according to claim 1, and the steps of the method for recognition are:
[0049] Step 4: According to the spatial relationship of scene units, establish the scene unit adjacency matrix and adjacency table to assist in constraining the scene recognition results;
[0050] Step 5: Design a scene recognition system construction plan with scene recognition algorithm, data compression strategy and topological relationship constraints as the core;
[0051] Step 6: According to the plan, collect data in real time in real scenarios for scene perception and recognition.
[0052] Preferably, the detailed steps in step 4 are:
[0053] S4.1. Analyze the spatial entity attributes of indoor scenes, analyze the topological relationship between scenes, and construct the topological relationship adjacency matrix and adjacency table for indoor positioning needs;
[0054] S4.2, select the scene with a higher probability as the candidate result first, and then check the adjacency table of the current scene to determine whether the candidate result and the current scene are in an adjacent relationship;
[0055] S4.3, if it does not belong to an adjacency relationship, return to step 5.2 and select the next scene with a higher probability;
[0056] S4.4, if it is an adjacency relationship, check the adjacency matrix to determine whether it has connectivity;
[0057] S4.5. If there is connectivity, output the result; if there is no connectivity, return to step S4.2 and repeat this process until the scene recognition result is finally output.
[0058] Preferably, the detailed steps in step 5 are:
[0059] The scene recognition system construction solution divides the scene recognition process into three subsystems, covering the three main processes of scene data collection, training and recognition. The three subsystems are: offline collection and manual annotation system, scene recognition cloud service and online management and verification service;
[0060] The offline collection and manual annotation system collects and uploads the current scene data through the HTTP protocol. The scene data includes: place name, scene unit, device name and feature data;
[0061] The scene recognition cloud service is responsible for receiving, processing, storing, training and generating prediction models for scene recognition data;
[0062] The online management and verification service is responsible for the management of the database, model library, user interface, and the use of prediction models to perform scene perception based on real-time uploaded signal data.
[0063] Preferably, the data processing module of the scene recognition cloud service includes feature extraction and format conversion functions, which is responsible for processing the uploaded scene recognition data into vectors, compressing them using the PCA algorithm, and finally storing them in the scene recognition library for training.
[0064] Preferably, the core part of the scene recognition cloud service is a machine learning algorithm library, which includes: naive Bayes, support vector machine SVM, random forest, decision tree, neural network and other machine learning algorithms, selects a suitable classifier according to the signal type, has a unified input interface and output interface, and regularly retrieves data from the scene recognition library for offline learning and updates the prediction model.
[0065] Preferably, in step six, a mobile scene recognition application is used to collect data in real time in a real scene to perform scene perception and recognition, and output a scene recognition result.
[0066] The schematic diagram of the scene recognition system of the present invention is as follows Figure 2 shown.
[0067] Compared with the prior art, the present invention provides a method for indoor scene classification and recognition integrating spatial topological relationships, which has the following beneficial effects:
[0068] 1. The present invention helps the system understand and utilize the spatial topological relationship between indoor scenes by constraining the scene unit adjacency matrix and adjacency table established in step 4 through topological relationships, so as to verify whether the candidate scene is adjacent to the current scene, thereby reducing erroneous recognition. Through the adjacency matrix in step 4, the system checks whether the candidate scene has connectivity with the current scene. The connectivity check helps to exclude those scene units that are close in space but not actually adjacent, further improving the accuracy of recognition. In steps 5 and 6, machine learning algorithms are used for scene recognition and data processing. Selecting appropriate algorithms and feature extraction methods can better capture the subtle differences between scenes and reduce confusion between adjacent scenes. The real-time data collection and recognition capabilities mentioned in step 6 enable the system to continuously update and optimize the scene model. The system dynamically adjusts and improves the recognition algorithm through timely feedback data, thereby more accurately distinguishing adjacent scenes. Regularly performing accuracy evaluation and performance testing on the system is a key step to improve recognition accuracy. By monitoring and analyzing the recognition results, the causes of erroneous judgments are discovered and corrected, and the system design and algorithm selection are further optimized, achieving the beneficial effect of addressing the problem of erroneous judgments that are easily caused by adjacent scene recognition.
[0069] 2. In the present invention, by constructing the scene unit adjacency matrix and adjacency list in step 4, the system can accurately understand the spatial layout and relationship between indoor scenes. These topological relationships constrain the selection of candidate scenes, so that the system assists scene recognition based on actual spatial connectivity, thereby avoiding erroneous scene judgments. The connectivity check in step 4 utilizes the adjacency matrix to ensure that the candidate scene is indeed spatially adjacent or connectable to the current scene. This check mechanism can effectively filter out scene units that are similar in appearance but not actually adjacent, thereby improving the accuracy and reliability of scene recognition. In steps 5 and 6, machine learning algorithms are used for scene recognition and data processing. By selecting appropriate feature extraction methods and classification algorithms, the system can more accurately distinguish different indoor scenes, including slight differences between adjacent scenes, thereby further improving the recognition accuracy and achieving the beneficial effects of constructing spatial topological constraints, assisting scene recognition, and improving scene recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 This is a schematic diagram of spatial topological relationship-assisted scene recognition in the present invention;
[0071] Figure 2 Schematic diagram of the scene recognition system of the present invention. DETAILED DESCRIPTION
[0072] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0073] Embodiment 1
[0074] See also Figure 1 In a preferred embodiment of the present invention, Figure 1The experiment was conducted in an indoor positioning scene shown in the figure. The scene is 24.92m long and 27.49m wide, divided into 3 floors, and the structural layout of each floor is different. The first floor of the experimental field is a hall, which has a rectangular hollow structure with the second and third floors. According to the definition of scene units, the indoor scenes of the entire experimental field are defined and divided. There are a total of 8 indoor scenes in the entire experimental field, namely the medium-sized hall on the first floor, which has a medium-sized space range and many indoor mobile elements. It is often used for meetings and other functions; 3 small rooms on the second floor and 3 small rooms on the third floor, which have a small space range and many indoor mobile elements. They are often used for offices; and a corridor on the second floor, which is a narrow passage composed of the external walls of the experimental field and the internal tempered glass. Each scene unit is within the coverage of Wi-Fi and Bluetooth wireless signals. The distribution, numbering and identification of each scene are as follows: Figure 1 As shown, the same type of scenes are marked with the same color, where light blue represents a medium-sized hall scene, light green represents a small room scene, and bright blue represents a corridor scene.
[0075] After dividing the experimental field into 8 scenes, the crowdsourcing information collection software developed independently was used to collect Wi-Fi and Bluetooth signals for scene data training. The collected data included the current experimental field name, scene name, and device name. The user walks freely in each scene, and the walking range tries to cover the scene in which he is located. 400 seconds of data are collected in each scene to form a scene recognition training data set. In addition, 400 seconds of data are also collected in each scene as test data. There are 3295 training data and 3289 test data. The training data are input into the PCA compression algorithm and the naive Bayes classifier for training and testing. Then, the adjacency matrix and adjacency table are established according to the spatial relationship of the scene units to perform spatial topological constraints, and the results are statistically analyzed respectively.
[0076] 1. Comparison of indicators before and after data compression
[0077] method Number of attributes Training time / s Scene recognition accuracy Raw data 189 1.651 97.4% Data after PCA compression 135 1.278 97.1%
[0078] The original data set has been reduced from 189 fields to 135 fields, the attribute fields have been reduced by 54, and the data volume has been reduced by 28.5%. The training data has been trained 10 times, and the average training time of the original data set is
[0079] The training time of the compressed dataset is 1.651s, and the training time of the compressed dataset is 1.278s, which shortens the training time by 22.6%. The scene recognition accuracy rates of the two are 97.4% and 97.1% respectively.
[0080] 2. Adjacency Matrix and Adjacency List
[0081] Scene Unit Scenario 1 Scenario 2 Scene 3 Scene 4 Scene 5 Scene 6 Scene 7 Scene 8 Scenario 1 1 0 0 0 1 0 0 0 Scenario 2 0 1 0 0 1 0 0 0 Scene 3 0 0 1 0 1 0 0 0 Scene 4 0 0 0 1 1 0 0 0 Scene 5 1 1 1 1 1 1 0 0 Scene 6 0 0 0 0 1 1 1 0 Scene 7 0 0 0 0 0 1 1 1 Scene 8 0 0 0 0 0 0 1 1
[0082] Scene Unit Adjacent unit Scenario 1 Scene 1, Scene 5 Scenario 2 Scene 2, Scene 3, Scene 5 Scene 3 Scene 3, Scene 2, Scene 4, Scene 5 Scene 4 Scene 4, Scene 3, Scene 5 Scene 5 Scene 5, Scene 1, Scene 2, Scene 3, Scene 4, Scene 6 Scene 6 Scene 6, Scene 5, Scene 7 Scene 7 Scene 7, Scene 6, Scene 8 Scene 8 Scene 8, Scene 7
[0083] 3. Naive Bayes Classifier Scene Recognition Confusion Matrix
[0084]
[0085]
[0086] 4. Confusion matrix of scene recognition based on spatial topological relationship constraints
[0087] Recognition rate Scenario 1 Scenario 2 Scene 3 Scene 4 Scene 5 Scene 6 Scene 7 Scene 8 Scenario 1 100.0% 0.0 0.0 0.0 0.0 0.0 0.0 0.0 Scenario 2 0.0 100.0% 0.0 0.0 0.0 0.0 0.0 0.0 Scene 3 0.0 0.0 100.0% 0.0 0.0 0.0 0.0 0.0 Scene 4 0.0 0.0 0.0 100% 0.0 0.0 0.0 0.0 Scene 5 0.3% 0.0 0.0 0.0 99.6% 0.1% 0.0 0.0 Scene 6 0.0 0.0 0.0 0.0 0.7% 97.3% 2.0% 0.0 Scene 7 0.0 0.0 0.0 0.0 0.0 3.0% 95.3% 1.7% Scene 8 0.0 0.0 0.0 0.0 0.0 0.0 9.0% 91.0%
[0088] When using topological constraints to assist scene recognition, the overall recognition accuracy of the eight scenes is 98.2%, which is 1.1% higher than the 97.1% recognition rate of the original NB classifier. In addition to improving the scene recognition accuracy, the scene recognition errors are limited to the adjacent scene range, reducing the phenomenon of rapid scene jumps during real-time scene recognition.
[0089] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and alterations may be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for indoor scene classification integrating spatial topological relationships, characterized in that: The classification method steps are: Step 1: Divide the current complex indoor scene into scene units, collect, process and store data in different scenes to form training data sets and test data sets; Step 2: Data compression strategy based on PCA algorithm, using PCA algorithm to perform data compression and dimension reduction with 95% reconstruction threshold index; Step 3: Use the naive Bayes classifier to train and classify wireless signals in different scenarios.
2. According to claim 1, the indoor scene classification method integrating spatial topological relationships is characterized by: The specific process of step 1 is as follows: S1.
1. Indoor scenes have different building materials, spatial layout structures, etc., and are composed of fixed elements, moving elements, and attribute elements; S1.2, Complex scenes are composed of single scene units, and different elements are combined into scene units; S1.
3. According to the scene definition, the current complex indoor scene is divided into scene units, and WiFi and Bluetooth wireless signal strength data are collected, processed and stored in different scene units to form training data sets respectively; D={x1,x2,…,x m } and test set D'={x1',x2',…,x m '}.
3. The indoor scene classification method integrating spatial topological relationships according to claim 1 is characterized in that: The specific process of step 2 is: S2.
1. Data preprocessing of PCA algorithm: Input sample set D = {x1, x2, ..., x m }, where x i is a sample, the number of its data is D, and then the following calculation steps are taken on the data: S2.1.
1. Centralize all samples: S2.1.
2. Calculate the sample covariance matrix XX T ; S2.1.
3. Covariance matrix XX T Perform eigenvalue decomposition; S2.1.
4. Take the eigenvectors w1, w2, ..., w corresponding to the largest d' eigenvalues d' ; S2.1.5, output projection matrix W = (w1, w2, ..., w d' ); S2.
2. Data compression and dimensionality reduction based on reconstruction threshold index: From the perspective of reconstruction, a reconstruction threshold t is set to determine the proportion of original information retained to be 95%. Then, the data dimension d' value after data compression is determined based on the threshold t. The reconstruction threshold formula is expressed as:
4. The indoor scene classification method integrating spatial topological relationships according to claim 1, characterized in that: The specific process of step 3 is as follows: S3.1, let the sample data set D = x1, x2, ..., x m , sample x i =(x i1 ,x i2 ,…,x id ) is a d-dimensional attribute vector, with the categories labeled y=c1,c2,…,c N , the sample set data D is divided into N categories. Based on Bayes' theorem, the posterior probability of the sample is expressed as: Where P(c) is the prior probability of the class, P(x i |c) is the sample x i The conditional probability of class c, P(x i ) is the sample x i The total probability, for any scenario, the total probability formula remains the same; S3.
2. For wireless signal data, the prior probability P(c) and conditional probability P(x i,j |c) The solution steps are as follows: In the formula, |D c | represents the number of samples in the cth class, |D| represents the total number of samples, μ c,j and are the mean and variance of the c-th sample on the j-th attribute; S3.3, in the training phase, based on the training data set D, various prior probabilities P(c) are calculated and stored; Based on the c-type sample data set D c , calculate the mean μ of the c-class samples on the j-th attribute c,j and variance and and store; S3.
4. In the classification stage, based on real-time data, the sample category is inferred according to the maximum likelihood estimation. The formula for maximum likelihood estimation is:
5. A method for indoor scene recognition integrating spatial topological relationships, characterized in that: The recognition method is used in the scene classification method according to claim 1, and the recognition method steps are: Step 4: According to the spatial relationship of scene units, establish the scene unit adjacency matrix and adjacency table to assist in constraining the scene recognition results; Step 5: Design a scene recognition system construction plan with scene recognition algorithm, data compression strategy and topological relationship constraints as the core; Step 6: According to the plan, collect data in real time in real scenarios for scene perception and recognition.
6. The indoor scene recognition method integrating spatial topological relationships according to claim 5, characterized in that: The detailed steps in step 4 are: S4.
1. Analyze the spatial entity attributes of indoor scenes, analyze the topological relationship between scenes, and construct the topological relationship adjacency matrix and adjacency table for indoor positioning needs; S4.2, select the scene with a higher probability as the candidate result first, and then check the adjacency table of the current scene to determine whether the candidate result and the current scene are in an adjacent relationship; S4.3, if it does not belong to an adjacency relationship, return to step 5.2 and select the next scene with a higher probability; S4.4, if it is an adjacency relationship, check the adjacency matrix to determine whether it has connectivity; S4.
5. If there is connectivity, output the result; If there is no connectivity, return to step S4.2 and repeat this process until the scene recognition result is finally output.
7. The indoor scene recognition method integrating spatial topological relationships according to claim 1, characterized in that: The detailed steps in step five are: The scene recognition system construction solution divides the scene recognition process into three subsystems, covering the three main processes of scene data collection, training and recognition. The three subsystems are: offline collection and manual annotation system, scene recognition cloud service and online management and verification service; The offline collection and manual annotation system collects and uploads the current scene data through the HTTP protocol. The scene data includes: place name, scene unit, device name and feature data; The scene recognition cloud service is responsible for receiving, processing, storing, training and generating prediction models for scene recognition data; The online management and verification service is responsible for the management of the database, model library, user interface, and the use of prediction models to perform scene perception based on real-time uploaded signal data.
8. The indoor scene recognition method integrating spatial topological relationships according to claim 7, characterized in that: The data processing module of the scene recognition cloud service includes feature extraction and format conversion functions, which is responsible for processing the uploaded scene recognition data into vectors, compressing them using the PCA algorithm, and finally storing them in the scene recognition library for training.
9. The indoor scene recognition method integrating spatial topological relationships according to claim 8, characterized in that: The core part of the scene recognition cloud service is the machine learning algorithm library, which includes: Naive Bayes, support vector machine SVM, random forest, decision tree, neural network and other machine learning algorithms. It selects the appropriate classifier according to the signal type, has a unified input interface and output interface, and regularly retrieves data from the scene recognition library for offline learning and updates the prediction model.
10. The indoor scene recognition method integrating spatial topological relationships according to claim 1, characterized in that: In step six, a mobile scene recognition application is used to collect data in real time in a real scene to perform scene perception and recognition, and output the scene recognition result.
Citation Information
Patent Citations
Augmented reality navigation method based on indoor natural scene image deep learning
CN111126304A
Traffic scenario identification method and apparatus, device, and storage medium
US20240137777A1
Cited By
Building design scene automatic generation method and system based on artificial intelligence
CN120372782A
