CN112131942A - Method and device for classifying attributes of places, electronic equipment and storage medium - Google Patents

Method and device for classifying attributes of places, electronic equipment and storage medium Download PDF

Info

Publication number
CN112131942A
CN112131942A CN202010839718.5A CN202010839718A CN112131942A CN 112131942 A CN112131942 A CN 112131942A CN 202010839718 A CN202010839718 A CN 202010839718A CN 112131942 A CN112131942 A CN 112131942A
Authority
CN
China
Prior art keywords
matrix
label
place
sample
global
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010839718.5A
Other languages
Chinese (zh)
Other versions
CN112131942B (en
Inventor
余晓填
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Priority to CN202010839718.5A priority Critical patent/CN112131942B/en
Publication of CN112131942A publication Critical patent/CN112131942A/en
Application granted granted Critical
Publication of CN112131942B publication Critical patent/CN112131942B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/41Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention provides a place attribute classification method, a place attribute classification device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring human face space-time data and sample label data; extracting a global place and personnel flow information corresponding to the global place according to the human face spatio-temporal data and the personnel flow information of the sample place; performing label propagation on a target place according to the personnel flow information corresponding to the global place and the initialized sample label matrix to obtain a first label distribution matrix; performing label propagation on a target place based on personnel flow information corresponding to the global place and an initialized sample label matrix to obtain a first label distribution matrix; combining the label distribution matrix corresponding to the last iteration times, continuously updating to obtain a label distribution matrix corresponding to the current iteration times, and obtaining a final label distribution matrix; and carrying out attribute classification on the target places according to the final label distribution matrix. The invention can improve the integral calibration effect of each place.

Description

Method and device for classifying attributes of places, electronic equipment and storage medium
Technical Field
The invention relates to the field of artificial intelligence, in particular to a place attribute classification method and device, electronic equipment and a storage medium.
Background
With the continuous improvement of living standard, various complex commercial or non-commercial places are put into use, such as internet cafes combined with internet cafes, book reading posthouses combined with water cafes, coffee shops and bookstores, and places combined with multiple entertainment functions, and the like, and because the functions of the places are complex, the calibration difficulty of the place attributes is high, the management of branch management departments is not facilitated, and the management difficulty is high. The existing place attribute calibration is mostly based on judging and calibrating attributes of various places by managers according to collected place information data and combined experience, and branch management departments manage the attributes according to the calibration, however, because the center of gravity of place function services is changed quickly and changed insignificantly, the manual calibration method not only has the conditions of low attribute calibration efficiency and high change response delay, but also has the condition of error calibration caused by insufficient objectivity of the information data. Therefore, the existing method for manually calibrating the site attributes has the conditions of low calibration efficiency, high delay of change response and high mis-calibration rate, so that the effect of calibrating the site attributes is poor.
Disclosure of Invention
The embodiment of the invention provides a place attribute classification method, which can automatically classify the attributes of places, and calibrate the places according to the classified attributes, so that the calibration efficiency is improved, the error calibration rate is reduced, meanwhile, the manual collection of information data is not needed, the response delay is reduced, and the effect of calibrating the attributes of the places is improved.
In a first aspect, an embodiment of the present invention provides a method for classifying attributes of a place, including:
acquiring face spatiotemporal data and sample label data, wherein the sample label data comprises a sample place, personnel flow information of the sample place and an initialized sample label matrix;
extracting a global place and personnel flow information corresponding to the global place according to the human face spatio-temporal data and the personnel flow information of the sample place, wherein the global place comprises a target place and the sample place;
performing label propagation on the target place according to the personnel flow information corresponding to the global place and the initialized sample label matrix to obtain a first label distribution matrix;
iterating the step of carrying out label propagation on the target site based on the personnel flow information corresponding to the global site and the initialized sample label matrix by combining the label distribution matrix corresponding to the last iteration time, continuously updating to obtain a label distribution matrix corresponding to the current iteration time until the label distribution matrix corresponding to the current iteration time is converged or iterated to reach the preset time, and obtaining a final label distribution matrix;
and carrying out attribute classification on the target places according to the final label distribution matrix.
Optionally, the performing label propagation on the target location according to the staff flow information corresponding to the global location and the initialized sample label matrix to obtain a first label distribution matrix includes:
constructing a personnel flow matrix corresponding to the global place according to the personnel flow information corresponding to the global place;
and carrying out label propagation on the target place based on the personnel flow matrix and the initialized sample label matrix to obtain a first label distribution matrix.
Optionally, the constructing a staff flow matrix corresponding to the target location according to the staff flow information corresponding to the global location includes:
acquiring personnel flow information of K global places within preset time;
counting the personnel flow information of each global place according to preset T time granularities to obtain the personnel flow information of each global place corresponding to the T time granularities;
and constructing a personnel flow matrix with the dimension of K x T according to the personnel flow information of the time granularity corresponding to each global place.
Optionally, the tag propagation on the target site based on the staff flow matrix and the initialized sample tag matrix includes:
calculating the similarity among all global places according to the personnel flow matrix with the dimension of K x T;
each global site is used as a node, the similarity between every two global sites is used as a connecting line between two corresponding nodes, a site node graph structure is constructed, the site graph structure comprises a target site node and a sample site node, the target site node corresponds to a target site, and the sample site node corresponds to a sample site;
and carrying out label propagation on the target site node based on the site node graph structure.
Optionally, the calculating the similarity between the global sites according to the staff flow matrix with the dimension K × T includes:
and calculating a similarity matrix of the personnel flow matrix according to a similarity function, wherein each matrix element in the similarity matrix represents the similarity between two global places.
Optionally, the propagating the label to the target site node based on the site node map structure includes:
and carrying out label propagation on the target site node according to the similarity between the sample site node and the target site node.
Optionally, the step of iterating the step of performing label propagation on the target location based on the personnel flow information corresponding to the global location and the initialized sample label matrix in combination with the label distribution matrix corresponding to the last iteration time is performed, and the label distribution matrix corresponding to the current iteration time is obtained by continuously updating until the label distribution matrix corresponding to the current iteration time converges or the iteration reaches a preset time, so as to obtain a final label distribution matrix, where the step includes:
and iterating the step of carrying out label propagation on the target site based on the personnel flow matrix and the initialized sample label matrix by combining with the label distribution matrix corresponding to the last iteration time, continuously updating to obtain a label distribution matrix corresponding to the current iteration time until the label distribution matrix corresponding to the current iteration time is converged or iterated to reach the preset time, and obtaining a final label distribution matrix.
Optionally, the step of iterating the label propagation to the target location based on the personnel flow matrix and the initialized sample label matrix in combination with the label distribution matrix corresponding to the last iteration number is continuously updated to obtain a label distribution matrix corresponding to the current iteration number until the label distribution matrix corresponding to the current iteration number converges or the iteration reaches a preset number, so as to obtain a final label distribution matrix, where the step includes:
acquiring a priori parameters a1 and a2, wherein a1 and a2 are positive numbers with the sum of 1;
in the iteration process, obtaining a label distribution matrix obtained by the last iteration times;
calculating a product matrix of the similarity matrix and the label distribution matrix obtained by the last iteration number, and adjusting the product matrix through the prior parameter a 1;
adjusting the initialized sample label matrix through the prior parameter a2, and adding the adjusted initialized sample label matrix and the product matrix to obtain a label matrix corresponding to the current iteration number;
and iterating the steps until the label matrix corresponding to the current iteration times converges or the iteration reaches the preset times.
Optionally, the calculating a product matrix of the similarity matrix and the label distribution matrix obtained from the last iteration number, and adjusting the product matrix by using the prior parameter a1 includes:
obtaining a diagonal matrix of the similarity matrix, wherein the diagonal matrix and the similarity matrix have the same row number and column number, and each diagonal value of the diagonal matrix is the sum of the same rows in the similarity matrix;
calculating a Laplace matrix of the similarity matrix based on the diagonal matrix;
and calculating the product of the Laplace matrix of the degree matrix and the label distribution matrix obtained by the last iteration number to obtain a product matrix.
In a second aspect, an embodiment of the present invention provides an apparatus for classifying attributes of a place, including:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring human face spatiotemporal data and sample label data, and the sample label data comprises a sample place, personnel flow information of the sample place and an initialized sample label matrix;
the extraction module is used for extracting a global place and staff flow information corresponding to the global place according to the face spatiotemporal data and the staff flow information of the sample place, wherein the global place comprises a target place and a sample place;
the processing module is used for carrying out label propagation on the target place according to the personnel flow information corresponding to the global place and the initialized sample label matrix to obtain a first label distribution matrix;
the iteration module is used for iterating the step of carrying out label propagation on the target place according to the personnel flow information corresponding to the global place and the initialized sample label matrix by combining the label distribution matrix corresponding to the last iteration time, continuously updating to obtain the label distribution matrix corresponding to the current iteration time until the label distribution matrix corresponding to the current iteration time is converged or iterated to reach the preset time, and obtaining the final label distribution matrix;
and the classification module is used for carrying out attribute classification on the target place according to the final label distribution matrix.
In a third aspect, an embodiment of the present invention provides an electronic device, including: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps in the property classification method of the place provided by the embodiment of the invention.
In a fourth aspect, the embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps in the method for classifying attributes of a place provided by the embodiment of the present invention.
In the embodiment of the invention, human face spatiotemporal data and sample label data are obtained, wherein the sample label data comprise a sample place, personnel flow information of the sample place and an initialized sample label matrix; extracting a global place and personnel flow information corresponding to the global place according to the human face spatio-temporal data and the personnel flow information of the sample place, wherein the global place comprises a target place and the sample place; performing label propagation on the target place according to the personnel flow information corresponding to the global place and the initialized sample label matrix to obtain a first label distribution matrix; iterating the step of carrying out label propagation on the target site based on the personnel flow information corresponding to the global site and the initialized sample label matrix by combining the label distribution matrix corresponding to the last iteration time, continuously updating to obtain a label distribution matrix corresponding to the current iteration time until the label distribution matrix corresponding to the current iteration time is converged or iterated to reach the preset time, and obtaining a final label distribution matrix; and carrying out attribute classification on the target places according to the final label distribution matrix. The personnel flow information corresponding to the target place is extracted through the face space-time data, manual collection of place information data can be omitted, attribute classification of the place can be automatically obtained by depicting the attribute classification of the place according to the personnel flow information, manual calibration is omitted, calibration efficiency of place attributes is improved, the error calibration rate is reduced, and therefore the overall calibration effect of each place is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of a method for classifying properties of a place according to an embodiment of the present invention;
FIG. 2 is a flow chart for constructing a people flow matrix according to an embodiment of the present invention;
FIG. 3 is a flow chart of tag propagation provided by an embodiment of the present invention;
FIG. 4 is a diagram illustrating an initialization graph structure provided by an embodiment of the present invention;
FIG. 5 is a diagram illustrating an iterative completion graph according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an attribute classification apparatus for a place according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an attribute classification device of another location according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a building block provided by an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of a processing module according to an embodiment of the present invention;
FIG. 10 is a block diagram of an iteration module provided by an embodiment of the present invention;
FIG. 11 is a schematic structural diagram of a first adjusting submodule provided in an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a method for classifying attributes of a place according to an embodiment of the present invention, as shown in fig. 1, including the following steps:
101. and acquiring face spatiotemporal data and sample label data.
The sample label data includes a sample location, staff flow information of the sample location, and an initialized sample label matrix.
The initialized sample label matrix includes a class label of the sample attribute, and the number of classes of the attribute is set by the user according to a required scene, for example, in a scene of the second classification, the number of classes of the attribute is 2, and in a scene of the 5-attribute classification, the number of classes of the attribute is 5. For example, when a place is judged to be legitimate or illegitimate, the above attribute type is 2, and when a place is judged to be a bookstore, a water bar, a coffee shop, or a bar, the above attribute type is 4.
In the embodiment of the present invention, the face spatiotemporal data may be understood as data of a face in time and space, for example, face snapshot data in a certain place at a certain time of a person a, and the face snapshot data may be structured or semi-structured data based on a face image, for example, a face image of the structured or semi-structured data is face image + snapshot place + snapshot time.
The face spatiotemporal data can be acquired by cameras arranged in various places and stored in corresponding snapshot databases. Furthermore, the cameras have ID identifications, and the cameras are arranged in various places, and the cameras with different ID identifications are arranged in different places, so that the positions of the places can be determined by binding the camera ID identifications and the places when the camera ID identifications are obtained.
The sample location may be understood as a location where the attribute has been calibrated, and has a guiding meaning in the calibration of the attribute.
The staff flow information of the sample location may be the staff flow number of the sample location, specifically, the staff flow number in the preset time, and more specifically, the staff flow number may be an average staff flow number of the preset time granularity in the preset time. For example, if the preset time is one month, the staff flow information is the number of staff flows in one month, the preset time is one month, the preset time granularity is 1 hour, and the number of staff flows is the average number of staff flows per hour in one month.
The sample tag data can be stored in an expert database, and when the sample tag data is needed, the sample tag data is obtained from the expert database.
In the snapshot database, storage areas of different cameras can be established according to the camera ID identifications, and each storage area stores face snapshot data captured by the corresponding camera in all time periods.
Further, the face spatiotemporal data is face spatiotemporal data within a preset time. For example, the preset time may be one week, one month, or two months, and the specific preset time may be set according to the needs of the user.
The sample label data can be obtained by manual labeling processing or labeling processing by a labeling algorithm.
In the embodiment of the invention, the required sample location is far smaller than the target location to be classified, so the number of the sample label data is far smaller than the human face spatiotemporal data. In particular, e.g. (x)1,y1)...(xn,yn) Sample tag data for a labeled sample location, (x)n+1,yn+1)...(xn+m,yn+m) Data for unlabeled sample sites, where x1Indicating the flow of people, x, at location 1nInformation on the flow of people, y, in the place n1Indicates a tag corresponding to location 1, ynIndicates the label, x, corresponding to the location nn+1Indicating the flow information of people at location n +1, xn+mAnd (3) representing the personnel flow information of a place n + m, wherein n is an integer far smaller than m. Above (y)n+1,…,yn+m) The label-free data can be understood as data to be classified. The above-mentioned initialization sample label matrix is Y ═ Y (Y)1,…,yn,yn+1,…,yn+m)。
102. And extracting the global place and the personnel flow information corresponding to the global place according to the human face spatio-temporal data and the personnel flow information of the sample place.
The global location includes a target location and a sample location, and may be understood as a total set of the target location and the sample location. The target site refers to a site to be classified, and the sample site mayTo be understood as the location where the attribute has been calibrated. It should be noted that, in the embodiment of the present invention, the number of the sample fields is much smaller than the target field. For example, (x)n+1,yn+1)...(xn+m,yn+m) Data for unlabeled sample sites, where xn+1Indicating the flow information of people at location n +1, xn+mAnd (3) representing the personnel flow information of a place n + m, wherein n is an integer far smaller than m. Above (y)n+1,…,yn+m) The label-free data can be understood as data to be classified. In one possible embodiment, the sample sites account for around 2% of the global sites. Further, in the two-class scene, the sample locations include a positive sample location and a negative sample location, and the positive sample location and the negative sample location may each account for about 1% of the global location.
The staff flow information corresponding to the global location includes staff flow information of the sample location and staff flow information of the target location.
The staff movement information of the sample location can be extracted through the sample label data acquired in step 101, and the staff movement information of the target location can be extracted through the face spatio-temporal data.
Specifically, the face spatiotemporal data may be face spatiotemporal data within a preset time, and the face spatiotemporal data may be face snapshot data captured by one or more cameras. The face data may be structured or semi-structured data based on the face image, for example, the face image of the structured or semi-structured data is face image + snapshot place + snapshot time.
The staff flow information may be a staff flow number, specifically, a staff flow number within a preset time, and more specifically, the staff flow number may be an average staff flow number of a preset time granularity within a preset time. For example, if the preset time is one month, the staff flow information is the number of staff flows in one month, the preset time is one month, the preset time granularity is 1 hour, and the number of staff flows is the average number of staff flows per hour in one month.
Certainly, in some possible embodiments, the staff flow number may also be a staff flow number of a preset time granularity in a preset time, for example, if the preset time is one month, and the preset time granularity is 1 hour, the staff flow information is a staff flow number of 24 hours per day in one month, and certainly, the staff flow number at this time is not an average number, but a staff flow number of 24 hours per day, which increases a dimension of days, so that the staff flow information needs to be expressed by three-dimensional information, and under the condition of paying a calculation amount cost, richer spatio-temporal information can be obtained, and the accuracy of subsequent attribute classification is further improved.
Furthermore, after the face spatio-temporal data within the preset time is acquired from the snapshot database, the face spatio-temporal data is a face image of structured or semi-structured data, so that target places needing attribute classification can be determined according to the camera ID identifications, and the personnel flow information corresponding to each target place is determined according to the face image corresponding to each camera ID identification. For example, assuming that the camera ID of the camera arranged in the a restaurant is 001, the camera ID of the camera arranged in the B bar is 002, the face images captured by 001 and 002 at each time interval are stored in the capture database as face spatio-temporal data, and when the face spatio-temporal data within one month are acquired in the capture database, the face spatio-temporal data corresponding to the cameras with the camera ID of 001 and the camera ID of 002 are acquired respectively, it can be determined that 2 target places are obtained, that is, the a restaurant and the B bar are the target places, the number of face images with the camera ID of 001 is 3000, the number of face images with the camera ID of 002 is 5000, which indicates that the number of people in one month in the a restaurant is 3000, and the number of people in one month in the B bar is 5000.
In the embodiment of the invention, the staff flow information of the sample site and the staff flow information of the target site jointly construct the staff flow information corresponding to the global site.
After the staff flow information corresponding to the global location is obtained, the target location can be subjected to label propagation according to the staff flow information corresponding to the global location and the initialized sample label matrix, so that a first label distribution matrix is obtained. The staff movement information corresponding to the global location may be preprocessed, for example, by performing matrix coding or vector coding, and specifically, refer to steps 103 and 104 described below.
103. And constructing a personnel flow matrix corresponding to the global place according to the personnel flow information corresponding to the global place.
In this step, the staff flow matrix includes a matrix row and a matrix column, the matrix row is a staff flow number with a preset time granularity, and the matrix column is a target location. Assuming that the preset time granularity is hour, the number of people flowing in 24 hours, the target sites are 3, and the sample sites are 1, if so, the method is adopted
Table 1 shows:
0 point to 1 point 1 point-2 points …… 22 points to 23 points 23 point-0 point
Target site 1 65 60 …… 61 75
Target site 2 0 0 …… 1 0
Target site 3 11 12 …… 9 8
Sample site 1 10 11 …… 12 11
TABLE 1
In table 1, the people flow number vector of the target location 1 is (65, 60, … …, 61, 75), the people flow number vector of the target location 2 is (0, 0, … …, 1, 0), the people flow number vector of the target location 3 is (11, 12, … …, 9, 8), the people flow number vector of the sample location 1 is (10, 11, … …, 12, 11), and the people flow matrix corresponding to the global location is [ (65, 60, … …, 61, 75); (0, 0, … …, 1, 0); (11, 12, … …, 9, 8); (10, 11, … …, 12, 11) ].
Further, as shown in fig. 2, fig. 2 is a flowchart for constructing a people flow matrix according to an embodiment of the present invention, including:
201. and acquiring the personnel flow information corresponding to K global places in the preset time.
In this step, the predetermined time may be one week, one month, two months, one year, or the like. It should be noted that, under the condition that the preset time is long, the existence of the target place needs to be judged, and whether the existence of the place is within the preset time is judged, for example, a hotel exists from 4 months in 2019 to 12 months in 2019, the later hotel is assigned to the cafe in 1 month in 2020 to 3 months in 2020 so far, the preset time is one year, the current time is 3 months in 2020, obviously, the target place is the cafe, the face time-space data of the cafe is only from 1 month in 2020 to 3 months in 2020, and is not full of one year, at this time, other times in not full of one year can be filled, specifically, 0 or an average value can be filled, the user can be prompted, specifically, the preset time is prompted to be too long, and the preset time is reduced or the corresponding place and the corresponding staff movement information are deleted.
In the embodiment of the present invention, the preset time may be defaulted to one month, and of course, the user may adjust the preset time as needed.
When the sample label data is (x)1,y1)...(xn,yn) The data of the target site is (x)n+1,yn+1)...(xn+m,yn+m) And K is n + m. At this time, x1Can represent the personnel flow information, x, of the place 1nCan represent the personnel flow information of the place n, xn+1Can represent the personnel flow information of the place n +1, xn+mIt is possible to represent the traffic information of the person at the place n + m.
202. And counting the personnel flow information of each global place according to preset T time granularities to obtain the personnel flow information of each global place corresponding to the T time granularities.
In this step, the time granularity may be 1 hour, and the preset T time granularities are 24 hours. Of course, in other possible embodiments, the time granularity may also be days, weeks, and the like, and it should be noted that the time granularity is smaller than the preset time in step 201. I.e. the preset time is a week, the time granularity should be less than a week, e.g. it could be a day or an hour, not a year as time granularity.
The staff flow information may be an average number of staff flows based on a time granularity, and when the preset time granularity is T, the staff flow information may be an average number of staff flows per time granularity within a preset time. For example, when the preset time is 1 month and the preset T time granularities are 24 hours, the average number of people flowing per time granularity represents the average number of people flowing per hour in 1 month of the target site.
The traffic information may be a traffic number, and after the traffic number of K target locations is obtained, the traffic number may be normalized so that the traffic number corresponds to a floating point operation in a computer. The normalization may be performed by calculating the average number of human movements at the time granularity, or may be performed by calculating the average number of human movements at the time granularity and then performing the calculation (corresponding to vector normalization). After normalization, the sum of the average people flow number normalized values for all time granularities for each site was 1.
203. And constructing a personnel flow matrix with the dimension of K x T according to the personnel flow information of the time granularity corresponding to each global place.
In this step, the staff flow information may be an average number of staff flows based on a time granularity, and when the preset time granularity is T, the staff flow information may be an average number of staff flows per time granularity within a preset time. Therefore, the number of people flowing in a preset area can be represented by a vector with a T dimension. The number of people flowing in K sites within a month can be represented by a vector with dimension K x T.
When the staff flow information is an average number of staff flows based on time granularity, and when the preset time is one month and the time granularity is 1 hour, the staff flow information may be an average number of staff flows per hour in one month. Therefore, the number of people flowing in a site within one month can be represented by a 24-dimensional feature vector. The number of people flowing in the K places in one month can be represented by a K-24 dimensional matrix, and each row of the matrix represents a feature vector of people flowing in the target place.
When the sample label data is (x)1,y1)...(xn,yn) The data of the target site is (x)n+1,yn+1)...(xn+m,yn+m) When x1Can represent the feature vector, x corresponding to the personnel flow information of the place 1nCan represent a feature vector, x corresponding to the personnel flow information of the place nn+1Can represent a feature vector, x, corresponding to the personnel flow information of the place n +1n+mThe feature vector corresponding to the people movement information of the place n + m can be represented. The above-mentioned flow matrix a ═ x1;……;xn;xn+1;……;xn+m)=(x1;……;xK). Further, the aforementioned flow matrix a ═ x (x)1;……;xK)∈R24The flow matrix a is a K × 24 dimensional matrix. Note that, after normalization in step 202, the above-mentioned feature vector modulo length is 1.
104. And carrying out label propagation on the target place based on the personnel flow matrix and the initialized sample label matrix to obtain a first label distribution matrix.
Wherein, the initialized sample label matrix comprises the attribute classification of the place.
In the embodiment of the invention, the attributes of each place are described according to the distribution condition of the number of people flowing in each global place. Taking a bar as an example, the distribution situation of the number of people flowing is that the number of people flowing at night is high, the number of people flowing at morning, noon and afternoon is low, when the distribution situation of the number of people flowing at a target place conforms to the situation that the number of people flowing at night is high, and the number of people flowing at morning, noon and afternoon is low, the probability that the target place is the bar is extremely high, and therefore, the target place can be considered to have the bar attribute. Of course, in a more subdivided attribute classification, the attributes of the bar may include a regular bar and a denormal bar, and the distribution of the number of people flowing in the regular bar and the denormal bar are also different, and when the distribution of the number of people flowing in a target location conforms to the distribution of the number of people flowing in the regular bar, the attribute of the target location may be considered as the regular bar, and when the distribution of the number of people flowing in the target location conforms to the distribution of the number of people flowing in the denormal bar, the attribute of the target location may be considered as the denormal bar. The coincidence degree of the distribution of the number of people flowing can be determined by the similarity between the number of people flowing and the label matrix in the pre-trained site attribute classification model, and the higher the similarity with the corresponding label, the higher the coincidence degree of the distribution of the number of people flowing.
The label propagation refers to propagating the label of the sample site to the target site, so as to mark the target site with a corresponding label. The label propagation is based on similarity, and two places with higher similarity can be regarded as places with the same attribute.
The first label distribution matrix refers to a label distribution matrix obtained when the label is spread for the first time, and since the label is spread for the first time, there is no label distribution matrix obtained when the label is spread for the last time, the initialized sample label matrix can be used as the label distribution matrix obtained when the label is spread for the last time.
Specifically, as shown in fig. 3, fig. 3 is a flowchart of tag propagation provided in an embodiment of the present invention, and includes:
301. and calculating the similarity among all the global places according to the personnel flow matrix with the dimension K x T.
In this step, since there are K global places, the similarity calculation between the respective global places is the similarity calculation of any two global places. The flow matrix is taken as the flow matrix a (x) in step 2031;……;xK) To illustrate, then the feature vector xiAnd the feature vector xjHas a similarity of xi*xj. Wherein i represents a global location i, j represents a global location j, where i may be equal to j, and at this time, the similarity is 1.
Further, the similarity may be calculated by a similarity function such as euclidean distance, gaussian kernel function distance, cosine distance, jaccard distance, or mahalanobis distance. In the embodiment of the present invention, it is preferable to calculate the similarity matrix of the staff flow matrix through a gaussian kernel function, where in the similarity matrix, each matrix element represents the similarity between two global places, and the gaussian kernel function is a 2-norm function, has a high time complexity, and can improve the convergence speed. Specifically, the similarity matrix may be calculated by the following gaussian kernel function formula:
(1)
wherein, i, j represents the ith row and jth column position of the similarity matrix B, and x is described aboveiAnd xjIs the corresponding eigenvector x in the people flow matrix AiAnd the feature vector xj。σ2Representing the variance of the number of people moving between different sites. For example, the similarity matrix B is shown in table 2:
x1 …… xi …… xj …… xK
x1 S11 …… S1i …… S1j …… S1k
…… …… …… …… …… …… …… ……
xi Si1 …… Sii …… Sij …… Sik
…… …… …… …… …… …… …… ……
xj Sj1 …… Sji …… Sjj …… Sjk
…… …… …… …… …… …… …… ……
xK Sk1 …… Ski …… Skj …… Skk
TABLE 2
Wherein S isijIs a feature vector xiAnd the feature vector xjSimilarity, further, SijThe similarity of the global place i and the global place j on the staff flow information is shown. It can be seen that the similarity matrix B is a matrix with a dimension K × K, and each element in the similarity matrix represents the similarity of two global sites.
In some possible embodiments, the similarity matrix may also be calculated by other similarity algorithms, for example, by a cosine similarity algorithm, an euclidean distance similarity algorithm, or the like, that is, only the similarity between every two global sites needs to be calculated. Further, for example, the human flow matrix a is multiplied by the transposed matrix of a, so that a similarity matrix, that is, the similarity matrix K T K may be obtained.
302. And taking each global place as a node, and taking the similarity between every two global places as a connecting line between the corresponding two nodes to construct a place node graph structure.
The site graph structure comprises a target site node and a sample site node, wherein the target site node corresponds to a target site, and the sample site node corresponds to a sample site.
Further, in a possible embodiment, the sample label data includes positive sample label data and negative sample label data, and correspondingly, the sample location includes a positive sample location and a negative sample location, and the location graph structure includes a target location node, a positive sample location node, and a negative sample location node, where the target location node corresponds to the target location, the positive sample location node corresponds to the positive sample location, and the negative sample location node corresponds to the negative sample location. As shown in fig. 4, the node with the darkest color is a positive sample site node, the node with the lightest color is a negative sample site node, and the rest are target site nodes.
In fig. 4, the connecting line between two nodes represents the similarity between the two nodes, and in a possible embodiment, the different similarities correspond to different types of connecting lines, for example, the different similarities correspond to connecting lines with different color values, or the different similarities correspond to connecting lines with different thicknesses, and so on.
Further, in the embodiment of the present invention, the location map structure may be constructed according to a similarity matrix, and the location map structure may be understood as a map display of the similarity matrix.
303. And carrying out label propagation on the target site node based on the site node graph structure.
In the site node graph structure, one site node may be connected to a plurality of site nodes, for example, if the number of global site nodes is K, one global site node may be connected to K-1 global site nodes. Assuming that n sample site nodes and m target site nodes are provided, one sample site node is connected with n-1 sample site nodes and is connected with m target site nodes, and similarly, one target site node is connected with n sample site nodes and is connected with m-1 target site nodes.
In the embodiment of the invention, because the target site node is not labeled and the sample site node is labeled, the label propagation can be carried out on the target site node according to the similarity between the sample site node and the target site node. Through label propagation, a target place node with high similarity to the sample place node is regarded as a place with the same type of attributes, and then the label of the sample place node is propagated to the target place node, so that the target place node has the same label as the sample place node. Thus, the labels of the target place nodes can be obtained, and the corresponding target places are classified according to the labels.
And traversing the site node graph structure, and performing label propagation on all target sites to obtain corresponding label matrixes.
In the embodiment of the present invention, the step of performing label propagation on the target location according to the staff flow information corresponding to the global location and the initialized sample label matrix may be iterated in combination with the label distribution matrix corresponding to the last iteration number, and the label distribution matrix corresponding to the current iteration number is obtained by continuously updating until the label distribution matrix corresponding to the current iteration number converges or the iteration reaches the preset number, so that the final label distribution matrix may be obtained. The staff flow information corresponding to the global location may be a staff flow matrix corresponding to the global location, and specifically, refer to step 105 below.
105. And (3) iterating the step of carrying out label propagation on the target place based on the personnel flow matrix and the initialized sample label matrix by combining the label distribution matrix corresponding to the last iteration time, continuously updating to obtain the label distribution matrix corresponding to the current iteration time until the label distribution matrix corresponding to the current iteration time is converged or the iteration reaches the preset time, and obtaining the final label distribution matrix.
In this step, the above-mentioned convergence refers to that the error of the label distribution matrix obtained by two iterations is smaller than the error of the convergence condition, and the iteration is ended when the label distribution matrix corresponding to the current iteration number converges. Alternatively, the iteration is ended when the number of iterations reaches a preset number (e.g., 200).
In the embodiment of the present invention, before performing iteration, a priori parameters a1 and a2 may be obtained, where a1 and a2 are positive numbers whose sum is 1, that is, a2 is 1-a 1.
In the current iteration process, firstly, a label distribution matrix L obtained by obtaining the last iteration times is obtainedt. Calculating a similarity matrix B and a label distribution matrix L obtained by the last iteration numbertAnd adjusting the product matrix by the prior parameter a 1. Adjusting the label matrix of the initialization sample through a priori parameter a2, and adding the adjusted label matrix of the initialization sample and the product matrix to obtain a label distribution matrix L corresponding to the current iteration timest+1
The prior parameter refers to the confidence degree of the user for initializing the sample label matrix, which needs to be performed by the user when constructing the sample label data, when the confidence degree of the user for initializing the sample label matrix is higher, a2 can be set to be larger, a1 can be set to be smaller, and at this time, the label matrix L obtained by the current iteration is smallert+1Is greatly affected by the initialized sample label matrix,when the user has low confidence level on the initialized sample label matrix, a2 can be set to be small, a1 can be set to be large, and at this time, the label distribution matrix L corresponding to the current iteration number ist+1Less affected by the initialized sample label matrix.
Further, after the similarity matrix is obtained, a diagonal matrix of the similarity matrix may be obtained, where the diagonal matrix and the similarity matrix have the same number of rows and columns, and each diagonal value of the diagonal matrix is a sum of the same rows in the similarity matrix.
In the embodiment of the invention, a specific iterative formula is as follows:
Figure BDA0002640996900000151
where D is a diagonal matrix whose diagonal corresponds to the sum of each row of the similarity matrix B. Y is an initialization sample tag matrix, LtIs the label matrix obtained from the last iteration. A is an a priori parameter, a is equal to the a priori parameter a1, and 1-a is equal to the a priori parameter a 2. And (5) performing iterative learning through an iterative formula, and iterating the steps until convergence. It should be noted that the initialized sample label matrix and the label matrix obtained by each iteration have the same dimension, specifically, the dimension of the similarity matrix B is K × K, the dimension of the initialized sample label matrix Y is K × W, the dimension of the diagonal matrix D is K × K, and if the label distribution matrix L corresponding to the current iteration number is a label distribution matrix L corresponding to the current iteration numbert+1Then, the label matrix L obtained from the last iterationtMay be an initialization sample tag matrix Y from which may be derived
Figure BDA0002640996900000161
K × W, and then added to the initialized sample label matrix Y, the dimension of the label matrix Y is also unchanged, and is also K × W, that is, the label distribution matrix L corresponding to the current iteration number is obtainedt+1Is also K x W. Wherein, the above-mentioned W is related to the number of categories of the attribute, and can be an integer greater than or equal to 1, when W is 1, the category of the attribute is twoClassification, i.e. whether it is a certain attribute or not, in which case Lt+1The dimension of (2) is K x 1, the attribute labels corresponding to all global places in the K global places are classified by 0 and 1, the attribute needing to be classified is assumed to be a bar, the place does not belong to the bar when the attribute label is 0, the place belongs to the bar when the attribute label is 1, and if the label distribution matrix L corresponding to the current iteration number is Lt+1The final label distribution matrix can pass through the label distribution matrix L corresponding to the current iteration numbert+1To find out whether the attribute of each of the K global places is a bar.
The location graph structure after iteration is as shown in fig. 5, and similar to fig. 4, the node with the darkest color is a positive sample location node, the node with the lightest color is a negative sample node, and the rest are target location nodes with unobvious features, so that it can be understood that no corresponding attribute label is taken as a reference, and the solution can be achieved by adding a corresponding attribute label in the initialized sample label matrix.
In a possible embodiment, in the current iteration process, the label distribution matrix corresponding to the last iteration number may be preprocessed, and the preprocessing may be to assign a value to a label corresponding to a sample location in the label distribution matrix corresponding to the last iteration number, so as to keep the label corresponding to the sample location unchanged in the label distribution matrix corresponding to the last iteration number, thereby improving the classification accuracy.
106. And carrying out attribute classification on the target places according to the final label distribution matrix.
After iteration is completed, a final label distribution matrix of the global site nodes is obtained, and labels of corresponding target site nodes can be inquired according to the label distribution matrix, so that labels corresponding to target sites are determined, and attribute classification of the target sites is obtained according to the labels.
In the embodiment of the invention, human face spatiotemporal data and sample label data are obtained, wherein the sample label data comprise a sample place, personnel flow information of the sample place and an initialized sample label matrix; extracting a global place and personnel flow information corresponding to the global place according to the human face spatio-temporal data and the personnel flow information of the sample place, wherein the global place comprises a target place and the sample place; constructing a personnel flow matrix corresponding to the global place according to the personnel flow information corresponding to the global place; performing label propagation on the target site based on the personnel flow matrix and the initialized sample label matrix; iterating the step of carrying out label propagation on the target place based on the personnel flow matrix and the initialized sample label matrix until convergence, and obtaining a final label distribution matrix; and carrying out attribute classification on the target places according to the final label distribution matrix. The personnel flow information corresponding to the target place is extracted through the face space-time data, manual collection of place information data can be omitted, attribute classification of the place can be automatically obtained by depicting the attribute classification of the place according to the personnel flow information, manual calibration is omitted, calibration efficiency of place attributes is improved, the error calibration rate is reduced, and therefore the overall calibration effect of each place is improved.
The method for classifying attributes of places according to the embodiment of the present invention can be applied to devices such as a mobile phone, a monitor, a computer, and a server that can classify attributes of places.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an attribute classification apparatus for a place according to an embodiment of the present invention, and as shown in fig. 6, the apparatus includes:
an obtaining module 601, configured to obtain face spatiotemporal data and sample label data, where the sample label data includes a sample location, staff mobility information of the sample location, and an initialized sample label matrix;
an extracting module 602, configured to extract a global location and staff flow information corresponding to the global location according to the face spatio-temporal data and the staff flow information of the sample location, where the global location includes a target location and a sample location;
the processing module 603 is configured to perform label propagation on the target location according to the staff flow information corresponding to the global location and the initialized sample label matrix, so as to obtain a first label distribution matrix;
an iteration module 604, configured to iterate the step of performing label propagation on the target location based on the personnel flow matrix and the initialized sample label matrix in combination with a label distribution matrix corresponding to the last iteration number, and continuously update the label distribution matrix to obtain a label distribution matrix corresponding to the current iteration number until the label distribution matrix corresponding to the current iteration number converges or the iteration reaches a preset number, so as to obtain a final label distribution matrix;
a classification module 605, configured to perform attribute classification on the target location according to the final label distribution matrix.
Optionally, as shown in fig. 7, the processing module 603 includes:
a constructing submodule 6031 configured to construct a staff flow matrix corresponding to the global location according to the staff flow information corresponding to the global location;
and a processing sub-module 6032, configured to perform label propagation on the target site based on the personnel flow matrix and the initialized sample label matrix, to obtain a first label distribution matrix.
Optionally, as shown in fig. 8, the building sub-module 6031 includes:
the first obtaining unit 60311 is configured to obtain staff flow information corresponding to K global places within a preset time;
a statistics unit 60312, configured to perform statistics on the staff mobility information of each global location according to preset T time granularities, so as to obtain the staff mobility information of each global location corresponding to the T time granularities;
the first constructing unit 60313 is configured to construct a staff flow matrix with a dimension K × T according to the staff flow information of the time granularity corresponding to each global place.
Optionally, as shown in fig. 9, the processing sub-module 6032 includes:
a calculating unit 60321, configured to calculate a similarity between the global places according to the people flow matrix with the dimension K × T;
a second constructing unit 60322, configured to use each global site as a node, use a similarity between every two global sites as a connection line between two corresponding nodes, and construct a site node graph structure, where the site graph structure includes a target site node and a sample site node, the target site node corresponds to a target site, and the sample site node corresponds to a sample site;
a processing unit 60323 configured to perform label propagation on the target venue node based on the venue node map structure.
Optionally, the calculating unit 60321 is further configured to calculate a similarity matrix of the people flow matrix according to a similarity function, where each matrix element represents a similarity between two global places.
Optionally, the processing unit 60323 is further configured to perform label propagation on the target site node according to a similarity between the sample site node and the target site node.
Optionally, the iteration module 604 is further configured to iterate the step of performing label propagation on the target location according to the staff flow matrix and the initialized sample label matrix in combination with the label distribution matrix corresponding to the last iteration time, and continuously update the label distribution matrix corresponding to the current iteration time until the label distribution matrix corresponding to the current iteration time converges or the iteration reaches a preset time, so as to obtain a final label distribution matrix.
Optionally, as shown in fig. 10, the iteration module 604 includes:
a first obtaining submodule 6041, configured to obtain a priori parameters a1 and a2, where a1 and a2 are positive numbers whose sum is 1;
a second obtaining sub-module 6042, configured to obtain, in the iteration process, a label distribution matrix obtained for the last iteration time;
a first adjusting submodule 6043, configured to calculate a product matrix of the similarity matrix and the label distribution matrix obtained in the last iteration, and adjust the product matrix according to the prior parameter a 1;
a second adjusting submodule 6044, configured to adjust the initialized sample label matrix according to the priori parameter a2, and add the adjusted initialized sample label matrix to the product matrix to obtain a label matrix corresponding to the current iteration number;
and an iteration submodule 6045, configured to iterate the above steps until the tag matrix corresponding to the current iteration number converges or the iteration reaches a preset number.
Optionally, as shown in fig. 11, the first adjusting sub-module 6043 includes:
an obtaining unit 60431, configured to obtain a diagonal matrix of the similarity matrix, where the diagonal matrix and the similarity matrix have the same number of rows and columns, and each diagonal value of the diagonal matrix is a sum of the same rows in the similarity matrix;
a first calculation unit 60432 configured to calculate a laplacian matrix of the similarity matrix based on the diagonal matrix;
a second calculating unit 60433, configured to calculate a product of the laplacian matrix of the degree matrix and the label distribution matrix obtained from the last iteration number, so as to obtain a product matrix.
The location attribute classification device provided in the embodiment of the present invention can be applied to devices such as a mobile phone, a monitor, a computer, and a server that can classify the location attributes.
The attribute classification device for the places provided by the embodiment of the invention can realize each process realized by the attribute classification method for the places in the embodiment of the method, and can achieve the same beneficial effect. To avoid repetition, further description is omitted here.
Referring to fig. 12, fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 12, including: a memory 1202, a processor 1201, and a computer program stored on the memory 1202 and executable on the processor 1201, wherein:
the processor 1201 is configured to call the computer program stored in the memory 1202, and perform the following steps:
acquiring face spatiotemporal data and sample label data, wherein the sample label data comprises a sample place, personnel flow information of the sample place and an initialized sample label matrix;
extracting a global place and personnel flow information corresponding to the global place according to the human face spatio-temporal data and the personnel flow information of the sample place, wherein the global place comprises a target place and the sample place;
performing label propagation on the target place according to the personnel flow information corresponding to the global place and the initialized sample label matrix to obtain a first label distribution matrix;
iterating the step of carrying out label propagation on the target place according to the personnel flow information corresponding to the global place and the initialized sample label matrix by combining the label distribution matrix corresponding to the last iteration time, continuously updating to obtain a label distribution matrix corresponding to the current iteration time until the label distribution matrix corresponding to the current iteration time is converged or iterated to reach the preset time, and obtaining a final label distribution matrix;
and carrying out attribute classification on the target places according to the final label distribution matrix.
Optionally, the performing, by the processor 1201, label propagation on the target location according to the staff flow information corresponding to the global location and the initialized sample label matrix to obtain a first label distribution matrix includes:
constructing a personnel flow matrix corresponding to the global place according to the personnel flow information corresponding to the global place;
and carrying out label propagation on the target place based on the personnel flow matrix and the initialized sample label matrix to obtain a first label distribution matrix.
Optionally, the constructing, by the processor 1201, a staff flow matrix corresponding to the target location according to the staff flow information corresponding to the global location includes:
acquiring personnel flow information corresponding to K global places within preset time;
counting the personnel flow information of each global place according to preset T time granularities to obtain the personnel flow information of each global place corresponding to the T time granularities;
and constructing a personnel flow matrix with the dimension of K x T according to the personnel flow information of the time granularity corresponding to each global place.
Optionally, the performing, by the processor 1201, tag propagation on the target site based on the staff flow matrix and the initialized sample tag matrix includes:
calculating the similarity among all global places according to the personnel flow matrix with the dimension of K x T;
each global site is used as a node, the similarity between every two global sites is used as a connecting line between two corresponding nodes, a site node graph structure is constructed, the site graph structure comprises a target site node and a sample site node, the target site node corresponds to a target site, and the sample site node corresponds to a sample site;
and carrying out label propagation on the target site node based on the site node graph structure.
Optionally, the calculating, by the processor 1201, the similarity between the global sites according to the staff flow matrix with the dimension K × T includes:
and calculating a similarity matrix of the personnel flow matrix according to a similarity function, wherein each matrix element in the similarity matrix represents the similarity between two global places.
Optionally, the tag propagation performed by the processor 1201 on the target venue node based on the venue node graph structure includes:
and carrying out label propagation on the target site node according to the similarity between the sample site node and the target site node.
Optionally, the step of combining the label distribution matrix corresponding to the last iteration number, executed by the processor 1201, iterating the step of performing label propagation on the target location according to the staff flow information corresponding to the global location and the initialized sample label matrix, and continuously updating to obtain the label distribution matrix corresponding to the current iteration number until the label distribution matrix corresponding to the current iteration number converges or the iteration reaches a preset number, so as to obtain a final label distribution matrix, where the step includes:
and iterating the step of carrying out label propagation on the target place according to the personnel flow matrix and the initialized sample label matrix by combining the label distribution matrix corresponding to the last iteration time, continuously updating to obtain a label distribution matrix corresponding to the current iteration time until the label distribution matrix corresponding to the current iteration time is converged or iterated to reach the preset time, and obtaining a final label distribution matrix.
Optionally, the step of combining the label distribution matrix corresponding to the last iteration number executed by the processor 1201, iterating the step of performing label propagation on the target site based on the personnel flow matrix and the initialized sample label matrix, and continuously updating to obtain the label distribution matrix corresponding to the current iteration number until the label distribution matrix corresponding to the current iteration number converges or the iteration reaches a preset number, so as to obtain a final label distribution matrix, where the step includes:
acquiring a priori parameters a1 and a2, wherein a1 and a2 are positive numbers with the sum of 1;
in the iteration process, obtaining a label distribution matrix obtained by the last iteration times;
calculating a product matrix of the similarity matrix and the label distribution matrix obtained by the last iteration number, and adjusting the product matrix through the prior parameter a 1;
adjusting the initialized sample label matrix through the prior parameter a2, and adding the adjusted initialized sample label matrix and the product matrix to obtain a label matrix corresponding to the current iteration number;
iterating the steps until the label matrix corresponding to the current iteration times converges or the iteration reaches the preset times
Optionally, the calculating, performed by the processor 1201, a product matrix of the similarity matrix and the label distribution matrix obtained from the last iteration number, and adjusting the product matrix by using the prior parameter a1 include:
obtaining a diagonal matrix of the similarity matrix, wherein the diagonal matrix and the similarity matrix have the same row number and column number, and each diagonal value of the diagonal matrix is the sum of the same rows in the similarity matrix;
calculating a Laplace matrix of the similarity matrix based on the diagonal matrix;
and calculating the product of the Laplace matrix of the degree matrix and the label distribution matrix obtained by the last iteration number to obtain a product matrix.
The electronic device may be a device such as a mobile phone, a monitor, a computer, or a server that can be used to classify attributes of a location.
The electronic device provided by the embodiment of the invention can realize each process realized by the attribute classification method of the place in the method embodiment, can achieve the same beneficial effects, and is not repeated here to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the location attribute classification method provided in the embodiment of the present invention, and can achieve the same technical effect, and is not described herein again to avoid repetition.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (12)

1. A method for classifying attributes of a place, comprising the steps of:
acquiring face spatiotemporal data and sample label data, wherein the sample label data comprises a sample place, personnel flow information of the sample place and an initialized sample label matrix;
extracting a global place and personnel flow information corresponding to the global place according to the human face spatio-temporal data and the personnel flow information of the sample place, wherein the global place comprises a target place and the sample place;
performing label propagation on the target place according to the personnel flow information corresponding to the global place and the initialized sample label matrix to obtain a first label distribution matrix;
iterating the step of carrying out label propagation on the target place according to the personnel flow information corresponding to the global place and the initialized sample label matrix by combining the label distribution matrix corresponding to the last iteration time, continuously updating to obtain a label distribution matrix corresponding to the current iteration time until the label distribution matrix corresponding to the current iteration time is converged or iterated to reach the preset time, and obtaining a final label distribution matrix;
and carrying out attribute classification on the target places according to the final label distribution matrix.
2. The method of claim 1, wherein the performing label propagation on the target site according to the staff flow information corresponding to the global site and the initialized sample label matrix to obtain a first label distribution matrix comprises:
constructing a personnel flow matrix corresponding to the global place according to the personnel flow information corresponding to the global place;
and carrying out label propagation on the target place based on the personnel flow matrix and the initialized sample label matrix to obtain a first label distribution matrix.
3. The method of claim 2, wherein the constructing the people flow matrix corresponding to the target site according to the people flow information corresponding to the global site comprises:
acquiring personnel flow information corresponding to K global places within preset time;
counting the personnel flow information of each global place according to preset T time granularities to obtain the personnel flow information of each global place corresponding to the T time granularities;
and constructing a personnel flow matrix with the dimension of K x T according to the personnel flow information of the time granularity corresponding to each global place.
4. The method of claim 3, wherein the tag propagation of the target site based on the people flow matrix and an initialization sample tag matrix comprises:
calculating the similarity among all global places according to the personnel flow matrix with the dimension of K x T;
each global site is used as a node, the similarity between every two global sites is used as a connecting line between two corresponding nodes, a site node graph structure is constructed, the site graph structure comprises a target site node and a sample site node, the target site node corresponds to a target site, and the sample site node corresponds to a sample site;
and carrying out label propagation on the target site node based on the site node graph structure.
5. The method of claim 4, wherein calculating the similarity between the global sites based on the people flow matrix with the dimension K T comprises:
and calculating a similarity matrix of the personnel flow matrix according to a similarity function, wherein each matrix element in the similarity matrix represents the similarity between two global places.
6. The method of claim 4, wherein said propagating labels for said target venue node based on said venue node graph structure comprises:
and carrying out label propagation on the target site node according to the similarity between the sample site node and the target site node.
7. The method of claim 2, wherein the step of iterating the step of propagating the labels to the target location according to the staff flow information corresponding to the global location and the initialized sample label matrix in combination with the label distribution matrix corresponding to the last iteration number is continuously updated to obtain a label distribution matrix corresponding to the current iteration number until the label distribution matrix corresponding to the current iteration number converges or the iteration reaches a preset number, so as to obtain a final label distribution matrix, and the method includes:
and iterating the step of carrying out label propagation on the target place according to the personnel flow matrix and the initialized sample label matrix by combining the label distribution matrix corresponding to the last iteration time, continuously updating to obtain a label distribution matrix corresponding to the current iteration time until the label distribution matrix corresponding to the current iteration time is converged or iterated to reach the preset time, and obtaining a final label distribution matrix.
8. The method of claim 7, wherein the step of iterating the label propagation for the target site according to the staff flow matrix and the initialized sample label matrix in combination with the label distribution matrix corresponding to the last iteration number is continuously updated to obtain a label distribution matrix corresponding to the current iteration number until the label distribution matrix corresponding to the current iteration number converges or the iteration reaches a preset number, so as to obtain a final label distribution matrix, and the method comprises:
acquiring a priori parameters a1 and a2, wherein a1 and a2 are positive numbers with the sum of 1;
in the iteration process, obtaining a label distribution matrix obtained by the last iteration times;
calculating a product matrix of the similarity matrix and the label distribution matrix obtained by the last iteration number, and adjusting the product matrix through the prior parameter a 1;
adjusting the initialized sample label matrix through the prior parameter a2, and adding the adjusted initialized sample label matrix and the product matrix to obtain a label matrix corresponding to the current iteration number;
and iterating the steps until the label matrix corresponding to the current iteration times converges or the iteration reaches the preset times.
9. The method of claim 7, wherein the calculating a product matrix of the similarity matrix and the label distribution matrix obtained from the previous iteration and adjusting the product matrix according to the prior parameter a1 comprises:
obtaining a diagonal matrix of the similarity matrix, wherein the diagonal matrix and the similarity matrix have the same row number and column number, and each diagonal value of the diagonal matrix is the sum of the same rows in the similarity matrix;
calculating a Laplace matrix of the similarity matrix based on the diagonal matrix;
and calculating the product of the Laplace matrix of the degree matrix and the label distribution matrix obtained by the last iteration number to obtain a product matrix.
10. An apparatus for attribute classification of a venue, the apparatus comprising:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring human face spatiotemporal data and sample label data, and the sample label data comprises a sample place, personnel flow information of the sample place and an initialized sample label matrix;
the extraction module is used for extracting a global place and staff flow information corresponding to the global place according to the face spatiotemporal data and the staff flow information of the sample place, wherein the global place comprises a target place and a sample place;
the processing module is used for carrying out label propagation on the target place according to the personnel flow information corresponding to the global place and the initialized sample label matrix to obtain a first label distribution matrix;
the iteration module is used for iterating the step of carrying out label propagation on the target place according to the personnel flow information corresponding to the global place and the initialized sample label matrix by combining the label distribution matrix corresponding to the last iteration time, continuously updating to obtain the label distribution matrix corresponding to the current iteration time until the label distribution matrix corresponding to the current iteration time is converged or iterated to reach the preset time, and obtaining the final label distribution matrix;
and the classification module is used for carrying out attribute classification on the target place according to the final label distribution matrix.
11. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, the processor implementing the steps in the method of property classification of a venue according to any of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the steps in the method of property classification of a place according to any one of claims 1 to 9.
CN202010839718.5A 2020-08-19 2020-08-19 Method and device for classifying attributes of places, electronic equipment and storage medium Active CN112131942B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010839718.5A CN112131942B (en) 2020-08-19 2020-08-19 Method and device for classifying attributes of places, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010839718.5A CN112131942B (en) 2020-08-19 2020-08-19 Method and device for classifying attributes of places, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112131942A true CN112131942A (en) 2020-12-25
CN112131942B CN112131942B (en) 2022-05-17

Family

ID=73851692

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010839718.5A Active CN112131942B (en) 2020-08-19 2020-08-19 Method and device for classifying attributes of places, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112131942B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120250950A1 (en) * 2011-03-29 2012-10-04 Phaedra Papakipos Face Recognition Based on Spatial and Temporal Proximity
CN109379282A (en) * 2018-10-25 2019-02-22 浙江工业大学 The network community detection method propagated based on multi-tag
CN110428139A (en) * 2019-07-05 2019-11-08 阿里巴巴集团控股有限公司 The information forecasting method and device propagated based on label
CN110705629A (en) * 2019-09-27 2020-01-17 北京市商汤科技开发有限公司 Data processing method and related device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120250950A1 (en) * 2011-03-29 2012-10-04 Phaedra Papakipos Face Recognition Based on Spatial and Temporal Proximity
CN109379282A (en) * 2018-10-25 2019-02-22 浙江工业大学 The network community detection method propagated based on multi-tag
CN110428139A (en) * 2019-07-05 2019-11-08 阿里巴巴集团控股有限公司 The information forecasting method and device propagated based on label
CN110705629A (en) * 2019-09-27 2020-01-17 北京市商汤科技开发有限公司 Data processing method and related device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SEEMA RANI ET AL.: "《Hybrid influential centrality based label propagation algorithm for community detection》", 《IEEE XPLORE》 *
王华: "《基于时空大数据的社交关系分析系统》", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Also Published As

Publication number Publication date
CN112131942B (en) 2022-05-17

Similar Documents

Publication Publication Date Title
CN111523621B (en) Image recognition method and device, computer equipment and storage medium
CN108288051B (en) Pedestrian re-recognition model training method and device, electronic equipment and storage medium
JP6536058B2 (en) Method, computer system, and program for estimating demographic characteristics of a user
CN108280477B (en) Method and apparatus for clustering images
US20170228871A1 (en) System and method for labelling aerial images
CN108304435A (en) Information recommendation method, device, computer equipment and storage medium
CN109446889B (en) Object tracking method and device based on twin matching network
CN110532970B (en) Age and gender attribute analysis method, system, equipment and medium for 2D images of human faces
CN111898547A (en) Training method, device and equipment of face recognition model and storage medium
CN110765863B (en) Target clustering method and system based on space-time constraint
CN110765882B (en) Video tag determination method, device, server and storage medium
CN110399895A (en) The method and apparatus of image recognition
CN114550053A (en) Traffic accident responsibility determination method, device, computer equipment and storage medium
CN111783713A (en) Weak supervision time sequence behavior positioning method and device based on relation prototype network
CN109635647B (en) Multi-picture multi-face clustering method based on constraint condition
Werner et al. DeepMoVIPS: Visual indoor positioning using transfer learning
CN113705596A (en) Image recognition method and device, computer equipment and storage medium
CN114299304B (en) Image processing method and related equipment
CN111666976A (en) Feature fusion method and device based on attribute information and storage medium
CN113360512A (en) Model updating method and device based on user feedback and storage medium
US20230281462A1 (en) Data processing method and apparatus, device, and medium
CN112131942B (en) Method and device for classifying attributes of places, electronic equipment and storage medium
CN115223003A (en) Yolov 5-based intrusion detection model training method and apparatus
CN114693997A (en) Image description generation method, device, equipment and medium based on transfer learning
CN114092746A (en) Multi-attribute identification method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant