Model-based modification detection method, device, equipment and medium
By employing a model-based modification detection method, utilizing spatial and channel attention mechanism networks, and combining ResNet and FPN, the location and visual center of non-motorized vehicles are identified. This solves the problems of low efficiency and poor accuracy in existing technologies, achieving efficient and accurate detection of illegal modifications to non-motorized vehicles and meeting the requirements of the new national standard for electric vehicles.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- QINGDAO HISENSE TRANS TECH
- Filing Date
- 2025-11-24
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies are inefficient and inaccurate in detecting illegal modifications to non-motorized vehicles, making it difficult to meet the requirements of the new national standard for electric vehicles. Furthermore, traditional video surveillance cannot achieve real-time monitoring, allowing illegally modified vehicles to evade supervision.
A model-based modification detection method is adopted. By recognizing the spatial attention mechanism and channel attention mechanism network of the model, the position and visual center of non-motorized vehicles in video frame images are identified. The similarity and distance of adjacent frame images are combined to determine whether it is an illegal modification. ResNet and FPN are used for feature map extraction and the model is trained to improve detection accuracy.
It improves the accuracy and real-time performance of detecting illegal modifications to non-motorized vehicles, reduces the false recognition rate, meets the requirements of the new national standard for electric vehicles, and enhances traffic management efficiency and safety.
Smart Images

Figure CN121904403A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of deep learning technology, computer vision technology, and traffic management technology, and in particular to a model-based modification detection method, device, equipment, and medium. Background Technology
[0002] In the field of non-motorized vehicle illegal modification detection, especially after the implementation of the new national standard for electric vehicles, existing technologies face new challenges. The new national standard for electric vehicles imposes stricter requirements on the technical parameters and safety performance of vehicles, but existing technologies mainly rely on manual inspections and simple video surveillance. These methods are insufficient in terms of efficiency and accuracy to meet the requirements of the new national standard. Manual inspection is not only inefficient and unable to provide comprehensive coverage, but it is also easily affected by subjective judgment, leading to inconsistent test results. At the same time, traditional video surveillance technology cannot achieve real-time monitoring of electric vehicles, allowing illegally modified vehicles to often evade supervision, and the concealment of illegally modified parts increases the difficulty of identification. Therefore, there is an urgent need for a detection method to improve the efficiency, accuracy, and real-time performance of detection. Summary of the Invention
[0003] This application provides a model-based modification detection method, apparatus, equipment, and medium to solve the problem in related technologies where it is impossible to accurately and effectively detect non-motorized vehicle modifications.
[0004] A model-based modification detection method, the method comprising: The system receives video frame images captured by a data acquisition device installed at the intersection; inputs the video frame images into a pre-trained recognition model, wherein the spatial attention mechanism network of the recognition model identifies the position information corresponding to each non-motorized vehicle in the video frame image, and the channel attention mechanism network of the recognition model identifies whether each non-motorized vehicle in the video frame image has been illegally modified and the visual center of each non-motorized vehicle; wherein the visual center is determined based on the color characteristics of the non-motorized vehicle. For each illegally modified non-motorized vehicle identified, if the distance between the visual center of the non-motorized vehicle and the center point of its location information is less than a preset distance, and the similarity of the non-motorized vehicle in two adjacent video frames is higher than a threshold, then the non-motorized vehicle is determined to be an illegally modified non-motorized vehicle.
[0005] The above-mentioned technical solution has the following advantages or beneficial effects: In this embodiment, the electronic device inputs video frame images into the recognition model, which identifies whether the non-motorized vehicle has been illegally modified. The recognition model also identifies the visual center of the non-motorized vehicle. If the distance between the center point of the illegally modified non-motorized vehicle and the visual center is less than a preset distance, and the similarity of the non-motorized vehicle in two adjacent video frame images is higher than a threshold, it can be determined that the non-motorized vehicle has indeed been illegally modified. The recognition model can identify whether the non-motorized vehicle has been illegally modified. After identification, the distance between the center point of the illegally modified non-motorized vehicle and the visual center, and the similarity of the non-motorized vehicle in two adjacent video frame images, can be used to determine whether the illegally modified non-motorized vehicle is a misidentification caused by the complex background of the recognition model. This can further improve the accuracy of detecting illegally modified non-motorized vehicles.
[0006] In one possible implementation, the similarity of the non-motorized vehicle in two adjacent video frames is determined as follows: The similarity of the non-motorized vehicle in the two adjacent video frames is determined based on the intersection over union (IoU) ratio of the non-motorized vehicle's position information.
[0007] The above-mentioned technical solution has the following advantages or beneficial effects: In this embodiment of the application, the similarity of the non-motorized vehicle is determined by the IoU of the location information of the non-motorized vehicle, thereby improving the accuracy of similarity determination and thus accurately and effectively detecting whether the non-motorized vehicle has been illegally modified.
[0008] In one possible implementation, after inputting the video frame image into a pre-trained recognition model and before the spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image, the method further includes: The Residual Network (ResNet) and Feature Pyramid Network (FPN) of the recognition model identify the video frame images to obtain the feature maps corresponding to the video frame images; The spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image, including: The spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image based on the feature map.
[0009] The above technical solution has the following advantages or beneficial effects: In this embodiment, the video frame image is processed by ResNet and FPN to accurately determine the feature map corresponding to the video frame image, thereby improving the accuracy of subsequent recognition model recognition.
[0010] In one possible implementation, the spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image based on the feature map, including: The first sub-network of the spatial attention mechanism network of the recognition model generates a weight mask based on the feature map; wherein, the weight of the region where the non-motorized vehicle is located is higher than the weight of other regions in the weight mask; The second sub-network of the spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image based on the weight mask.
[0011] The above-mentioned technical solution has the following advantages or beneficial effects: In the embodiments of this application, the location information of non-motorized vehicles is identified through the first sub-network and the second sub-network, wherein the weight of the area where the non-motorized vehicle is located in the weight mask is higher than the weight of other areas, thereby improving the accuracy of determining the location information of non-motorized vehicles.
[0012] In one possible implementation, the recognition model is trained in the following manner: Obtain any sample image from the training set, along with the sample location information, sample category information, sample mask, and sample visual center corresponding to that sample image; wherein, the sample category information is whether the vehicle has been illegally modified or not. The sample image is input into the recognition model to obtain the output location information, output category information, output mask, and output visual center corresponding to the non-motorized vehicle output by the recognition model. The recognition model is trained based on the first deviation between the sample location information and the output location information, the second deviation between the sample category information and the output category information, the third deviation between the sample mask and the output mask, and the fourth deviation between the sample visual center and the output visual center.
[0013] The above technical solution has the following advantages or beneficial effects: In the embodiments of this application, the accuracy of the recognition model is improved by training the recognition model.
[0014] In one possible implementation, the method further includes: Obtain the confidence level of the illegally modified sample corresponding to the sample image saved for this sample image; Obtaining the output location information, output category information, and output visual center corresponding to the non-motorized vehicle output by the recognition model includes: Obtain the output location information, output visual center, and output confidence level corresponding to the illegal modification of the non-motorized vehicle output by the recognition model; The second deviation between the sample category information and the output category information is determined in the following manner: A second deviation between the sample category information and the output category information is determined based on the deviation between the sample confidence level and the output confidence level.
[0015] The above technical solution has the following advantages or beneficial effects: In the embodiments of this application, the accuracy of the recognition model is improved by training the recognition model.
[0016] This application also provides a model-based modification detection device, the device comprising: The processing module is used to receive video frame images captured by the acquisition device set up at the intersection; input the video frame images into a pre-trained recognition model, wherein the spatial attention mechanism network of the recognition model identifies the position information corresponding to each non-motorized vehicle in the video frame image, and the channel attention mechanism network of the recognition model identifies whether each non-motorized vehicle in the video frame image has been illegally modified and the visual center of each non-motorized vehicle; wherein the visual center is determined based on the color characteristics of the non-motorized vehicle; The determination module is used to determine if, for each illegally modified non-motorized vehicle identified, the distance between the visual center of the non-motorized vehicle and the center point of the non-motorized vehicle's location information is less than a preset distance, and the similarity of the non-motorized vehicle in two adjacent video frames is higher than a threshold, then the non-motorized vehicle is determined to be an illegally modified non-motorized vehicle.
[0017] In one possible implementation, the processing module is further configured to determine the similarity of the non-motorized vehicle in the two adjacent video frame images based on the IoU of the non-motorized vehicle's position information in the two adjacent video frame images.
[0018] In one possible implementation, the processing module is specifically used to recognize the video frame image using the ResNet and FPN of the recognition model to obtain the feature map corresponding to the video frame image; The processing module is specifically used by the spatial attention mechanism network of the recognition model to identify the location information corresponding to each non-motorized vehicle in the video frame image based on the feature map.
[0019] In one possible implementation, the processing module is specifically used for the first sub-network of the spatial attention mechanism network of the recognition model to generate a weight mask based on the feature map; wherein, the weight of the region where the non-motorized vehicle is located in the weight mask is higher than the weight of other regions; and the second sub-network of the spatial attention mechanism network of the recognition model to identify the location information corresponding to each non-motorized vehicle in the video frame image based on the weight mask.
[0020] In one possible implementation, the processing module is further configured to train the recognition model by: acquiring any sample image from the training set and the sample location information, sample category information, sample mask, and sample visual center corresponding to the non-motorized vehicle stored for that sample image; wherein the sample category information is whether it has been illegally modified or not; inputting the sample image into the recognition model, and acquiring the output location information, output category information, output mask, and output visual center corresponding to the non-motorized vehicle output by the recognition model; and training the recognition model based on a first deviation between the sample location information and the output location information, a second deviation between the sample category information and the output category information, a third deviation between the sample mask and the output mask, and a fourth deviation between the sample visual center and the output visual center.
[0021] In one possible implementation, the processing module is further configured to obtain the confidence level of the illegally modified sample corresponding to the sample image stored for that sample image; The processing module is specifically used to obtain the output location information, output visual center, and output confidence level corresponding to the illegal modification of the non-motorized vehicle output by the recognition model. The processing module is specifically used to determine a second deviation between the sample category information and the output category information based on the deviation between the sample confidence level and the output confidence level.
[0022] This application also provides an electronic device, which includes at least a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the steps of the model-based modification detection method as described in any of the preceding claims.
[0023] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the model-based modification detection method as described in any of the preceding claims. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 A schematic diagram illustrating the process of a model-based modification detection method provided in this application embodiment; Figure 2 A schematic diagram illustrating the output of a recognition model provided in an embodiment of this application; Figure 3 A schematic diagram illustrating the output of a recognition model provided in an embodiment of this application; Figure 4 A schematic diagram illustrating the output of a recognition model provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a recognition model provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of an attention mechanism network provided in an embodiment of this application; Figure 7 A schematic diagram of the structure of a spatial attention mechanism network provided in an embodiment of this application; Figure 8 This is a schematic diagram of a channel attention mechanism provided in an embodiment of this application; Figure 9 This is a schematic diagram illustrating the overall process of violation identification provided in an embodiment of this application; Figure 10 A detailed schematic diagram illustrating a license plate recognition process provided in this application embodiment; Figure 11 A schematic diagram of a model-based illegal modification detection device provided for an embodiment of this application; Figure 12 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation
[0026] To make the objectives and implementation methods of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the exemplary embodiments described are only some embodiments of this application, and not all embodiments.
[0027] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0028] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0029] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0030] The term "module" refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0031] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0032] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the described embodiments and various different variations of embodiments suitable for specific use considerations.
[0033] Before introducing the modification testing method, apparatus, equipment and medium provided in the embodiments of this application, the technical background of the embodiments of this application will be introduced first for ease of understanding.
[0034] In the field of non-motorized vehicle illegal modification detection, especially after the implementation of the new national standard for electric vehicles, existing technologies face new challenges. The new national standard for electric vehicles imposes stricter requirements on the technical parameters and safety performance of vehicles, and related problems with illegal modifications of non-motorized vehicles are widespread in the industry. However, existing technologies mainly rely on manual inspections and simple video surveillance, methods that are difficult to meet the requirements of the new national standard in terms of efficiency and accuracy. Manual inspection is not only inefficient and unable to provide comprehensive coverage, but it is also easily influenced by subjective judgment, leading to inconsistent test results. At the same time, traditional video surveillance technology cannot achieve real-time monitoring of electric vehicles, allowing illegally modified vehicles to often evade supervision. The concealment of illegally modified parts increases the difficulty of identification, and privacy protection issues also limit the application of video surveillance technology. Therefore, there is an urgent need for technological innovation to improve the efficiency, accuracy, and real-time performance of detection to meet the requirements of the new national standard for electric vehicles.
[0035] Figure 1 This application provides a schematic diagram of a model-based modification detection method, which includes the following steps: S101: Receive video frame images collected by the acquisition device set up at the intersection; input the video frame images into a pre-trained recognition model, wherein the spatial attention mechanism network of the recognition model identifies the position information corresponding to each non-motorized vehicle in the video frame image, and the channel attention mechanism network of the recognition model identifies whether each non-motorized vehicle in the video frame image has been illegally modified and the visual center of each non-motorized vehicle; wherein the visual center is determined based on the color characteristics of the non-motorized vehicle.
[0036] The modification detection method provided in this application is applied to electronic devices, which can be intelligent devices such as PCs or servers.
[0037] For modification inspection, a data acquisition device is installed at the intersection. This device can capture video streams and send each video frame to an electronic device. In other words, the electronic device can receive the video frame images captured by the acquisition device at the intersection. For example, the electronic device can connect to the real-time stream from the acquisition device, obtain the image address frame by frame, and decode and re-encode it into a video frame image of the required format.
[0038] To accurately and effectively detect modifications, the electronic device locally stores a pre-trained recognition model. The device can input acquired video frame images into this model, which employs a dual-attention architecture. The spatial attention network identifies the location information of each non-motorized vehicle in the video frame image. For example, it can label the location information of each non-motorized vehicle with a rectangle in the video frame image and output the labeled video frame image. The channel attention network of the recognition model can dynamically adjust the weights of each channel to extract the color histogram features of the main body region of the non-motorized vehicle in the color space of the video frame image. This feature is then combined with a custom illegal modification feature library (including typical modification patterns such as adding sunshades, expanding battery compartments, and modifying the frame structure) for multi-label classification, simultaneously determining whether each non-motorized vehicle has been illegally modified. Simultaneously, the channel attention network extracts the red, green, and blue (RGB) channel values of the main color of the non-motorized vehicle body using a color clustering algorithm, and determines the coordinates of its visual center using gradient significance analysis. The recognition model output includes the location information of each non-motorized vehicle, the probability value of illegal modification for each non-motorized vehicle, and the labeling of the visual center for each non-motorized vehicle. For example, the electronic device can determine whether a non-motorized vehicle is illegally modified based on whether the probability value of the non-motorized vehicle being illegally modified is greater than a preset probability value.
[0039] This application proposes an occlusion perception method combining a dual attention mechanism to improve the performance of tricycle and non-motorized vehicle detection algorithms under severe occlusion conditions and reduce the impact of occlusion on detection. This method effectively addresses target omissions caused by occlusion by introducing a dual attention mechanism of spatial and channel considerations, thereby improving detection accuracy. Simultaneously, optimized decision logic is designed to ensure the detection rate of illegal passenger transport.
[0040] Figure 2 , Figure 3 and Figure 4 This is a schematic diagram of the output of a recognition model provided in an embodiment of this application.
[0041] Reference Figure 2 , Figure 3 and Figure 4 The recognition model can identify motor vehicles, non-motor vehicles, and pedestrians in video frame images, such as... Figure 2 , Figure 3 and Figure 4 As shown, labels 8, 9, and 1 represent different types of vehicles that have been identified, and Figure 2 , Figure 3 and Figure 4The largest rectangle in the image represents the most dangerous area at the intersection as identified by the recognition model, and "illegal mod" represents the non-motorized vehicles that have been illegally modified. Figure 2 , Figure 4 and Figure 4 The document also shows the acquisition time and corresponding acquisition location of the video frame images.
[0042] S102: For each illegally modified non-motorized vehicle identified, if the distance between the visual center of the non-motorized vehicle and the center point of the location information of the non-motorized vehicle is less than a preset distance, and the similarity of the non-motorized vehicle in two adjacent video frames is higher than a threshold, then the non-motorized vehicle is determined to be an illegally modified non-motorized vehicle.
[0043] In real-world scenarios, when there are complex backgrounds around non-motorized vehicles in the captured video frame images, there may be misidentification, where ordinary non-motorized vehicles are identified as illegally modified non-motorized vehicles. For example, a leaf might be identified as an illegally installed sunshade for a non-motorized vehicle, and thus the non-motorized vehicle might be identified as illegally modified. Based on this, in this embodiment of the application, it is possible to further determine whether the illegally modified non-motorized vehicle output by the model is a misidentification.
[0044] For example, for each illegally modified non-motorized vehicle identified, the electronic device can determine the center point of the non-motorized vehicle based on its location information, and determine whether the distance between the center point and the visual center of the non-motorized vehicle is less than a preset distance. If the distance is not less than the preset distance, it can be considered that the recognition model has misidentified the non-motorized vehicle, and it can be confirmed that the non-motorized vehicle is not illegally modified. For example, the preset distance can be determined based on the size of the bounding box corresponding to the location information of the non-motorized vehicle. In one possible implementation, the product of the area of the bounding box and a preset value can be used to determine the preset distance.
[0045] Furthermore, the electronic device can also determine the similarity between two adjacent video frames of the non-motorized vehicle and whether the similarity is higher than a threshold. If the similarity is lower than the threshold, it can be determined that the recognition model may have recognized background content, such as fallen leaves or trash cans, during the process of recognizing the non-motorized vehicle. The recognition model's result in determining whether the non-motorized vehicle has been illegally modified has an error. Based on this, it can be determined that the non-motorized vehicle is not an illegally modified non-motorized vehicle.
[0046] Based on this, if the distance between the visual center of a non-motorized vehicle identified by the recognition model and the center point of the non-motorized vehicle is less than a preset distance, and the similarity of the non-motorized vehicle in two adjacent video frames is higher than a threshold, then the non-motorized vehicle can be determined to be a non-motorized vehicle that has been illegally modified.
[0047] For example, an electronic device can extract sub-images containing the non-motorized vehicle from two adjacent video frames, identify the similarity between these two sub-images, and determine the similarity as the similarity of the non-motorized vehicle. In one possible implementation, these two sub-images can be input into a similarity recognition model to obtain the similarity output by the model.
[0048] In one possible implementation, to address the false detection problem caused by overlapping spatiotemporal locations, the electronic device can employ a continuous frame collaborative judgment mechanism: by periodically collecting and accumulating the detection results of continuous video frames of the non-motorized vehicle in dynamic driving conditions, a multi-dimensional judgment basis can be formed. For example, when the non-motorized vehicle is not stationary, the probability of illegal modification can be detected in real time for N consecutive video frames (e.g., 10 consecutive frames). If more than 50% of the frames (i.e., at least 6 frames) detect an illegal modification probability exceeding a preset threshold, the vehicle is comprehensively judged as an illegally modified vehicle, and an alarm message is triggered.
[0049] Using the method provided in this application, non-motorized vehicles can be identified based on the final target detection results and logical judgment results. This includes identifying illegal passenger-carrying behaviors such as those by agricultural tricycles, and periodically pushing analysis results. Compared with traditional identification methods, the overall identification accuracy can be improved by more than 30%.
[0050] The basic solution of this application embodiment is a method for detecting illegal modifications to non-motorized vehicles based on video analysis technology. This method automatically detects illegal modifications to non-motorized vehicles through video streams, and upon detection of illegal modifications, performs license plate recognition and recording, while simultaneously alerting management personnel for handling. The solution includes steps such as video access, hardware decoding, preprocessing, non-motorized vehicle detection, illegal modification recognition, license plate recognition, and recording into a database.
[0051] Understandably, lagging technological updates have prevented existing technologies from adapting to the new national standards in a timely manner, and insufficient data integration has weakened the comprehensiveness of supervision. Limitations in hardware facilities, such as insufficient camera resolution and coverage, further affect the effectiveness of detecting illegal modifications. However, this application's embodiment utilizes automated video analysis technology to effectively detect and identify illegal modifications to non-motorized vehicles, improving road safety and traffic management efficiency while ensuring that electric vehicles comply with the new national standards. It reduces labor costs, decreases traffic accidents, protects the environment, enhances the city's image, and promotes technological innovation. Simultaneously, this method, through data-driven decision support, optimizes resource allocation, improves emergency response capabilities, reduces traffic congestion, strengthens law enforcement, protects personal privacy, promotes fair competition, increases citizen satisfaction, and drives the development of intelligent transportation systems, contributing to sustainable development.
[0052] Among these, illegal modifications to non-motorized vehicles mainly include speed modifications, the addition of battery outlets, modifications to pedals, and the addition of canopies. Given the limitations of detecting speed modifications and pedals, the method provided in this application primarily targets the detection of illegal canopies and umbrellas, ensuring compliance with the new national standard for electric vehicles and improving road safety.
[0053] In this embodiment, the electronic device inputs video frame images into the recognition model, which identifies whether the non-motorized vehicle has been illegally modified. The recognition model also identifies the visual center of the non-motorized vehicle. If the distance between the center point of the illegally modified non-motorized vehicle and the visual center is less than a preset distance, and the similarity of the non-motorized vehicle in two adjacent video frame images is higher than a threshold, then it can be determined that the non-motorized vehicle has indeed been illegally modified. The recognition model can identify whether the non-motorized vehicle has been illegally modified. After identification, the distance between the center point of the illegally modified non-motorized vehicle and the visual center, and the similarity of the non-motorized vehicle in two adjacent video frame images, can be used to determine whether the illegally modified non-motorized vehicle is a misidentification caused by the complex background of the recognition model. This can further improve the accuracy of detecting illegally modified non-motorized vehicles.
[0054] In order to accurately and effectively detect whether a non-motorized vehicle has been illegally modified, based on the above embodiments, in this embodiment, the similarity of the non-motorized vehicle in two adjacent video frames is determined in the following way: The similarity of the non-motorized vehicle in the two adjacent video frames is determined based on the intersection over union (IoU) ratio of the non-motorized vehicle's position information.
[0055] In non-motorized vehicle dynamic tracking scenarios, similarity can be quantified by the intersection-union ratio (IoU) of positional information in adjacent video frames. For example, the IoU can be obtained by dividing the intersection area of the non-motorized vehicle in two adjacent video frames by the union area, and the resulting IoU value ranges from [0,1]. When the IoU is not higher than 0.6, the illegally modified non-motorized vehicle can be considered a misidentification.
[0056] In the logical judgment stage, in order to avoid the interference of the two factors on the judgment result of the recognition model, the solution mainly relies on analyzing and calculating the intersection-union ratio (IOU) of the non-motorized vehicle detection boxes detected in each video frame. If the IOU is not higher than 0.6 or the coordinates of the center point of the non-motorized vehicle target are not in the core area of the tricycle target box, the situation is considered as a false detection of illegal modification, and no result is pushed.
[0057] To accurately and effectively detect whether non-motorized vehicles have been illegally modified, based on the above embodiments, in this embodiment, after inputting the video frame image into the pre-trained recognition model and before the spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image, the method further includes: The ResNet and FPN of the recognition model are used to recognize the video frame images to obtain the feature maps corresponding to the video frame images; The spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image, including: The spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image based on the feature map.
[0058] The recognition model in this embodiment includes ResNet and FPN. For example, the recognition model can use ResNet-50 as the backbone feature extractor, and solve the gradient vanishing problem in deep networks through residual connections, effectively capturing low-level texture features and high-level semantic information in video frame images. Subsequently, FPN performs top-down upsampling and lateral connections on the multi-scale feature maps output by ResNet to generate a high-resolution feature pyramid, ensuring that non-motorized vehicle targets at different scales can be effectively detected, and outputting the corresponding feature maps. The spatial attention mechanism network of the recognition model identifies the positional information corresponding to each non-motorized vehicle in the video frame image based on this feature map.
[0059] The method provided in this application effectively addresses the target omission phenomenon caused by occlusion by introducing a dual attention mechanism of space and channel and defining a novel loss function for occlusion perception, thereby improving the detection accuracy. At the same time, it designs optimized judgment logic to ensure the detection rate of illegal passenger carrying behavior.
[0060] In this embodiment of the application, non-motorized vehicles such as two-wheeled vehicles and three-wheeled vehicles in the video frame images collected by the access monitoring can be detected based on the structure of the recognition model, as shown in the figure. Figure 5 As shown, by Figure 5 As can be seen, the improved recognition model structure, using ResNet as the basic framework, consists of three parts: a convolutional prediction module incorporating a dual attention mechanism; and a ResNet50 module composed of C3, C5, C6, and C7, and an FPN composed of P7, P6, P5, and P3. The convolutional prediction stage consists of a classification branch and a regression branch. The classification branch is a channel attention mechanism network, and the regression branch is a spatial attention mechanism network.
[0061] Figure 6This is a schematic diagram of the structure of an attention mechanism network provided in an embodiment of this application.
[0062] Depend on Figure 6 As can be seen, the channel attention mechanism network's output is directly connected to a convolutional layer containing five 3×3 kernels, which outputs 256 feature maps. This is followed by another convolutional layer (labeled 2A, indicating the number of kernels), and the final output is used to calculate the classification loss. The spatial attention mechanism network's output undergoes a non-linear transformation using an exponential function (exp), and is also connected to a convolutional layer containing five 3×3 kernels, outputting 256 feature maps. This is followed by another convolutional layer (labeled 4A, indicating the number of kernels), and the final output is used to calculate the improved regression loss, receiving visible box supervision information as input. The two attention mechanisms work collaboratively with the convolutional layers, performing joint optimization through different loss functions.
[0063] To accurately and effectively detect violations, based on the above embodiments, in this embodiment, the spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image based on the feature map, including: The first sub-network of the spatial attention mechanism network of the recognition model generates a weight mask based on the feature map; wherein, the weight of the region where the non-motorized vehicle is located is higher than the weight of other regions in the weight mask; The second sub-network of the spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image based on the weight mask.
[0064] In this embodiment, an attention mechanism can be used to guide the network to focus on the unobstructed areas of non-motorized vehicles, increasing the feature weights of key parts of non-motorized vehicles, thereby avoiding the influence of background occlusion and other interfering information.
[0065] For example, the spatial attention mechanism network in the recognition model includes a first sub-network and a second sub-network, used to enhance the feature representation of non-motorized vehicles and accurately extract their location information. The first sub-network can receive feature maps output by ResNet and FPN as input, and perform spatial context modeling on the feature maps through convolution operations and nonlinear activation functions to generate a weight mask of the same size as the input feature map. Each pixel value in the weight mask represents the importance weight of the corresponding spatial region in the current task. In this embodiment, the first sub-network is trained to be highly sensitive to the appearance structure, contour shape, and motion semantics of non-motorized vehicles. Therefore, in the generated weight mask, the target region containing non-motorized vehicles is assigned a higher weight value, while the background or other irrelevant object regions are assigned a lower weight, thereby achieving selective enhancement of key target regions.
[0066] The second sub-network performs weighted fusion processing on the original feature map based on a weight mask. This involves applying the weight mask to the feature map through element-wise multiplication, significantly enhancing the feature responses of non-motorized vehicle-related regions while effectively suppressing features in interfering regions. Subsequently, the second sub-network performs multi-scale feature aggregation and boundary regression analysis on the weighted feature map. Combined with a region proposal mechanism or keypoint detection module, it ultimately identifies the location information of each non-motorized vehicle in the video frame image.
[0067] Figure 7 This is a schematic diagram of the structure of a spatial attention mechanism network provided in an embodiment of this application, with reference to... Figure 7 First, the regression branch is convolved with four 3×3 convolutional kernels (conv) with 256 channels each. Then, a 3×3 convolution with 1 channel is used to compress the feature map into a weight mask. To preserve the original background information, the original feature map is weighted and fused based on the weight mask. This is done by applying the weight mask to the feature map element-wise, thereby adjusting the weights at various positions in the original feature map.
[0068] In this embodiment, an attention mechanism guides the network to focus on areas where non-motorized vehicles are not obscured, increasing the feature weights of key parts of the non-motorized vehicles to avoid the influence of background occlusion and other interfering information. Different attention mechanisms are used for the classification and localization aspects of the detection problem: a spatial attention mechanism is used in the localization branch, and a channel attention mechanism is used in the classification branch.
[0069] In this embodiment, the channel attention mechanism is based on a fundamental understanding of convolutional neural networks: different channels of the convolutional feature map encode features of different parts of an object. This embodiment incorporates a channel attention mechanism into the classification branch. Figure 8 This diagram illustrates a channel attention mechanism provided in an embodiment of this application. First, pooling is performed on the classification branch. The pooled weight vector is then fed into fully connected layers (FC)1 and FC2 for "compression" and "stretching" operations. Then, the sigmoid function is used to restrict the vector components to between 0 and 1, and the two vectors are added together to form the final weight vector. Unlike the original structure which only uses average pooling, this approach employs both global pooling and max pooling, which can highlight the main features while preserving the average features of each channel, making the network focus more on the visible parts of the target.
[0070] This application improves the network structure based on ResNet. For the two sub-tasks of object detection (localization and classification), spatial and channel attention mechanisms are adopted in different branch structures, respectively. Non-motorized vehicle bounding boxes are introduced as supervision information to simply and effectively guide the learning of the two attention mechanisms. Furthermore, a novel regression loss function for perceptible occlusion is designed using the bounding boxes of the visible non-motorized vehicle region, further improving the algorithm's robustness to occluded targets. In determining the passenger-carrying behavior, the intersection-over-union ratio of the two- and three-wheeled vehicle detection boxes and the positional relationship of their center points are used to determine the perception of illegal modification status.
[0071] To address issues such as occlusion, posture changes, and environmental fusion that affect the detection of modified non-motorized vehicles in real-world application scenarios, an improved dual attention mechanism is introduced into the native RetinaNet network. Channel attention and spatial attention mechanisms are introduced into the classification and regression branches corresponding to the convolutional prediction modules in the network structure, respectively. This allows the network to focus on the unoccluded areas of non-motorized vehicles and increases the feature weights of key parts of non-motorized vehicles, thereby avoiding the influence of background occlusion and other interfering information.
[0072] Figure 9 This is a schematic diagram illustrating the overall process of violation identification provided in an embodiment of this application. Figure 9 It can be seen that video access can be performed first, the accessed video can be decoded to obtain video frame images, preprocessing can be performed based on the video frame images, non-motorized vehicle detection and illegal modification identification can be performed, the license plates of illegally modified non-motorized vehicles can be identified and recorded, and the identified license plates can be notified.
[0073] Figure 10 This is a detailed schematic diagram illustrating a license plate recognition process provided in an embodiment of this application. Figure 10 It can be seen that non-motorized vehicle detection can be performed first. After detecting non-motorized vehicles, illegal modification features can be identified to determine whether the non-motorized vehicle has been illegally modified. The image of the illegally modified non-motorized vehicle is then extracted and the license plate is located in the license plate area. Based on the license plate area, optical character recognition (OCR) technology is used to recognize the license plate number and obtain the license plate number recognition result.
[0074] To accurately and effectively detect violations, based on the above embodiments, the identification model in this application embodiment is trained in the following manner: Obtain any sample image from the training set, along with the sample location information, sample category information, sample mask, and sample visual center corresponding to that sample image; wherein, the sample category information is whether the vehicle has been illegally modified or not. The sample image is input into the recognition model to obtain the output location information, output category information, output mask, and output visual center corresponding to the non-motorized vehicle output by the recognition model. The recognition model is trained based on the first deviation between the sample location information and the output location information, the second deviation between the sample category information and the output category information, the third deviation between the sample mask and the output mask, and the fourth deviation between the sample visual center and the output visual center.
[0075] In this embodiment, supervised learning can be used to train the recognition model. In one example, a training set is pre-stored. The electronic device can obtain any sample image from the training set and simultaneously load various supervisory signals corresponding to the sample image, including: sample location information of the non-motorized vehicle, sample category information (distinguishing between "illegally modified" and "not illegally modified" states), sample mask (i.e., pixel-level instance segmentation label), and sample visual center. After the electronic device inputs the sample image into the recognition model to be trained, the recognition model will output the corresponding prediction results, including: output location information of the non-motorized vehicle, output category information, output mask, and output visual center. The output location information is the location information of the target bounding box of each non-motorized vehicle predicted by the recognition model; the output category information is the classification result of the recognition model in determining whether the non-motorized vehicle belongs to the "illegally modified" category; and the output mask is a pixel-level segmentation map generated by the recognition model, used to characterize the target shape and spatial distribution. The output visual center is the target center location inferred by the recognition model through heatmap regression, key point localization, or attention mechanism.
[0076] The electronic device can determine the first deviation between sample location information and output location information, the second deviation between sample category information and output category information, the third deviation between sample mask and output mask, and the fourth deviation between sample visual center and output visual center. Based on the first deviation, second deviation, third deviation, and fourth deviation and their corresponding weights, a loss value is determined, and the recognition model is trained based on this loss value.
[0077] For example, the first deviation can be confirmed using the following formula:
[0078] in, The first deviation, This application presents a novel regression loss function that can autonomously design the weights based on different degrees of occlusion. Let represent the total number of predicted non-motorized vehicles, considering only those judged as foreground, where t represents the sample location information of the non-motorized vehicles. To provide the output location information for the non-motorized vehicle, this application introduces a dynamic weighting mechanism based on the proportion of the intersection over the ground truth (IoG) area. This mechanism determines the deviation between the sample location information and the output location information for each non-motorized vehicle. This method measures the spatial matching degree between each positive sample predicted box and its corresponding ground truth box, and generates adaptive loss weights accordingly. Since IoG reflects the proportion of the real target region covered, it maintains a high numerical response even when the target is partially occluded. Therefore, it effectively reduces the risk of overfitting the model to occluded samples and better handles target occlusion problems.
[0079] For example, the third deviation can be confirmed using the following formula:
[0080] in, This is the third deviation. For sample mask, To output the mask, The loss function for the spatial attention mechanism subnetwork is actually a cross-entropy loss function based on each pixel of the mask.
[0081] The embodiments of this application not only achieve high-precision non-motorized vehicle detection and semantic understanding, but also significantly improve the accuracy of automatic identification of "illegal modification" behavior.
[0082] This application proposes an occlusion perception method combining a dual attention mechanism to improve the performance of tricycle and non-motorized vehicle detection algorithms under severe occlusion conditions and reduce the impact of occlusion on detection. This method effectively addresses target misses caused by occlusion by introducing a dual attention mechanism of spatial and channel considerations and defining a novel loss function for occlusion perception, thereby improving detection accuracy. Simultaneously, optimized decision logic is designed to ensure the detection rate of illegal passenger transport.
[0083] To accurately and effectively detect violations, based on the above embodiments, the method in this application embodiment further includes: Obtain the confidence level of the illegally modified sample corresponding to the sample image saved for this sample image; Obtaining the output location information, output category information, and output visual center corresponding to the non-motorized vehicle output by the recognition model includes: Obtain the output location information, output visual center, and output confidence level corresponding to the illegal modification of the non-motorized vehicle output by the recognition model; The second deviation between the sample category information and the output category information is determined in the following manner: A second deviation between the sample category information and the output category information is determined based on the deviation between the sample confidence level and the output confidence level.
[0084] In order to more accurately identify whether non-motorized vehicles have been illegally modified, this application embodiment can use a dual-channel confidence supervision mechanism to train the identification model.
[0085] For example, for any sample image in the training set, the category confidence information for each pre-labeled non-motorized vehicle corresponding to that sample image is obtained, including: sample confidence, which represents the true category confidence of each non-motorized vehicle being illegally modified, with a value range of [0,1], determined by manual annotation or other methods. After inputting the sample image into the recognition model to be trained, the recognition model outputs the corresponding prediction result, including: the output confidence of the non-motorized vehicle being illegally modified. In one possible implementation, the second deviation between the sample category information and the output category information is determined as follows: the difference between the sample confidence and the output confidence is calculated, and the confidence distribution is compared sample by sample using weighted cross-entropy loss or other methods, thereby quantifying the prediction error of the model on the "illegal modification" discrimination task.
[0086] In another possible implementation, the confidence level of samples where the non-motorized vehicle has not been illegally modified can also be obtained, as well as the output confidence level of the recognition model where the non-motorized vehicle has not been illegally modified. Based on the confidence level of samples where the non-motorized vehicle has been illegally modified and the output confidence level, and the confidence level of samples where the non-motorized vehicle has not been illegally modified and the output confidence level, a second bias can be determined.
[0087] For example, the second deviation can be confirmed using the following formula:
[0088] in, This is the second deviation. Let n be the number of each non-motorized vehicle, and n be the number of the non-motorized vehicle. Let be the confidence level of the first sample of the nth non-motorized vehicle that has been illegally modified. Let be the first output confidence level for the nth non-motorized vehicle that has been illegally modified.
[0089] This application embodiment uses a multi-task loss function to jointly optimize the parameters of each part, thereby achieving the training of the recognition model.
[0090] To further enhance the identification of whether non-motorized vehicles have been illegally modified based on detected areas, this paper proposes a regression loss function that can autonomously adjust the weights of detection boxes based on the degree of occlusion. The basic idea is that when calculating the regression loss function, the IOG (Intersection over Group) between the predicted non-motorized vehicle bounding box and the visible non-motorized vehicle bounding box provided in the dataset is used as the weight for each positive sample in the loss function. That is, if the predicted positive sample bounding box overlaps significantly with the visible non-motorized vehicle area, the resulting loss is more reliable and assigned a higher weight; conversely, it is assigned a lower weight. This application uses this idea to improve the original loss function.
[0091] Figure 11 A schematic diagram of a model-based modification detection structure provided in this application embodiment is shown below. Figure 11 As shown: The device includes a processing module 1101 and a determination module 1102.
[0092] The processing module 1101 is used to receive video frame images collected by the acquisition device set at the intersection; input the video frame images into a pre-trained recognition model, wherein the spatial attention mechanism network of the recognition model identifies the position information corresponding to each non-motorized vehicle in the video frame image, and the channel attention mechanism network of the recognition model identifies whether each non-motorized vehicle in the video frame image has been illegally modified and the visual center of each non-motorized vehicle; wherein the visual center is determined based on the color characteristics of the non-motorized vehicle; The determination module 1102 is used to determine that each illegally modified non-motorized vehicle is an illegally modified non-motorized vehicle if the distance between the visual center of the non-motorized vehicle and the center point of the location information of the non-motorized vehicle is less than a preset distance, and the similarity of the non-motorized vehicle in two adjacent video frames is higher than a threshold.
[0093] In one possible implementation, the processing module 1101 is further configured to determine the similarity of the non-motorized vehicle in the two adjacent video frame images based on the IoU of the non-motorized vehicle's position information in the two adjacent video frame images.
[0094] In one possible implementation, the processing module 1101 is specifically used to recognize the video frame image using the ResNet and FPN of the recognition model to obtain the feature map corresponding to the video frame image; The processing module 1101 is specifically used for the spatial attention mechanism network of the recognition model to identify the location information corresponding to each non-motorized vehicle in the video frame image based on the feature map.
[0095] In one possible implementation, the processing module 1101 is specifically used for the first sub-network of the spatial attention mechanism network of the recognition model to generate a weight mask based on the feature map; wherein, the weight of the region where the non-motorized vehicle is located in the weight mask is higher than the weight of other regions; the second sub-network of the spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image based on the weight mask.
[0096] In one possible implementation, the processing module 1101 is further configured to train the recognition model by: acquiring any sample image in the training set and the sample location information, sample category information, sample mask, and sample visual center corresponding to the non-motorized vehicle stored for that sample image; wherein the sample category information is whether it has been illegally modified or not; inputting the sample image into the recognition model, and acquiring the output location information, output category information, output mask, and output visual center corresponding to the non-motorized vehicle output by the recognition model; and training the recognition model based on the first deviation between the sample location information and the output location information, the second deviation between the sample category information and the output category information, the third deviation between the sample mask and the output mask, and the fourth deviation between the sample visual center and the output visual center.
[0097] In one possible implementation, the processing module 1101 is further configured to obtain the confidence level of the illegally modified sample corresponding to the sample image stored for the sample image; The processing module 1101 is specifically used to obtain the output location information, output visual center, and output confidence level corresponding to the illegal modification of the non-motorized vehicle output by the recognition model. The processing module 1101 is specifically used to determine a second deviation between the sample category information and the output category information based on the deviation between the sample confidence level and the output confidence level.
[0098] Figure 12 This application provides a schematic diagram of an electronic device structure based on an embodiment of the present application. In addition to the above embodiments, this application also provides an electronic device, such as... Figure 12 As shown, it includes: processor 1201, communication interface 1202, memory 1203 and communication bus 1204, wherein processor 1201, communication interface 1202 and memory 1203 communicate with each other through communication bus 1204. The memory 1203 stores a computer program, which, when executed by the processor 1201, causes the processor 1201 to perform any of the above method steps.
[0099] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0100] The communication interface 1202 is used for communication between the above-mentioned electronic device and other devices.
[0101] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0102] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0103] This application also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform any of the above method steps.
[0104] This application provides a computer program product, which includes an executable program that, when executed by a processor, implements the method described herein.
[0105] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0106] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A model-based modification detection method, characterized in that, The method includes: The system receives video frame images captured by a data acquisition device installed at the intersection; inputs the video frame images into a pre-trained recognition model, wherein the spatial attention mechanism network of the recognition model identifies the position information corresponding to each non-motorized vehicle in the video frame image, and the channel attention mechanism network of the recognition model identifies whether each non-motorized vehicle in the video frame image has been illegally modified and the visual center of each non-motorized vehicle; wherein the visual center is determined based on the color characteristics of the non-motorized vehicle. For each illegally modified non-motorized vehicle identified, if the distance between the visual center of the non-motorized vehicle and the center point of its location information is less than a preset distance, and the similarity of the non-motorized vehicle in two adjacent video frames is higher than a threshold, then the non-motorized vehicle is determined to be an illegally modified non-motorized vehicle.
2. The method according to claim 1, characterized in that, The similarity of the non-motorized vehicle in two adjacent video frames is determined in the following way: The similarity of the non-motorized vehicle in the two adjacent video frames is determined based on the intersection-union ratio (IoU) of the non-motorized vehicle's position information.
3. The method according to claim 1, characterized in that, After inputting the video frame image into the pre-trained recognition model, and before the spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image, the method further includes: The ResNet residual network and the FPN feature pyramid network of the recognition model recognize the video frame image and obtain the feature map corresponding to the video frame image. The spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image, including: The spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image based on the feature map.
4. The method according to claim 3, characterized in that, The spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image based on the feature map, including: The first sub-network of the spatial attention mechanism network of the recognition model generates a weight mask based on the feature map; wherein, the weight of the region where the non-motorized vehicle is located is higher than the weight of other regions in the weight mask; The second sub-network of the spatial attention mechanism network of the recognition model identifies the location information corresponding to each non-motorized vehicle in the video frame image based on the weight mask.
5. The method according to claim 1, characterized in that, The recognition model is trained in the following manner: Obtain any sample image from the training set and the corresponding sample location information, sample category information, sample mask, and sample visual center for the non-motorized vehicle stored for that sample image; wherein, the sample category information is whether it has been illegally modified or not. The sample image is input into the recognition model to obtain the output location information, output category information, output mask, and output visual center corresponding to the non-motorized vehicle output by the recognition model. The recognition model is trained based on the first deviation between the sample location information and the output location information, the second deviation between the sample category information and the output category information, the third deviation between the sample mask and the output mask, and the fourth deviation between the sample visual center and the output visual center.
6. The method according to claim 5, characterized in that, The method further includes: Obtain the confidence level of the illegally modified sample corresponding to the sample image saved for this sample image; Obtaining the output location information, output category information, and output visual center corresponding to the non-motorized vehicle output by the recognition model includes: Obtain the output location information, output visual center, and output confidence level corresponding to the illegal modification of the non-motorized vehicle output by the recognition model; The second deviation between the sample category information and the output category information is determined in the following manner: A second deviation between the sample category information and the output category information is determined based on the deviation between the sample confidence level and the output confidence level.
7. A model-based modification detection device, characterized in that, The device includes: The processing module is used to receive video frame images captured by the acquisition device set up at the intersection; input the video frame images into a pre-trained recognition model, wherein the spatial attention mechanism network of the recognition model identifies the position information corresponding to each non-motorized vehicle in the video frame image, and the channel attention mechanism network of the recognition model identifies whether each non-motorized vehicle in the video frame image has been illegally modified and the visual center of each non-motorized vehicle; wherein the visual center is determined based on the color characteristics of the non-motorized vehicle; The determination module is used to determine if, for each illegally modified non-motorized vehicle identified, the distance between the visual center of the non-motorized vehicle and the center point of the non-motorized vehicle's location information is less than a preset distance, and the similarity of the non-motorized vehicle in two adjacent video frames is higher than a threshold, then the non-motorized vehicle is determined to be an illegally modified non-motorized vehicle.
8. The apparatus according to claim 7, characterized in that, The processing module is further configured to determine the similarity of the non-motorized vehicle in the two adjacent video frames based on the intersection-union ratio (IoU) of the non-motorized vehicle's position information in the two adjacent video frames.
9. An electronic device, characterized in that, The electronic device includes at least a processor and a memory, wherein the processor executes a computer program stored in the memory to implement the steps of the model-based modification detection method as described in any one of claims 1-6.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the model-based modification detection method as described in any one of claims 1-6.