Image detection method, device, electronic device and storage medium
By using neural networks in railway monitoring systems to detect target objects and rail data in railway images to determine whether there are dangerous behaviors, it solves the problems of low efficiency and safety hazards in existing railway monitoring, and achieves real-time, automated safety monitoring and cost-effectiveness. reduce.
Patent Information
- Application Number
- CN202011145968.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-23
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-10-23
AI Technical Summary
Existing railway monitoring mainly relies on manual or regular inspections, which is inefficient and prone to misjudgment or neglect, leading to safety hazards and high costs.
The first neural network is used to detect target objects in railway surveillance images, and combined with railway track image data, the Intersection Over Union (IOU) is used to determine whether there is dangerous behavior, and a warning is output to improve safety performance.
It achieves real-time, automated railway safety monitoring, reduces the risk of misjudgment, improves detection efficiency and safety performance, and reduces monitoring costs.
Smart Images

Figure CN112257604B
Abstract
Description
Technical Field
[0001] The present disclosure relates to artificial intelligence fields such as computer vision, deep learning, and intelligent transportation, and can be used in intelligent cloud scenarios. Background Art
[0002] Railway transportation is a very important mode of transportation at present, such as traditional railways and high-speed railways (referred to as high-speed railways). At present, railway monitoring is mainly carried out through personnel monitoring, or by special inspection trains to monitor the railway before normal transportation trains, such as special inspection trains running in the morning to inspect railway safety. Summary of the invention
[0003] The present disclosure provides an image detection method, device, electronic device and storage medium.
[0004] According to one aspect of the present disclosure, there is provided an image detection method, comprising:
[0005] Acquire railway surveillance images;
[0006] Performing target object detection on the railway monitoring image by a first neural network;
[0007] Acquiring rail image data of the railway monitoring image;
[0008] When the first neural network detects the image data of the target object in the railway monitoring image, it is detected whether there is a dangerous behavior based on the image data of the target object and the image data of the railroad.
[0009] According to another aspect of the present disclosure, there is provided an image detection device, comprising:
[0010] A first acquisition module is used to acquire railway monitoring images;
[0011] A first detection module, configured to perform target object detection on the railway monitoring image through a first neural network;
[0012] A second acquisition module, used to acquire rail image data of the railway monitoring image;
[0013] The second detection module is used to detect whether there is a dangerous behavior based on the image data of the target object and the image data of the railroad when the first neural network detects the image data of the target object in the railway monitoring image.
[0014] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the image detection method provided by the present disclosure.
[0018] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the image detection method provided by the present disclosure.
[0019] According to another aspect of the present disclosure, the present disclosure provides a computer program product, including a computer program, which implements the image detection method provided by an embodiment of the present invention when executed by a processor.
[0020] According to the technical solution disclosed in the present invention, it is possible to detect whether there is any dangerous behavior on the railway based on the rail image data and image data of the railway monitoring image, so as to improve the efficiency of railway detection.
[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0023] Figure 1 is a flow chart of an image detection method provided by the present disclosure;
[0024] Figure 2 is a schematic diagram of a detection result of an image detection provided by the present disclosure;
[0025] Figure 3 is a schematic diagram of another detection result of image detection provided by the present disclosure;
[0026] Figure 4 is a schematic diagram of another detection result of image detection provided by the present disclosure;
[0027] Figure 5 is a network schematic diagram of another image detection provided by the present disclosure;
[0028] Figure 6 is a structural diagram of an image detection device provided by the present disclosure;
[0029] Figure 7 is a block diagram of an electronic device used to implement the image detection method of an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0031] See also Figure 1 , Figure 1 is a flow chart of an image detection method provided by the present disclosure, such as Figure 1 As shown, the following steps are included:
[0032] Step S101: Acquire railway monitoring images.
[0033] The railway monitoring images may be images collected in real time or periodically by railway monitoring cameras installed near the railway.
[0034] The above-mentioned acquisition of railway monitoring images may be acquired from other devices, for example, acquiring images transmitted by railway monitoring cameras, or the electronic device executing this step includes a railway monitoring camera to read images captured by the camera.
[0035] Step S102: Detect target objects in the railway monitoring image using a first neural network.
[0036] In the present disclosure, the target object may be a pedestrian, an animal or other obstacle that hinders the operation of the train.
[0037] The first neural network may be a pre-configured or pre-trained neural network for detecting a target object, for example, a YOLO (You Only Look Once) detection network, or other target detection networks, such as a neural network for human body detection. Specifically, the first neural network may be a network whose input is an image and whose output is image data of a target object.
[0038] It should be noted that in actual applications, the images collected often include the target object or do not include the target object. That is to say, the railway monitoring image in the present disclosure may include the target object or may not include the target object. When the railway monitoring image includes the target object, step S102 detects the image data of the target object. When the railway monitoring image does not include the target object, step S102 can output the result that the railway monitoring image does not include the target object.
[0039] Step S103: Acquire rail image data of the railway monitoring image.
[0040] The rail image data may be the area information of the rail in the railway monitoring image, that is, the data may indicate which areas in the railway monitoring image are rails. In addition, the acquisition may be real-time acquisition, or the acquisition may be pre-stored rail image data.
[0041] Step S104: When the first neural network detects the image data of the target object in the railway monitoring image, detect whether there is a dangerous behavior based on the image data of the target object and the image data of the railroad track.
[0042] The image data of the target object may be the region information of the target object in the railway monitoring image, that is, the data may indicate which regions in the railway monitoring image include the target object.
[0043] The above-mentioned detection of whether there is a dangerous behavior based on the image data of the target object and the image data of the rail can be that when the image data of the target object and the image data of the rail indicate that the target object is inside the rail or the target object is at the edge of the rail, etc., it is determined that there is a dangerous behavior; when the image data of the target object and the image data of the rail indicate that the target object is not inside the rail or is a certain distance away from the rail, etc., it is determined that there is no dangerous behavior.
[0044] Furthermore, when it is determined that there is a dangerous behavior, a warning can be output, for example, by outputting a warning through a loudspeaker at the railway site, or outputting a warning to a corresponding moving train, etc. In this way, the safety performance of the railway can be improved by outputting warnings.
[0045] In the present disclosure, the above steps can be used to detect whether there are dangerous behaviors on the railway based on the rail image data and image data of the railway monitoring image, so as to improve the efficiency of railway detection. For example, it is possible to detect whether there are dangerous behaviors on the railway in real time based on the railway monitoring image collected in real time. Furthermore, since there is no need for personnel monitoring, it is possible to avoid misjudgment or neglect of personnel monitoring, so as to improve the railway monitoring effect and reduce the cost of railway monitoring. Specifically, it can effectively assist the corresponding company or regulatory department in conducting operational supervision and provide effective protection for the safety of train operation.
[0046] It should be noted that the above method can be applied to electronic devices, such as monitoring equipment at a railway site, or remote monitoring equipment, which can specifically be electronic devices such as computers, servers, and mobile terminals.
[0047] As an optional implementation manner, the image data of the target object includes: information of a first region of the target object in the railway monitoring image, and the rail image data includes: information of a second region of the rail in the railway monitoring image;
[0048] The detecting whether there is a dangerous behavior based on the image data of the target object and the image data of the rail includes:
[0049] Whether there is a dangerous behavior is detected according to an intersection of union (IOU) between the first area information and the second area information.
[0050] The first area information is used to represent area information of the target object in the railway monitoring image, and the first area information is used to represent area information of the railroad in the railway monitoring image.
[0051] The above-mentioned detection of whether there is a dangerous behavior based on the IOU of the first area information and the second area information may be that when the IOU is a positive real number, it is determined that there is a dangerous behavior, otherwise, it is determined that there is no dangerous behavior. Alternatively, it may be that when the value of the IOU is greater than or equal to a preset threshold, it is determined that there is a dangerous behavior, otherwise, it is determined that there is no dangerous behavior.
[0052] For example: Figure 2 As shown, the railway monitoring image includes rails 201, pedestrians 202 and pedestrians 203, and the above-mentioned first area information can include the boundary boxes of pedestrians 202 and pedestrians 203. Through the above-mentioned IOU, it can be determined that pedestrian 203 is in a dangerous behavior, because pedestrian 203 is within the rails, and pedestrian 202 is not in a dangerous behavior.
[0053] It should be noted that Figure 2 It is only an example diagram and is not an actual image of a real railway monitoring image.
[0054] In this implementation, the above IOU can accurately detect whether there is a dangerous behavior, so as to improve the railway monitoring effect.
[0055] Optionally, when the value of the IOU is greater than or equal to a preset threshold, it is determined that there is a dangerous behavior, wherein the preset threshold corresponds to at least one of the following:
[0056] Collection angle and business requirements;
[0057] The acquisition angle is the angle of the surveillance camera that acquires the railway surveillance image relative to the rails.
[0058] In actual applications, different surveillance cameras may have different adopted angles relative to the rails, and different acquisition angles may also capture different images. For example, for a pedestrian who is located on the left side of the rails and a certain distance from the rails, the IOU value between the pedestrian and the rails in the image is generally large for the camera on the left side of the rails, but the pedestrian is not on the rails in real time. Therefore, this implementation method can set the above preset threshold to a larger threshold for the image of the camera. For the camera facing the rails, the above preset threshold can be set to a smaller threshold.
[0059] Furthermore, when multiple cameras collect images, the camera identification corresponding to the image can be obtained at the same time when the image is obtained, so that during detection, the corresponding preset threshold is obtained according to the camera identification to perform dangerous behavior detection, so as to further improve the accuracy of detection.
[0060] Furthermore, for some high-security business needs, a smaller threshold can be set to improve security, and for some low-security business needs, a larger threshold can be set to improve work efficiency. The specific setting can be flexibly based on business needs.
[0061] In this implementation, since the preset threshold corresponds to at least one of the acquisition angle and the business requirement, different preset thresholds can be used according to actual conditions to improve the accuracy of detection.
[0062] Optionally, the first area information is location information of an area including the target object, and the size of the area corresponds to at least one of the following:
[0063] Collection angle and business requirements;
[0064] The acquisition angle is the angle of the surveillance camera that acquires the railway surveillance image relative to the rails.
[0065] The position information of the area including the target object may be N rows of pixels selected from the bottom position of the target object upward as the position information actually used for judgment. The position information may be a bounding box, where N may correspond to at least one of the acquisition angle and the business requirement.
[0066] The size of the area and the acquisition angle correspond to each other, and the corresponding relationship between the size of the area and the acquisition angle can be pre-configured, and the corresponding relationship can be set according to user experience. Similarly, the size of the area and the business requirements can be pre-configured, and the specific pre-configuration can be performed according to actual business requirements.
[0067] In this implementation, since the size of the area corresponds to at least one of the acquisition angle and the business requirement, different area sizes can be used according to actual conditions to improve the accuracy of detection.
[0068] It should be noted that the present disclosure is not limited to detecting whether there is dangerous behavior by the above-mentioned IOU. For example, it can be determined by simply comparing whether there is overlap between the first area information and the second area information. If so, it is determined that there is dangerous behavior. If there is no overlap, it is determined that there is no dangerous behavior.
[0069] As an optional implementation manner, the obtaining of the rail image data of the railway monitoring image includes:
[0070] Performing rail detection on the railway monitoring image by a second neural network to obtain the rail image data;
[0071] or,
[0072] The rail image data of the pre-stored target image is obtained as the rail image data of the railway monitoring image, wherein the target image and the railway monitoring image are images captured by the same monitoring camera.
[0073] The second neural network may be a rail segmentation network, which can segment the rails in the railway monitoring image. For example, the network can segment the rails as follows: Figure 3 and Figure 4 The effect diagram shown needs to be explained. Figure 3 and Figure 4 Not right Figure 2 The effect diagram obtained by segmenting the image shown in the figure is because, Figure 2 This is only an example diagram, not a true diagram of the railway monitoring image obtained in step 201. Figure 3 and Figure 4 It can represent the segmentation effect diagram of different railway monitoring images obtained in step 201.
[0074] The second neural network can detect the target object and the rails according to different neural networks, thereby improving the overall detection effect. Figure 5 As shown, taking the target object as a pedestrian as an example, the segmentation result and the pedestrian detection result are obtained by the rail segmentation network and the pedestrian detection network respectively, and finally the final result is obtained based on these two detection results, that is, whether there is any dangerous behavior.
[0075] Specifically, the second neural network may be a preset configuration or pre-trained. For example, the second neural network may be an OCRNET network or a preset trained convolutional neural network or a recurrent neural network whose input is an image and output is rail image data, etc., which is not limited in the present disclosure.
[0076] Furthermore, performing rail detection on the railway monitoring image by using the second neural network may be performed in combination with target context information of each pixel in the railway monitoring image to improve the detection effect.
[0077] The above-mentioned acquisition of the pre-stored rail image data of the target image as the rail image data of the railway monitoring image can be that the rail image data captured by the same camera that has been acquired before is used as the rail image data of the railway monitoring image, because the rail is stationary, while the camera is fixed, therefore, the rail image data in the captured image of the same camera is the same.
[0078] By acquiring the pre-stored rail image data of the target image as the rail image data of the railway monitoring image, the amount of calculation can be saved.
[0079] As an optional implementation, the performing target object detection on the railway monitoring image by using the first neural network includes:
[0080] The railway monitoring image is scaled to obtain a railway monitoring image of a preset size, and the railway monitoring image of the preset size is normalized to obtain a normalized railway monitoring image. The normalized railway monitoring image is subjected to target object detection through a first neural network.
[0081] The above-mentioned normalization processing of the railway monitoring image of the preset size may be to subtract the mean from the pixel value of the railway monitoring image of the preset size and divide it by the variance. The mean and variance may be preset, for example, the mean and variance are calculated in advance based on the image data set, such as the mean is calculated to be [0.485, 0.456, 0.406], and the variance is calculated to be [0.229, 0.224, 0.225], wherein these three values may represent the red, green, and blue values of the pixel, respectively.
[0082] In this implementation, since scaling and normalization are performed before input into the neural network, the robustness of the image data can be improved.
[0083] Optionally, the first neural network can be a neural network improved by adding a regularization method (DropBlock) and IOU loss (iou loss) to the skeleton network. Due to the addition of DropBlock and iou loss, the detection effect of the target object is effectively improved. Among them, the skeleton network can be a ResNet50 network, which is not limited in the present disclosure, and can also be other skeleton networks. In addition, the first neural network in the present disclosure is not limited to the neural network with DropBlock and iou loss, for example: it can be other convolutional neural networks or recurrent neural networks without DropBlock and iou loss.
[0084] In addition, in the implementation of the above-mentioned second neural network, the railway monitoring image can also be normalized, wherein the normalization processing is different from the normalization processing before the first neural network. For example, the normalization processing can be to divide all pixels in the railway monitoring image by 255, and then subtract the mean (such as [0.5, 0.5, 0.5]) and divide by the variance (such as [0.5, 0.5, 0.5]) to effectively improve the robustness of the image data.
[0085] According to the technical solution disclosed in the present invention, it is possible to detect whether there is any dangerous behavior on the railway based on the rail image data and image data of the railway monitoring image, so as to improve the efficiency of railway detection.
[0086] See also Figure 6 , Figure 6 is an image detection device provided by the present disclosure, such as Figure 6 As shown, the image detection device 600 includes:
[0087] The first acquisition module 601 is used to acquire railway monitoring images;
[0088] A first detection module 602, configured to perform target object detection on the railway monitoring image through a first neural network;
[0089] The second acquisition module 603 is used to acquire the rail image data of the railway monitoring image;
[0090] The second detection module 604 is used to detect whether there is a dangerous behavior based on the image data of the target object and the image data of the railroad when the first neural network detects the image data of the target object in the railway monitoring image.
[0091] Optionally, the image data of the target object includes: information about a first region of the target object in the railway monitoring image, and the rail image data includes: information about a second region of the rail in the railway monitoring image;
[0092] The second detection module 604 is used to detect whether there is a dangerous behavior based on the intersection-and-union (IOU) of the first area information and the second area information when the first neural network detects the image data of the target object in the railway monitoring image.
[0093] Optionally, when the value of the IOU is greater than or equal to a preset threshold, it is determined that there is a dangerous behavior, wherein the preset threshold corresponds to at least one of the following:
[0094] Collection angle and business requirements;
[0095] The acquisition angle is the angle of the surveillance camera that acquires the railway surveillance image relative to the rails;
[0096] and / or,
[0097] The first area information is location information of an area including the target object, and the size of the area corresponds to at least one of the following:
[0098] Collection angle and business requirements;
[0099] The acquisition angle is the angle of the surveillance camera that acquires the railway surveillance image relative to the rails.
[0100] Optionally, the second acquisition module is used to perform rail detection on the railway monitoring image through a second neural network to obtain the rail image data;
[0101] or,
[0102] The second acquisition 603 is used to acquire the pre-stored rail image data of the target image as the rail image data of the railway monitoring image, wherein the target image and the railway monitoring image are images captured by the same monitoring camera.
[0103] Optionally, the first detection module 602 is used to scale the railway monitoring image to obtain a railway monitoring image of a preset size, normalize the railway monitoring image of the preset size to obtain a normalized railway monitoring image, and perform target object detection on the normalized railway monitoring image through a first neural network.
[0104] The device provided in this embodiment can achieve Figure 1 The various processes implemented in the method embodiment shown can achieve the same beneficial effects, and will not be described again here to avoid repetition.
[0105] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a non-transitory computer-readable storage medium storing computer instructions.
[0106] like Figure 7 , is a block diagram of an electronic device according to an image detection method according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0107] like Figure 7 As shown, the electronic device includes: one or more processors 701, a memory 702, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 701 is taken as an example.
[0108] The memory 702 is a non-transitory computer-readable storage medium provided by the present disclosure. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the image detection method provided by the present disclosure. The non-transitory computer-readable storage medium of the present disclosure stores computer instructions, which are used to enable a computer to perform the image detection method provided by the present disclosure.
[0109] The memory 702 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the image detection method in the embodiment of the present disclosure (for example, the attached Figure 6 601, 602, a second acquisition module 603 and a second detection module 604 are shown). The processor 701 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 702, that is, the image detection method in the above method embodiment is implemented.
[0110] The memory 702 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device of the image detection method, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 702 may optionally include a memory remotely arranged relative to the processor 701, and these remote memories may be connected to the electronic device of the image detection method via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0111] The electronic device of the image detection method may further include: an input device 703 and an output device 707. The processor 701, the memory 702, the input device 703 and the output device 707 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0112] The input device 703 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device of the image detection method, such as input devices such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick, etc. The output device 707 may include a display device, an auxiliary lighting device (e.g., LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touch screen.
[0113] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0114] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0115] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0116] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0117] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0118] According to the technical solution disclosed in the present invention, it is possible to detect whether there is any dangerous behavior on the railway based on the rail image data and image data of the railway monitoring image, so as to improve the efficiency of railway detection.
[0119] The present disclosure provides a computer program product, including a computer program, which implements the image detection method provided by an embodiment of the present invention when executed by a processor.
[0120] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0121] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. An image detection method, comprising: Acquire railway surveillance images; Performing target object detection on the railway monitoring image by a first neural network; Acquiring rail image data of the railway monitoring image; When the first neural network detects the image data of the target object in the railway monitoring image, detecting whether there is a dangerous behavior based on the image data of the target object and the image data of the railroad track; The image data of the target object includes: information about the first region of the target object in the railway monitoring image, and the image data of the rail includes: information about the second region of the rail in the railway monitoring image; The detecting whether there is a dangerous behavior based on the image data of the target object and the image data of the rail includes: Detecting whether there is a dangerous behavior according to the intersection-over-union (IOU) ratio of the first area information and the second area information; The first area information includes position information of N rows of pixels selected from the bottom position upwards including the target object, and the value of N corresponds to at least one of the following: Collection angle and business requirements; The acquisition angle is the angle of the surveillance camera that acquires the railway surveillance image relative to the rails.
2. The method according to claim 1, wherein: When the value of the IOU is greater than or equal to a preset threshold, it is determined that there is a dangerous behavior, wherein the preset threshold corresponds to at least one of the following: Collection angle and business requirements; The acquisition angle is the angle of the surveillance camera that acquires the railway surveillance image relative to the rails.
3. The method according to claim 1, wherein: The obtaining of the rail image data of the railway monitoring image comprises: Performing rail detection on the railway monitoring image by a second neural network to obtain the rail image data; or, The rail image data of the pre-stored target image is obtained as the rail image data of the railway monitoring image, wherein the target image and the railway monitoring image are images captured by the same monitoring camera.
4. The method according to claim 1, wherein: The performing target object detection on the railway monitoring image by using a first neural network includes: The railway monitoring image is scaled to obtain a railway monitoring image of a preset size, and the railway monitoring image of the preset size is normalized to obtain a normalized railway monitoring image. The normalized railway monitoring image is subjected to target object detection through a first neural network.
5. An image detection device, comprising: A first acquisition module is used to acquire railway monitoring images; A first detection module, configured to perform target object detection on the railway monitoring image through a first neural network; A second acquisition module, used to acquire rail image data of the railway monitoring image; A second detection module is used to detect whether there is a dangerous behavior based on the image data of the target object and the image data of the railroad when the first neural network detects the image data of the target object in the railway monitoring image; The image data of the target object includes: information about the first region of the target object in the railway monitoring image, and the image data of the rail includes: information about the second region of the rail in the railway monitoring image; The second detection module is used to detect whether there is a dangerous behavior according to the intersection-and-union ratio (IOU) of the first area information and the second area information when the first neural network detects the image data of the target object in the railway monitoring image; The first area information includes position information of N rows of pixels selected from the bottom position upwards including the target object, and the value of N corresponds to at least one of the following: Collection angle and business requirements; The acquisition angle is the angle of the surveillance camera that acquires the railway surveillance image relative to the rails.
6. The device according to claim 5, wherein: When the value of the IOU is greater than or equal to a preset threshold, it is determined that there is a dangerous behavior, wherein the preset threshold corresponds to at least one of the following: Collection angle and business requirements; The acquisition angle is the angle of the surveillance camera that acquires the railway surveillance image relative to the rails.
7. The device according to claim 5, wherein: The second acquisition module is used to perform rail detection on the railway monitoring image through a second neural network to obtain the rail image data; or, The second acquisition module is used to acquire the pre-stored rail image data of the target image as the rail image data of the railway monitoring image, wherein the target image and the railway monitoring image are images captured by the same monitoring camera.
8. The device according to claim 5, wherein: The first detection module is used to scale the railway monitoring image to obtain a railway monitoring image of a preset size, normalize the railway monitoring image of the preset size to obtain a normalized railway monitoring image, and perform target object detection on the normalized railway monitoring image through a first neural network.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4.
