Non-standard parking behavior identification method and system based on machine vision
By combining the recognition methods of rectangular boxes and rotating boxes in the intelligent parking system, using the YOLOv8n_obb network model and non-maximum filtering processing, the problem of low detection accuracy in the existing technology is solved, and more efficient vehicle behavior recognition and Parking standard management.
Patent Information
- Application Number
- CN202410827552.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-09-27
AI Technical Summary
Existing intelligent parking systems based on machine vision have low detection accuracy in complex parking scenarios, and are difficult to adapt to the identification of irregular behaviors in vehicle locations in parking lots, and traditional algorithms are susceptible to distortion.
Using a combination of rectangular frames and rotating frames, the YOLOv8n_obb network model is constructed through the YOLOv8 network model, the improved C2F module and the cross-layer connected convolutional layer, and combined with non-maximum filtering processing, the recognition accuracy of the target detection frame is improved.
It improves the accuracy of vehicle behavior recognition, reduces misidentification, enhances the detection ability of parking standard behavior, and provides more accurate parking management guidance.
Smart Images

Figure CN118710882A
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent parking technology, and in particular to a method and system for identifying irregular parking behaviors based on machine vision. Background Art
[0002] There is a serious problem of random parking or occupying parking spaces in existing parking lots, which brings great trouble to parking lot personnel. Many existing parking management personnel conduct manual inspections or discover them in surveillance video images. Surveillance cameras are low-cost and collect richer information around the car. Therefore, most of the current perception and recognition algorithm methods rely on vision. Traditional algorithms are easy to implement and have lower costs, but they are difficult to adapt to complex parking scenarios. In addition, the existing intelligent parking system based on machine vision uses a high-confidence target box to identify vehicles, but it cannot avoid the influence of distortion, resulting in low final detection accuracy.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a method and system for identifying irregular parking behaviors based on machine vision, which improves the recognition accuracy of the target detection frame by combining a rectangular frame and a rotating frame.
[0005] To achieve the above-mentioned purpose, one aspect of an embodiment of the present application proposes a method for identifying irregular parking behaviors based on machine vision, the method comprising:
[0006] Acquire a parking space image of a target area and perform data annotation processing to obtain an annotated parking space image of the target area, wherein the annotated parking space image of the target area includes rectangular target frame data of the parking space image of the target area and rotated target frame data of the parking space image of the target area;
[0007] The rectangular target frame data of the parking space image in the target area is predicted by using the YOLOv8 network model to obtain a vehicle prediction frame in the target area;
[0008] Introduce the improved C2F module and the cross-layer connected convolutional layer to build an improved YOLOv8n_obb network model;
[0009] The rotation target frame data of the parking space image in the target area is predicted by the improved YOLOv8n_obb network model to obtain a parking space prediction frame in the target area;
[0010] The target area vehicle prediction frame and the target area parking space prediction frame are combined, and non-maximum filtering processing is performed to obtain a vehicle behavior recognition result.
[0011] In some embodiments, the step of acquiring the target area parking space image and performing data annotation processing to obtain the annotated target area parking space image includes:
[0012] The target area is photographed and collected by a camera to obtain a parking space image of the target area;
[0013] Performing target frame selection and labeling processing on the parking space image in the target area by using the LabelImg tool to obtain rectangular target frame data of the parking space image in the target area;
[0014] Perform target frame selection and labeling and fine-tune the rotation of the parking space image in the target area by using the roLabelImg tool to obtain the rotation target frame data of the parking space image in the target area;
[0015] The marked target area parking space image is obtained by combining the rectangular target frame data of the target area parking space image and the rotated target frame data of the target area parking space image.
[0016] In some embodiments, the improved YOLOv8n_obb network model includes a backbone network module, a neck module and a prediction module, the output end of the backbone network module is connected to the input end of the neck module, and the output end of the neck module is connected to the input end of the prediction module, wherein:
[0017] The backbone network module includes an SPPF module, an improved C2F module, a convolution module and a Concat module, wherein the output end of the improved C2F module is connected to the input end of the Concat module through the cross-layer connected convolution layer;
[0018] The neck module includes an FPN layer and a PAN layer;
[0019] The prediction module includes a convolutional layer.
[0020] In some embodiments, the improved C2F module includes a first convolutional layer, several FineNet modules, a first Concat module and a second convolutional module, the first output end of the first convolutional layer is connected to the input end of the FineNet module, the output end of the FineNet module is connected to the first input end of the first Concat module, the second output end of the first convolutional layer is connected to the second input end of the first Concat module, and the output end of the first Concat module is connected to the input end of the second convolutional module, wherein:
[0021] The FineNet module includes a Split network layer and a Bottleneck network layer, and the output end of the Split network layer is connected to the input end of the Bottleneck network layer;
[0022] The Bottleneck network layer includes a third convolutional layer and a fourth convolutional layer.
[0023] In some embodiments, the method of predicting the rotation target frame data of the target area parking space image by using the improved YOLOv8n_obb network model to obtain the target area parking space prediction frame includes:
[0024] Inputting the rotation target frame data of the target area parking space image into the improved YOLOv8n_obb network model;
[0025] Based on the backbone network module of the improved YOLOv8n_obb network model, feature extraction processing is performed on the rotation target frame data of the parking space image in the target area to obtain the rotation target frame feature data of the parking space image in the target area;
[0026] Based on the neck module of the improved YOLOv8n_obb network model, feature fusion processing is performed on the rotation target frame feature data of the parking space image in the target area to obtain fused rotation target frame feature data of the parking space image in the target area;
[0027] Based on the prediction module of the improved YOLOv8n_obb network model, the rotation target frame feature data of the fused target area parking space image is predicted to obtain the target area parking space prediction frame.
[0028] In some embodiments, the backbone network module based on the improved YOLOv8n_obb network model performs feature extraction processing on the target area parking space image rotation target frame data to obtain the target area parking space image rotation target frame feature data, including:
[0029] Input the rotation target frame data of the parking space image in the target area into the backbone network module of the improved YOLOv8n_obb network model;
[0030] Based on the convolution module of the backbone network module, convolution processing is performed on the rotation target frame data of the parking space image in the target area to obtain the rotation target frame data of the parking space image in the target area after convolution;
[0031] Based on the improved C2F module of the backbone network module, feature dimension reduction processing is performed on the rotation target frame data of the parking space image in the target area after the convolution to obtain the rotation target frame data of the parking space image in the target area after dimension reduction;
[0032] Based on the cross-layer connected convolutional layer of the backbone network module, convolution processing is performed on the rotated target frame data of the parking space image in the target area after the convolution to obtain the rotated target frame data of the parking space image in the target area after secondary convolution;
[0033] Based on the Concat module of the backbone network module, the rotated target frame data of the parking space image in the target area after the dimension reduction and the rotated target frame data of the parking space image in the target area after the secondary convolution are fused and spliced to obtain preliminary rotated target frame feature data of the parking space image in the target area;
[0034] Based on the SPPF module of the backbone network module, block pooling processing is performed on the preliminary target area parking space image rotation target frame feature data to obtain the target area parking space image rotation target frame feature data.
[0035] In some embodiments, the improved C2F module based on the backbone network module performs feature dimensionality reduction processing on the rotated target frame data of the target area parking space image after convolution to obtain the rotated target frame data of the target area parking space image after dimensionality reduction, including:
[0036] Inputting the rotation target frame data of the convolved target area parking space image into the improved C2F module of the backbone network module;
[0037] Based on the first convolution layer of the improved C2F module, feature extraction processing is performed on the rotated target frame data of the target area parking space image after the convolution to obtain convolution feature data of the rotated target frame of the target area parking space image;
[0038] Based on the FineNet module of the improved C2F module, multi-scale information extraction processing is performed on the convolution feature data of the rotation target frame of the parking space image in the target area to obtain multi-scale feature data of the rotation target frame of the parking space image in the target area;
[0039] Based on the first Concat module of the improved C2F module, the convolution feature data of the rotation target frame of the parking space image in the target area and the multi-scale feature data of the rotation target frame of the parking space image in the target area are fused and spliced to obtain compressed rotation target frame data of the parking space image in the target area;
[0040] Based on the second convolution module of the improved C2F module, convolution processing is performed on the compressed target area parking space image rotation target frame data to obtain the target area parking space image rotation target frame data after dimension reduction.
[0041] In some embodiments, the FineNet module based on the improved C2F module performs multi-scale information extraction processing on the convolution feature data of the rotation target frame of the parking space image in the target area to obtain the multi-scale feature data of the rotation target frame of the parking space image in the target area, including:
[0042] Inputting the convolution feature data of the rotation target frame of the parking space image in the target area into the FineNet module of the improved C2F module;
[0043] Based on the Split network layer of the FineNet module, multi-scale segmentation processing is performed on the convolution feature data of the rotation target frame of the parking space image in the target area to obtain multi-scale feature data of the rotation target frame of the parking space image in the first target area and multi-scale feature data of the rotation target frame of the parking space image in the second target area;
[0044] Based on the Bottleneck network layer of the FineNet module, weighted fusion processing is performed on the multi-scale feature data of the rotated target frame of the first target area parking space image and the multi-scale feature data of the rotated target frame of the second target area parking space image to obtain the multi-scale feature data of the rotated target frame of the target area parking space image.
[0045] In some embodiments, the combining the target area vehicle prediction frame and the target area parking space prediction frame and performing non-maximum filtering to obtain a vehicle behavior recognition result includes:
[0046] Obtaining the width and height of the target area vehicle prediction frame and the width and height of the target area parking space prediction frame, and determining the area of the target area vehicle prediction frame and the area of the target area parking space prediction frame;
[0047] Set area threshold;
[0048] Eliminate the prediction frames whose areas of the target area vehicle prediction frame and the target area parking space prediction frame are smaller than the prediction frames corresponding to the area threshold, to obtain the eliminated target area vehicle prediction frame and the eliminated target area parking space prediction frame;
[0049] The IoU calculation is performed on the vehicle prediction frame of the target area after elimination and the parking space prediction frame of the target area after elimination, respectively, and the vehicle behavior recognition result is determined according to the calculation results.
[0050] To achieve the above-mentioned purpose, another aspect of the embodiment of the present application proposes a system for identifying irregular parking behavior based on machine vision, the system comprising:
[0051] A labeling module is used to obtain a parking space image of a target area and perform data labeling processing to obtain a labeled parking space image of the target area, wherein the labeled parking space image of the target area includes rectangular target frame data of the parking space image of the target area and rotated target frame data of the parking space image of the target area;
[0052] The first prediction module is used to predict the rectangular target frame data of the parking space image in the target area through the YOLOv8 network model to obtain a vehicle prediction frame in the target area;
[0053] The construction module is used to introduce the improved C2F module and the cross-layer connected convolutional layer to build an improved YOLOv8n_obb network model;
[0054] A second prediction module is used to predict the rotation target frame data of the parking space image in the target area through the improved YOLOv8n_obb network model to obtain a parking space prediction frame in the target area;
[0055] The recognition module is used to combine the target area vehicle prediction frame and the target area parking space prediction frame, and perform non-maximum filtering processing to obtain a vehicle behavior recognition result.
[0056] The embodiments of the present application include at least the following beneficial effects: The present application provides a method and system for identifying irregular parking behaviors based on machine vision. The scheme obtains a parking space image in a target area and performs data annotation processing to obtain rectangular target frame data of the parking space image in the target area and rotated target frame data of the parking space image in the target area. The detection accuracy is improved by combining a rectangular frame and a rotated frame. An improved C2F module and a cross-layer connected convolutional layer are further introduced to construct an improved YOLOv8n_obb network model, and non-maximum filtering processing is performed. False recognition is filtered out through the area of the rectangular frame, thereby improving the recognition and detection accuracy of the target frame and providing better guidance on standardized parking behaviors. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 is a flow chart of a method for identifying irregular parking behavior based on machine vision provided in an embodiment of the present application;
[0058] Figure 2 It is a structural schematic diagram of a system for identifying irregular parking behaviors based on machine vision provided in an embodiment of the present application;
[0059] Figure 3 It is a structural diagram of an improved YOLOv8n_obb network model provided in an embodiment of the present application;
[0060] Figure 4 is a schematic diagram of the structure of an improved C2F module provided in an embodiment of the present application;
[0061] Figure 5 It is a schematic diagram of the structure of the Bottleneck network layer provided in an embodiment of the present application;
[0062] Figure 6 It is a schematic diagram of the results of the rotation box prediction and the rectangular box prediction provided in the embodiment of the present application.
[0063] Description of the figures: 1. Backbone network module; 2. Neck module; 3. Prediction module; 4. Cross-layer connected convolutional layer; 5. First convolutional layer; 6. First Concat module; 7. Second convolutional module; 8. Split network layer; 9. Bottleneck network layer; 10. Third convolutional layer; 11. Fourth convolutional layer. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of systems and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0065] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0066] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0068] Reference Figure 1 , Figure 1 A flowchart of a method for identifying irregular parking behaviors based on machine vision provided by an embodiment of the present invention, referring to Figure 1 , the method comprises the following steps:
[0069] S100, acquiring a parking space image in a target area and performing data annotation processing to obtain an annotated parking space image in the target area, wherein the annotated parking space image in the target area includes rectangular target frame data of the parking space image in the target area and rotated target frame data of the parking space image in the target area;
[0070] It should be noted that, in some embodiments, step S100 may include: S110, photographing and collecting the target area through a camera to obtain a parking space image of the target area; S120, performing target frame selection and labeling processing on the parking space image of the target area through the LabelImg tool to obtain rectangular target frame data of the parking space image of the target area; S130, performing target frame selection and labeling and fine-tuning and rotating processing on the parking space image of the target area through the roLabelImg tool to obtain rotated target frame data of the parking space image of the target area; S140, combining the rectangular target frame data of the parking space image of the target area and the rotated target frame data of the parking space image of the target area to obtain the labeled parking space image of the target area.
[0071] In some specific embodiments, surveillance cameras are deployed in the parking lot, i.e., the target area, and drone scenes can be used outdoors to assist. Data is collected according to preset collection points and data is annotated. This article mainly adopts two different annotation schemes. The first is to use LabelImg to annotate rectangular frame data. The rectangular frame annotation only annotates vehicles. The second is to use roLabelImg to annotate the rotated target frame data. The target objects of the rotating frame annotation are the line type annotations of the vehicle and parking space rectangular frames into two categories.
[0072] LabelImg labeling: First, open the image to be labeled in the installed LabelImg software, find the labeled target in the image, start from the upper left corner, drag to the lower right corner of the target, and enter the category of the labeled target.
[0073] roLabelImg labeling: In the installed roLabelImg software, label the target. First, roughly frame the upper left corner and lower right corner of the target image. Then, fine-tune and rotate it in the software so that the frame completely contains the target.
[0074] S200, predicting the rectangular target frame data of the parking space image in the target area through the YOLOv8 network model to obtain a vehicle prediction frame in the target area;
[0075] S300, introduce the improved C2F module and the cross-layer connected convolutional layer to build an improved YOLOv8n_obb network model;
[0076] First of all, it should be noted that the data set is divided into a training set, a test set, and a validation set for training. The training parameters can be adjusted according to the actual training equipment situation. A better model is obtained. For the rotating box model, the embodiment of the present invention selects the YOLOv8n_obb model to generate a rotating target box detection. The parking line detection rotating rectangular box and the vehicle rotating rectangular box are generated respectively. For the rectangular box, only the vehicle is detected as a rectangular box vehicle. For the original YOLOv8 network, the input is the rectangular box data annotated by the LabelImg annotation tool. However, the input of YOLOv8n_obb is the rotating box data generated by the roLabelImg annotation. Compared with the rectangular box, the rotating box can contain the target area to the maximum extent and reduce the non-target area. For the output of the model, the original YOLOv8 output is the predicted upper left corner and lower right corner of the rectangular box. The output of YOLOv8n_obb predicts the rotation angle, the center point of the target, and the width and height of the target prediction range. This improvement is to better judge the target area when outputting the selection box. In addition, when there is a high-confidence misidentification, the original method of removing erroneous candidate boxes by confidence is changed to a filtering method of calculating the target area, which effectively reduces misidentification and improves detection accuracy.
[0077] In some specific embodiments, Figure 3 As shown, the improved YOLOv8n_obb network model includes a backbone network module 1, a neck module 2 and a prediction module 3, the output end of the backbone network module is connected to the input end of the neck module, and the output end of the neck module is connected to the input end of the prediction module, wherein the backbone network module includes an SPPF module, an improved C2F module, a convolution module and a Concat module, wherein the output end of the improved C2F module is connected to the input end of the Concat module through a cross-layer connected convolution layer 4; the neck module includes an FPN layer and a PAN layer; the prediction module includes a convolution layer.
[0078] Specifically, Figure 4 As shown, the improved C2F module includes a first convolutional layer 5, several FineNet modules, a first Concat module 6 and a second convolutional module 7, the first output end of the first convolutional layer is connected to the input end of the FineNet module, the output end of the FineNet module is connected to the first input end of the first Concat module, the second output end of the first convolutional layer is connected to the second input end of the first Concat module, and the output end of the first Concat module is connected to the input end of the second convolutional module, wherein the FineNet module includes a Split network layer 8 and a Bottleneck network layer 9, and the output end of the Split network layer is connected to the input end of the Bottleneck network layer; as shown Figure 5As shown, the Bottleneck network layer includes a third convolutional layer 10 and a fourth convolutional layer 11.
[0079] S400, predicting the rotation target frame data of the parking space image in the target area through the improved YOLOv8n_obb network model to obtain a parking space prediction frame in the target area;
[0080] It should be noted that, in some embodiments, step S400 may include: S410, inputting the rotated target frame data of the parking space image in the target area into the improved YOLOv8n_obb network model; S420, based on the backbone network module of the improved YOLOv8n_obb network model, performing feature extraction processing on the rotated target frame data of the parking space image in the target area to obtain feature data of the rotated target frame of the parking space image in the target area; S430, based on the neck module of the improved YOLOv8n_obb network model, performing feature fusion processing on the feature data of the rotated target frame of the parking space image in the target area to obtain fused feature data of the rotated target frame of the parking space image in the target area; S440, based on the prediction module of the improved YOLOv8n_obb network model, predicting the fused feature data of the rotated target frame of the parking space image in the target area to obtain a prediction frame of the parking space in the target area.
[0081] Among them, it should be noted that the backbone network module based on the improved YOLOv8n_obb network model performs feature extraction processing on the rotation target frame data of the parking space image in the target area to obtain the feature data of the rotation target frame of the parking space image in the target area, including: inputting the rotation target frame data of the parking space image in the target area into the backbone network module of the improved YOLOv8n_obb network model; based on the convolution module of the backbone network module, performing convolution processing on the rotation target frame data of the parking space image in the target area to obtain the convolved rotation target frame data of the parking space image in the target area; based on the improved C2F module of the backbone network module, performing feature dimensionality reduction processing on the rotation target frame data of the parking space image in the target area to obtain the reduced dimensionality The target area parking image rotated target frame data; based on the cross-layer connected convolution layer of the backbone network module, the convolution processing is performed on the target area parking image rotated target frame data after the convolution to obtain the target area parking image rotated target frame data after the secondary convolution; based on the Concat module of the backbone network module, the target area parking image rotated target frame data after dimensionality reduction and the target area parking image rotated target frame data after the secondary convolution are fused and spliced to obtain preliminary target area parking image rotated target frame feature data; based on the SPPF module of the backbone network module, the preliminary target area parking image rotated target frame feature data is processed by block pooling to obtain the target area parking image rotated target frame feature data.
[0082] Furthermore, based on the improved C2F module of the backbone network module, feature dimension reduction processing is performed on the rotation target frame data of the parking space image in the target area after convolution to obtain the rotation target frame data of the parking space image in the target area after dimension reduction, including: inputting the rotation target frame data of the parking space image in the target area after convolution into the improved C2F module of the backbone network module; based on the first convolution layer of the improved C2F module, feature extraction processing is performed on the rotation target frame data of the parking space image in the target area after convolution to obtain the convolution feature data of the rotation target frame of the parking space image in the target area; based on the FineNet module of the improved C2F module, The multi-scale information extraction process is performed on the convolution feature data of the rotation target frame of the parking space image to obtain the multi-scale feature data of the rotation target frame of the parking space image in the target area; based on the first Concat module of the improved C2F module, the convolution feature data of the rotation target frame of the parking space image in the target area and the multi-scale feature data of the rotation target frame of the parking space image in the target area are fused and spliced to obtain the compressed rotation target frame data of the parking space image in the target area; based on the second convolution module of the improved C2F module, the compressed rotation target frame data of the parking space image in the target area is convolved to obtain the rotation target frame data of the parking space image in the target area after dimensionality reduction.
[0083] More specifically, based on the FineNet module of the improved C2F module, multi-scale information extraction processing is performed on the convolution feature data of the rotation target frame of the parking space image in the target area to obtain multi-scale feature data of the rotation target frame of the parking space image in the target area, including: inputting the convolution feature data of the rotation target frame of the parking space image in the target area into the FineNet module of the improved C2F module; based on the Split network layer of the FineNet module, multi-scale segmentation processing is performed on the convolution feature data of the rotation target frame of the parking space image in the target area to obtain multi-scale feature data of the rotation target frame of the parking space image in the first target area and multi-scale feature data of the rotation target frame of the parking space image in the second target area; based on the Bottleneck network layer of the FineNet module, weighted fusion processing is performed on the multi-scale feature data of the rotation target frame of the parking space image in the first target area and the multi-scale feature data of the rotation target frame of the parking space image in the second target area to obtain multi-scale feature data of the rotation target frame of the parking space image in the target area.
[0084] Specifically, the improved YOLOv8_obb model is mainly composed of four parts. The first is the input of the original image. The input image is uniformly scaled to a resolution of 640*640 and then sent to the backbone network feature extraction module. The feature extraction module mainly uses a convolutional neural network model to extract convolutional features. The extracted convolutional features are used to classify the target. It is predicted to be a certain target. Then a rotated target box is generated within the range of a certain target. The YOLOv8_obb backbone network model is still the YOLOv8 model, but we have modified the network structure as shown in the improved YOLOv8, outputting the upper convolution, and realizing the reuse of deep information flow through the cross-layer connection to reduce the problem of deep information loss in the network. And the output is set to the rotated target box output.
[0085] S500, combining the target area vehicle prediction frame and the target area parking space prediction frame, and performing non-maximum filtering processing to obtain a vehicle behavior recognition result;
[0086] It should be noted that, in some embodiments, step S500 may include: S510, obtaining the width and height of the target area vehicle prediction frame and the width and height of the target area parking space prediction frame, and determining the area of the target area vehicle prediction frame and the area of the target area parking space prediction frame; S520, setting an area threshold; S530, eliminating the prediction frames whose areas of the target area vehicle prediction frame and the target area parking space prediction frame are smaller than the area threshold, and obtaining the eliminated target area vehicle prediction frame and the eliminated target area parking space prediction frame; S540, respectively performing IoU calculation on the eliminated target area vehicle prediction frame and the eliminated target area parking space prediction frame, and determining the vehicle behavior recognition result according to the calculation results.
[0087] In some specific embodiments, there will be certain misidentifications for training a better model. In addition to increasing data, the solution of the embodiment of the present invention can also remove high-confidence target boxes for non-maximum filtering. Traditional non-maximum filtering is to predict the confidence of each target box, select the maximum confidence, perform IoU calculation with other target boxes, and perform intersection and union calculation. Remove redundant target boxes according to a given threshold. However, some high-confidence target boxes still exist and will not be filtered. Therefore, we take the width and height of the target box to calculate the area of the target box. The size of the basic target box for parking spaces or vehicles is fixed. Therefore, we set a certain threshold to filter target boxes with smaller areas first. Then sort according to the area, select the target box with larger area and the rest for IoU calculation, and filter them in turn according to the area size. Finally, save the correct target box.
[0088] It should be noted that the rectangular frame model is used to determine whether the vehicle exists and has stopped; the rotating frame model is used to determine whether the vehicle has stopped properly.
[0089] To summarize, first detect whether there is a long-term vehicle entering and not driving into the parking space. This paper uses the rectangular box YOLOv8n detection algorithm for detection and the DeepSort algorithm for tracking. Start timing when the vehicle is detected, set the time interval, and calculate the IoU between the current vehicle rectangular target box and the target box of the previous timing in the same monitoring scene. If there is a high overlap, it is judged that the vehicle has stopped. And through the output of the rotating box of the target and the center point of the rotating box. Determine the parking space box closest to the rotating box target of the vehicle. By calculating the IoU of the rotating box, count the IoU of the vehicle and the rotating boxes of different parking spaces. If it is greater than a certain threshold, it means that the vehicle is detected and parked normally. If it is less than a certain threshold, it means that the vehicle is not parked in a standardized manner. At this time, the platform interface pops up an alarm. Remind the management personnel to start control.
[0090] like Figure 6 As shown in the figure, the blue part of the picture indicates the position of the parking space target frame predicted by the rotating frame, the orange part indicates the parking target position, and the transparent box outside indicates the position of the rectangular box predicted by YOLOv8. It can be seen that the rectangular box contains a large number of non-target areas. The IoU calculation calculated in this way is inaccurate, so the rotating target box is used.
[0091] In addition, for video stream detection, we set up auxiliary services to prevent video stream interruption. Once interruption occurs, we can immediately kill the process and start the auxiliary service to continue video stream detection.
[0092] For the image capture, recognition and display phase, we use the flask communication protocol to start the service and initialize the model in advance. This saves the model loading and initialization time. Different users can call the same service resource, improving user efficiency.
[0093] Therefore, the embodiment of the present invention adopts an artificial intelligence detection algorithm, combines rectangular frame detection and rotating target frame detection, and embeds a deepsort algorithm. By removing the traditional method of filtering the target frame by confidence, the target frame area size is used for calculation, which effectively reduces the probability of misidentification. The detection accuracy is improved. Auxiliary services are set, and the initialization model is pre-loaded, which improves the detection efficiency and the efficiency of vehicle standard management.
[0094] See also Figure 2 The embodiment of the present application further provides a system for identifying irregular parking behaviors based on machine vision, which can implement the above-mentioned method for identifying irregular parking behaviors based on machine vision. The system includes:
[0095] A labeling module is used to obtain a parking space image of a target area and perform data labeling processing to obtain a labeled parking space image of the target area, wherein the labeled parking space image of the target area includes rectangular target frame data of the parking space image of the target area and rotated target frame data of the parking space image of the target area;
[0096] The first prediction module is used to predict the rectangular target frame data of the parking space image in the target area through the YOLOv8 network model to obtain a vehicle prediction frame in the target area;
[0097] The construction module is used to introduce the improved C2F module and the cross-layer connected convolutional layer to build an improved YOLOv8n_obb network model;
[0098] A second prediction module is used to predict the rotation target frame data of the parking space image in the target area through the improved YOLOv8n_obb network model to obtain a parking space prediction frame in the target area;
[0099] The recognition module is used to combine the target area vehicle prediction frame and the target area parking space prediction frame, and perform non-maximum filtering processing to obtain a vehicle behavior recognition result.
[0100] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0101] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for identifying irregular parking behaviors based on machine vision, characterized in that: The method comprises the following steps: Acquire a parking space image of a target area and perform data annotation processing to obtain an annotated parking space image of the target area, wherein the annotated parking space image of the target area includes rectangular target frame data of the parking space image of the target area and rotated target frame data of the parking space image of the target area; The rectangular target frame data of the parking space image in the target area is predicted by using the YOLOv8 network model to obtain a vehicle prediction frame in the target area; Introduce the improved C2F module and the cross-layer connected convolutional layer to build an improved YOLOv8n_obb network model; The rotation target frame data of the parking space image in the target area is predicted by the improved YOLOv8n_obb network model to obtain a parking space prediction frame in the target area; The target area vehicle prediction frame and the target area parking space prediction frame are combined, and non-maximum filtering processing is performed to obtain a vehicle behavior recognition result.
2. The method according to claim 1, characterized in that: The step of acquiring the parking space image of the target area and performing data annotation processing to obtain the annotated parking space image of the target area includes: The target area is photographed and collected by a camera to obtain a parking space image of the target area; Performing target frame selection and labeling processing on the parking space image in the target area by using the LabelImg tool to obtain rectangular target frame data of the parking space image in the target area; Perform target frame selection and labeling and fine-tune the rotation of the parking space image in the target area by using the roLabelImg tool to obtain the rotation target frame data of the parking space image in the target area; The marked target area parking space image is obtained by combining the rectangular target frame data of the target area parking space image and the rotated target frame data of the target area parking space image.
3. The method according to claim 1, characterized in that The improved YOLOv8n_obb network model includes a backbone network module, a neck module and a prediction module, wherein the output end of the backbone network module is connected to the input end of the neck module, and the output end of the neck module is connected to the input end of the prediction module, wherein: The backbone network module includes an SPPF module, an improved C2F module, a convolution module and a Concat module, wherein the output end of the improved C2F module is connected to the input end of the Concat module through the cross-layer connected convolution layer; The neck module includes an FPN layer and a PAN layer; The prediction module includes a convolutional layer.
4. The method according to claim 3, characterized in that The improved C2F module includes a first convolutional layer, a plurality of FineNet modules, a first Concat module and a second convolutional module, wherein the first output end of the first convolutional layer is connected to the input end of the FineNet module, the output end of the FineNet module is connected to the first input end of the first Concat module, the second output end of the first convolutional layer is connected to the second input end of the first Concat module, and the output end of the first Concat module is connected to the input end of the second convolutional module, wherein: The FineNet module includes a Split network layer and a Bottleneck network layer, and the output end of the Split network layer is connected to the input end of the Bottleneck network layer; The Bottleneck network layer includes a third convolutional layer and a fourth convolutional layer.
5. The method according to claim 4, characterized in that The method predicts the rotation target frame data of the parking space image in the target area by using the improved YOLOv8n_obb network model to obtain the parking space prediction frame in the target area, including: Inputting the rotation target frame data of the target area parking space image into the improved YOLOv8n_obb network model; Based on the backbone network module of the improved YOLOv8n_obb network model, feature extraction processing is performed on the rotation target frame data of the parking space image in the target area to obtain the rotation target frame feature data of the parking space image in the target area; Based on the neck module of the improved YOLOv8n_obb network model, feature fusion processing is performed on the rotation target frame feature data of the parking space image in the target area to obtain fused rotation target frame feature data of the parking space image in the target area; Based on the prediction module of the improved YOLOv8n_obb network model, the rotation target frame feature data of the fused target area parking space image is predicted to obtain the target area parking space prediction frame.
6. The method according to claim 5, characterized in that The backbone network module based on the improved YOLOv8n_obb network model performs feature extraction processing on the target area parking space image rotation target frame data to obtain the target area parking space image rotation target frame feature data, including: Input the rotation target frame data of the parking space image in the target area into the backbone network module of the improved YOLOv8n_obb network model; Based on the convolution module of the backbone network module, convolution processing is performed on the rotation target frame data of the parking space image in the target area to obtain the rotation target frame data of the parking space image in the target area after convolution; Based on the improved C2F module of the backbone network module, feature dimension reduction processing is performed on the rotation target frame data of the parking space image in the target area after the convolution to obtain the rotation target frame data of the parking space image in the target area after dimension reduction; Based on the cross-layer connected convolutional layer of the backbone network module, convolution processing is performed on the rotated target frame data of the parking space image in the target area after the convolution to obtain the rotated target frame data of the parking space image in the target area after secondary convolution; Based on the Concat module of the backbone network module, the rotated target frame data of the parking space image in the target area after the dimension reduction and the rotated target frame data of the parking space image in the target area after the secondary convolution are fused and spliced to obtain preliminary rotated target frame feature data of the parking space image in the target area; Based on the SPPF module of the backbone network module, block pooling processing is performed on the preliminary target area parking space image rotation target frame feature data to obtain the target area parking space image rotation target frame feature data.
7. The method according to claim 6, characterized in that The improved C2F module based on the backbone network module performs feature dimension reduction processing on the rotated target frame data of the parking space image in the target area after convolution to obtain the rotated target frame data of the parking space image in the target area after dimension reduction, including: Inputting the rotation target frame data of the convolved target area parking space image into the improved C2F module of the backbone network module; Based on the first convolution layer of the improved C2F module, feature extraction processing is performed on the rotated target frame data of the parking space image in the target area after the convolution to obtain convolution feature data of the rotated target frame of the parking space image in the target area; Based on the FineNet module of the improved C2F module, multi-scale information extraction processing is performed on the convolution feature data of the rotation target frame of the parking space image in the target area to obtain multi-scale feature data of the rotation target frame of the parking space image in the target area; Based on the first Concat module of the improved C2F module, the convolution feature data of the rotation target frame of the parking space image in the target area and the multi-scale feature data of the rotation target frame of the parking space image in the target area are fused and spliced to obtain compressed rotation target frame data of the parking space image in the target area; Based on the second convolution module of the improved C2F module, convolution processing is performed on the compressed target area parking space image rotation target frame data to obtain the target area parking space image rotation target frame data after dimension reduction.
8. The method according to claim 7, characterized in that The FineNet module based on the improved C2F module performs multi-scale information extraction processing on the convolution feature data of the rotation target frame of the parking space image in the target area to obtain the multi-scale feature data of the rotation target frame of the parking space image in the target area, including: Inputting the convolution feature data of the rotation target frame of the parking space image in the target area into the FineNet module of the improved C2F module; Based on the Split network layer of the FineNet module, multi-scale segmentation processing is performed on the convolution feature data of the rotation target frame of the parking space image in the target area to obtain multi-scale feature data of the rotation target frame of the parking space image in the first target area and multi-scale feature data of the rotation target frame of the parking space image in the second target area; Based on the Bottleneck network layer of the FineNet module, weighted fusion processing is performed on the multi-scale feature data of the rotated target frame of the first target area parking space image and the multi-scale feature data of the rotated target frame of the second target area parking space image to obtain the multi-scale feature data of the rotated target frame of the target area parking space image.
9. The method according to claim 1, characterized in that: The combining the target area vehicle prediction frame and the target area parking space prediction frame and performing non-maximum filtering processing to obtain a vehicle behavior recognition result includes: Obtaining the width and height of the target area vehicle prediction frame and the width and height of the target area parking space prediction frame, and determining the area of the target area vehicle prediction frame and the area of the target area parking space prediction frame; Set area threshold; Eliminate the prediction frames whose areas of the target area vehicle prediction frame and the target area parking space prediction frame are smaller than the prediction frames corresponding to the area threshold, to obtain the eliminated target area vehicle prediction frame and the eliminated target area parking space prediction frame; The IoU calculation is performed on the vehicle prediction frame of the target area after elimination and the parking space prediction frame of the target area after elimination, respectively, and the vehicle behavior recognition result is determined according to the calculation results.
10. A system for identifying irregular parking behaviors based on machine vision, characterized in that: The system comprises: A labeling module is used to obtain a parking space image of a target area and perform data labeling processing to obtain a labeled parking space image of the target area, wherein the labeled parking space image of the target area includes rectangular target frame data of the parking space image of the target area and rotated target frame data of the parking space image of the target area; The first prediction module is used to predict the rectangular target frame data of the parking space image in the target area through the YOLOv8 network model to obtain a vehicle prediction frame in the target area; The construction module is used to introduce the improved C2F module and the cross-layer connected convolutional layer to build an improved YOLOv8n_obb network model; A second prediction module is used to predict the rotation target frame data of the parking space image in the target area through the improved YOLOv8n_obb network model to obtain a parking space prediction frame in the target area; The recognition module is used to combine the target area vehicle prediction frame and the target area parking space prediction frame, and perform non-maximum filtering processing to obtain a vehicle behavior recognition result.
Citation Information
Patent Citations
Method and device for detecting vehicle area in parking space
CN110688902A
On-road non-standard parking identification method based on video data
CN113378690A
Road vehicle detection and tracking method based on deep learning
CN116110009A
Parking space and vehicle state monitoring method
CN116343106A
Method and device for detecting use state of parking space
CN117115467A
Cited By
Roadside intelligent parking target detection method based on improved YOlOv8 model
CN119904623A
