Sewage suspended matter identification method and system based on IA-YOLOV7

By using an IA-YOLOV7-based method for identifying suspended solids in wastewater, the target image is processed using the Image-Adaptive YOLOV7 model to generate target label information for suspended solids. This solves the problem of wastewater suspended solids identification being affected by harsh natural environments and achieves high-precision identification results.

CN116665092BActive Publication Date: 2025-12-12JINAN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310559438.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-17
Publication Date
2025-12-12
Estimated Expiration
2043-05-17

AI Technical Summary

Technical Problem

The identification of suspended solids in wastewater using existing technologies is affected by harsh natural environments, resulting in high difficulty and low accuracy.

Method used

A wastewater suspended solids identification method based on IA-YOLOV7 is adopted. By acquiring target images and processing them using the Image-Adaptive YOLOV7 target detection model, target label information and identification results of suspended solids are generated, including suspended solids category label information and location information. Deep learning algorithms and image adaptive processing are combined to reduce the influence of natural environmental noise.

Benefits of technology

It has achieved accurate detection and identification of suspended solids in sewage under harsh natural environments, improving detection accuracy and identification rate, and solving the problems of high identification difficulty and low accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116665092B_ABST
    Figure CN116665092B_ABST
Patent Text Reader

Abstract

The application relates to a sewage suspended matter identification method and system based on IA-YOLOV7. The method comprises the following steps: obtaining a target image to be identified, the target image being obtained from video stream data for detecting a sewage flowing medium; processing the target image by using an image self-adaptive Image-Adaptive YOLOV7 target detection model which has been constructed, to obtain target label information of the sewage suspended matter, the target label information comprising suspended matter category label information and suspended matter position information, the Image-Adaptive YOLOV7 target detection model being a baseline model taking a YOLOV7 standard model as the baseline model and being trained based on a preset image data set and measured suspended matter category label information and measured suspended matter position information corresponding to images of the image data set; and generating an identification result of the sewage suspended matter based on the suspended matter category label information, the suspended matter position information and the target image. Through the application, the problem that the identification of sewage suspended matter in the related art is affected by a harsh natural environment, resulting in great difficulty in identifying the sewage suspended matter and low identification accuracy is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a sewage suspended matter identification method and system based on IA-YOLOV7. BACKGROUND

[0002] The urban sewage treatment comprehensive operation and management platform or system based on the Internet of Things and cloud computing provides a safe management platform for sewage operation enterprises, which can uniformly manage enterprise real-time production data, video monitoring data, process design, daily management and other related data, and provide immediate and rich production operation information for production operation managers, so as to assist in decision-making, realize standardized management, energy saving and consumption reduction, staff reduction and efficiency increase, and fine management.

[0003] In the related art, a sewage supervision system based on image recognition is used to automatically supervise urban sewage treatment. However, the treatment of sewage suspended matter is particularly important in sewage treatment supervision, such as classification screening, settling, filtering and collecting according to the category of sewage suspended matter. In the related art, a conventional visual detection module needs to perform complex algorithm processing on images to complete the detection work, which has large errors, low accuracy, and high requirements for the working environment, thereby causing low detection rate and low identification accuracy of the suspended matter in the sewage environment. At the same time, the visual detection module in the related art is greatly affected by bad weather (for example, smog), and the image noise caused by the natural environment is high, which further reduces the accuracy of the identification of sewage suspended matter.

[0004] At present, there is no effective solution to the problem that the identification of sewage suspended matter in the related art is affected by bad natural environment, which causes great difficulty in identifying sewage suspended matter and low identification accuracy. SUMMARY

[0005] The embodiments of the present application provide a sewage suspended matter identification method and system based on IA-YOLOV7, and a storage medium, to at least solve the problem that the identification of sewage suspended matter in the related art is affected by bad natural environment, which causes great difficulty in identifying sewage suspended matter and low identification accuracy.

[0006] In a first aspect, the embodiments of the present application provide a sewage suspended matter identification method based on IA-YOLOV7, comprising: acquiring a target image to be identified, wherein the target image is acquired from video stream data for detecting a sewage flowing medium; processing the target image by using an Image-Adaptive YOLOV7 target detection model that has been constructed, to obtain target label information corresponding to sewage suspended matter, wherein the target label information comprises suspended matter category label information and suspended matter position information, the Image-Adaptive YOLOV7 target detection model is a baseline model based on a YOLOV7 standard model, and is trained based on a preset image data set and measured suspended matter category label information and measured suspended matter position information corresponding to images of the image data set; generating an identification result of sewage suspended matter based on the suspended matter category label information, the suspended matter position information and the target image, wherein the identification result comprises a target area where target sewage suspended matter appears, which is marked in the form of a preset detection frame.

[0007] In a second aspect, the embodiments of the present application provide a sewage suspended matter identification system, comprising: a camera acquisition module, a transmission device and a server device; wherein the camera acquisition module is connected to the server device through the transmission device; the camera acquisition module is configured to acquire video stream data for detecting a sewage flowing medium; the transmission device is configured to transmit the video stream data to the server device, and to transmit an identification result generated by the server device after executing the sewage suspended matter identification method based on IA-YOLOV7 of the first aspect to a front-end webpage of the server device for display.

[0008] In a third aspect, the embodiments of the present application provide a storage medium having a computer program stored thereon, the program being executed by a processor to implement the sewage suspended matter identification method based on IA-YOLOV7 of the first aspect.

[0009] Compared with the related art, the sewage suspended matter identification method and system based on IA-YOLOV7 and the storage medium provided by the embodiments of the present application obtain a target image to be identified, wherein the target image is obtained from video stream data of a sewage flowing medium; an image adaptive Image-Adaptive YOLOV7 target detection model that has been constructed is used to process the target image to obtain target label information corresponding to the sewage suspended matter, wherein the target label information includes suspended matter category label information and suspended matter position information, the Image-Adaptive YOLOV7 target detection model is based on a YOLOV7 standard model as a baseline model and is trained based on a preset image data set and measured suspended matter category label information and measured suspended matter position information corresponding to images of the image data set; based on the suspended matter category label information, the suspended matter position information and the target image, an identification result of the sewage suspended matter is generated, wherein the identification result includes a target region where the target sewage suspended matter appears marked in the form of a preset detection frame, the Image-Adaptive YOLOV7 target detection model is used to filter and perform image adaptive processing on the target image to reduce image noise introduced due to the influence of the natural environment, to provide detection accuracy and recognition rate, and meanwhile, the YOLOV7 training target detection model based on the deep learning algorithm is used to improve the sewage suspended matter detection effect and robustness, thereby solving the problem in the related art that the identification of the sewage suspended matter is affected by the harsh natural environment, resulting in great difficulty in identifying the sewage suspended matter and low identification accuracy, and achieving the beneficial effect of accurate detection and identification of the sewage suspended matter in the harsh natural environment.

[0010] The details of one or more embodiments of the present application are presented in the following drawings and description to make other features, objects and advantages of the present application more apparent. BRIEF DESCRIPTION OF DRAWINGS

[0011] The drawings described herein are intended to provide further understanding of the present application, and constitute a part of the present application. The illustrative embodiments of the present application and their description serve to explain the present application, and do not constitute an improper limitation on the present application. In the drawings:

[0012] Figure 1 is a hardware structure block diagram of a terminal of the sewage suspended matter identification method based on IA-YOLOV7 according to the embodiments of the present application;

[0013] Figure 2 is a flowchart of the sewage suspended matter identification method based on IA-YOLOV7 according to the embodiments of the present application;

[0014] Figure 3 is a structure block diagram of the sewage suspended matter identification device based on IA-YOLOV7 according to the embodiments of the present application. DETAILED DESCRIPTION

[0015] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application is described and explained below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application and should not be used to limit the present application. Based on the embodiments provided by the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of the present application. In addition, it should be understood that, although the efforts made in this development process can be complex and lengthy, some design, manufacture or production changes made on the basis of the technical content disclosed in the present application by those of ordinary skill in the art related to the content disclosed in the present application are only routine technical means and should not be understood as insufficient disclosure of the present application.

[0016] In the present application, the term "embodiment" means that the specific features, structures or properties described in conjunction with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor is it an independent or alternative embodiment to other embodiments. Those of ordinary skill in the art explicitly and implicitly understand that the embodiments described in the present application can be combined with other embodiments without conflict.

[0017] Unless otherwise defined, the technical terms or scientific terms involved in the present application should be understood as the usual meaning by those of ordinary skill in the art to which the present application belongs. The terms "one", "a", "an", "the", and the like similar words involved in the present application do not represent quantity limitation, but can represent singular or plural. The terms "include", "contain", "have", and any variations thereof involved in the present application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or device including a series of steps or modules (units) is not limited to the listed steps or units, but can also include steps or units not listed, or can also include other steps or units inherent to the process, method, product or device. The "multiple links" involved in the present application refers to more than or equal to two links. "And / or" describes the association between the associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that A exists alone, A and B exist together, and B exists alone. The terms "first", "second", "third", and the like involved in the present application only distinguish similar objects, and do not represent a specific order for the objects.

[0018] The method embodiments provided by the present embodiment can be executed in a terminal, a computer or a similar computing device. Taking the case of running on a terminal, Figure 1is a hardware structure block diagram of a terminal of the sewage suspended solids identification method based on IA-YOLOV7 of the embodiment of the present application. As shown in Figure 1 , the terminal can include one or more (only one is shown in the Figure 1 ) processor 102 (the processor 102 can include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the above terminal can also include a transmission device 106 for communication function and an input and output device 108. Those skilled in the art can understand that Figure 1 the structure shown is only schematic, which does not limit the structure of the above terminal. For example, the terminal can also include more or less components than Figure 1 shown, or have a different configuration from Figure 1 shown.

[0019] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the sewage suspended solids identification method based on IA-YOLOV7 in the embodiment of the present application. The processor 102 executes various functions and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, which can be connected to the terminal 10 through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0020] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network can include a wireless network provided by a communication provider of the terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, RF for short) module, which is used to communicate with the Internet in a wireless manner.

[0021] The embodiment provides a sewage suspended solids identification method based on IA-YOLOV7 running on the above terminal, Figure 2 is a flowchart of the sewage suspended solids identification method based on IA-YOLOV7 according to the embodiment of the present application, as shown in Figure 2 , the flowchart includes the following steps:

[0022] Step S201, obtaining a target image to be recognized, wherein the target image is obtained from the video stream data of the detected sewage flowing medium.

[0023] In the embodiment, the video stream data is real-time video data collected by a preset camera detection module. By preset scheduling, the overhead view image information of each sewage treatment node can be obtained, that is, the camera detection module is responsible for collecting the video data of the sewage flowing medium. In the embodiment, the distance between the camera detection module and the sewage discharge port is fixed. By considering the fixed transmission delay, the influence of data transmission on the efficiency of sewage suspended matter recognition can be avoided.

[0024] In the embodiment, the camera of the camera detection module adopts a single camera layout arrangement, and is arranged above the sewage flowing medium and collects the overhead view image corresponding to the sewage treatment node. Meanwhile, the camera of each collection node is independently collected.

[0025] Step S202, processing the target image by using the constructed image adaptive Image-Adaptive YOLOV7 target detection model to obtain the target label information corresponding to the sewage suspended matter, wherein the target label information includes suspended matter class label information and suspended matter position information, and the Image-Adaptive YOLOV7 target detection model is a baseline model based on YOLOV7 standard model, and is trained based on the preset image data set and the measured suspended matter class label information and measured suspended matter position information corresponding to the image of the image data set.

[0026] In the embodiment, the Image-Adaptive YOLOV7 target detection model is used to infer and detect the target image collected at the sewage treatment node. If suspended matter is detected in the target image, the suspended matter position information is represented in the form of a preset marking box to mark the edge position of the suspended matter. Meanwhile, the target information corresponding to the suspended matter, that is, the suspended matter class label information, is also labeled, wherein the suspended matter class label information is used to represent the classification category of the suspended matter and the confidence of the corresponding category.

[0027] In the embodiment, the data preprocessing corresponding to the Image-Adaptive YOLOV7 is different from the data processing in the conventional computer vision field. In the embodiment, the IA-YOLO mode is used in an end-to-end manner, that is, the parameters in the data preprocessing module are generated by the training network, so as to realize the preprocessing effect close to the actual processing condition of the adverse weather. The data preprocessing method used in the embodiment includes DIP filter preprocessing and image self-adaptation. The DIP filter preprocessing refers to applying the DIP filter on the input image to reduce the influence of haze and other adverse weather conditions. The image self-adaptation refers to adaptively processing the image according to the content of each image, for example, image size standardization, image normalization, adaptive bounding box calculation, and adaptive image scaling.

[0028] In the embodiment, yolov7-tiny is used as the baseline model, and data augmentation and hyperparameter optimization processing are performed on the data set during the training process. Since the Image-Adaptive YOLOV7 has a preprocessing module, the image is not subjected to sharpness, noise addition, and other processing in the embodiment. Only the "flipping" of part of the insufficient feature data is used for data expansion. At the same time, in order to make the Image-Adaptive YOLOV7 have better recognition effect in adverse conditions, the "atmospheric scattering generation" method is used to simulate "fog images" for model training. In the embodiment, the corresponding hyperparameter optimization is to use grid search, define the learning rate as 0.01-0.0001, and use the Adam optimizer.

[0029] In step S203, based on the suspended matter category label information, the suspended matter position information, and the target image, the recognition result of the sewage suspended matter is generated, wherein the recognition result includes marking the target area where the target sewage suspended matter appears in the form of a preset detection box.

[0030] In the embodiment, after the target category, target confidence, and suspended matter position information of the suspended matter are obtained by the Image-Adaptive YOLOV7 target detection model, the corresponding target category is determined according to the target confidence, and then the target information corresponding to the target is determined to determine whether the corresponding target belongs to the target suspended matter through the target information. After it is determined that the target is the corresponding target suspended matter, the boundary position of the suspended matter is marked on the position corresponding to the suspended matter position information on the target image in the preset detection box (for example, a rectangular box), that is, a bounding box, and the target category and target confidence of the corresponding suspended matter are also marked on the bounding box.

[0031] Through the steps S201 to S203, the target image to be recognized is obtained, wherein the target image is obtained from the video stream data of the sewage flowing medium; the image adaptive Image-Adaptive YOLOV7 target detection model constructed is used to process the target image, and the target label information corresponding to the sewage suspended matter is obtained, wherein the target label information includes suspended matter category label information and suspended matter position information, the Image-Adaptive YOLOV7 target detection model is based on the YOLOV7 standard model as the baseline model, and is trained based on the preset image data set and the measured suspended matter category label information and the measured suspended matter position information corresponding to the image of the image data set; based on the suspended matter category label information, the suspended matter position information and the target image, the recognition result of the sewage suspended matter is generated, wherein the recognition result includes a target area where the target sewage suspended matter appears marked in the form of a preset detection frame, the Image-Adaptive YOLOV7 target detection model is used to filter and image-adaptively process the target image, so as to reduce the image noise introduced by the natural environment, improve the detection accuracy and recognition rate, and improve the sewage suspended matter detection effect and robustness by using the YOLOV7 training target detection model based on the deep learning algorithm. The problem that the recognition of the sewage suspended matter is affected by the harsh natural environment in the related art, and the difficulty of recognizing the sewage suspended matter and the recognition accuracy are low are solved, and the beneficial effect of accurately detecting and recognizing the sewage suspended matter in the harsh natural environment is realized.

[0032] It should be noted that in the present embodiment, after the sewage suspended matter is recognized, the recognition result is pushed to the server in real time and displayed on the Web page of the server in real time. In the present embodiment, the Flask framework of Python and the UDP protocol are used for real-time streaming transmission of the video stream after the suspended matter recognition. In the real-time video transmission process, the video effect is optimized by adjusting the resolution, compression quality and frame rate, for example, reducing the resolution and compression quality to reduce the size of each frame and reduce the bandwidth requirement, thereby improving the video fluency. In the present embodiment, the Web page is a Web front-end page designed by HTML+JavaScript, and the Web front-end page is provided with four interactive blocks of device, area, record and login for viewing device, real-time streaming, managing edge side and user login.

[0033] In this embodiment, the identification result of the sewage suspended matter needs to be transmitted in real time, and the application embodiment uses the Flask framework of Python and the UDP protocol to transmit the video stream corresponding to the identification result to the server device in real time and display the video stream on the Web page of the server device in real time. The Flask is a lightweight Python Web framework that allows the creation of Web services and web applications. In the application embodiment, a Web server is created using Flask to receive and process the real-time video stream. In the Web server, a generator is used to continuously send frame data. The generator is a special Python function that generates a series of values. By encoding each video frame as a separate JPEG image and using the multipart / x-mixed-replace MIME type, the video stream can be displayed in real time on the Web page. In the real-time video transmission process of this embodiment, the video effect is optimized by adjusting the resolution, compression quality and frame rate. Reducing the resolution and compression quality can reduce the size of each frame and reduce the bandwidth requirement, thereby improving the smoothness of the video stream. At the same time, in order to realize real-time performance, the application embodiment uses the connectionless UDP protocol. After each frame is identified, it is sent to the designated server device through the UDP protocol, without the need for secondary storage and forwarding, greatly enhancing the real-time performance.

[0034] It should be further pointed out that the application embodiment uses a deep learning algorithm to replace the traditional image processing algorithm, which achieves a detection effect better than the traditional algorithm, has stronger robustness, and the algorithm is an end-to-end network, which reduces the difficulty of algorithm design and training, and has high flexibility in industrial applications. At the same time, in order to solve the difficulty of sewage suspended matter detection in harsh environments, the IA-YOLOv7 target detection algorithm is used, which can realize accurate detection of objects in natural conditions.

[0035] In some embodiments, an image-adaptive Image-Adaptive YOLOV7 target detection model is used to process target images, including the following steps:

[0036] Step 21, data duplication is performed on the target image to obtain a first image and a second image with a preset resolution, wherein the resolution corresponding to the first image is lower than the resolution corresponding to the second image.

[0037] In this embodiment, the target image to be processed is duplicated into two copies, and a high-resolution image (corresponding to the second image) and a low-resolution image (corresponding to the first image) are obtained by modifying the size of the image. In this embodiment, the size of the target image is modified by calling the interface of the openCV open source image processing library to obtain a high-resolution image (second image) and a low-resolution image (first image).

[0038] Step 22, input the first image into the Image-Adaptive YOLOV7 target detection model to obtain image filtering parameters, wherein the image filtering parameters include at least one of the following: defogging parameters, white balance parameters, brightness parameters, hue parameters, contrast adjustment parameters, and sharpness adjustment parameters.

[0039] In this embodiment, the Image-Adaptive YOLOV7 target detection model is self-equipped with a filtering parameter prediction module and an image filtering module (for example, a DIP filter); in this embodiment, a low-resolution image (first image) is input into the filtering parameter prediction module for processing to obtain image filtering parameters, and the obtained image filtering parameters will be used as parameters for inputting a high-resolution image (second image) into the image filtering model for image filtering processing; specifically, the low-resolution first image is input into the filtering parameter prediction module, and is processed through convolution layers and fully connected layers respectively to obtain an output result including image filtering parameters.

[0040] Step 23, using the Image-Adaptive YOLOV7 target detection model and the image filtering parameters, the second image is filtered and denoised to obtain an enhanced image.

[0041] In this embodiment, a high-resolution image (second image) is input into the image filtering module for image processing, including defogging, white balance, brightness adjustment, hue adjustment, contrast adjustment, and sharpness adjustment, and the image filtering parameters for the image processing are based on the image filtering parameters obtained in step 22; in this embodiment, based on the image filtering parameters predicted by the filtering parameter prediction module, the target features in the high-resolution image are strengthened, and natural noise is reduced, for example: when the target image is a picture of a target in a foggy weather, the image filtering parameters are predicted based on the picture, and then the predicted image filtering parameters are used for filtering and denoising processing, and the fog effect in the picture is weakened, and the target is more obvious in the picture.

[0042] Through the data copying of the target image in steps 21-23, the first image and the second image of a preset resolution are obtained, wherein the resolution corresponding to the first image is lower than the resolution corresponding to the second image; the first image is input into the Image-Adaptive YOLOV7 target detection model to obtain image filtering parameters, wherein the image filtering parameters include at least one of the following: defogging parameters, white balance parameters, brightness parameters, hue parameters, contrast adjustment parameters, and sharpness adjustment parameters; the second image is filtered and denoised by using the Image-Adaptive YOLOV7 target detection model and the image filtering parameters to obtain an enhanced image, thereby realizing data preprocessing of the target image to strengthen the target features in the target image and weaken the image noise caused by the natural environment, reducing the influence of natural noise and improving the accuracy of sewage suspended matter detection and recognition in a relatively harsh natural environment.

[0043] In some embodiments, the constructed Image-Adaptive YOLOV7 target detection model is used to process the target image to obtain target label information corresponding to the sewage suspended matter, including the following steps:

[0044] Step 31: performing image adaptive processing on the enhanced image to obtain an input image, wherein the image adaptive processing includes image size standardization, image normalization, adaptive frame calculation, and adaptive image scaling.

[0045] In this embodiment, after the enhanced image is obtained by image filtering processing based on the predicted image filtering parameters, the enhanced image is adaptively processed according to the content of the enhanced image to generate an input image for sewage suspended matter detection.

[0046] Step 32: detecting the sewage suspended matter in the input image by using the Image-Adaptive YOLOV7 target detection model to obtain target label information.

[0047] Through the image adaptive processing of the enhanced image in steps 31-32, the input image is obtained, wherein the image adaptive processing includes image size standardization, image normalization, adaptive frame calculation, and adaptive image scaling; the sewage suspended matter in the input image is detected by using the Image-Adaptive YOLOV7 target detection model to obtain target label information, thereby realizing image adaptive processing and further improving the accuracy of sewage suspended matter detection and recognition in a relatively harsh natural environment.

[0048] In some embodiments, the step of detecting sewage suspended solids in the input image using the Image-Adaptive YOLOV7 target detection model in step 32 is achieved by the following steps:

[0049] Step 321, using the Image-Adaptive YOLOV7 target detection model, the input image is divided into multiple image grid units, and multi-scale feature extraction is performed in each image grid unit to obtain the first feature.

[0050] In this embodiment, before the input image is divided into multiple image grid units, the input image is processed to adapt to the network, including adjusting the input image to the size required by the network and image normalization, i.e. converting the pixel value from [0, 255] to the range of [0, 1].

[0051] In this embodiment, the input image processed to adapt to the network is input into the backbone network of the Image-Adaptive YOLOV7 target detection model, which is composed of multiple convolutional layers, pooling layers and residual connections. These layers can effectively extract multi-scale features. The Image-Adaptive YOLOV7 will divide the input image into multiple image grid units, and then perform multi-scale feature detection on each image grid unit to obtain the output result containing the first feature.

[0052] Step 322, the first feature is fused to obtain the candidate feature.

[0053] In this embodiment, after obtaining the first feature, the first feature is integrated into multi-scale features, and the feature fusion of the Feature Pyramid Network (FPN) is further optimized, and finally the fused candidate feature is obtained.

[0054] Step 323, in the candidate feature, a preset prediction head is used for target detection to obtain the prediction result corresponding to each image grid unit, wherein the prediction result includes position boundary information, target class and target confidence.

[0055] In this embodiment, multiple prediction heads are used to detect targets for features of different scales to predict the position boundary information (corresponding to the bounding box), target class and target confidence of each image grid unit.

[0056] Step 324, based on the prediction result, the target label information is determined.

[0057] The input image is divided into a plurality of image grid units by using the Image-Adaptive YOLOV7 target detection model in steps 321 to 324, and multi-scale feature extraction is performed in each image grid unit to obtain first features; the first features are fused to obtain candidate features; in the candidate features, a preset prediction head is used for target detection to obtain a prediction result corresponding to each image grid unit, wherein the prediction result includes position boundary information, a target category and a target confidence; based on the prediction result, target label information is determined to realize detection of the target label information corresponding to the target image by using the Image-Adaptive YOLOV7 target detection model.

[0058] In some optional embodiments, determining the target label information based on the prediction result is implemented by the following steps:

[0059] Step 41: converting the position boundary information in the prediction result in a preset conversion manner to obtain an initial prediction bounding box.

[0060] In this embodiment, the preset conversion manner refers to converting the bounding box in the prediction result by a set activation function to obtain the initial prediction bounding box.

[0061] Step 42: scaling the initial prediction bounding box to the size corresponding to the input image to obtain a plurality of candidate prediction bounding boxes.

[0062] In this embodiment, after converting the bounding box by the activation function to obtain the initial prediction bounding box, the prediction result is mapped back to the original image size, that is, the initial prediction bounding box is converted to the size same as the input image, and then the candidate prediction bounding box is obtained.

[0063] Step 43: detecting a target bounding box from the candidate prediction bounding box by using a non-maximum suppression algorithm and a preset matching strategy, and determining a target category and a target confidence corresponding to the target bounding box, wherein the target label information corresponding to the suspended matter category label information includes the target category and the target confidence, and the target label information corresponding to the suspended matter position information includes the target bounding box.

[0064] In this embodiment, the non-maximum suppression (NMS) is used to process a plurality of overlapping candidate prediction bounding boxes, the bounding box with the highest confidence is retained, and the final bounding box (corresponding to the target bounding box) and the target category and the target confidence thereof are output.

[0065] In some optional embodiments, the step of detecting the target bounding box from the candidate prediction bounding box by using the non-maximum suppression algorithm and the preset matching strategy in step 43 includes the following steps:

[0066] At step 431, a set of prior bounding boxes corresponding to each candidate prediction bounding box is obtained, wherein the set of prior bounding boxes includes a plurality of first prior bounding boxes generated by clustering based on a k-means clustering algorithm and the candidate prediction bounding box.

[0067] In this embodiment, based on the candidate prediction bounding box predicted by the Image-Adaptive YOLOV7 target detection model, nine (which can be set to other numbers according to requirements) first prior bounding boxes arranged from small to large are obtained by the k-means clustering algorithm; the nine first prior bounding boxes are different scale anchor boxes set artificially according to experience, which are equivalent to preset reference boxes. The candidate prediction bounding box predicted by the subsequent Image-Adaptive YOLOV7 target detection model will be matched with the nine first prior bounding boxes to determine whether the candidate prediction bounding box is a positive sample.

[0068] At step 432, a first coordinate loss of each candidate prediction bounding box and all first prior bounding boxes in the corresponding set of prior bounding boxes is calculated, and whether the candidate prediction bounding box is a positive sample bounding box is determined according to the corresponding first coordinate loss.

[0069] In this embodiment, each candidate prediction bounding box is matched with the nine first prior bounding boxes, and the width-to-width ratio (the larger width divided by the smaller width, the ratio is greater than 1, and the height is also calculated) and the height-to-height ratio of the candidate prediction bounding box and the nine first prior bounding boxes are calculated. Among the two ratios of width ratio and height ratio, the maximum ratio is taken. If the ratio is less than a set ratio threshold, the candidate prediction bounding box corresponding to this first prior bounding box is a positive sample bounding box. In this embodiment, the calculation of the width ratio and the height ratio can also be regarded as a kind of coordinate loss ICOU operation.

[0070] At step 433, in the case where the candidate prediction bounding box is determined to be a positive sample bounding box, neighborhood search is performed based on the candidate prediction bounding box as the positive sample bounding box to obtain a plurality of positive sample bounding boxes.

[0071] In an embodiment, the center position of the candidate prediction bounding box as the positive sample bounding box is also used as a prediction grid, that is, an expanded positive sample bounding box, to increase the number of positive samples and obtain a plurality of positive sample bounding boxes, thereby providing data samples for subsequent selection of the optimal target bounding box.

[0072] It can be understood that a real bounding box can be predicted by three grids.

[0073] Step 434, all first prior bounding boxes are taken as second prior bounding boxes, a second coordinate loss of the plurality of positive sample bounding boxes and the second prior bounding boxes is calculated, and a candidate prior bounding box in which a plurality of second coordinate losses are greater than a preset loss threshold is detected in all first prior bounding boxes.

[0074] In the embodiment, the second prior bounding box refers to all first prior bounding boxes, and each positive sample bounding box is subjected to a calculation of a coordinate loss (corresponding to a second coordinate loss) with the plurality of all first prior bounding boxes as the second prior bounding boxes, so as to determine whether each first prior bounding box can be a candidate prior bounding box; in the embodiment, as long as the first prior bounding box satisfies that the coordinate loss with any positive sample bounding box is greater than the preset loss threshold, the first prior bounding box is taken as the candidate prior bounding box, and it can be known that the number of the candidate prior bounding boxes will not be more than the number of the first prior bounding boxes in the prior bounding box set.

[0075] Step 435, a coordinate loss of each positive sample bounding box and the plurality of candidate prior bounding boxes is determined, at least one positive sample bounding box is selected from the plurality of positive sample bounding boxes in order of the coordinate loss from small to large, and a target bounding box is obtained.

[0076] In the embodiment, the target bounding box is determined according to the coordinate loss of the positive sample bounding box and all candidate prior bounding boxes; in the embodiment, one positive sample bounding box with the minimum coordinate loss is taken as the target bounding box.

[0077] It can be understood that the minimum coordinate loss indicates that the anchor box is closest to the actual position of the target, which is the optimal solution of the inference of the Image-Adaptive YOLOV7 target detection model.

[0078] The prior frame set corresponding to each candidate prediction bounding box is obtained through the above steps 431 to 435, wherein the prior frame set includes a plurality of first prior frames generated by clustering based on the k-means clustering algorithm and the candidate prediction bounding box; a first coordinate loss of each candidate prediction bounding box and all first prior frames in the corresponding prior frame set is calculated, and whether the candidate prediction bounding box is a positive sample frame is judged according to the corresponding first coordinate loss; in the case of judging that the candidate prediction bounding box is a positive sample frame, a neighborhood search is performed based on the candidate prediction bounding box as a positive sample frame, and a plurality of positive sample frames are obtained; all first prior frames are used as second prior frames, a second coordinate loss of the plurality of positive sample frames and the second prior frames is calculated, and a plurality of candidate prior frames with a second coordinate loss greater than a preset loss threshold are detected in all first prior frames; the coordinate loss of each positive sample frame and the plurality of candidate prior frames is determined, at least one positive sample frame is selected from the plurality of positive sample frames in order of coordinate loss from small to large, and a target bounding box is obtained, so as to realize the matching strategy according to the candidate prediction bounding box predicted by the Image-Adaptive YOLOV7 target detection model and the set first prior frame to determine the bounding box closest to the target actual position, thereby improving the recognition rate of suspended matter recognition.

[0079] In some embodiments, based on the suspended matter category label information, the suspended matter position information and the target image, an identification result of the sewage suspended matter is generated, including the following steps:

[0080] Step 51, the target bounding box is obtained from the suspended matter position information, and a frame is drawn on the position corresponding to the target bounding box in the target image, wherein the frame is used to represent the boundary position of the corresponding suspended matter.

[0081] Step 52, based on the target confidence corresponding to the suspended matter category label information, a target category whose target confidence satisfies a confidence threshold is detected from a plurality of target categories, and the detected target category is labeled to the frame to obtain an identification result.

[0082] In this embodiment, the anchor frame is drawn on the relative position of the suspended matter detected from the target image to label, and then the identification result of the sewage suspended matter is generated based on the suspended matter category label information, the suspended matter position information and the target image.

[0083] In some embodiments, a target image to be identified is obtained, including the following steps:

[0084] Step 61, the video stream data of the sewage flowing medium is called by using a preset computer vision library.

[0085] In the embodiment, the preset computer vision library includes, but is not limited to, an interface of an openCV library; in the embodiment, a corresponding camera is started by calling the interface of the openCV library, and real-time video stream data for detecting the flowing medium of sewage is acquired.

[0086] In step 62, the video stream data is frame-extracted to obtain a single-frame video frame, wherein the target image includes the single-frame video frame.

[0087] In the above steps 61 to 62, the preset computer vision library is used to call the video stream data for detecting the flowing medium of sewage; the video stream data is frame-extracted to obtain a single-frame video frame, wherein the target image includes the single-frame video frame, so as to realize acquisition of the target image.

[0088] In some embodiments, the training process of the Image-Adaptive YOLOV7 target detection model includes:

[0089] In step 1, a training picture data set with a preset resolution is acquired, and the training picture data set is labeled to generate a label picture set labeled with a suspended class category and coordinate information, wherein the training picture data set is obtained by performing data enhancement processing on a first picture with suspended matter and a second picture without suspended matter, and the data enhancement includes at least one of the following processing: random contrast adjustment, random cropping, transparency transformation, image rotation, image cutting and recombination.

[0090] In the embodiment, a sewage suspended matter data set with a resolution of 1920x1080 is constructed, the data set includes pictures with suspended matter and pictures without suspended matter, and a rotation and size change data enhancement technique is used to enrich the image training set and enhance the data sample quantity; in the embodiment, the image data arranged is manually labeled by using a labeling website Makesense to obtain the suspended matter category and coordinate information in each picture, generate a YOLO format data set annotation file, and divide the training set, the test set and the verification set in a ratio of 6:2:2.

[0091] In step 2, a YOLOV7 standard model is used as a baseline model to construct an initial network model, wherein the initial network model uses an input end capable of adaptive frame calculation and adaptive image scaling processing.

[0092] In the embodiment, the initial network model comprises five parts of an input end, an image filtering module, a Backbone main network of YOLOv7 network, a Neck and an output end, the input end adopts a Mosaic data enhancement mode, and comprises adaptive frame calculation and adaptive picture scaling; the Backbone comprises three modules of stem, ELAN and DS; the Neck adopts a structure of FPN+PAN; and the output end adopts CIOU_Loss as a loss function of a Boundingbox.

[0093] The formula calculation process of the coordinate loss CIOU is as follows:

[0094] 1. Calculation of IoU:

[0095]

[0096] The calculation of IoU is the intersection of the candidate prediction bounding box (A) and the real bounding box (B) corresponding to the suspended matter divided by the union of the two.

[0097] 2. Calculation of CIoU:

[0098]

[0099] Wherein, α is a weight function, and v is used to measure the consistency of the width-height ratio:

[0100]

[0101]

[0102] The final CIoU Loss is:

[0103]

[0104] Step 3, training based on the initial network model and the label picture set until convergence, to obtain an Image-Adaptive YOLOV7 target detection model.

[0105] In some preferred embodiments, the following steps are also implemented to train the Image-Adaptive YOLOV7 target detection model:

[0106] Step 1, picture data acquisition, first collect data pictures.

[0107] In the embodiment, the internet public data set and the field scene sampling are collected, and after screening, 4700 pictures of water surface suspended matter are obtained, and 3700 pictures are divided as a training set, 400 pictures are divided as a verification set, and 600 pictures are divided as a test set.

[0108] Step 2: Train a suitable IA-YOLOv7 detection model based on the collected image data and deploy it on the development board.

[0109] In this embodiment, YOLO algorithm is the most typical representative of one-stage target detection algorithm, which is based on deep neural network for object recognition and positioning, and has fast running speed and can be used in real-time system. YOLOV7 is a more advanced algorithm in YOLO series, which surpasses the previous YOLO series in accuracy and speed.

[0110] In this embodiment, although the target detection method based on deep learning has achieved good results on traditional data sets, it is still challenging to locate the target from low-quality images in adverse weather conditions. The existing methods either have difficulty in balancing image enhancement and target detection tasks, or often ignore the potential information conducive to detection. In our actual test, the YOLO series algorithm is greatly affected by environmental interference. To this end, this embodiment proposes an improved algorithm based on IA-YOLO and YOLOv7, namely IA-YOLOv7. In the training process of the Image-Adaptive YOLOV7 target detection model, the YOLOv7 standard model structure with the best performance in speed is determined as the baseline model for detection through preliminary training, and the collected data is preprocessed by random contrast adjustment, random cropping, transparency transformation, image cropping and reorganization, etc. After that, the preliminary training model is enhanced, and the model is approximated to the optimal solution by adjusting the learning rate, training rounds, b batch size and other key hyperparameters. Finally, the Image-Adaptive YOLOV7 target detection model with recognition rate of 95% and mAP0.5 of 0.955 on the test set is obtained.

[0111] In this embodiment, in order to speed up the model inference and improve the algorithm execution efficiency, the TensorRT technology is combined in the embodiment of the application, which is helpful for high-performance inference on NVIDIA graphics processing unit (GPU) and is used for accelerating the inference of the Image-Adaptive YOLOV7 target detection model. According to the TensorRT technology process, the model structure is re-implemented using cuda programming, and the obtained model weight is tested, which has obvious improvement in inference speed.

[0112] The embodiment also provides a sewage suspended matter identification device based on an IA-YOLOV7. The device is used to implement the above-mentioned embodiment and preferred implementation, and details have been described above. As used below, the terms "module", "unit", "sub-unit", and the like can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiment is preferably implemented in software, hardware, or a combination of software and hardware can also be implemented and conceived.

[0113] Figure 3 is a structural block diagram of a sewage suspended matter identification device based on an IA-YOLOV7 according to the embodiment of the present application, as shown in Figure 3 The device includes an acquisition module 31, an identification module 32, and a processing module 33, wherein

[0114] The acquisition module 31 is configured to acquire a target image to be identified, wherein the target image is acquired from video stream data of a detected sewage flowing medium.

[0115] The identification module 32 is coupled to the acquisition module 31 and is configured to process the target image by using an already constructed image adaptive Image-Adaptive YOLOV7 target detection model to obtain target label information corresponding to the sewage suspended matter, wherein the target label information includes suspended matter category label information and suspended matter position information, and the Image-Adaptive YOLOV7 target detection model is a baseline model based on a YOLOV7 standard model and is trained based on a preset image data set and measured suspended matter category label information and measured suspended matter position information corresponding to images of the image data set.

[0116] The processing module 33 is coupled to the identification module 32 and is configured to generate an identification result of the sewage suspended matter based on the suspended matter category label information, the suspended matter position information, and the target image, wherein the identification result includes a target region where the target sewage suspended matter appears marked in the form of a preset detection frame.

[0117] The sewage suspended matter recognition device based on the IA-YOLOV7 according to the embodiment of the present application adopts to acquire a target image to be recognized, wherein the target image is acquired from video stream data for detecting a sewage flowing medium; an image adaptive Image-Adaptive YOLOV7 target detection model is constructed, and the target image is processed to obtain target label information corresponding to the sewage suspended matter, wherein the target label information includes suspended matter category label information and suspended matter position information, the Image-Adaptive YOLOV7 target detection model is based on a YOLOV7 standard model as a baseline model, and is trained based on a preset image data set and measured suspended matter category label information and measured suspended matter position information corresponding to images of the image data set; based on the suspended matter category label information, the suspended matter position information and the target image, a recognition result of the sewage suspended matter is generated, wherein the recognition result includes a target region where the target sewage suspended matter appears marked in the form of a preset detection frame, the Image-Adaptive YOLOV7 target detection model is used to filter and perform image adaptive processing on the target image, so as to reduce image noise introduced due to the influence of the natural environment, provide detection accuracy and recognition rate, at the same time, the YOLOV7 training target detection model based on the deep learning algorithm is used to improve the sewage suspended matter detection effect and robustness, and the problem that the recognition of the sewage suspended matter is influenced by the harsh natural environment in the related art, which causes great difficulty in recognizing the sewage suspended matter and low recognition accuracy, is solved, and the beneficial effect of accurately detecting and recognizing the sewage suspended matter in the harsh natural environment is realized.

[0118] In some embodiments, the recognition module 32 is further configured to perform data replication on the target image to obtain a first image and a second image with preset resolutions, wherein the resolution corresponding to the first image is lower than the resolution corresponding to the second image; the first image is input into the Image-Adaptive YOLOV7 target detection model to obtain image filtering parameters, wherein the image filtering parameters include at least one of the following: defogging parameters, white balance parameters, brightness parameters, hue parameters, contrast adjustment parameters, and sharpness adjustment parameters; the Image-Adaptive YOLOV7 target detection model and the image filtering parameters are used to perform filtering and denoising processing on the second image to obtain an enhanced image.

[0119] In some embodiments, the recognition module 32 is further configured to perform image adaptive processing on the enhanced image to obtain an input image, wherein the image adaptive processing includes image size standardization, image normalization, adaptive frame calculation, and adaptive picture scaling; the Image-Adaptive YOLOV7 target detection model is used to detect the sewage suspended matter in the input image to obtain target label information.

[0120] In some embodiments, the identification module 32 is further configured to divide the input image into a plurality of image grid units using an Image-Adaptive YOLOV7 object detection model, and perform multi-scale feature extraction in each image grid unit to obtain first features; perform feature fusion on the extracted first features to obtain candidate features; perform object detection on the candidate features using a preset prediction head to obtain a prediction result corresponding to each image grid unit, wherein the prediction result includes position boundary information, object category and object confidence; and determine target label information based on the prediction result.

[0121] In some embodiments, the identification module 32 is further configured to convert the position boundary information in the prediction result into an initial prediction bounding box in a preset conversion manner; scale the initial prediction bounding box to the size corresponding to the input image to obtain a plurality of candidate prediction bounding boxes; detect a target bounding box from the candidate prediction bounding boxes using a non-maximum suppression algorithm and a preset matching strategy, and determine the object category and object confidence corresponding to the target bounding box, wherein the suspended matter category label information corresponding to the target label information includes the object category and the object confidence, and the suspended matter position information corresponding to the target label information includes the target bounding box.

[0122] In some embodiments, the identification module 32 is further configured to obtain a prior bounding set corresponding to each candidate prediction bounding box, wherein the prior bounding set includes a plurality of first prior bounding boxes generated by clustering based on a k-means clustering algorithm and the candidate prediction bounding boxes; calculate a first coordinate loss of each candidate prediction bounding box and all first prior bounding boxes in the corresponding prior bounding set, and determine whether the candidate prediction bounding box is a positive sample bounding box according to the corresponding first coordinate loss; in a case where it is determined that the candidate prediction bounding box is a positive sample bounding box, perform neighborhood search based on the candidate prediction bounding box as the positive sample bounding box to obtain a plurality of positive sample bounding boxes; take all first prior bounding boxes as second prior bounding boxes, calculate a second coordinate loss of the plurality of positive sample bounding boxes and the second prior bounding boxes, and detect a plurality of candidate prior bounding boxes with a second coordinate loss greater than a preset loss threshold from all first prior bounding boxes; determine a coordinate loss of each positive sample bounding box and the plurality of candidate prior bounding boxes, and select at least one positive sample bounding box from the plurality of positive sample bounding boxes in order of coordinate loss from small to large to obtain a target bounding box.

[0123] In some embodiments, the processing module 33 is further configured to obtain a target bounding box from the suspended matter position information, and draw a frame on a position corresponding to the target bounding box in the target image, where the frame is used to represent the boundary position of the corresponding suspended matter; detect a target category that satisfies a confidence threshold from a plurality of target categories based on a target confidence corresponding to the suspended matter category label information, and label the detected target category to the frame to obtain a recognition result.

[0124] In some embodiments, the obtaining module 31 is further configured to call video stream data of the flowing medium of sewage by using a preset computer vision library; and perform frame extraction processing on the video stream data to obtain a single-frame video frame, where the target image includes the single-frame video frame.

[0125] The embodiment also provides a sewage suspended matter recognition system, including a camera acquisition module, a transmission device, and a server device; the camera acquisition module is connected to the server device through the transmission device; the camera acquisition module is configured to acquire video stream data of the flowing medium of sewage; the transmission device is configured to transmit the video stream data to the server device, and to transmit a recognition result generated by the server device after executing any of the above methods to a front-end webpage of the server device for display in real time.

[0126] The embodiment also provides an electronic device including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps in any of the above method embodiments.

[0127] Optionally, the electronic device can further include a transmission device and an input / output device, where the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0128] Optionally, in the embodiment, the processor can be configured to execute the following steps by using the computer program:

[0129] S1, obtaining a target image to be recognized, where the target image is obtained from video stream data of the flowing medium of sewage.

[0130] S2, processing the target image by using the constructed image-adaptive Image-Adaptive YOLOV7 target detection model to obtain target label information corresponding to the sewage suspended matter, wherein the target label information comprises suspended matter category label information and suspended matter position information, and the Image-Adaptive YOLOV7 target detection model is a baseline model taking YOLOV7 standard model as the baseline model and is trained based on a preset image data set and measured suspended matter category label information and measured suspended matter position information corresponding to images of the image data set.

[0131] S3, generating a recognition result of the sewage suspended matter based on the suspended matter category label information, the suspended matter position information and the target image, wherein the recognition result comprises a target area where the target sewage suspended matter appears marked in the form of a preset detection frame.

[0132] It should be noted that the specific examples in the embodiments can refer to the examples described in the above embodiments and optional implementation manners, and the embodiments will not be described here.

[0133] In addition, in combination with the sewage suspended matter recognition method based on IA-YOLOV7 in the above embodiments, the embodiments of the present application can provide a storage medium for implementation. The storage medium has a computer program stored thereon; and the computer program is executed by a processor to implement any one of the sewage suspended matter recognition methods based on IA-YOLOV7 in the above embodiments.

[0134] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any manner, and in order to make the description concise, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combinations of the technical features do not exist contradictory, they should be considered as the scope of the present application.

[0135] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.

Claims

1. An IA-YOLOV7-based sewage suspended matter identification method, characterized in that, The method comprises the following steps: acquiring a target image to be recognized, wherein the target image is acquired from video stream data of a sewage flowing medium; processing the target image by using an image-adaptive Image-Adaptive YOLOV7 target detection model to obtain target label information corresponding to sewage suspended matter, wherein the target label information comprises suspended matter category label information and suspended matter position information, the Image-Adaptive YOLOV7 target detection model is a baseline model based on a YOLOV7 standard model, and is trained based on a preset image data set and measured suspended matter category label information and measured suspended matter position information corresponding to images of the image data set; generating a recognition result of sewage suspended matter based on the suspended matter category label information, the suspended matter position information and the target image, wherein the recognition result comprises a target region where target sewage suspended matter appears marked in the form of a preset detection frame; wherein processing the target image by using the image-adaptive Image-Adaptive YOLOV7 target detection model comprises the following steps: performing data replication on the target image to obtain a first image and a second image of a preset resolution, wherein the resolution corresponding to the first image is lower than the resolution corresponding to the second image; inputting the first image into the Image-Adaptive YOLOV7 target detection model to obtain image filtering parameters, wherein the image filtering parameters comprise at least one of the following: defogging parameters, white balance parameters, brightness parameters, hue parameters, contrast adjustment parameters and sharpness adjustment parameters; performing filter denoising processing on the second image by using the Image-Adaptive YOLOV7 target detection model and the image filtering parameters to obtain an enhanced image; wherein processing the target image by using the image-adaptive Image-Adaptive YOLOV7 target detection model to obtain target label information corresponding to sewage suspended matter comprises the following steps: performing image-adaptive processing on the enhanced image to obtain an input image, wherein the image-adaptive processing comprises image size standardization, image normalization, adaptive frame calculation and adaptive picture scaling; detecting sewage suspended matter in the input image by using the Image-Adaptive YOLOV7 target detection model to obtain the target label information; wherein detecting sewage suspended matter in the input image by using the Image-Adaptive YOLOV7 target detection model to obtain the target label information comprises the following steps: dividing the input image into a plurality of image grid units by using the Image-Adaptive YOLOV7 target detection model, and performing multi-scale feature extraction in each image grid unit to obtain first features; performing feature fusion on the extracted first features to obtain candidate features; In the candidate features, a preset prediction head is used for target detection to obtain a prediction result corresponding to each image grid unit, wherein the prediction result comprises position boundary information, a target category and a target confidence; Based on the prediction result, the target label information is determined.

2. The method of claim 1, wherein, Based on the prediction result, the target label information is determined, comprising: The position boundary information in the prediction result is converted in a preset conversion manner to obtain an initial prediction bounding box; The initial prediction bounding box is scaled to the size corresponding to the input image to obtain a plurality of candidate prediction bounding boxes; A non-maximum suppression algorithm and a preset matching strategy are used to detect a target bounding box from the candidate prediction bounding boxes, and a target category and a target confidence corresponding to the target bounding box are determined, wherein the suspended matter category label information corresponding to the target label information comprises the target category and the target confidence, and the suspended matter position information corresponding to the target label information comprises the target bounding box.

3. The method of claim 2, wherein, A non-maximum suppression algorithm and a preset matching strategy are used to detect a target bounding box from the candidate prediction bounding boxes, comprising: A prior frame set corresponding to each candidate prediction bounding box is obtained, wherein the prior frame set comprises a plurality of first prior frames generated by clustering based on a k-means clustering algorithm and the candidate prediction bounding boxes; A first coordinate loss of each candidate prediction bounding box and all first prior frames in the corresponding prior frame set is calculated, and whether the candidate prediction bounding box is a positive sample frame is determined according to the corresponding first coordinate loss; In the case where it is determined that the candidate prediction bounding box is a positive sample frame, a neighborhood search is performed based on the candidate prediction bounding box as a positive sample frame to obtain a plurality of positive sample frames; All first prior frames are taken as second prior frames, a second coordinate loss of a plurality of positive sample frames and the second prior frames is calculated, and a plurality of candidate prior frames with a second coordinate loss greater than a preset loss threshold are detected from all first prior frames; The coordinate loss of each positive sample frame and a plurality of candidate prior frames is determined, and at least one positive sample frame is selected from a plurality of positive sample frames in order of coordinate loss from small to large to obtain the target bounding box.

4. The method of claim 3, wherein, Based on the suspended matter category label information, the suspended matter position information and the target image, an identification result of sewage suspended matter is generated, comprising: The target bounding box is obtained from the suspended matter position information, and a frame is drawn on the position corresponding to the target bounding box in the target image, wherein the frame is used to represent the boundary position of the corresponding suspended matter; Based on the target confidence corresponding to the suspended matter category label information, the target category with a target confidence satisfying a confidence threshold is detected from a plurality of target categories, and the detected target category is labeled to the frame to obtain the identification result.

5. The method of claim 1, wherein, A target image to be identified is obtained, comprising: The preset computer vision library is used to call video stream data for detecting the flowing medium of sewage. Frame extraction is performed on the video stream data to obtain a single-frame video frame, and the target image includes the single-frame video frame.

6. A sewage suspension identification system characterized by, The method comprises the following steps: A camera acquisition module, a transmission device, and a server device are connected through the transmission device; The camera acquisition module is used to acquire video stream data for detecting the flowing medium of sewage; The transmission device is used to transmit the video stream data to the server device and to transmit the recognition result generated by the server device after executing the IA-YOLOV7-based sewage suspended matter identification method of any one of claims 1 to 5 to the front-end webpage of the server device for display in real time.

7. A storage medium having stored thereon a computer program, characterized in that The computer program is executed by a processor to implement the IA-YOLOV7-based sewage suspended matter identification method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • A method for detecting floating objects on water based on YOLOv2 network

    CN109033934A

  • Detection method and system for multiple target images

    CN114927236A