WO2023024670A1 - 设备聚类方法、装置、计算机设备及存储介质 - Google Patents

设备聚类方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2023024670A1
WO2023024670A1 PCT/CN2022/099443 CN2022099443W WO2023024670A1 WO 2023024670 A1 WO2023024670 A1 WO 2023024670A1 CN 2022099443 W CN2022099443 W CN 2022099443W WO 2023024670 A1 WO2023024670 A1 WO 2023024670A1
Authority
WO
WIPO (PCT)
Prior art keywords
matrix
camera
clustering
shooting
equipment
Prior art date
Application number
PCT/CN2022/099443
Other languages
English (en)
French (fr)
Inventor
吴文胜
Original Assignee
深圳云天励飞技术股份有限公司
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 深圳云天励飞技术股份有限公司 filed Critical 深圳云天励飞技术股份有限公司
Publication of WO2023024670A1 publication Critical patent/WO2023024670A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • H04N7/181Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources

Definitions

  • the present invention relates to the technical field of data processing, in particular to a device clustering method, device, computer device and storage medium.
  • a device clustering method comprising:
  • the set of shooting number vectors includes shooting number vectors corresponding to each camera equipment to be clustered, and the shooting number vectors are generated based on the shooting data of the camera equipment within a preset time period;
  • the camera equipment is clustered based on the similarity matrix to obtain a device clustering result corresponding to the camera equipment.
  • a device clustering device comprising:
  • the shooting number vector set module is used to obtain the shooting number vector set, the shooting number vector set includes the shooting number vector corresponding to each camera equipment to be clustered, and the shooting number vector is based on the shooting number vector of the camera equipment in a preset time period Generated from the shooting data within;
  • a similarity matrix module configured to perform similarity calculations on any two shooting number vectors in the set of shooting number vectors to generate a similarity matrix
  • a device clustering result module configured to perform clustering processing on the imaging devices based on the similarity matrix, to obtain a device clustering result corresponding to the imaging devices.
  • a computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and operable on the processor, and implementing the above-mentioned device clustering method when the processor executes the computer-readable instructions .
  • One or more readable storage media storing computer-readable instructions.
  • the one or more processors execute the device clustering method as described above.
  • the collection of shooting data vectors includes shooting data vectors corresponding to each camera equipment to be clustered, and the shooting data vectors are generated based on the shooting data of the camera equipment within a preset time period Because the shooting number vector reflects a kind of characteristic information of the image shooting number characteristics of the camera device within a preset time period, this feature information is related to the application scene to which the camera device belongs; any two in the shooting number vector set Carry out similarity calculations on the shooting data vectors to generate a similarity matrix; by clustering the camera equipment based on the similarity matrix, the equipment clustering results corresponding to the camera equipment are obtained.
  • the equipment clustering results include two or more equipment Clustering clusters, the devices in each device clustering cluster belong to the same application scenario, thus realizing the clustering of camera devices based on the characteristics of the number of images captured by camera devices within a preset time period to obtain device clustering results, which can effectively
  • the application scenarios of the camera equipment are distinguished, and the efficiency and accuracy of classifying the application scenarios of the camera equipment are improved.
  • Fig. 1 is a schematic flow chart of a device clustering method in an embodiment of the present invention
  • Fig. 2 is a schematic flow chart of a device clustering method in an embodiment of the present invention
  • Fig. 3 is a schematic flow chart of a device clustering method in an embodiment of the present invention.
  • Fig. 4 is a schematic flow chart of a device clustering method in an embodiment of the present invention.
  • Fig. 5 is a schematic flow chart of a device clustering method in an embodiment of the present invention.
  • Fig. 6 is a schematic flow chart of a device clustering method in an embodiment of the present invention.
  • FIG. 7 is a schematic flowchart of a device clustering method in an embodiment of the present invention.
  • Fig. 8 is a schematic structural diagram of a device clustering device in an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of computer equipment in an embodiment of the present invention.
  • a device clustering method is provided, which can be applied to a client or a server, where the client includes but is not limited to various personal computers, notebook computers, smart phones, Tablets and portable wearables.
  • the server can be implemented by an independent server or a server cluster composed of multiple servers. The application of this method on the server is used as an example for illustration, including the following steps:
  • the set of shooting number vectors includes shooting number vectors corresponding to each camera device to be clustered, and the shooting number vector is generated based on shooting data of the camera device within a preset time period.
  • the shot number vector set is a vector set composed of multiple shot number vectors.
  • One shooting number vector corresponds to one camera device, that is, each shooting number vector is generated based on shooting data of a single camera device within a preset time period.
  • the camera equipment may be a quasi-professional camera used in security, or other camera equipment not in security, which is not limited here.
  • the shooting number vector is a kind of feature information reflecting the shooting number characteristics of the camera device within a preset time period, and the feature information is associated with the application scene to which the camera device belongs.
  • camera equipment is widely used in many application scenarios such as schools, companies, banks, transportation, and safe cities.
  • the camera equipment will continuously detect whether there are passers-by 24 hours a day.
  • a passer-by enters the range monitored by the camera device, the camera device will shoot it to obtain a captured image.
  • the more people pass by the range monitored by the camera equipment the more times the camera equipment performs the shooting, and the larger the number of image captures is. Due to the difference in the flow of people in different application scenarios, the flow of people passing through the application scenario in the same time period is different, so in the same time period, the number of images captured by the camera equipment in different application scenarios is also different. .
  • the shooting data vector corresponding to the camera device can be generated by acquiring the shooting data of the camera device within a preset time period.
  • the preset time period can be set according to requirements.
  • the preset time period can be Set to 24 hours.
  • the shooting data includes each image captured by the imaging device and the attribute information of each image. It can be understood that the above attribute information may include the shooting time. Of course, the attribute information may also include identification information of the imaging device. This is not limited.
  • the shooting data vector corresponding to the camera device when the shooting data vector corresponding to the camera device is generated based on the shooting data of the camera device within the preset time period, the shooting data of the camera device to be clustered within the preset time period may be obtained, and A plurality of time segments are divided from the preset time period according to the preset interval time.
  • the number of images captured in each time segment is obtained according to the shooting data, and the number of images captured by the same camera in each time segment is determined.
  • a shooting number vector set may be generated according to the shooting number vectors corresponding to the multiple imaging devices.
  • a similarity model may be used to calculate the similarity between any two shot number vectors in the shot number vector set, to obtain the similarity between any two shot number vectors.
  • the similarity model includes the following formula SCR(X, Y), and the similarity is calculated by the formula SCR(X, Y).
  • X is the first camera device, and the first camera device belongs to any one of the camera devices to be clustered
  • Y is the second camera device, and the second camera device belongs to any one of the camera devices to be clustered
  • SCR( X, Y) represents the Spearman (Spearman) correlation coefficient between the first imaging device X and the second imaging device Y
  • i represents the sequence number in the preset time period, wherein the sequence number is arranged in time order Sequence number, the value range of i is [1,m], m is a positive integer greater than 1.
  • the shooting number vector set includes shooting number vectors of several imaging devices. Input the shooting number vector set into the similarity model, and by calculating the formula SCR(X, Y), the similarity between any two shooting number vectors in the shooting number vector set can be obtained.
  • the Euclidean distance function and the Pearson correlation coefficient function may also be used to calculate the similarity between any two shot number vectors in the shot number vector set, and then generate a similarity matrix.
  • the shooting number vector set includes shooting number vectors of 6 camera devices, and the 6 camera devices are respectively d 1 , d 2 , ..., d 6 , then the generated similarity matrix is shown in Table 1 Show.
  • the camera devices are clustered according to the application scenarios to which the camera devices belong, and the device cluster results are obtained.
  • the device cluster results include two or more device clusters, each Devices in a device cluster belong to the same application scenario.
  • the device clustering model is used to cluster all camera devices to be clustered according to the similarity matrix. Before clustering all the imaging devices to be clustered, it is necessary to set the number M of clustering categories, and then cluster the imaging equipment into different M categories according to the preset number M of categories.
  • the clustering of all camera devices to be clustered can be realized through a device clustering model, and the device clustering model includes but is not limited to the k-means algorithm.
  • the k-means algorithm is a partition-based clustering method.
  • the device clustering result refers to the clustering result of the camera device.
  • the device clustering result includes several device clustering clusters.
  • the standard Laplacian matrix can be constructed according to the similarity matrix, the eigenvector of the standard Laplacian matrix can be calculated, and the eigenvector matrix can be generated according to the eigenvector, and each row of the eigenvector matrix F can be used as a sample, a total of n sample.
  • the n samples are clustered through the equipment clustering model, and the clustering results C(C 1 , C 2 , . . . , C M ) of n camera equipment are obtained.
  • the equipment cluster C 1 includes (d 1 , d 2 , d 4 ), the equipment cluster C 2 includes (d 4 , d 6 , d 7 , d 10 ), and the equipment cluster C 3 includes (d 5 ) and device cluster C 4 include (d 3 , d 8 ).
  • the shooting number vector set includes the shooting number vector corresponding to each imaging device to be clustered, and the shooting number vector is generated based on the shooting data of the imaging device within a preset time period, since the shooting number vector reflects A kind of characteristic information of the image shooting number feature of the camera device within a preset time period, which is related to the application scene to which the camera device belongs; the similarity is calculated for any two shooting number vectors in the shooting number vector set Calculate and generate a similarity matrix; by clustering the imaging equipment based on the similarity matrix, the equipment clustering results corresponding to the imaging equipment are obtained.
  • the equipment clustering results include two or more equipment clusters, each equipment The devices in the cluster cluster belong to the same application scenario, thus realizing the clustering of the camera devices based on the characteristics of the number of images taken by the camera devices within a preset time period to obtain the device clustering results, which can effectively distinguish the application scenarios of the camera devices , which improves the efficiency and accuracy of the application scene classification of camera equipment, and then facilitates the investigation of cases and suspects, according to the clustering results of camera equipment, the centralized screening of surveillance images belonging to a certain type of application scene, speeding up the investigation efficiency and save human resources.
  • step S10 a set of shooting number vectors is acquired; the set of shooting number vectors includes multiple shooting number vectors, including:
  • S104 Sorting the number of images taken by the imaging device in a plurality of time segments according to the order of time from the front to the rear, and generating a vector of the number of images taken by the imaging device.
  • the preset time period is a certain period of time set in advance, for example, it can be set to 24 hours (one day).
  • the preset interval time refers to the time interval set according to the time setting instruction.
  • the time setting instruction is generated after an operator (eg, a tester) inputs a preset interval time.
  • the interval time can be set to 6 minutes.
  • the interval time can be set according to the actual situation of the device. For example, different devices process data at different speeds. The longer the interval time is set, the less data needs to be processed, and it is more suitable for devices with slower data processing speeds. The shorter the interval time is set, the more data needs to be processed, which is more suitable for devices with faster data processing speed.
  • different shooting number vectors can be obtained according to different interval time settings.
  • the application scenarios of camera equipment can be clustered according to different shooting number vectors to improve the accuracy of clustering results.
  • One time segment corresponds to one image capture number, and the same camera device includes multiple image capture numbers.
  • the number of images captured by the same imaging device in different time segments is sorted according to the time corresponding to the number of captured images, and a vector of the number of captured images corresponding to the imaging device is generated.
  • the number and shooting time of images taken by the camera device within a preset time period are acquired.
  • the preset time period is divided into multiple time segments according to the set interval time. For example, as shown in Table 3, the preset interval time is 6 minutes, and the preset time period is 24 hours, then 240 time segments are obtained, and the number of image shots in each time segment is determined. According to the images in each time segment For the number of shots, each time segment is sorted in the order of time from front to back, and a vector of the number of shots corresponding to the imaging device is generated, and the vector of the number of shots is (1372, 5243, . . . , 469).
  • steps S101-S103 the shooting data of each imaging device to be clustered within a preset time period is obtained; the preset time period is divided into multiple time segments according to the preset interval time; according to the shooting data, it is determined that the imaging device is in The number of image captures in multiple time segments; the number of image captures by the imaging device in the multiple time segments is sorted according to the order of time from the front to the rear, and a vector of the number of captures corresponding to the imaging device is generated.
  • the number of images shot by the camera device in different time segments can be determined, which can more accurately reflect the characteristics of the number of shots taken by the camera device at different points, thereby effectively improving the number of images taken by the camera device in the preset time segment.
  • Accuracy of the number of shots feature clustering the application scenarios of camera equipment.
  • step S20 the similarity calculation is performed on any two shooting number vectors in the shooting number vector set to generate a similarity matrix, including:
  • the similarity model is used to perform similarity calculation on the shooting number vector set to obtain a similarity matrix.
  • the correlation coefficient algorithm is:
  • X is the first camera device, and the first camera device belongs to any one of the camera devices to be clustered
  • Y is the second camera device, and the second camera device belongs to any one of the camera devices to be clustered
  • SCR( X, Y) represents the Spearman (Spearman) correlation coefficient between the first imaging device X and the second imaging device Y
  • i represents the sequence number in the preset time period, wherein the sequence number is in a chronological order Number, the value range of i is [1,m], m is a positive integer greater than 1.
  • the shot number vector set includes several shot number vectors.
  • One camera device corresponds to one shooting number vector.
  • the set of shooting data vectors is calculated to obtain the similarity between two cameras.
  • the similarity between any two shot number vectors is calculated respectively, and the similarity between any two shot number vectors can be obtained. Furthermore, according to the similarity between any two shooting data vectors, a similarity matrix among several imaging devices is constructed.
  • steps S201 and S202 according to the correlation coefficient algorithm, similarity calculations are performed on any two shot number vectors in the shot number vector set to obtain the similarity between any two shot number vectors; based on the similarity, a similarity matrix is generated .
  • the similarity between any two camera devices can be obtained, and the obtained similarity matrix takes into account the similarity between several camera devices at different time segments, making the clustering results more accurate.
  • step S30 the step S30 of performing clustering processing on the imaging equipment based on the similarity matrix to obtain the equipment clustering result corresponding to the imaging equipment includes:
  • the clustering matrix is a Laplacian matrix
  • the Laplacian matrix (Laplacian matrix) is also called the admittance matrix, Kirchhoff matrix or discrete Laplacian operator, which is mainly used in graph theory , as a matrix representation of a graph.
  • the data needs to be converted into a graph, that is, all the data is regarded as points in the space, and the points are connected by edges. The weight value of the edge between two points that are farther away is lower, and the weight value of the edge between two points that are closer is higher.
  • the edge weight sum between different subgraphs is as low as possible after the graph is cut, and the edge weight sum in the subgraph is as high as possible, so as to achieve the purpose of clustering.
  • the Laplacian matrix is a positive semi-definite matrix, and the number of occurrences of 0 in the eigenvalue is the number of connected regions in the graph.
  • the minimum eigenvalue is 0, because the sum of each row of the Laplacian matrix is 0.
  • the step S301 of constructing a clustering matrix according to the similarity matrix may include:
  • the adjacency matrix and the degree matrix can be obtained through the similarity matrix of the sample point distance measure.
  • the method of constructing the adjacency matrix includes but not limited to the full connection method.
  • different kernel functions are selected to define edge weights.
  • the kernel function is the Gaussian kernel function RBF.
  • the degree matrix is a diagonal matrix, and only the main diagonal has a value, corresponding to the degree of the i-th point in the i-th row.
  • the adjacency matrix and the degree matrix corresponding to the similarity matrix are calculated according to the formula L to obtain the Laplacian matrix L.
  • L is a degree matrix
  • D is a diagonal matrix
  • the off-diagonal elements are all 0.
  • W is an adjacency matrix.
  • L sym D-1/2LD-1/2
  • D is the degree matrix
  • L is the Laplacian matrix
  • Standardizing the Laplacian matrix L is to standardize the elements in L so that the dimensions of different elements are normalized. For example, when for different subsets, the size of the edge between the sample points may vary greatly. To do this standard operation, the elements in L can be normalized between [-1,1], so that the dimension Consistent, the algorithm iteration speed and the accuracy of the results are greatly improved.
  • the degree matrix is:
  • the adjacency matrix is:
  • steps S3011-S3014 construct the adjacency matrix and the degree matrix corresponding to the similarity matrix; construct the Laplacian matrix according to the adjacency matrix and the degree matrix; standardize the Laplacian matrix, generate the aggregate class matrix.
  • the standardization process is performed on the Laplacian matrix so that the dimensions of different elements are normalized. For example, when for different subsets, the size of the edge between the sample points may vary greatly.
  • the elements in L can be normalized between [-1,1], so that the dimension Consistent, can improve algorithm iteration speed and accuracy.
  • a minimum eigenvalue ⁇ corresponds to an eigenvector f.
  • the eigenvector matrix F is a K*n-dimensional matrix, and n is the number of imaging devices.
  • the present invention constructs an eigenvector matrix based on the similarity matrix, and performs dimensionality reduction processing on the data, which can more effectively process clustering of high-dimensional data and improve data processing efficiency.
  • step S30 of inputting the eigenvector matrix into the device clustering model and obtaining the device clustering result output by the device clustering model include:
  • the scene setting information is scene information input by an operator according to the device clustering result.
  • the scene setting information refers to information of an application scene corresponding to the camera device.
  • the scene setting information may include application scenes such as restaurants, hotels, parking lots, cafes, bars, stadiums, parks, libraries, shopping malls (shops), waiting rooms, waiting rooms, and public transportation.
  • the clustering result includes 6 device clusters, and the scene setting information of the 6 device clusters is (restaurant, hotel, parking lot, cafe, bar, stadium).
  • Device clusters refer to the categories included in the device clustering results.
  • the scene setting information of the device clustering result is acquired, and according to the scene setting information, a scene label is added to the camera device corresponding to the shooting number vector.
  • the clustering result of the shooting number vector corresponding to the camera device d 1 is category a
  • the scene setting information of category a is a parking lot
  • the camera device d 1 corresponding to the shooting number vector is added with a scene label, and the scene label is " PARKING LOT".
  • steps S304 and S305 according to the scene setting information of the clustering result, a corresponding scene label is added to the camera equipment, so as to facilitate corresponding data analysis according to the scene label corresponding to the camera equipment, such as when investigating cases and checking suspects
  • the monitoring images of a certain type of application scene can be checked in a centralized manner, which can speed up the checking efficiency and save human resources.
  • step S30 of performing clustering processing on the imaging equipment based on the similarity matrix to obtain the equipment clustering result corresponding to the imaging equipment it also includes:
  • a device cluster refers to a category of device clusters, and each category includes shooting number vectors of several camera devices. According to the shooting number vectors of several imaging devices, an average vector corresponding to each category of shooting number vectors can be calculated.
  • the shooting number vectors corresponding to the camera equipment to be classified are obtained, and according to the shooting number vectors of the camera equipment clusters of each equipment cluster in the clustering results, the average vector, and use the average vector corresponding to the shooting number vector of each equipment cluster as the average vector of the shooting number corresponding to each equipment cluster. Furthermore, according to the shooting number vector corresponding to the camera equipment to be classified and the average shooting number vector corresponding to each equipment cluster, the similarity between the two is determined, and the equipment cluster corresponding to the maximum similarity is taken as the camera to be classified. The equipment cluster with the highest equipment matching degree is used as the label of the camera equipment to be classified.
  • steps S306-S308 based on the shooting number vector corresponding to the shooting device to be classified and the shooting number average vector corresponding to each device cluster, the scene label to which the shooting device to be classified belongs is determined. Since the shooting number average vector takes into account the shooting number vectors corresponding to all the camera devices in the device cluster, the scene labels of the camera devices to be classified can be made more accurate, and the classification accuracy of the camera devices to be classified can be improved.
  • a device clustering device is provided, and the device clustering device corresponds to the device clustering method in the foregoing embodiments one by one.
  • the device clustering device includes a shooting number vector collection module 10 , a similarity matrix module 20 , and a device clustering result module 30 .
  • the detailed description of each functional module is as follows:
  • the shooting number vector set module 10 is used to obtain the shooting number vector set, the shooting number vector set includes the shooting number vector corresponding to each camera equipment to be clustered, and the shooting number vector is based on the shooting number vector of the camera equipment at a preset time Generated from the shooting data in the segment;
  • a similarity matrix module 20 configured to perform similarity calculations on any two shooting number vectors in the set of shooting number vectors to generate a similarity matrix
  • the equipment clustering result module 30 is configured to perform clustering processing on the imaging equipment based on the similarity matrix, and obtain the equipment clustering result corresponding to the imaging equipment to obtain a shooting number vector set; the shooting number vector set Contains a vector of multiple shot numbers;
  • the device clustering result module 30 includes:
  • a clustering matrix unit configured to construct a clustering matrix according to the similarity matrix
  • An eigenvector matrix unit configured to calculate an eigenvector of the clustering matrix, and generate an eigenvector matrix according to the eigenvector;
  • a clustering processing unit configured to perform clustering processing on the imaging devices based on the eigenvector matrix, to obtain a device clustering result corresponding to the imaging devices.
  • the shooting number vector collection module 10 includes:
  • the shooting data unit is used to obtain the shooting data of each camera device to be clustered within a preset time period
  • a time division unit configured to divide the preset time period into a plurality of time segments according to preset intervals
  • an image shooting number unit configured to determine the number of images taken by the imaging device within a plurality of time segments according to the shooting data
  • the shooting number vector unit is configured to sort the number of images taken by the imaging device in a plurality of time segments in order of time from front to back, and generate a shooting number vector corresponding to the imaging device.
  • the similarity matrix module 20 includes:
  • a similarity unit configured to perform similarity calculations on any two shot number vectors in the set of shot number vectors according to the correlation coefficient algorithm, to obtain the similarity between any two shot number vectors;
  • a similarity matrix unit configured to generate the similarity matrix based on the similarity
  • the device clustering result module 30 includes:
  • a similarity matrix processing unit configured to construct an adjacency matrix and a degree matrix corresponding to the similarity matrix according to the similarity matrix
  • a Laplacian matrix unit configured to construct a Laplacian matrix according to the adjacency matrix and the degree matrix
  • the clustering matrix unit is used to standardize the Laplacian matrix to generate a clustering matrix.
  • the device clustering result module 30 include:
  • a scene setting information module configured to obtain scene setting information corresponding to each device cluster contained in the device clustering result
  • the scene tagging module is configured to add scene tags to the camera devices in each device cluster according to the scene setting information.
  • the device clustering result module 30 after the device clustering result module 30, it also includes:
  • the shooting number vector acquisition unit is used to obtain the shooting number vector corresponding to the camera equipment to be classified;
  • the average vector unit is used to calculate the average vector of the shooting number vectors corresponding to the imaging equipment in the equipment cluster, as the average vector of the shooting numbers corresponding to each equipment cluster;
  • the scene label determining unit is configured to determine the scene label to which the camera equipment to be classified belongs based on the shooting number vector corresponding to the camera equipment to be classified and the shooting number average vector corresponding to each device cluster.
  • Each module in the device clustering apparatus above can be fully or partially realized by software, hardware or a combination thereof.
  • the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of the above modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure may be as shown in FIG. 9 .
  • the computer device includes a processor, memory, network interface and database connected by a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a readable storage medium and an internal memory.
  • the readable storage medium stores an operating system, computer readable instructions and a database.
  • the internal memory provides an environment for the execution of the operating system and computer readable instructions in the readable storage medium.
  • the database of the computer equipment is used to store the data involved in the equipment clustering method.
  • the network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer readable instructions are executed by the processor, a device clustering method is implemented.
  • the readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
  • a computer device including a memory, a processor, and computer-readable instructions stored on the memory and operable on the processor.
  • the processor executes the computer-readable instructions, the following steps are implemented:
  • the set of shooting number vectors includes shooting number vectors corresponding to each camera equipment to be clustered, and the shooting number vectors are generated based on the shooting data of the camera equipment within a preset time period;
  • the camera equipment is clustered based on the similarity matrix to obtain a device clustering result corresponding to the camera equipment.
  • one or more computer-readable storage media storing computer-readable instructions.
  • the readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage media. storage medium.
  • Computer-readable instructions are stored on the readable storage medium, and when the computer-readable instructions are executed by one or more processors, the following steps are implemented:
  • the set of shooting number vectors includes shooting number vectors corresponding to each camera equipment to be clustered, and the shooting number vectors are generated based on the shooting data of the camera equipment within a preset time period;
  • the camera equipment is clustered to obtain a device clustering result corresponding to the camera equipment.
  • Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM random access memory
  • RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明涉及数据处理技术领域,尤其涉及一种设备聚类方法、装置、计算机设备及存储介质。其方法包括:获取拍摄数向量集合;对拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵;基于相似度矩阵对摄像设备进行聚类处理,得到摄像设备对应的设备聚类结果。本发明实现了基于摄像设备在预设时间段内的图像拍摄数特征对摄像设备进行聚类得到设备聚类结果,可以有效区分出摄像设备的应用场景,提高了对摄像设备进行应用场景分类的效率和准确度。

Description

设备聚类方法、装置、计算机设备及存储介质
本申请要求于2021年8月27日提交中国专利局,申请号为202110997621.1、发明名称为“设备聚类方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及数据处理技术领域,尤其涉及一种设备聚类方法、装置、计算机设备及存储介质。
背景技术
随着互联网络的迅速发展,摄像设备的应用越来越广泛。摄像设备安装于停车场、图书馆、商场等各种应用场景中,是维护社会治安的一种监督手段。在侦查案件、排查嫌疑人时,通常需要集中排查某一类应用场景的监控影像。那么,就需要对摄像设备的应用场景进行有效分类,进而实现将同一应用场景的摄像设备聚成一类。目前,通过人工对摄像设备的应用场景进行标注,需要耗费大量的人力,效率很低。如何根据摄像设备所属的应用场景对摄像设备进行快速聚类成为亟待解决的问题。
发明内容
基于此,有必要针对上述技术问题,提供一种设备聚类方法、装置、计算机设备及存储介质,以解决无法根据摄像设备所属的应用场景对摄像设备进行快速聚类的问题。
一种设备聚类方法,包括:
获取拍摄数向量集合,所述拍摄数向量集合包括待聚类的各摄像设备对应的拍摄数向量,所述拍摄数向量是基于所述摄像设备在预设时间段内的拍摄数据生成的;
对所述拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵;
基于所述相似度矩阵对所述摄像设备进行聚类处理,得到所述摄像设备对应的设备聚类结果。
一种设备聚类装置,包括:
拍摄数向量集合模块,用于获取拍摄数向量集合,所述拍摄数向量集合包括待聚类的各摄像设备对应的拍摄数向量,所述拍摄数向量是基于所述摄像设备在预设时间段内的拍摄数据生成的;
相似度矩阵模块,用于对所述拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵;
设备聚类结果模块,用于基于所述相似度矩阵对所述摄像设备进行聚类处理,得到所述摄像设备对应的设备聚类结果。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述设备聚类方法。
一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如上述设备聚类方法。
上述设备聚类方法、装置、计算机设备及存储介质,拍摄数向量集合包括待聚类的各摄像设备对应的拍摄数向量,而拍摄数向量是基于摄像设备在预设时间段内的拍摄数据生成的,由于拍摄数向量反映摄像设备在预设时间段内的图像拍摄数特征的一种特征信息,该特征信息与摄像设备所属的应用场景是存在关联的;对拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵;通过基于相似度矩阵对摄像设备进行聚类处理,得到摄像设备对应的设备聚类结果,设备聚类结果包括两个或两个以上的设备聚类簇,每个设备聚类簇中的设备属于同一应用场景,由此实现了基于摄像设备在预设时间段内的图像拍摄数特征对摄像设备进行聚类得到设备聚类结果,可以有效区分出摄像设备的应用场景,提高了对摄像设备进行应用场景分类的效率和准确度。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性 的前提下,还可以根据这些附图获得其他的附图。
图1是本发明一实施例中设备聚类方法的一流程示意图;
图2是本发明一实施例中设备聚类方法的一流程示意图;
图3是本发明一实施例中设备聚类方法的一流程示意图;
图4是本发明一实施例中设备聚类方法的一流程示意图;
图5是本发明一实施例中设备聚类方法的一流程示意图;
图6是本发明一实施例中设备聚类方法的一流程示意图;
图7是本发明一实施例中设备聚类方法的一流程示意图;
图8是本发明一实施例中设备聚类装置的一结构示意图;
图9是本发明一实施例中计算机设备的一示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
在一实施例中,如图1所示,提供一种设备聚类方法,该方法可以应用于客户端或服务端,其中,客户端包括但不限于各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。服务端可以用独立的服务器或者是多个服务器组成的服务器集群来实现,以该方法应用在服务端为例进行说明,包括如下步骤:
S10、获取拍摄数向量集合;拍摄数向量集合包括待聚类的各摄像设备对应的拍摄数向量,拍摄数向量是基于摄像设备在预设时间段内的拍摄数据生成的。
在一个实施例中,拍摄数向量集合是由多个拍摄数向量构成的向量集合。一个拍摄数向量对应一个摄像设备,即每个拍摄数向量是基于单个摄像设备在预设时间段内的拍摄数据生成的。
在一个实施例中,摄像设备可以是用在安防方面的准专业摄像机,也可以是非安防方面的其它摄像设备,在此不作限定。
在一个实施例中,拍摄数向量是反映摄像设备在预设时间段内的拍摄数特征的一种特征信息,该特征信息与摄像设备所属的应用场景是存在关联的。
例如,摄像设备广泛应用于学校、公司、银行、交通、平安城市等多个应 用场景。摄像设备会24小时不间断地检测是否有路人经过。当有路人进入摄像设备所监控的范围时,摄像设备会对其进行拍摄,得到拍摄图像。经过摄像设备所监控的范围的人越多,摄像设备所执行的拍摄次数就越多,图像拍摄数越大。由于在不同的应用场景,人流量存在差异,因此,同一个时间段经过该应用场景的人流量是不同,所以在同一时间段内,摄像设备在不同的应用场景的图像拍摄数也随之不同。
在一个实施例中,可以通过获取摄像设备在预设时间段内的拍摄数据,以生成该摄像设备对应的拍摄数向量,预设时间段内可根据需求设定,例如,预设时间段可设置为24小时。拍摄数据包括摄像设备进行拍摄的每一张图像以及每一张图像的属性信息,可以理解的是,上述属性信息可以包括拍摄时间,当然,该属性信息还可以包括摄像设备的标识信息等,在此不作限定。
具体的,在基于摄像设备在预设时间段内的拍摄数据生成该摄像设备对应的拍摄数向量时,可以是从待聚类的各摄像设备获取其在预设时间段内的拍摄数据,并按预设间隔时间从预设时间段内划分出多个时间片段。根据拍摄数据获取各个时间片段内的图像拍摄数,确定同一个摄像机在各个时间片段内的图像拍摄数。在得到同一个摄像机在各个时间片段内的图像拍摄数,按时间从前往后的顺序对各个时间片段进行排序,以生成由各个时间片段内的图像拍摄数所生成的一个向量,将其作为该摄像设备对应的拍摄数向量。在分别生成多个摄像设备对应的拍摄数向量后,则可以根据多个摄像设备对应的拍摄数向量生成拍摄数向量集合。
S20、对拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵。
在一个实施例中,需要对拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,得到任意两个拍摄数向量之间的相似度,并根据任意两个拍摄数向量之间的相似度生成相似度矩阵,上述相似度可以反映两个摄像设备在图像拍摄数这一维度特征下的相似程度大小;相似度越大,则两个摄像设备在图像拍摄数这一维度特征的相似程度较高,相似度越小,则两个摄像设备在图像拍摄数这一维度特征的相似程度较低。可理解的,可以采用相似度模型对拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,得到任意两个拍摄数向量之间的相似度。其中,相似度模型包含以下公式SCR(X,Y),通过公式SCR(X,Y)计算出相似度。
Figure PCTCN2022099443-appb-000001
其中,X为第一摄像设备,第一摄像设备属于待聚类的各摄像设备中任意一个;Y为第二摄像设备,第二摄像设备属于待聚类的各摄像设备中任意一个;SCR(X,Y)表示第一摄像设备X与第二摄像设备Y之间的Spearman(斯皮尔曼)相关系数;i表示在预设时间段内的时序号,其中,时序号为按时间顺序排列的顺序号,i的取值范围为[1,m],m为大于1的正整数。x i表示第一摄像设备X在时间序号i的图像拍摄数;y i表示第二摄像设备Y在时间序号i的图像拍摄数;r x(x i)表示图像拍摄数xi的次序号,其中,次序号为按图像拍摄数大小顺序排列的顺序号;r y(y i)表示图像拍摄数yi的次序号,其中,次序号为按图像拍摄数大小顺序的顺序号。
可理解的,拍摄数向量集合包括若干摄像设备的拍摄数向量。将拍摄数向量集合输入相似度模型,通过计算公式SCR(X,Y),可得到拍摄数向量集合中任意两个拍摄数向量之间的相似度。
可选的,还可以采用欧氏距离函数和Pearson相关系数函数来计算拍摄数向量集合中任意两个拍摄数向量之间的相似度,进而生成相似度矩阵。
在一示例中,例如,拍摄数向量集合包括6台摄像设备的拍摄数向量,6台摄像设备分别为d 1,d 2,...,d 6,则生成的相似度矩阵如表1所示。
表1相似度矩阵
  d 1 d 2 d 3 d 4 d 5 d 6
d 1 1          
d 2 0.92 1        
d 3 0.78 0.68 1      
d4 0.61 0.49 0.62 1    
d5 0.77 0.57 0.96 0.74 1  
d6 0.98 0.84 0.71 0.96 0.82 1
S30、基于相似度矩阵对摄像设备进行聚类处理,得到摄像设备对应的设备 聚类结果。
可理解的,由于在不同的应用场景,人流量存在差异,因此,同一个时间段经过该应用场景的人流量是不同,所以在同一时间段内,摄像设备在不同的应用场景的图像拍摄数也随之不同。根据摄像设备的图像拍摄数的差异,实现根据摄像设备所属的应用场景对摄像设备进行聚类,得到设备聚类结果,设备聚类结果包括两个或两个以上的设备聚类簇,每个设备聚类簇中的设备属于同一应用场景。设备聚类模型用于根据相似度矩阵对待聚类的所有摄像设备进行聚类。在对待聚类的所有摄像设备进行聚类之前,需要对聚类的类别个数M进行设置,进而根据预设的类别个数M,将摄像设备聚类成不同的M类。
对待聚类的所有摄像设备进行聚类,可以通过设备聚类模型来实现,设备聚类模型包括但不限于k-means算法。k-means算法是一种基于划分的聚类方法。设备聚类结果是指摄像设备的聚类结果。设备聚类结果包括若干设备聚类簇。
具体的,可以根据相似度矩阵构建标准拉普拉斯矩阵,计算标准拉普拉斯矩阵的特征向量,根据特征向量生成特征向量矩阵,将特征向量矩阵F的每一行作为一个样本,共n个样本。通过设备聚类模型对n个样本进行聚类,得到n个摄像设备的聚类结果C(C 1,C 2,...,C M)。
在一示例中,有10台摄像设备(d 1,d 2,...,d 10),M设置为4,则10台摄像设备的聚类结果为表2所示。10台摄像设备的聚类结果为表2所示。其中,设备聚类簇C 1包括(d 1、d 2、d 4),设备聚类簇C 2包括(d 4、d 6、d 7、d 10),设备聚类簇C 3包括(d 5)和设备聚类簇C 4包括(d 3、d 8)。
表2聚类结果
摄像设备 设备聚类簇
d 1、d 2、d 4 C 1
d 4、d 6、d 7、d 10 C 2
d 5 C 3
d 3、d 8 C 4
在步骤S10-S30中,拍摄数向量集合包括待聚类的各摄像设备对应的拍摄数向量,而拍摄数向量是基于摄像设备在预设时间段内的拍摄数据生成的,由于拍摄数向量反映摄像设备在预设时间段内的图像拍摄数特征的一种特征信息,该特征信息与摄像设备所属的应用场景是存在关联的;对拍摄数向量集合 中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵;通过基于相似度矩阵对摄像设备进行聚类处理,得到摄像设备对应的设备聚类结果,设备聚类结果包括两个或两个以上的设备聚类簇,每个设备聚类簇中的设备属于同一应用场景,由此实现了基于摄像设备在预设时间段内的图像拍摄数特征对摄像设备进行聚类得到设备聚类结果,可以有效区分出摄像设备的应用场景,提高了对摄像设备进行应用场景分类的效率和准确度,进而便于在侦查案件、排查嫌疑人时,可根据摄像设备的聚类结果,集中排查属于某一类应用场景的监控影像,加快排查效率,节省人力资源。
可选的,如图2所示,在步骤S10中,即获取拍摄数向量集合;拍摄数向量集合包括多个拍摄数向量,包括:
S101、获取待聚类的各摄像设备在预设时间段内的拍摄数据;
S102、按照预设间隔时间将预设时间段划分为多个时间片段;
S103、根据拍摄数据,确定摄像设备在多个时间片段内的图像拍摄数;
S104、将摄像设备在多个时间片段内的图像拍摄数按照时间从前往后的顺序进行排序,生成摄像设备对应的拍摄数向量。
可理解的,预设时间段是预先设置的某一段时间,如可设置为24小时(一天)。
预设间隔时间是指根据时间设置指令设定的时间间隔。其中,时间设置指令是在操作人员(如,测试员)输入预设间隔时间之后生成的。例如,间隔时间可设置为6分钟。间隔时间可根据设备的实际情况设定,例如,不同设备处理数据的速度不同,间隔时间设置的越长,需要处理的数据越少,更适配数据处理速度较慢的设备。间隔时间设置的越短,需要处理的数据越多,更适配数据处理速度较快的设备。可选的,根据不同的间隔时间设置,可得到不同的拍摄数向量。可根据不同的拍摄数向量对摄像设备的应用场景进行聚类,提高聚类结果的准确性。
一个时间片段对应一个图像拍摄数,同一个摄像设备包含多个图像拍摄数。按图像拍摄数对应的时间将同一个摄像设备在不同时间片段的图像拍摄数按照时间从前往后的顺序进行排序,生成该摄像设备对应的拍摄数向量。
具体的,获取摄像设备在预设时间段内的图像拍摄数和拍摄时间。根据设置的间隔时间将预设时间段划分出多个时间片段。例如,如表3所示,预设间隔时间为6分钟,预设时间段为24小时,则得到240个时间片段,确定每个时 间片段内的图像拍摄数,根据每个时间片段内的图像拍摄数,按时间从前往后的顺序对各个时间片段进行排序,生成该摄像设备对应的拍摄数向量,该拍摄数向量为(1372,5243,...,469)。
表3与间隔时间对应的时间片段和图像拍摄数
时间片段 图像拍摄数
00:00:00-00:06:00 1372
00:06:00-00:12:00 5243
... ...
23:54:00-24:00:00 469
在步骤S101-S103中,获取待聚类的各摄像设备在预设时间段内的拍摄数据;按照预设间隔时间将预设时间段划分为多个时间片段;根据拍摄数据,确定摄像设备在多个时间片段内的图像拍摄数;将摄像设备在多个时间片段内的图像拍摄数按照时间从前往后的顺序进行排序,生成摄像设备对应的拍摄数向量。通过设置多个时间片段,可以确定摄像设备在不同时间片段内的图像拍摄数,可以更加精准的反映出摄像设备在不同点的拍摄数特征,进而有效提高根据摄像设备在预设时间段内的拍摄数特征对摄像设备的应用场景进行聚类的准确性。
可选的,如图3所示,在步骤S20中,即对拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵,包括:
S201、对拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,得到任意两个拍摄数向量之间的相似度;
S202、基于相似度,生成相似度矩阵。
可理解的,相似度模型用于对拍摄数向量集合进行相似度计算,得到相似度矩阵。其中,相关系数算法为:
Figure PCTCN2022099443-appb-000002
其中,X为第一摄像设备,第一摄像设备属于待聚类的各摄像设备中任意一个;Y为第二摄像设备,第二摄像设备属于待聚类的各摄像设备中任意一个;SCR(X,Y)表示第一摄像设备X与第二摄像设备Y之间的Spearman(斯皮尔曼)相关系数;i表示在预设时间段内的时序号,其中,时序号为按时间顺序的顺序号,i的取值范围为[1,m],m为大于1的正整数。x i表示第一摄像设备X在时间序号i的图像拍摄数;y i表示第二摄像设备Y在时间序号i的图像拍 摄数;r x(x i)表示图像拍摄数x i的次序号,其中,次序号为按图像拍摄数大小顺序的顺序号;r y(y i)表示图像拍摄数yi的次序号,其中,次序号为按图像拍摄数大小顺序的顺序号。
可理解的,拍摄数向量集合包括若干拍摄数向量。一个摄像设备对应一个拍摄数向量。根据相关系数算法对拍摄数向量集合进行计算,得到若干摄像设备两两之间的相似度。
具体的,根据相关系数算法SCR(X,Y),分别计算任意两个拍摄数向量之间的相似度,可得到任意两个拍摄数向量之间的相似度。进而,根据任意两个拍摄数向量之间的相似度,构建若干摄像设备之间的相似度矩阵。
在步骤S201和S202中,根据相关系数算法对拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,得到任意两个拍摄数向量之间的相似度;基于相似度,生成相似度矩阵。通过计算公式SCR(X,Y),可得到任意两个摄像设备之间的相似度,得到的相似度矩阵考虑了若干摄像设备之间在不同时间片段的相似度,使得聚类结果更加准确。
可选的,如图4所示,在步骤S30中,即基于相似度矩阵对摄像设备进行聚类处理,得到摄像设备对应的设备聚类结果的步骤S30,包括:
S301、根据相似度矩阵构建聚类矩阵;
S302、计算聚类矩阵的特征向量,根据特征向量生成特征向量矩阵;
S303、基于特征向量矩阵对摄像设备进行聚类处理,得到摄像设备对应的设备聚类结果。
可理解的,聚类矩阵为一种拉普拉斯矩阵,拉普拉斯矩阵(Laplacian matrix)也叫做导纳矩阵、基尔霍夫矩阵或离散拉普拉斯算子,主要应用在图论中,作为一个图的矩阵表示。首先需要将数据转换为图,即所有的数据看做空间中的点,点点之间用边相连。距离较远的两个点,它们之间边的权重值较低,距离较近的两点之间边的权重值较高。通过对所有数据点组成的图进行切图,让切图后不同的子图间边权重和尽可能的低,而子图内的边权重和尽可能的高,从而达到聚类的目的。
可理解的,拉普拉斯矩阵是半正定矩阵,特征值中0出现的次数就是图连通区域的个数,最小特征值是0,因为拉普拉斯矩阵每一行的和均为0。
在一个实施例中,如图5所示,根据相似度矩阵构建聚类矩阵的步骤S301可以包括:
S3011、根据相似度矩阵,构建与相似度矩阵对应的邻接矩阵和度矩阵;
S3012、根据邻接矩阵和度矩阵构建拉普拉斯矩阵;
S3013、对拉普拉斯矩阵进行标准化处理,生成聚类矩阵。
可理解的,邻接矩阵和度矩阵可以通过样本点距离度量的相似矩阵来获得。构建邻接矩阵的方法包括但不限于全连接法。全连接法,选择不同的核函数来定义边权重,例如,核函数是高斯核函数RBF。度矩阵是一个对角矩阵,只有主对角线有值,对应第i行的第i个点的度数。
具体的,在得到邻接矩阵和度矩阵之后,根据公式L对与该相似度矩阵对应的邻接矩阵和度矩阵进行计算,得到拉普拉斯矩阵L。
L=D-W
其中,D为度矩阵,D是对角矩阵且非对角元素均为0。W为邻接矩阵。在得到拉普拉斯矩阵L之后,根据公式L sym=D-1/2LD-1/2,其中,D为度矩阵,L为拉普拉斯矩阵,将拉普拉斯矩阵L标准化,得到标准化后的标准拉普拉斯矩阵L sym。将拉普拉斯矩阵L标准化就是对L中的元素进行标准化处理使得不同元素的量纲得到归一。例如,当对于不同子集,样本点之间的连边大小可能会差异很大,做这一步标准操作,可以将L中的元素归一化在[-1,1]之间,这样量纲一致,对算法迭代速度,结果的精度都是有很大提升。
例如,度矩阵为:
Figure PCTCN2022099443-appb-000003
邻接矩阵为:
Figure PCTCN2022099443-appb-000004
则拉普拉斯矩阵为:
Figure PCTCN2022099443-appb-000005
在步骤S3011-S3014中,根据相似度矩阵,构建与相似度矩阵对应的邻接矩阵和度矩阵;根据邻接矩阵和度矩阵构建拉普拉斯矩阵;对拉普拉斯矩阵进行标准化处理,生成聚类矩阵。其中,对拉普拉斯矩阵进行标准化处理使得不同元素的量纲得到归一。例如,当对于不同子集,样本点之间的连边大小可能会差异很大,做这一步标准操作,可以将L中的元素归一化在[-1,1]之间,这样量纲一致,可提高算法迭代速度和精度。
在得到聚类矩阵之后,根据计算公式L=λE(L为聚类矩阵,E为对角矩阵且对角元素均为1),可计算出聚类矩阵L的K个最小特征值λ,进而根据线性方程LV=λEV,对V进行求解,得到与最小特征值λ对应的V的解,即得到与最小特征值λ对应的特征向量f。一个最小特征值λ对应一个特征向量f。根据K个最小特征值λ所对应的特征向量f构建特征向量矩阵F。其中,特征向量矩阵F为K*n维的矩阵,n为摄像设备的个数。
在一示例中,当K为2(即有两个最小特征值λ1、λ2),n为6,则对应得到两个特征向量f,若两个特征向量f1,f2分别为:
Figure PCTCN2022099443-appb-000006
则可得到特征向量矩阵F:
Figure PCTCN2022099443-appb-000007
在步骤S301-S303中,本发明基于相似度矩阵构建特征向量矩阵,对数据进行了降维处理,能更加有效的处理高维数据的聚类,提升数据处理效率。
可选的,如图6所示,在将特征向量矩阵输入设备聚类模型,获取设备聚类模型输出的设备聚类结果的步骤S30之后,包括:
S304、获取与设备聚类结果所包含的各设备聚类簇对应的场景设置信息;
S305、根据场景设置信息,为各设备聚类簇中的摄像设备添加场景标签。
可理解的,场景设置信息是由操作人员根据设备聚类结果输入的场景信息。场景设置信息是指摄像设备对应的应用场景的信息。例如,场景设置信息可以包括饭馆、旅店、停车场、咖啡馆、酒吧、体育场、公园、图书馆、商场(店)、候诊室、候车室和公共交通工具等应用场景。例如,聚类结果包含6个设备聚类簇,该6个设备聚类簇的场景设置信息为(饭馆、旅店、停车场、咖啡馆、酒吧、体育场)。设备聚类簇是指设备聚类结果所包含的类别。获取设备聚类结果的场景设置信息,根据场景设置信息,为与拍摄数向量对应的摄像设备添加场景标签。例如,摄像设备d 1对应的拍摄数向量的聚类结果为类别a,类别a的场景设置信息为停车场,则将与该拍摄数向量对应的摄像设备d 1添加场景标签,场景标签为“停车场”。
在步骤S304和S305中,根据聚类结果的场景设置信息,为摄像设备添加对应的场景标签,进而便于根据摄像设备所对应的场景标签进行相应的数据分析,如在侦查案件、排查嫌疑人时,可根据摄像设备的场景标签,集中排查某一类应用场景的监控影像,加快排查效率,节省人力资源。
在一个实施例中,参考图7,在基于相似度矩阵对摄像设备进行聚类处理,得到摄像设备对应的设备聚类结果的步骤S30之后,还包括:
S306、获取待分类的摄像设备对应的拍摄数向量;
S307、针对设备聚类结果所包含的各设备聚类簇,分别计算各设备聚类簇中的摄像设备对应的拍摄数向量的平均向量,作为各设备聚类簇对应的拍摄数平均向量;
S308、基于待分类的摄像设备对应的拍摄数向量以及各设备聚类簇对应的拍摄数平均向量,确定待分类的摄像设备所属的场景标签。
可理解的,设备聚类簇是指设备聚类的类别,每一个类别包含若干摄像设备的拍摄数向量。根据若干摄像设备的拍摄数向量,可计算得到与各个类别拍摄数向量对应的平均向量。
具体的,获取与待分类的摄像设备对应的拍摄数向量,并根据聚类结果中各个设备聚类簇的摄像设备的拍摄数向量,分别计算得到与各个设备聚类簇拍摄数向量对应的平均向量,将与各个设备聚类簇拍摄数向量对应的平均向量作为各设备聚类簇对应的拍摄数平均向量。进而,根据待分类的摄像设备对应的 拍摄数向量以及各设备聚类簇对应的拍摄数平均向量,确定二者的相似度,将相似度最大值所对应的设备聚类簇作为待分类的摄像设备匹配度最高的设备聚类簇,将设备聚类簇对应场景标签作为待分类的摄像设备的标签。
在步骤S306-S308中,基于待分类的摄像设备对应的拍摄数向量以及各设备聚类簇对应的拍摄数平均向量,确定待分类的摄像设备所属的场景标签。由于拍摄数平均向量考虑了设备聚类簇中所有摄像设备对应的拍摄数向量,可使待分类的摄像设备的场景标签更加准确,提高待分类的摄像设备的分类准确性。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。
在一实施例中,提供一种设备聚类装置,该设备聚类装置与上述实施例中设备聚类方法一一对应。如图8所示,该设备聚类装置包括拍摄数向量集合模块10、相似度矩阵模块20、和设备聚类结果模块30。各功能模块详细说明如下:
拍摄数向量集合模块10,用于获取拍摄数向量集合,所述拍摄数向量集合包括待聚类的各摄像设备对应的拍摄数向量,所述拍摄数向量是基于所述摄像设备在预设时间段内的拍摄数据生成的;
相似度矩阵模块20,用于对所述拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵;
设备聚类结果模块30,用于基于所述相似度矩阵对所述摄像设备进行聚类处理,得到所述摄像设备对应的设备聚类结果用于获取拍摄数向量集合;所述拍摄数向量集合包括多个拍摄数向量;
可选的,设备聚类结果模块30,包括:
聚类矩阵单元,用于根据所述相似度矩阵构建聚类矩阵;
特征向量矩阵单元,用于计算所述聚类矩阵的特征向量,根据所述特征向量生成特征向量矩阵;
聚类处理单元,用于基于所述特征向量矩阵对所述摄像设备进行聚类处理,得到所述摄像设备对应的设备聚类结果。
可选的,所述拍摄数向量集合模块10,包括:
拍摄数据单元,用于获取待聚类的各摄像设备在预设时间段内的拍摄数据;
时间划分单元,用于按照预设间隔时间将所述预设时间段划分为多个时间 片段;
图像拍摄数单元,用于根据所述拍摄数据,确定所述摄像设备在多个所述时间片段内的图像拍摄数;
拍摄数向量单元,用于将所述摄像设备在多个所述时间片段内的图像拍摄数按照时间从前往后的顺序进行排序,生成所述摄像设备对应的拍摄数向量。
可选的,相似度矩阵模块20,包括:
相似度单元,用于根据相关系数算法对所述拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,得到任意两个拍摄数向量之间的相似度;
相似度矩阵单元,用于基于所述相似度,生成所述相似度矩阵
可选的,设备聚类结果模块30,包括:
相似度矩阵处理单元,用于根据所述相似度矩阵,构建与所述相似度矩阵对应的邻接矩阵和度矩阵;
拉普拉斯矩阵单元,用于根据所述邻接矩阵和所述度矩阵构建拉普拉斯矩阵;
聚类矩阵单元,用于对所述拉普拉斯矩阵进行标准化处理,生成聚类矩阵。
可选的,在设备聚类结果模块30之后,包括:
场景设置信息模块,用于获取与所述设备聚类结果所包含的各设备聚类簇对应的场景设置信息;
场景标签模块,用于根据所述场景设置信息,为所述各设备聚类簇中的摄像设备添加场景标签。
可选的,在设备聚类结果模块30之后,还包括:
拍摄数向量获取单元,用于获取待分类的摄像设备对应的拍摄数向量;
平均向量单元,用于计算所述设备聚类簇中的摄像设备对应的拍摄数向量的平均向量,作为所述各设备聚类簇对应的拍摄数平均向量;
场景标签确定单元,用于基于待分类的摄像设备对应的拍摄数向量以及所述各设备聚类簇对应的拍摄数平均向量,确定待分类的摄像设备所属的场景标签。
关于设备聚类装置的具体限定可以参见上文中对于设备聚类方法的限定,在此不再赘述。上述设备聚类装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调 用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图9所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括可读存储介质、内存储器。该可读存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为可读存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储设备聚类方法所涉及的数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种设备聚类方法。本实施例所提供的可读存储介质包括非易失性可读存储介质和易失性可读存储介质。
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现以下步骤:
获取拍摄数向量集合,所述拍摄数向量集合包括待聚类的各摄像设备对应的拍摄数向量,所述拍摄数向量是基于所述摄像设备在预设时间段内的拍摄数据生成的;
对所述拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵;
基于所述相似度矩阵对所述摄像设备进行聚类处理,得到所述摄像设备对应的设备聚类结果。
在一个实施例中,提供了一个或多个存储有计算机可读指令的计算机可读存储介质,本实施例所提供的可读存储介质包括非易失性可读存储介质和易失性可读存储介质。可读存储介质上存储有计算机可读指令,计算机可读指令被一个或多个处理器执行时实现以下步骤:
获取拍摄数向量集合,所述拍摄数向量集合包括待聚类的各摄像设备对应的拍摄数向量,所述拍摄数向量是基于所述摄像设备在预设时间段内的拍摄数据生成的;
对所述拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵;
基于所述相似度矩阵对所述摄像设备进行聚类处理,得到所述摄像设备对 应的设备聚类结果。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性可读取存储介质或易失性可读存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。
以上所述实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围,均应包含在本发明的保护范围之内。

Claims (10)

  1. 一种设备聚类方法,其特征在于,包括:
    获取拍摄数向量集合,所述拍摄数向量集合包括待聚类的各摄像设备对应的拍摄数向量,所述拍摄数向量是基于所述摄像设备在预设时间段内的拍摄数据生成的;
    对所述拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵;
    基于所述相似度矩阵对所述摄像设备进行聚类处理,得到所述摄像设备对应的设备聚类结果。
  2. 如权利要求1所述的设备聚类方法,其特征在于,所述获取拍摄数向量集合,包括:
    获取待聚类的各摄像设备在预设时间段内的拍摄数据;
    按照预设间隔时间将所述预设时间段划分为多个时间片段;
    根据所述拍摄数据,确定所述摄像设备在多个所述时间片段内的图像拍摄数;
    将所述摄像设备在多个所述时间片段内的图像拍摄数按照时间从前往后的顺序进行排序,生成所述摄像设备对应的拍摄数向量。
  3. 如权利要求1所述的设备聚类方法,其特征在于,所述对所述拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵,包括:
    对所述拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,得到任意两个拍摄数向量之间的相似度;
    基于所述相似度,生成所述相似度矩阵。
  4. 如权利要求1所述的设备聚类方法,其特征在于,所述基于所述相似度矩阵对所述摄像设备进行聚类处理,得到所述摄像设备对应的设备聚类结果,包括:
    根据所述相似度矩阵构建聚类矩阵;
    计算所述聚类矩阵的特征向量,根据所述特征向量生成特征向量矩阵;
    基于所述特征向量矩阵对所述摄像设备进行聚类处理,得到所述摄像设备对应的设备聚类结果。
  5. 如权利要求4所述的设备聚类方法,其特征在于,所述根据所述相似度矩阵构建聚类矩阵,包括:
    根据所述相似度矩阵,构建与所述相似度矩阵对应的邻接矩阵和度矩阵;
    根据所述邻接矩阵和所述度矩阵构建拉普拉斯矩阵;
    对所述拉普拉斯矩阵进行标准化处理,生成聚类矩阵。
  6. 如权利要求1所述的设备聚类方法,其特征在于,在所述基于所述相似度矩阵对所述摄像设备进行聚类处理,得到所述摄像设备对应的设备聚类结果之后,包括:
    获取与所述设备聚类结果所包含的各设备聚类簇对应的场景设置信息;
    根据所述场景设置信息,为所述各设备聚类簇中的摄像设备添加场景标签。
  7. 如权利要求1所述的设备聚类方法,其特征在于,在所述基于所述相似度矩阵对所述摄像设备进行聚类处理,得到所述摄像设备对应的设备聚类结果之后,还包括:
    获取待分类的摄像设备对应的拍摄数向量;
    针对所述设备聚类结果所包含的各设备聚类簇,分别计算所述各设备聚类簇中的摄像设备对应的拍摄数向量的平均向量,作为所述各设备聚类簇对应的拍摄数平均向量;
    基于待分类的摄像设备对应的拍摄数向量以及所述各设备聚类簇对应的拍摄数平均向量,确定待分类的摄像设备所属的场景标签。
  8. 一种设备聚类装置,其特征在于,包括:
    拍摄数向量集合模块,用于获取拍摄数向量集合,所述拍摄数向量集合包括待聚类的各摄像设备对应的拍摄数向量,所述拍摄数向量是基于所述摄像设备在预设时间段内的拍摄数据生成的;
    相似度矩阵模块,用于对所述拍摄数向量集合中任意两个拍摄数向量分别进行相似度计算,生成相似度矩阵;
    设备聚类结果模块,用于基于所述相似度矩阵对所述摄像设备进行聚类处理,得到所述摄像设备对应的设备聚类结果。
  9. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如权利要求1至7中任一项所述设备聚类方法。
  10. 一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如权利要求1至7中任一项所述设备聚类方法。
PCT/CN2022/099443 2021-08-27 2022-06-17 设备聚类方法、装置、计算机设备及存储介质 WO2023024670A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110997621.1 2021-08-27
CN202110997621.1A CN113901981A (zh) 2021-08-27 2021-08-27 设备聚类方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023024670A1 true WO2023024670A1 (zh) 2023-03-02

Family

ID=79187925

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/099443 WO2023024670A1 (zh) 2021-08-27 2022-06-17 设备聚类方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN113901981A (zh)
WO (1) WO2023024670A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117236803A (zh) * 2023-11-16 2023-12-15 中铁二十二局集团电气化工程有限公司 一种牵引变电站等级划分及评价方法、系统及电子设备
CN117975071A (zh) * 2024-03-28 2024-05-03 浙江大华技术股份有限公司 图像聚类方法、计算机设备和存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113901981A (zh) * 2021-08-27 2022-01-07 深圳云天励飞技术股份有限公司 设备聚类方法、装置、计算机设备及存储介质
CN114639052B (zh) * 2022-03-23 2023-08-04 阿里巴巴(中国)有限公司 生成拍摄场次分组信息的方法、装置及设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120281887A1 (en) * 2010-01-25 2012-11-08 Koichiro Yamaguchi Image sorting device, method, program, and integrated circuit and storage medium storing said program
CN105631033A (zh) * 2015-12-31 2016-06-01 北京奇艺世纪科技有限公司 一种视频数据的挖掘方法和装置
CN112131430A (zh) * 2020-09-24 2020-12-25 腾讯科技(深圳)有限公司 视频聚类方法、装置、存储介质和电子设备
CN112801053A (zh) * 2021-04-01 2021-05-14 腾讯科技(深圳)有限公司 视频数据处理方法、装置
CN113901981A (zh) * 2021-08-27 2022-01-07 深圳云天励飞技术股份有限公司 设备聚类方法、装置、计算机设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120281887A1 (en) * 2010-01-25 2012-11-08 Koichiro Yamaguchi Image sorting device, method, program, and integrated circuit and storage medium storing said program
CN105631033A (zh) * 2015-12-31 2016-06-01 北京奇艺世纪科技有限公司 一种视频数据的挖掘方法和装置
CN112131430A (zh) * 2020-09-24 2020-12-25 腾讯科技(深圳)有限公司 视频聚类方法、装置、存储介质和电子设备
CN112801053A (zh) * 2021-04-01 2021-05-14 腾讯科技(深圳)有限公司 视频数据处理方法、装置
CN113901981A (zh) * 2021-08-27 2022-01-07 深圳云天励飞技术股份有限公司 设备聚类方法、装置、计算机设备及存储介质

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117236803A (zh) * 2023-11-16 2023-12-15 中铁二十二局集团电气化工程有限公司 一种牵引变电站等级划分及评价方法、系统及电子设备
CN117236803B (zh) * 2023-11-16 2024-01-23 中铁二十二局集团电气化工程有限公司 一种牵引变电站等级划分及评价方法、系统及电子设备
CN117975071A (zh) * 2024-03-28 2024-05-03 浙江大华技术股份有限公司 图像聚类方法、计算机设备和存储介质

Also Published As

Publication number Publication date
CN113901981A (zh) 2022-01-07

Similar Documents

Publication Publication Date Title
WO2023024670A1 (zh) 设备聚类方法、装置、计算机设备及存储介质
Zhong et al. Re-ranking person re-identification with k-reciprocal encoding
Hua et al. Clickage: Towards bridging semantic and intent gaps via mining click logs of search engines
Leng et al. Person re-identification with content and context re-ranking
CN109376237B (zh) 客户稳定性的预测方法、装置、计算机设备和存储介质
WO2018171412A1 (zh) 一种行人检索方法及装置
JP2022518469A (ja) 情報処理方法および装置、記憶媒体
Subbiah et al. An extensive study and comparison of the various approaches to object detection using deep learning
US9665773B2 (en) Searching for events by attendants
CN109284613B (zh) 标识检测及仿冒站点检测方法、装置、设备及存储介质
Sapkota et al. Large scale unconstrained open set face database
CN112818162A (zh) 图像检索方法、装置、存储介质和电子设备
CN111882034A (zh) 神经网络处理及人脸识别方法、装置、设备和存储介质
Sun et al. Indiscernible object counting in underwater scenes
CN114897764A (zh) 基于标准化通道注意力的肺结节假阳性排除方法及装置
CN108960013B (zh) 一种行人再识别方法及装置
Yang et al. An adaptive automatic approach to filtering empty images from camera traps using a deep learning model
Miguel et al. Identifying individual snow leopards from camera trap images
Dong et al. Research on fast face retrieval optimization algorithm based on fuzzy clustering
CN114528441A (zh) 一种图结构数据节点分类方法、装置及电子设备
Meena et al. Aerial imaging based sea lion count using modified U-net architecture
Zahorodnia et al. Analysis of objects classification approaches using vectors of inflection points
Yu et al. Aeroplane detection from high-resolution remotely sensed imagery using bag-of-visual-words based hough forests
Yuan et al. Study on forensic image retrieval
Dunaev et al. Logs analysis to search for anomalies in the functioning of large technology platforms

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE