An image-based urban management case classification method
By improving the EfficientNet-B0 image classification network and combining the CA attention module and SPPF pooling module, structured grouping channel pruning and multi-teacher distillation training were performed, which solved the problems of low efficiency and high computational resource consumption of manual classification in the urban management case management system, and realized automated, accurate case classification and real-time processing.
Patent Information
- Application Number
- CN202511148660.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-08-18
AI Technical Summary
In the existing urban management case management system, manual classification is inefficient, cumbersome, and has inconsistent classification standards, resulting in low accuracy and efficiency in case handling, as well as high consumption of computing resources, which affects the system's real-time response capabilities.
We adopted the EfficientNet-B0 image classification network, replaced the SE module and SPPF pooling module with the CA attention module, and combined it with structured grouping channel pruning and multi-teacher distillation training to construct a classification network for urban management cases, thereby optimizing the model structure and reducing computational resource consumption.
It enables automatic and accurate classification of urban management cases, reduces reliance on manual labor, improves processing efficiency, enhances classification accuracy, meets real-time and resource efficiency requirements, and the lightweight model can be deployed to mobile devices for real-time classification.
Smart Images

Figure CN120656002B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer vision, in particular to an image-based urban management case classification method. BACKGROUND
[0002] In the existing urban management case management system, case reporting needs on-site staff to take photos of the problem area and manually select the corresponding case type for classification and reporting. With the continuous acceleration of urbanization, the number of cases is growing rapidly, and the traditional manual classification method has many problems: first, manual classification is low in efficiency and the operation process is complicated, which not only increases the work burden of the reporting personnel, but also reduces the overall response speed of the system; second, manual classification is prone to non-uniform classification standards and judgment errors, which affects the accuracy of case handling and the execution efficiency of subsequent links; at the same time, in order to ensure the standardization of manual classification, a large amount of training resources need to be invested, further increasing the operating cost of the system. Therefore, it is of great significance to introduce artificial intelligence technologies such as deep learning into the traditional urban management case management system to realize automatic recognition and accurate classification of urban management cases, optimize the case reporting process, and improve the efficiency of case management and promote the intelligent transformation of the urban management case management system.
[0003] For the classification of urban management cases, the existing technology uniformly converts case images into fixed-pixel grayscale images, normalizes the brightness and contrast, and inputs them into an 8-layer convolutional network after ZCA whitening to realize automatic classification of cases; however, this scheme consumes a large amount of computing resources in the image preprocessing stage, affecting the real-time response capability of the system. SUMMARY
[0004] In order to overcome at least one of the deficiencies in the prior art, the present application provides an image-based urban management case classification method.
[0005] In a first aspect, an image-based urban management case classification method is provided, comprising:
[0006] Obtaining an urban management case dataset, the samples in the urban management case dataset being urban management case images and case category labels;
[0007] Constructing an urban management case classification network, comprising: based on EfficientNet-B0, replacing the original SE module in EfficientNet-B0 with a CA attention module, replacing the global average pooling layer before the fully connected layer in EfficientNet-B0 with a SPPF pooling module, to obtain an improved EfficientNet-B0; structurally grouping and channel pruning the improved EfficientNet-B0 to obtain the urban management case classification network;
[0008] The trained urban management case classification network is obtained by performing multi-teacher distillation training on the urban management case classification network based on the urban management case data set.
[0009] The urban management case image to be classified is input into the trained urban management case classification network to obtain a case category prediction result.
[0010] In one embodiment, an urban management case data set is obtained, including:
[0011] The urban management case data set is cleaned, the categories are adjusted, and the urban management case data set is expanded.
[0012] In one embodiment, the improved EfficientNet-B0 is structurally grouped and pruned to obtain an urban management case classification network, including:
[0013] The improved EfficientNet-B0 is sparsely trained to determine the weights of each channel and to determine the minimum weight value and the maximum weight value.
[0014] A pruning rate is set, and the pruning weight threshold is calculated according to the minimum weight value and the maximum weight value.
[0015] According to the pruning weight threshold, different pruning strategies are used to prune the channels of the ordinary convolution structure, the depth separable convolution structure and the convolution structure with residual connection in the improved EfficientNet-B0 to obtain the urban management case classification network.
[0016] In one embodiment, the improved EfficientNet-B0 is sparsely trained, and the loss function used is:
[0017]
[0018]
[0019] wherein, L SR is the loss function during sparse training, L weighted is a weighted cross-entropy loss function, L1 is a regularization term, SR is a sparsity rate, C is the total number of channels, γ c is the weight of the i-th channel. c
[0020] In one embodiment, a pruning rate is set, and the pruning weight threshold is calculated according to the minimum weight value and the maximum weight value, using the following formula:
[0021]
[0022] wherein, M is a pruning weight threshold, γ min is a minimum weight value, γ max is a maximum weight value, PR is a pruning rate.
[0023] In one embodiment, according to the pruning weight threshold, different pruning strategies are used to prune the channels of the improved ordinary convolution structure, depth separable convolution structure and convolution structure with residual connection in the improved EfficientNet-B0, to obtain the urban management case classification network, including:
[0024] For the ordinary convolution structure, the channels with weights lower than the threshold i in the layer and the layer i +1 are removed; M
[0025] For the depth separable convolution structure, in the layer i , the channels with weights lower than the threshold M are removed, assuming that there are m channels pruned, then the first i channels with smaller weights are synchronously removed in the layer m +1, and the layer i +1 is a depth convolution layer;
[0026] For the convolution structure with residual connection, the channels with weights lower than j are removed in the layer M , assuming that there are n channels removed, then the first k channels with smaller weights are synchronously removed in the layer n .
[0027] In one embodiment, the urban management case classification network is trained by multi-teacher distillation based on the urban management case data set, to obtain the trained urban management case classification network, including:
[0028] EfficientNet-B4, the improved EfficientNet-B0 and EfficientNetV2 are selected as the teacher network, the urban management case classification network is selected as the student network, the distillation temperature T is set, and the urban management case classification network is trained by multi-teacher distillation to obtain the trained urban management case classification network.
[0029] In one embodiment, the total loss used in the multi-teacher distillation training is:
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037] wherein, L Total is the total loss, L S is the student loss, L D is the distillation loss, N denotes the number of samples, C is the number of classes, is the weight of the j th class, is the true label of the sample i , is the probability predicted by the student model s for the sample at the distillation temperature T to be of the i th class, j is the weight of the teacher model , A is the number of teacher models, denotes the teacher model , is the probability predicted by the teacher model for the sample at the distillation temperature T to be of the i th class; j represents the cross-entropy loss between the teacher model and the student model s; is the unnormalized prediction score of the sample by the teacher model on the class i ; j is the unnormalized prediction score of the sample by the student model s on the class i . j
[0038] In a second aspect, an image-based urban management case classification device is provided, comprising:
[0039] a data set acquisition module configured to acquire an urban management case data set, wherein samples in the urban management case data set are urban management case images and case category labels;
[0040] The network construction module is configured to construct a city management case classification network, including: based on EfficientNet-B0, replacing the original SE module in EfficientNet-B0 with a CA attention module, replacing the global average pooling layer before the full connection layer in EfficientNet-B0 with a SPPF pooling module, to obtain an improved EfficientNet-B0; performing structured grouping channel pruning on the improved EfficientNet-B0 to obtain the city management case classification network.
[0041] The network training module is configured to perform multi-teacher distillation training on the city management case classification network based on a city management case data set, to obtain a trained city management case classification network.
[0042] The classification module is configured to input the city management case image to be classified into the trained city management case classification network, to obtain a case category prediction result.
[0043] In a third aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the computer program implements the image-based city management case classification method described above.
[0044] Compared with the prior art, the present application has the following beneficial effects: the present application can automatically and accurately classify city management cases in real time, optimize the case reporting process, reduce the dependence on human experience, reduce human error, and improve the efficiency of city management case processing. At the same time, in view of the complexity and diversity of the city management case classification task in the actual application scenario, the model structure is optimized in a targeted manner, effectively improving the case classification accuracy. In addition, through the model lightening strategy, the inference speed is improved, meeting the real-time and resource efficiency requirements of the system in actual application. Finally, the city management case classification model is deployed to the mobile terminal to classify the city management cases in real time. BRIEF DESCRIPTION OF DRAWINGS
[0045] The present application can be better understood by referring to the description given below in conjunction with the accompanying drawings, which are included in the specification and form a part of the specification. In the drawings:
[0046] Figure 1 A flowchart of an image-based city management case classification method is shown;
[0047] Figure 2 A city management case classification data set hierarchy and a part of the category image data instance are shown;
[0048] Figure 3 A schematic diagram showing the improvement of EfficientNet-B0 is shown;
[0049] Figure 4 Channel pruning process schematic diagram is shown, wherein (a) is a channel pruning process of a normal convolution structure, (b) is a channel pruning process of a depth separable convolution structure, and (c) is a channel pruning process of a convolution structure with a residual connection;
[0050] Figure 5 A schematic diagram of multi-teacher distillation training is shown.
[0051] Figure 6 A case reporting interface schematic diagram is shown. DETAILED DESCRIPTION
[0052] In the following, exemplary embodiments of the present application will be described with reference to the accompanying drawings. In the description, not all features of a practical embodiment are described in order to be clear and concise. It should be appreciated, however, that many embodiment-specific decisions can be made in the process of developing any such practical embodiment in order to achieve the specific goals of the developer, and these decisions can vary from embodiment to embodiment.
[0053] It should also be noted here that, in order to avoid obscuring the present application with unnecessary details, only the device structure closely related to the scheme according to the present application is shown in the accompanying drawings, and other details not closely related to the present application are omitted.
[0054] It should be understood that the present application is not limited to the described embodiments by virtue of the following description with reference to the drawings. In this context, embodiments can be combined with each other, features can be replaced or borrowed between different embodiments, and one or more features can be omitted in an embodiment.
[0055] The embodiment of the present application provides a kind of image-based urban management case classification method, Figure 1 The flow chart of the image-based urban management case classification method is shown, referring to Figure 1 The method mainly includes the following steps:
[0056] Step S1, obtain urban management case data set, the sample in urban management case data set is urban management case image and case category label.
[0057] Export historical case data from the existing urban management case management system, filter out the case entries containing image information; and according to the original case category label in the system, the data set composed of urban management case image and case category label is obtained by classification and arrangement.
[0058] Further, the original urban management case data set is cleaned, the category is adjusted and expanded. The specific processing process is as follows:
[0059] In the original dataset, there are cases of picture blur, repetition, misclassification, multiple targets, or no target objects. In order to ensure the quality and reliability of the dataset and improve the accuracy of subsequent model training, the collected urban management case pictures are screened and cleaned according to the following principles:
[0060] 1) The target object is clear and occupies the main part of the picture. Ensure that the target object in the picture occupies the main visual area of the picture, so that the subsequent model training can accurately identify and understand the target object.
[0061] 2) The image should only contain one kind of case category target object. Each picture should only contain one kind of case category target object, ensuring that the picture's labeling and classification are clear, avoiding ambiguity.
[0062] 3) The image should accurately reflect the characteristics of a certain case or target object. The image content should be the scene after the case occurs, and cannot be an image during or after the case is handled.
[0063] 4) The same case image cannot be repeated. Ensure that each picture is unique, avoiding the impact of repeated data on model training and evaluation, and ensuring the accuracy of model evaluation.
[0064] In the original case category, there are cases where target objects with the same characteristics are classified into different case types, and target objects with different characteristics are classified into the same case type, i.e., case repetition classification and comprehensive classification problems, which make the label information of the dataset not accurate and clear, affecting the training effect and classification performance of the model.
[0065] In the case of repeated classification, target objects with the same characteristics are assigned to different case types. For example, for the target objects of the three case categories of unlicensed catering, street occupation, and unlicensed business, the image characteristics of the case occurrence are basically the same. For the problem of repeated classification, the category merging strategy is used, and case types with the same characteristics or similar attributes are summarized into the same category, reducing redundant categories.
[0066] In the case of comprehensive classification, target objects with different characteristics are summarized into the same case type. For example, the street light problem mainly includes street light head damage, maintenance opening exposed, and stand pole leaning. The characteristics of these three are obviously quite different, but they are summarized into the same category. For the problem of comprehensive classification, the splitting method is used to further subdivide the original case categories that are too broad, and to assign target objects with different characteristics to corresponding subcategories, improving the accuracy and granularity of the dataset classification.
[0067] In the case of urban management, there are some low-frequency case categories, which result in less image data for these categories. To address the lack of data for low-frequency cases, the application adopts image augmentation methods to expand the image data for these categories. Specific methods include: vertical and horizontal flipping, 90°, 180°, and 270° rotation followed by scaling, random color transformation, adding Gaussian noise and salt and pepper noise, etc.
[0068] In the urban management case classification data set, the case categories are divided into two parts: event problems and component problems. Event problems refer to events or situations that occur in the city, such as posting illegal small advertisements, outdoor business operations, road water accumulation, etc. Component problems refer to problems caused by damage to urban infrastructure or equipment, including road damage, green plant loss, manhole cover damage, etc. In the event / component category, the categories are divided into 11 major categories, covering propaganda and advertising, emergencies, landscaping facilities, and building facilities. In each major category, the subcategories are further divided, such as exposed garbage, water pollution, and street hanging, which belong to the city environment category, and are divided into 84 subcategories. Figure 2 The hierarchical structure of the urban management case classification data set and the image data instances of the component categories are shown.
[0069] Step S2, constructing the urban management case classification network, including: based on EfficientNet-B0, replacing the original SE module in EfficientNet-B0 with CA attention module, replacing the global average pooling layer before the fully connected layer in EfficientNet-B0 with SPPF pooling module, obtaining the improved EfficientNet-B0; performing structured grouping channel pruning on the improved EfficientNet-B0 to obtain the urban management case classification network.
[0070] Several mainstream image classification models are selected for training and performance evaluation on the urban management case data set. Considering the accuracy, model parameter quantity and inference speed, the model with better classification performance is selected as the base model.
[0071] Under the same experimental environment, the common classification network models VGG, ResNet, DenseNet, ShuffleNet, MobileNet, EfficientNet, and Transformer are trained and tested. The results are shown in Table 1:
[0072] Table 1 Experimental results of mainstream classification models on urban management case classification data set
[0073]
[0074] Considering the classification accuracy of the model on urban management cases, as well as the parameter quantity, calculation quantity and memory size of the model, EfficientNet-B0 is specifically selected, with an accuracy of 88.72%, a parameter quantity of 4.12M, a calculation quantity of 0.39G and an inference speed of 10FPS, as the basic model for classification of urban management cases.
[0075] In view of the problems of insufficient attention of EfficientNet-B0 to the target region of complex scene images in the classification task of urban management cases, general adaptability to input images of different sizes and resolutions, and classification deviation caused by class imbalance, improvement is made. Figure 3 The schematic diagram of improving EfficientNet-B0 is shown, and the specific improvements are as follows:
[0076] The original EfficientNet-B0 includes a first reverse residual bottleneck convolution module (MBConv1) and a plurality of second reverse residual bottleneck convolution modules (MBConv6) connected in turn, and the specific structure is shown in Figure 3 , MBConv1 corresponds to n = 1, MBConv6 corresponds to n = 6, and n is a scaling coefficient. Here, the original SE module in MBConv1 and each MBConv6 is replaced by a CA attention module. The original EfficientNet-B0 also includes an output layer, and the specific structure is shown in Figure 3 , and a spatial pyramid fast pooling module (SPPF pooling module) is used to replace the global average pooling layer before the fully connected layer in the output layer.
[0077] Replacing the original SE module in EfficientNet-B0 with a CA attention module can make the model pay attention to both the spatial position information of the target object in the urban management case image and the importance between different feature channels while keeping the model complexity from increasing too much, compared with directly adding a CA module in the network, thereby improving the classification accuracy of the model on urban management cases.
[0078] Replacing the global average pooling layer before the fully connected layer in EfficientNet-B0 with a SPPF pooling module obtains an improved EfficientNet-B0 (EfficientNet-CASPPF for short), which not only solves the problem of different sizes and resolutions of urban management case images, but also obtains multi-scale features of the case image. The model takes the case image photographed by the urban management case reporter as input and outputs the category of the case. The improved EfficientNet-B0 has an accuracy of 93.36%, a parameter quantity of 3.98M, a calculation quantity of 0.41G and an inference speed of 9FPS.
[0079] The improved EfficientNet-B0 is pruned by structural grouping channel pruning to obtain the urban management case classification network, so as to remove low importance channels, reduce the model parameter quantity and calculation quantity, and improve the model inference speed.
[0080] In step S3, the urban management case classification network is trained by multi-teacher distillation based on the urban management case data set, and the trained urban management case classification network is obtained.
[0081] In step S4, the urban management case image to be classified is input into the trained urban management case classification network, and the case category prediction result is obtained.
[0082] In this embodiment, historical image data is exported from the urban management case management system and preprocessed to construct an urban management case image data set that meets actual needs. The EfficientNet-B0 is improved, and the model is optimized by structural channel pruning. The improved model is distilled to significantly reduce the model parameter quantity and calculation quantity. The urban management case classification network generated by training is used for urban management case image classification to effectively improve the accuracy of case classification.
[0083] In one embodiment, step S2, the improved EfficientNet-B0 is pruned by structural grouping channel pruning to obtain the urban management case classification network, comprising:
[0084] First, the improved EfficientNet-B0 is trained by sparsification at a sparsity of 0.00025 to determine the weights of each channel and the minimum and maximum weight values. After sparsification training, the weights of most channels tend to 0, while the classification accuracy remains basically stable.
[0085] The loss function used in sparsification training is:
[0086]
[0087]
[0088] wherein, L SR is the loss function during sparsification training, L weighted is a weighted cross-entropy loss function, L1 is a regularization term, and each channel weight scaling factor is introduced into the loss function to gradually reduce the weight factor of unimportant channels and eventually approach zero. SR is the sparsity, C is the total number of channels, γ c is the weight of the i th channel. c
[0089] Then, the pruning rate is set, and the pruning weight threshold is calculated according to the minimum weight value and the maximum weight value. The following formula is adopted:
[0090]
[0091] wherein, M is the pruning weight threshold, γ min is the minimum weight value, γ max is the maximum weight value, PR is the pruning rate.
[0092] Here, the pruning rate is preferably 40%. The specific analysis process is as follows:
[0093] Experiments with pruning rates of 10%, 20%, 30%, 40% and 50% are set respectively, and the results are shown in Table 2.
[0094] Table 2 Performance of models with different pruning rates
[0095]
[0096] Considering the accuracy, parameter quantity and inference speed of the model, a pruning rate of 40% is a relatively balanced choice. Under this pruning rate, the accuracy of the model remains at a high level, and the reduction of parameter quantity and the improvement of inference speed are also relatively significant. Therefore, the pruning rate is set to 40%,
[0097] Then, according to the pruning weight threshold, different pruning strategies are adopted for the ordinary convolution structure, the depth separable convolution structure and the convolution structure with residual connection in the improved EfficientNet-B0 to perform channel pruning, and the urban management case classification network is obtained.
[0098] Figure 4 The channel pruning process is shown in the schematic diagram, wherein (a) is the channel pruning process of the ordinary convolution structure, (b) is the channel pruning process of the depth separable convolution structure, and (c) is the channel pruning process of the convolution structure with residual connection.
[0099] Referring to (a) in Figure 4 , for the ordinary convolution structure, since there is no inherent channel dependency between the convolution layers, the channels with weights lower than the threshold i in the first i layer and the first M +1 layer are removed;
[0100] Referring to (b) in Figure 4 , for the depth separable convolution structure, it is necessary to ensure that the number of input channels and output channels of the depth convolution is consistent. In the first i layer, the channels with weights lower than the thresholdM channels are pruned, the first m channels with smaller weights are removed synchronously in the i layer, and the m layer is a deep convolutional layer to ensure consistency of the number of input and output channels of the deep convolution. i
[0101] Referring to (c) in the figure, for a convolutional structure with a residual connection, the channels with weights less than Figure 4 are removed in the j layer, and assuming that M channels are removed, the first n channels with smaller weights are removed synchronously in the k layer to ensure that the number of channels of the residual path and the trunk path after pruning matches, so that the feature information can be correctly superimposed. n In one embodiment, in order to make up for the loss of model accuracy caused by structured group pruning, the urban management case classification network is subjected to multi-teacher distillation training,
[0102] a schematic diagram of multi-teacher distillation training is shown, step S3, based on the urban management case data set, the urban management case classification network is subjected to multi-teacher distillation training to obtain the trained urban management case classification network, specifically including: Figure 5 EfficientNet-B4, improved EfficientNet-B0 (EfficientNet-CASPPF) and EfficientNetV2 are selected as teacher networks, the urban management case classification network (Pruned-EfficientNet-CASPPF) is selected as a student network, the distillation temperature T is set to 4, the urban management case classification network is subjected to multi-teacher distillation training to obtain the trained urban management case classification network.
[0103] The total loss used in multi-teacher distillation training is:
[0104]
[0105]
[0106]
[0107]
[0108]
[0109]
[0110]
[0111]
[0112] in, L Total is the total loss, L S Losses for students, L D is the distillation loss, N represents the number of samples, C is the number of categories, For the j The weight of the class, y ij For samples i The true label, For the student model s, at the distillation temperature T Next, the sample i Predicted to be j The probability of the class, w a Model for teachers a The weight of , A is the number of teacher models, Represents the teacher model , at distillation temperature T Next, the sample i Predicted to be j class probability; Representative teacher model Cross entropy loss with the student model s; Model for teachers For samples i In category j The unnormalized prediction score above is calculated by the model; For the student model s pairs of samples i In category j The unnormalized prediction score above, calculated by the model. is the temperature scaling factor, which is an artificially set hyperparameter, that is, the square of the distillation temperature T.
[0113] The final trained urban management case classification network has an accuracy rate of 92.14%, a parameter size of 1.54M, a computational size of 0.22G, and an inference speed of 17FPS.
[0114] Furthermore, the trained urban management case classification network is converted into ONNX (Open Neural Network Exchange) format and deployed to the mobile terminal of urban management patrol personnel. After inputting the urban management case image, the model can output the case category prediction results in real time, assisting urban management personnel in making rapid classification and judgment, and realizing the "instant shot and instant judgment" urban management case processing process. Figure 6 A schematic diagram of the case reporting interface is shown.
[0115] The embodiment also provides an image-based urban management case classification device corresponding to the image-based urban management case classification method, which has the same inventive concept as the image-based urban management case classification method.
[0116] A dataset obtaining module is configured to obtain an urban management case dataset, wherein samples in the urban management case dataset are urban management case images and case category labels.
[0117] A network constructing module is configured to construct an urban management case classification network, including: based on EfficientNet-B0, replacing an original SE module in the EfficientNet-B0 with a CA attention module, replacing a global average pooling layer before a full connection layer in the EfficientNet-B0 with a SPPF pooling module, to obtain an improved EfficientNet-B0; and performing structural grouping channel pruning on the improved EfficientNet-B0, to obtain the urban management case classification network.
[0118] A network training module is configured to perform multi-teacher distillation training on the urban management case classification network based on the urban management case dataset, to obtain a trained urban management case classification network.
[0119] A classification module is configured to input an urban management case image to be classified into the trained urban management case classification network, to obtain a case category prediction result.
[0120] The image-based urban management case classification device has the same inventive concept as the image-based urban management case classification method described above, and therefore the specific embodiments of the device can be seen in the embodiment part of the image-based urban management case classification method described above, and the technical effects of the device correspond to those of the method, which will not be described here again.
[0121] In summary, the present application has the following technical effects:
[0122] The present application can automatically and accurately classify urban management cases in real time, optimize the case reporting process, reduce the dependence on human experience, reduce human error, and improve the efficiency of urban management case processing. At the same time, in view of the complexity and diversity of the urban management case classification task in the actual application scenario, the model structure is optimized accordingly, effectively improving the case classification accuracy. In addition, through the model lightening strategy, the inference speed is improved, meeting the real-time and resource efficiency requirements of the system in actual application. Finally, the urban management case classification model is deployed to the mobile end to classify urban management cases in real time.
[0123] The above merely provides the various embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An image-based urban management case classification method, characterized in that, The method comprises the following steps: obtain a city management case data set, wherein samples in the city management case data set are city management case images and case category labels; construct a city management case classification network, comprising: based on EfficientNet-B0, replacing the original SE module in EfficientNet-B0 with a CA attention module, replacing the global average pooling layer before the full connection layer in EfficientNet-B0 with a SPPF pooling module, to obtain an improved EfficientNet-B0; performing structured grouping channel pruning on the improved EfficientNet-B0 to obtain a city management case classification network; based on the city management case data set, performing multi-teacher distillation training on the city management case classification network to obtain a trained city management case classification network; inputting a city management case image to be classified into the trained city management case classification network to obtain a case category prediction result; wherein, the structured grouping channel pruning on the improved EfficientNet-B0 to obtain a city management case classification network comprises: performing sparse training on the improved EfficientNet-B0 to determine the weight of each channel, and to determine the minimum weight value and the maximum weight value; setting a pruning rate, calculating a pruning weight threshold according to the minimum weight value and the maximum weight value; according to the pruning weight threshold, using different pruning strategies to perform channel pruning on the ordinary convolution structure, the depth separable convolution structure and the convolution structure with residual connection in the improved EfficientNet-B0, to obtain a city management case classification network.
2. The method of claim 1, wherein, The method of obtaining a city management case data set comprises: cleaning, adjusting categories and expanding the city management case data set.
3. The method of claim 1, wherein, wherein, the loss function used in the sparse training on the improved EfficientNet-B0 is: in, L SR is the loss function during sparse training, L weighted is the weighted cross entropy loss function, L1 is the regularization term, SR is the sparsity rate, C is the total number of channels, γ c For the c The weight of each channel.
4. The method of claim 1, wherein, wherein, setting a pruning rate, calculating a pruning weight threshold according to the minimum weight value and the maximum weight value, using the following formula: wherein, M is a pruning weight threshold, γ min is a minimum weight value, γ max is a maximum weight value, PR is a pruning rate.
5. The method of claim 1, wherein, wherein, according to the pruning weight threshold, using different pruning strategies to perform channel pruning on the ordinary convolution structure, the depth separable convolution structure and the convolution structure with residual connection in the improved EfficientNet-B0, to obtain a city management case classification network, comprising: For ordinary convolution structures, remove the i Layer and i +1 layer weights below the threshold M channel; i The layer is any convolution layer in the common convolution structure; For the depthwise separable convolutional structure, in the i In the layer, remove weights below the threshold M channel, assuming there is m channels are pruned, then i +1 layer before synchronization removal m The channel with smaller weight, i +1 layer is the depth convolution layer; i Layer is any convolutional layer in the depthwise separable convolutional structure; For the convolution structure with residual connection, the first j layer removes the channels with weights lower than M , assuming that n channels are removed, the first k layer synchronously removes the channels with smaller weights in the previous n layers; the first j layer is any convolution layer in the convolution structure with residual connection, and the first k layer is the convolution layer with residual connection to the first j layer.
6. The method of claim 1, wherein, wherein, based on the city management case data set, performing multi-teacher distillation training on the city management case classification network to obtain a trained city management case classification network, comprising: selecting EfficientNet-B4, the improved EfficientNet-B0 and EfficientNetV2 as teacher networks, taking the city management case classification network as a student network, setting a distillation temperature T, performing multi-teacher distillation training on the city management case classification network to obtain a trained city management case classification network.
7. The method of claim 6, wherein, the total loss used in the multi-teacher distillation training is: wherein, L Total is the total loss, L S is the student loss, L D is the distillation loss, N denotes the number of samples, C is the number of classes, is the weight of the j th class, is the true label of the sample i , is the probability that the student model s predicts the sample T to be of the i th class at the distillation temperature j , is the weight of the teacher model , A is the number of teacher models, denotes the probability that the teacher model predicts the sample T to be of the i th class at the distillation temperature j ; represents the cross-entropy loss between the teacher model and the student model s; is the unnormalized prediction score of the teacher model for the sample i in the class j ; is the unnormalized prediction score of the student model s for the sample i in the class j .
8. An image-based urban management case classification device, characterized in that, The method comprises the following steps: a data set acquisition module is configured to obtain a city management case data set, wherein samples in the city management case data set are city management case images and case category labels; The network construction module is configured to construct a city management case classification network, including: based on EfficientNet-B0, replacing the original SE module in EfficientNet-B0 with a CA attention module, replacing the global average pooling layer before the full connection layer in EfficientNet-B0 with a SPPF pooling module, to obtain an improved EfficientNet-B0; performing structural grouping channel pruning on the improved EfficientNet-B0 to obtain the city management case classification network; The network training module is configured to perform multi-teacher distillation training on the city management case classification network based on the city management case data set, to obtain a trained city management case classification network; The classification module is configured to input a city management case image to be classified into the trained city management case classification network, to obtain a case category prediction result. The network construction module is configured to construct a city management case classification network, including: based on EfficientNet-B0, replacing the original SE module in EfficientNet-B0 with a CA attention module, replacing the global average pooling layer before the full connection layer in EfficientNet-B0 with a SPPF pooling module, to obtain an improved EfficientNet-B0; performing structural grouping channel pruning on the improved EfficientNet-B0 to obtain the city management case classification network; The network training module is configured to perform multi-teacher distillation training on the city management case classification network based on the city management case data set, to obtain a trained city management case classification network; The classification module is configured to input a city management case image to be classified into the trained city management case classification network, to obtain a case category prediction result. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the image-based city management case classification method of any one of claims 1-7.
9. A computer-readable storage medium, characterized in that,
Citation Information
Patent Citations
Urban operation case intelligent one-key reporting method and system, medium and terminal
CN114821276A
Remote sensing image scene classification method based on MCA attention mechanism efficient network
CN118918372A