Smart city decision-making method and system based on edge calculation
By training the image encoder and classifier in the edge computing unit of the smart city monitoring device, extracting and fusing road image features, the problem of inaccurate identification of road occupation operations in the prior art is solved, and higher recognition accuracy and decision-making support capabilities are achieved.
Patent Information
- Application Number
- CN202510429456.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-04-08
AI Technical Summary
When identifying road-occupying operations, the prior art ignores other valid information related to road-occupying operations in the initial image, resulting in inaccurate identification results and inability to provide accurate information for smart city decision-making.
Using a smart city decision-making method based on edge computing, the image encoder and classifier are trained in the edge computing unit of the monitoring device to extract and fuse the feature information of road images to improve the accuracy of road occupation business identification.
By integrating real-time feature maps of multiple monitoring devices, more comprehensive environmental features are obtained, and the accuracy of road-occupying business identification results is improved, providing reliable information support for smart city management decisions.
Smart Images

Figure CN119942466A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart city technology, and in particular to a smart city decision-making method and system based on edge computing. Background Art
[0002] As the level of urban intelligence continues to advance, artificial intelligence technology is used to empower smart city decision-making, automatically identify road occupation, and improve the efficiency of urban environment management.
[0003] At present, a patent application document with publication number CN114155217A discloses a vision-based illegal business detection method, which performs target detection on an initial image and extracts all targets in the initial image; classifies the extracted targets; filters interference targets based on the classification and outputs targets of illegal business; performs road segmentation on the initial image to divide the out-of-store business area and the road-occupying business area; combines the area where the illegal business target is located with the result mask of the road segmentation, and outputs the out-of-store business target and the road-occupying business target.
[0004] Although the above method can eliminate the influence of interference targets on the identification of road occupation, it ignores other effective information related to the identification of road occupation in the initial image and does not make full use of the information in the initial image, resulting in inaccurate identification results of road occupation and unable to provide accurate information for smart city decision-making. Summary of the invention
[0005] In order to solve the above-mentioned technical problems in the prior art, the present application provides a smart city decision-making method based on edge computing to improve the accuracy of road occupation business identification results and provide accurate information for smart city management decisions.
[0006] The present invention provides a smart city decision-making method based on edge computing, which is used to identify road occupation business on a target road, wherein a plurality of monitoring devices including edge computing units are deployed on the target road, and the method comprises: in an edge computing unit, a trained image encoder extracts features from a real-time road image collected by the monitoring device to obtain a real-time feature map of the monitoring device, wherein parameters of the image encoders in different edge computing units are shared; in response to a target monitoring device receiving real-time feature maps of other monitoring devices, weighted summing up each real-time feature map based on a set association vector of the target monitoring device to obtain a real-time fusion feature, wherein for any one of the target monitoring devices, the set association vector includes the degree of association between a road occupation business identification result of the target monitoring device and each real-time feature map; the real-time fusion feature is input into a trained classifier in the target edge computing unit to output a road occupation business identification result of the target monitoring device, wherein the target edge computing unit is an edge computing unit in the target monitoring device, and parameters of the classifiers in different edge computing units are not shared; and management measures are formulated based on the road occupation business identification result.
[0007] Multiple monitoring devices are deployed on the target road to collect road images of different areas on the target road, and the edge computing units of the monitoring devices store trained image encoders and classifiers, and the parameters of the image encoders in different edge computing units are shared to ensure that the same feature extraction process is performed on road images of different areas, so as to obtain feature maps corresponding to the road images of each area on the target road; further, for a target monitoring device, the feature maps are fused according to the degree of correlation of all feature maps based on the road occupation business identification results of the target monitoring device, and the fused features are input into the classifier stored in the edge computing unit of the target monitoring device to obtain the road occupation business identification results of the corresponding area of the target monitoring device; the fused features include all environmental features on the target road related to the road occupation business identification results of the target monitoring device, so as to improve the accuracy of the road occupation business identification results of the target monitoring device.
[0008] In some embodiments, the image encoder is a convolutional neural network, the classifier includes a fully connected neural network and a classification function, and the classification function is a softmax function.
[0009] In some embodiments, the real-time fusion feature satisfies the relationship: ; in, For the Real-time feature map, is the number of real-time road images, is the number of real-time feature maps corresponding to a real-time road image, The road occupation identification result of the target monitoring device is The correlation degree of the real-time feature graph, Real-time feature fusion.
[0010] All real-time feature maps are fused according to the degree of correlation between the road occupation business identification results of the target monitoring equipment and each real-time feature map to obtain real-time fusion features; the real-time fusion features include all environmental features on the target road that are related to the road occupation business identification results of the target monitoring equipment. Classification based on the real-time fusion features can improve the accuracy of the road occupation business identification results of the target monitoring equipment.
[0011] In some embodiments, the method for obtaining the set association vector of the target monitoring device includes: for a set of training data, obtaining feature maps of all road images based on a trained image encoder, inputting the mean of all feature maps into the trained classifier in the target edge computing unit, and obtaining the recognition result of the target road image; calculating the cross entropy loss of the recognition result and label corresponding to the target road image, and calculating the gradient size of each feature map based on the cross entropy loss; normalizing the gradient sizes of all feature maps to obtain the normalized vector corresponding to the training data, calculating the average value of the normalized vectors corresponding to all training data, and obtaining the set association vector of the target monitoring device.
[0012] In some embodiments, the gradient magnitude satisfies the relationship: ; in, The first Zhang feature map, and The target road images are The recognition results and labels of The target road image The cross entropy loss is For the The gradient size of the feature map.
[0013] In some embodiments, the training method of the image encoder and classifier in the target edge computing unit includes: taking the road images of each monitoring device at any historical moment and the labels of the target monitoring device as a set of training data, the labels including road occupation and non-road occupation; inputting the road image into the image encoder to obtain the feature map of each road image, obtaining the fusion result of all feature maps, and inputting the fusion result of all feature maps into the classifier to output the recognition result of the target monitoring device; taking the cross entropy of the recognition result and the label, and the sum of the correlations between multiple feature maps of a road image as the loss function value, and updating the image encoder and the classifier using the gradient descent method; iteratively training the image encoder and the classifier, and completing the training in response to the loss function value being less than a set value.
[0014] Since different monitoring devices are located in different areas and the environments in different areas are different, in order to avoid inaccurate road occupation business identification results caused by environmental differences between areas, during the training process, the parameters of the classifiers in different edge computing units are not shared to ensure the accuracy of the identification results of each target monitoring device.
[0015] In some embodiments, the loss function value satisfies the relationship: ; in, The target road image The cross entropy loss is The target road image Tags, The target road image The recognition result of For road images No. Zhang feature map, For road images No. Zhang feature map, Representation calculation and The Hadamard is the number of feature maps corresponding to a road image, is the number of road images in a set of training data, Represents the target road image The cross entropy loss has an effect on The gradient of the feature map, is the loss function value.
[0016] During the training process of the image encoder and classifier, the multiple feature maps corresponding to a road image are constrained to be independent of each other to improve the diversity of the feature maps. At the same time, the gradient size of each feature map is calculated based on the cross entropy loss, and the gradient size of the feature map is used to accurately measure the degree of correlation between the feature map and the target road image recognition result. The weighted summation of all feature maps is performed according to the degree of correlation to achieve the fusion of all feature maps, thereby further improving the accuracy of the road occupation recognition results of the target monitoring equipment.
[0017] In some embodiments, obtaining the fusion results of all feature maps includes: setting an initial weighting vector, the initial weighting vector includes an initial weight of each feature map, and the initial weight of each feature map is the same; calculating the fusion results of all feature maps based on the initial weighting vector, and the fusion results satisfy the relationship: ;in, For the Zhang feature map, is the number of road images in a set of training data, is the number of feature maps corresponding to a road image, represents the number of all feature maps in a set of training data, is the initial weight, is the fusion result of all feature maps.
[0018] One feature map corresponds to one feature in one road image, and all feature maps are weighted to obtain a fusion result, which includes all types of features at different positions on the target road.
[0019] In some embodiments, obtaining the fusion result of all feature maps also includes: performing weighted fusion on each feature map according to the weight vector of the current training to obtain the fusion result of all feature maps, inputting the fusion result into the classifier in the target edge computing unit to obtain the recognition result of the target road image in the current training; calculating the cross entropy loss of the target road image in the current training, and calculating the gradient size of each feature map based on the cross entropy loss; normalizing the gradient sizes of all feature maps to obtain the weight vector for the next training; wherein, in response to the current training being the first training, the weight vector of the current training is the initial weight vector.
[0020] The present invention also provides a smart city decision-making system based on edge computing, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the smart city decision-making method based on edge computing described in the present invention is implemented.
[0021] The above-mentioned smart city decision-making method based on edge computing provided in the embodiment of the present application deploys multiple monitoring devices on the target road to collect road images of different areas on the target road, and the edge computing unit of the monitoring device stores the trained image encoder and classifier, and the parameters of the image encoders in different edge computing units are shared to ensure that the same feature extraction process is performed on the road images of different areas to obtain the feature map corresponding to the road image of each area on the target road; further, for a target monitoring device, the feature map is fused according to the degree of correlation of all feature maps based on the road occupation business identification result of the target monitoring device, and the fused features are input into the classifier stored in the edge computing unit of the target monitoring device to obtain the road occupation business identification result of the corresponding area of the target monitoring device; the fused features include all environmental features on the target road related to the road occupation business identification result of the target monitoring device, thereby improving the accuracy of the road occupation business identification result of the target monitoring device.
[0022] Furthermore, since different monitoring devices are located in different areas and the environments in different areas are different, in order to avoid inaccurate road occupation business identification results due to environmental differences between areas, the parameters of the classifiers in different edge computing units are not shared. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a flow chart of a smart city decision-making method based on edge computing according to an embodiment of the present application; Figure 2 is a schematic diagram of a process of outputting a road occupation business identification result of the target monitoring device according to an embodiment of the present application; Figure 3 It is a flowchart of a training method for an image encoder and a classifier in a target edge computing unit provided in a preferred embodiment of the present application; Figure 4 It is a schematic diagram of the recognition result of the target road image in the output training data provided by the preferred embodiment of the present application; Figure 5 It is a block diagram of a smart city decision-making system based on edge computing according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0025] According to the first aspect of the present application, the present application provides a smart city decision-making method based on edge computing, which is used to identify road occupation business on a target road, wherein the target road is any road that needs to be identified for road occupation business. Multiple monitoring devices are deployed along the target road, and the field of view of all monitoring devices can cover the entire target road, and the position of each monitoring device is fixed; an edge computing unit is deployed in each monitoring device, and the edge computing unit has the functions of data storage, data calculation and data transmission, that is, all monitoring devices can realize data transmission through the edge computing unit.
[0026] See also Figure 1 As shown, it is a flowchart of the smart city decision-making method based on edge computing provided by the preferred embodiment of the present application. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
[0027] S11, in an edge computing unit, a trained image encoder performs feature extraction on a real-time road image collected by a monitoring device to obtain a real-time feature map of the monitoring device, wherein parameters of image encoders in different edge computing units are shared.
[0028] In one embodiment, a road image collected by a monitoring device corresponds to an area on the target road, and a monitoring device corresponds to an identification result of road occupation. That is to say, when the road occupation business identification result of a monitoring device is road occupation business, the area where the road occupation business exists on the target road can be determined based on the number information of the monitoring device.
[0029] A trained image encoder and a trained classifier are stored in the edge computing unit of a monitoring device.
[0030] The trained image encoder extracts features from the road images collected by the monitoring device to obtain feature maps corresponding to the monitoring device. One monitoring device corresponds to at least one feature map. The number of feature maps is related to the network structure of the image encoder. The image encoder can be any existing convolutional neural network such as ResNet, ShuffleNet or VGGNet. Exemplarily, when the image encoder uses VGG16, VGG16 performs multiple convolution operations on road images with a size of 224×224×3 to achieve feature extraction. The size of the output result is 7×7×512, then the number of feature maps corresponding to the monitoring device is 512, and the size of each feature map is 7×7.
[0031] It should be noted that at the same time, the road images collected by different monitoring devices reflect the environmental information of different areas on the target road. The edge computing unit of each monitoring device extracts features from the road images of different areas to obtain feature maps of different areas on the target road. In order to maintain the consistency of the feature extraction process of different areas on the target road, the parameters of the image encoders in different edge computing units are shared. Exemplarily, the parameters of the image encoder are trainable parameters in VGG16.
[0032] That is to say, at any time, the edge computing unit of each monitoring device will perform the same feature extraction process on the collected road image to obtain the feature map of each area on the target road at any time. For example, if there are 10 monitoring devices on the target road, when the image encoder uses VGG16, each monitoring device will obtain 512 feature maps at a time, and the target road will obtain a total of 5120 feature maps, which can reflect the environmental information of all areas of the target road at that time.
[0033] In this way, at the current moment, the real-time road image collected by the monitoring device is input into the trained image encoder in the corresponding edge computing unit to obtain the real-time feature map of each area on the target road, providing a data basis for the subsequent acquisition of the road occupation business identification results of the target monitoring device, where the target monitoring device is any monitoring device on the target road.
[0034] S12, in response to the target monitoring device receiving the real-time feature map of other monitoring devices, weighted summation is performed on all the real-time feature maps based on the set association vector of the target monitoring device to obtain the real-time fusion feature, wherein the target monitoring device is any one of the monitoring devices in the target road, and the set association vector includes the degree of association between the road occupation business identification result of the target monitoring device and each real-time feature map.
[0035] In one embodiment, the edge computing unit deployed in the target monitoring device is used as the target edge computing unit. The target monitoring device receives the real-time feature map of other monitoring devices through the target edge computing node, and all real-time feature maps can reflect the environmental information of all areas on the target road at the current moment.
[0036] In an optional embodiment, the set association vector includes the degree of association between the road occupation business identification result of the target monitoring device and each real-time feature map; since different monitoring devices are located in different areas on the target road, the set association vectors corresponding to different monitoring devices are also different.
[0037] Exemplarily, at the current moment, a total of 5120 real-time feature maps are obtained for the target road, and the association vector is set to include 5120 numerical values, where one numerical value represents the degree of association between a real-time feature map and the road occupation business identification result of the target monitoring device.
[0038] Wherein, the real-time fusion feature satisfies the relationship: ; in, For the Real-time feature map, is the number of real-time road images, is the number of real-time feature maps corresponding to a real-time road image, The road occupation identification result of the target monitoring device is The correlation degree of the real-time feature graph, Real-time feature fusion.
[0039] In one embodiment, the method for obtaining the set association vector of the target monitoring device includes: obtaining at least one set of training data, the training data including road images of all monitoring devices at any historical moment and labels of target road images, the labels being road occupation or non-road occupation; for a set of training data, obtaining feature maps of all road images according to a trained image encoder, calculating the mean of all feature maps, and inputting them into a trained classifier in the target edge computing unit to obtain a recognition result of the target road image; calculating the cross entropy loss of the recognition result and label corresponding to the target road image, and calculating the gradient size of each feature map based on the cross entropy loss, and the gradient size satisfies the relationship: ; in, is the first Zhang feature map, and The target road images are The recognition results and labels of The target road image The cross entropy loss is For the The gradient size of each feature map is normalized to obtain the normalized vector corresponding to the training data, and the average value of the normalized vector corresponding to all the training data is calculated to obtain the set association vector of the target monitoring device.
[0040] Among them, the gradient size of each feature map is used to reflect the degree of correlation between the feature map and the target road image recognition result. The larger the gradient size, the more effective the information of the feature map is in obtaining the correct target road image recognition result, that is, the greater the degree of correlation between the feature map and the road occupation business recognition result of the target monitoring equipment.
[0041] In this way, all real-time feature maps are fused according to the degree of correlation between the road occupation business identification results of the target monitoring equipment and each real-time feature map to obtain real-time fusion features; the real-time fusion features include all environmental features on the target road that are related to the road occupation business identification results of the target monitoring equipment. Classification based on the real-time fusion features can improve the accuracy of the road occupation business identification results of the target monitoring equipment.
[0042] S13, inputting the real-time fusion features into the trained classifier in the target edge computing unit to output the road occupation business identification result of the target monitoring device, wherein the target edge computing unit is an edge computing unit deployed in the target monitoring device, and the parameters of the classifiers in different edge computing units are not shared.
[0043] In one embodiment, the trained classifier in the target edge computing unit is used to obtain the recognition result of the target monitoring device. The classifier performs dimensionality transformation on the real-time fusion features to output the recognition result of the target monitoring device for occupying the road, and the recognition result of the occupying the road is occupying the road or not occupying the road; wherein the classifier includes a fully connected neural network and a classification function, and the classification function is a softmax function.
[0044] It should be noted that since different monitoring devices are located in different areas (different environments in different areas), the corresponding classification logic will also be different when different monitoring devices identify road occupation. In order to ensure that each monitoring device can obtain accurate road occupation identification results, the parameters of the classifiers in different edge computing units are not shared. The parameters of the classifier are trainable parameters in the fully connected neural network.
[0045] For example, see Figure 2, is a flow chart of outputting the road occupation business identification result of the target monitoring device according to the embodiment of the present application. 10 monitoring devices are deployed on the target road, and different monitoring devices can collect road images of different areas. If the target monitoring device is monitoring device 5, in order to output the road occupation business identification result of the target monitoring device, the target edge computing node receives the real-time feature graphs of other monitoring devices except monitoring device 5, and fuses all real-time feature graphs according to the set association vector of monitoring device 5 to obtain the real-time fusion feature; the real-time fusion feature is input into the classifier in the target edge computing node to obtain the road occupation business identification result of monitoring device 5, and the road occupation business identification result of monitoring device 5 can reflect whether there is road occupation business behavior in the corresponding area of monitoring device 5.
[0046] It can be understood that at the same time, each monitoring device will obtain the road occupation business identification results in the corresponding area.
[0047] S14, formulating management measures based on the road occupation business identification results.
[0048] In one embodiment, in response to the identification result of occupying the road for business being occupied by the business, the location information of the monitoring device corresponding to the identification result of occupying the road for business is sent to the management personnel. The management personnel can promptly receive the location information of the business behavior occupying the road in the target road, and formulate management measures in time to stop the business behavior occupying the road.
[0049] In this way, the identification of road-blocking business on the target road is achieved. Based on the monitoring equipment deployed on the target road and the edge computing unit in the monitoring equipment, the location information of the road-blocking business behavior on the target road can be quickly and accurately obtained, and the location information can be sent to the management personnel in a timely manner.
[0050] In one embodiment, in order to realize the recognition of road occupation business on the target road, the image encoder and classifier of the edge computing unit need to be trained; the parameters of the image encoders in different edge computing units are shared, but the parameters of the classifiers in different edge computing units are not shared. Taking the target edge computing unit as an example, the training method of the image encoder and classifier is introduced in detail. The target edge computing unit is an edge computing unit deployed in the target monitoring device, and the target monitoring device is any one of the multiple monitoring devices deployed on the target road. Please refer to Figure 3 FIG. 2 is a flowchart of a method for training an image encoder and a classifier in a target edge computing unit provided in a preferred embodiment of the present application. The training method includes steps S21 to S24.
[0051] S21, collecting road images of all monitoring devices at the same historical moment, and obtaining labels of target road images to obtain a set of training data, wherein the labels include road occupation business and non-road occupation business, and the target road image is a road image collected by the target monitoring device.
[0052] In one embodiment, at any historical moment, road images of all monitoring devices at that historical moment are collected, and the road images collected by the target monitoring device are used as target road images. The target road image corresponds to a label, which is road occupation business or non-road occupation business. In this way, a set of training data for the target edge computing unit is obtained.
[0053] For example, there are 10 monitoring devices on the target road, and the target monitoring device is monitoring device 5; at the historical moment The collected training data is ,in, Representing historical moments Download the road image of the second monitoring device; Representing historical moments Download the road image of the first monitoring device; Representing historical moments The road image of the third monitoring device is shown below; Representing historical moments The road image of the fourth monitoring device is shown below; Representing historical moments The road image of the sixth monitoring device is shown below; Representing historical moments The road image of the 7th monitoring device is shown below; Representing historical moments The road image of the 8th monitoring device is shown below; Representing historical moments The road image of the 9th monitoring device is shown below; Representing historical moments The road image of the 10th monitoring device is shown below; Representing historical moments The target road image corresponding to the target monitoring device; Representing historical moments Select the label of the target monitoring device.
[0054] In this way, multiple sets of training data can be collected based on the road images of all monitoring devices at multiple historical moments.
[0055] S22, input all road images in a set of training data into the image encoder to obtain a feature map of each road image, and obtain a fusion result of all feature maps, which is input into the classifier in the target edge computing unit to output a recognition result of the target road image.
[0056] In one embodiment, all road images in a set of training data include target road images of the target monitoring device and road images of other monitoring devices other than the target monitoring device. Figure 4 , is a schematic diagram of the recognition result of the target road image in the output training data provided by the preferred embodiment of the present application. All road images in a set of training data are sent to the image encoder in the corresponding edge computing unit to output the feature map of each road image. feature maps, where It can be understood that the parameters of the image encoders in different edge computing units are shared, that is, the target road image and other road images other than the target road image are subjected to the same feature extraction operation. Further, the fusion results of all feature maps are obtained and input into the classifier in the target edge computing unit to output the recognition result of the target road image.
[0057] In an optional embodiment, obtaining the fusion results of all feature maps includes: setting an initial weighting vector, the initial weighting vector includes an initial weight of each feature map, and the initial weight of each feature map is the same; calculating the fusion results of all feature maps based on the initial weighting vector, and the fusion results satisfy the relationship:
[0058] in, For the Zhang feature map, is the number of road images in a set of training data, is the number of feature maps corresponding to a road image, represents the number of all feature maps in a set of training data, is the initial weight, is the fusion result of all feature maps.
[0059] In another optional embodiment, obtaining the fusion result of all feature maps includes: performing weighted fusion on all feature maps according to the weight vector of the current training to obtain the fusion result of all feature maps; inputting the fusion result into the classifier in the target edge computing unit to obtain the recognition result of the target road image in the current training; calculating the cross entropy loss of the target road image in the current training, and calculating the gradient size of each feature map based on the cross entropy loss; normalizing the gradient sizes of all feature maps to obtain the weight vector for the next training; in response to the current training being the first training, the weight vector of the current training is the initial weight vector.
[0060] In this way, the recognition result of the target road image is obtained based on a set of training data, and the recognition result is the road occupation business recognition result predicted by the classifier.
[0061] S23, calculating the loss function value, and using the gradient descent method to update the image encoder and the classifier, completing one training.
[0062] In one embodiment, the loss function value satisfies the relationship:
[0063] in, The target road image The cross entropy loss is The target road image Tags, The target road image The recognition result of For road images No. Zhang feature map, For road images No. Zhang feature map, Representation calculation and The Hadamard is the number of feature maps corresponding to a road image, is the number of road images in a set of training data, Represents the target road image The cross entropy loss has an effect on The gradient of the feature map, is the loss function value.
[0064] in, is the cross entropy loss, which is used to constrain the target road image The recognition results and target road image The labels are the same, so that the classifier and image encoder learn the mapping relationship between the road image and the road occupation recognition result, and obtain the target road image Correct recognition result.
[0065] in, Used to reflect road images No. The feature map and The closer the value is to 0, the stronger the road image is. The corresponding The feature map and The smaller the correlation between the feature maps, the smaller the As part of the loss function value, it is used to constrain the road image Corresponding The feature maps are independent of each other, that is, one feature map corresponds to one feature, which ensures that the image encoder can learn different types of features in a road image and improve the diversity of feature maps.
[0066] in, It is used to constrain the gradient of the classifier output to irrelevant feature maps to become sparse, thereby reducing the target road image The degree of dependence of the recognition results on irrelevant feature maps; The target road image The cross entropy loss has an effect on The gradient size of the feature map, used to characterize the feature map Target road image The correlation of the recognition results can be used to characterize the feature graph Target road image The recognition effectiveness of the recognition results to achieve the target road image The recognition results accurately quantify the recognition effectiveness of each feature map.
[0067] In one embodiment, the image encoder and the classifier are updated using a gradient descent method to complete a training.
[0068] It can be understood that since the parameters of the image encoders in different edge computing units are shared, the parameters of the classifiers in different edge computing units are not shared. When the image encoder and classifier in the target edge computing unit are trained, the classifier of the target edge computing unit and the image encoders in all edge computing units can be updated.
[0069] S24, iteratively training the image encoder and the classifier, and in response to the loss function value being less than a set value, obtaining the trained image encoder and classifier in the target edge computing unit.
[0070] In one embodiment, new training data is continuously collected, and the image encoder and classifier are iteratively updated until the loss function value is less than a set value, thereby obtaining the trained image encoder and classifier in the target edge computing unit. The set value is 0.01.
[0071] In this way, the training of the image encoder and classifier in the target edge computing unit is completed according to the method of step S21 to step S24; the training of the image encoder and classifier in the edge computing unit corresponding to each monitoring device can be obtained according to the same method. Since the parameters of the image encoders in different edge computing units are shared, the parameters of the classifiers in different edge computing units are not shared, the N monitoring devices on the target road need to train a total of 1 image encoder and N classifiers.
[0072] This application also provides a smart city decision-making system based on edge computing. Figure 5 is a block diagram of a smart city decision-making system based on edge computing according to an embodiment of the present application. Figure 5 As shown, the device 50 includes a processor and a memory, and the memory stores computer program instructions. When the computer program instructions are executed by the processor, a smart city decision-making method based on edge computing according to the first aspect of the present application is implemented. The device 50 also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, whose settings and functions are known in the art, so they are not repeated here.
[0073] In the present application, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in this application may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.
[0074] It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present application, and these modifications and improvements are all within the scope of protection of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the attached claims.
Claims
1. A smart city decision-making method based on edge computing, characterized in that: For identifying a target road for road occupation, the target road is deployed with a plurality of monitoring devices including edge computing units, the method comprising: In one edge computing unit, a trained image encoder extracts features from a real-time road image collected by a monitoring device to obtain a real-time feature map of the monitoring device, wherein parameters of the image encoders in different edge computing units are shared; In response to the target monitoring device receiving the real-time feature graphs of other monitoring devices, weighted summing of the real-time feature graphs is performed based on the set association vector of the target monitoring device to obtain the real-time fusion feature, wherein the set association vector includes the association degree between the road occupation business identification result of the target monitoring device and each real-time feature graph; The real-time fusion features are input into the trained classifier in the target edge computing unit to output the road-blocking business identification result of the target monitoring device, wherein the target edge computing unit is an edge computing unit within the target monitoring device, and the parameters of the classifiers in different edge computing units are not shared; management measures are formulated based on the road-blocking business identification result.
2. A smart city decision-making method based on edge computing as claimed in claim 1, characterized in that: The image encoder is a convolutional neural network, the classifier includes a fully connected neural network and a classification function, and the classification function is a softmax function.
3. The smart city decision-making method based on edge computing as claimed in claim 1, characterized in that: The real-time fusion feature satisfies the relationship: ; in, For the Real-time feature map, is the number of real-time road images, is the number of real-time feature maps corresponding to a real-time road image, The road occupation identification result of the target monitoring device is The correlation degree of the real-time feature graph, Real-time feature fusion.
4. A smart city decision-making method based on edge computing as claimed in claim 3, characterized in that: The method for obtaining the set association vector of the target monitoring device includes: For a set of training data, the feature maps of all road images are obtained according to the trained image encoder, and the mean of all feature maps is input into the trained classifier in the target edge computing unit to obtain the recognition result of the target road image; Calculating the cross entropy loss of the recognition result and the label corresponding to the target road image, and calculating the gradient size of each feature map based on the cross entropy loss; The gradient sizes of all feature maps are normalized to obtain the normalized vectors corresponding to the training data, and the average value of the normalized vectors corresponding to all training data is calculated to obtain the set association vector of the target monitoring device.
5. A smart city decision-making method based on edge computing as claimed in claim 4, characterized in that: The gradient size satisfies the relationship: ; in, is the first Zhang feature map, and The target road images are The recognition results and labels of The target road image The cross entropy loss is For the The gradient size of the feature map.
6. The smart city decision-making method based on edge computing as claimed in claim 1, characterized in that: The training methods of the image encoder and classifier in the target edge computing unit include: The road images of each monitoring device at any historical moment and the labels of the target monitoring device are used as a set of training data, wherein the labels include road occupation and non-road occupation; Input the road image into an image encoder to obtain a feature map of each road image, obtain a fusion result of all feature maps, and input the fusion result of all feature maps into a classifier to output a recognition result of the target monitoring device; A loss function value is obtained according to the cross entropy of the recognition result and the label, and the image encoder and the classifier are updated using the gradient descent method; the image encoder and the classifier are iteratively trained, and the training is completed in response to the loss function value being less than a set value.
7. A smart city decision-making method based on edge computing as claimed in claim 6, characterized in that: The loss function value satisfies the relationship: ; in, The target road image The cross entropy loss is The target road image Tags, The target road image The recognition result of For road images No. Zhang feature map, For road images No. Zhang feature map, Representation calculation and The Hadamard is the number of feature maps corresponding to a road image, is the number of road images in a set of training data, Represents the target road image The cross entropy loss has an effect on The gradient of the feature map, is the loss function value.
8. A smart city decision-making method based on edge computing as claimed in claim 6, characterized in that: The obtaining of the fusion results of all feature maps includes: An initial weight vector is set, wherein the initial weight vector includes an initial weight of each feature map, and the initial weight of each feature map is the same; The fusion results of all feature maps are calculated based on the initial weighted vector, and the fusion results satisfy the relationship: ; in, For the Zhang feature map, is the number of road images in a set of training data, is the number of feature maps corresponding to a road image, represents the number of all feature maps in a set of training data, is the initial weight, is the fusion result of all feature maps.
9. A smart city decision-making method based on edge computing as claimed in claim 8, characterized in that: The step of obtaining the fusion results of all feature maps further includes: Perform weighted fusion on each feature map according to the weighted vector of the current training to obtain the fusion result of all feature maps, input the fusion result into the classifier in the target edge computing unit, and obtain the recognition result of the target road image in the current training; Calculating the cross entropy loss of the target road image in the current training, and calculating the gradient size of each feature map based on the cross entropy loss; The gradient sizes of all feature maps are normalized to obtain a weight vector for the next training; wherein, in response to the current training being the first training, the weight vector for the current training is an initial weight vector.
10. A smart city decision-making system based on edge computing, characterized in that: It comprises a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a smart city decision-making method based on edge computing according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Vision-based illegal operation detection method and system
CN114155217A
Self-learning migration method based on feature sharing
CN112990340A
Pedestrian re-recognition method for shielding scene
CN114022686A
Remote fish decay prediction data acquisition method based on edge calculation
CN116304656A
Method for identifying lane line type, intelligent device and storage medium
CN118521991A