CN115035591A - Dog walking behavior detection method and device - Google Patents

Dog walking behavior detection method and device Download PDF

Info

Publication number
CN115035591A
CN115035591A CN202210473808.6A CN202210473808A CN115035591A CN 115035591 A CN115035591 A CN 115035591A CN 202210473808 A CN202210473808 A CN 202210473808A CN 115035591 A CN115035591 A CN 115035591A
Authority
CN
China
Prior art keywords
dog
image
training
detection
detected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210473808.6A
Other languages
Chinese (zh)
Inventor
刘佳丽
史晓蒙
毛宁
魏健康
张星
吕晓鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing E Hualu Information Technology Co Ltd
Original Assignee
Beijing E Hualu Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing E Hualu Information Technology Co Ltd filed Critical Beijing E Hualu Information Technology Co Ltd
Priority to CN202210473808.6A priority Critical patent/CN115035591A/en
Publication of CN115035591A publication Critical patent/CN115035591A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a dog walking behavior detection method and device, wherein the method comprises the following steps: acquiring an image to be detected; carrying out pedestrian detection and dog detection on an image to be detected by utilizing a pre-trained pedestrian dog detection model; if a dog is detected in the image to be detected, acquiring a dog image rectangular frame, and expanding the dog image rectangular frame to obtain a dog image expanded image; detecting the dog image expansion image by using a pre-trained dog rope detection model; if the dog leash is not detected in the dog image expansion image and pedestrians exist in the specified range of the dog, the detection result is judged to be that the dog walking behavior is existed. The dog leash detection method and the dog leash detection system automatically identify the dog leash-free behavior, reduce the workload of workers, and reduce the interference of similar objects such as electric wires and ground gaps by taking the dog image expansion image as dog leash detection data, thereby being beneficial to deepening the understanding of a network on the dog leash and improving the detection accuracy.

Description

Dog walking behavior detection method and device
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a dog walking behavior detection method and device.
Background
With the construction of civilized cities, the standard management of wandering dogs and the problem of not pulling ropes for walking dogs become important components of city management. At present, the detection method for deep learning can detect the appearance of dogs in cities, but the behavior of a wandering dog and the behavior of walking the dogs cannot be effectively distinguished, so that the workload of managers is increased.
Disclosure of Invention
Therefore, the technical problem to be solved by the invention is to overcome the defect of large workload when the dog behavior is manually identified in the prior art, so that the method and the device for detecting the dog walking behavior are provided.
The invention provides a method for detecting dog walking behavior, which comprises the following steps: acquiring an image to be detected; carrying out pedestrian detection and canine detection on the image to be detected by utilizing a pre-trained pedestrian canine detection model; if a dog is detected in the image to be detected, acquiring a dog image rectangular frame, and expanding the dog image rectangular frame to obtain a dog image expanded image; detecting the dog image expansion image by using a pre-trained dog rope detection model; and if the dog leash is not detected in the dog image expansion image and the pedestrian exists in the specified range of the dog, judging that the dog leash-free behavior exists according to the detection result.
Optionally, in the method for detecting a behavior of walking a dog provided by the present invention, the image to be detected is obtained by video stream data.
Optionally, in the method for detecting dog walking behavior provided by the present invention, the pedestrian dog detection model is obtained by training through the following steps: acquiring a plurality of first training images; carrying out pedestrian detection frame labeling and dog detection frame labeling on each first training image to obtain a first training data set; training a yolov5 network model based on the first training data set until a first loss value of a first loss function meets a first loss condition to obtain the pedestrian canine detection model.
Optionally, in the method for detecting a dog walking behavior provided by the present invention, the dog leash detection model is obtained by training through the following steps: acquiring a plurality of second training images; acquiring a dog image rectangular frame in the image, and expanding the dog image rectangular frame to obtain a training dog image expanded image; labeling the dog leash in the training dog image expansion image to obtain a second training data set; training the optimized yolov5 network model based on the second training data set until a second LOSS value of a second LOSS function meets a second LOSS condition to obtain the dog leash detection model, wherein the optimized yolov5 network model takes a yolov5 network as a main body and comprises a bidirectional characteristic pyramid structure, a HardSwitch function is taken as an activation function, and the second LOSS function is a FOCAL LOSS LOSS function.
The second aspect of the present invention provides a device for detecting a dog walking behavior, including: the image acquisition module is used for acquiring an image to be detected; the first detection module is used for carrying out pedestrian detection and canine detection on the image to be detected by utilizing a pre-trained pedestrian canine detection model; the image expansion module is used for acquiring a dog image rectangular frame and expanding the dog image rectangular frame to obtain a dog image expansion image if a dog is detected in the image to be detected; the second detection module is used for detecting the dog image expansion image by using a pre-trained dog rope detection model; and the dog walking behavior detection module is used for judging that the dog walking behavior does not lead if the dog rope is not detected in the dog image extension image and the pedestrian exists in the specified range of the dog, and determining the detection result as the dog walking behavior.
Optionally, in the device for detecting a behavior of walking a dog provided by the present invention, the image to be detected is obtained by video stream data.
Optionally, in the device for detecting dog walking behavior provided by the present invention, the device includes a first training module, configured to train the pedestrian dog detection model, where the first training module includes: the first training image acquisition sub-module is used for acquiring a plurality of first training images; the first training set acquisition submodule is used for carrying out pedestrian detection frame labeling and dog detection frame labeling on each first training image to obtain a first training data set; and the first model training submodule is used for training the yolov5 network model based on the first training data set until a first loss value of a first loss function meets a first loss condition to obtain the pedestrian dog detection model.
Optionally, in the device for detecting a behavior of walking a dog provided by the present invention, the device includes a second training module, configured to train the dog leash detection model, where the second training module includes: the second training image acquisition sub-module is used for acquiring a plurality of second training images; the second training set acquisition submodule is used for acquiring a dog image rectangular frame in the image, expanding the dog image rectangular frame to obtain a training dog image expansion image, and labeling a dog rope in the training dog image expansion image to obtain a second training data set; and the second model training submodule is used for training the optimized yolov5 network model based on the second training data set until a second LOSS value of a second LOSS function meets a second LOSS condition to obtain the dog leash detection model, the optimized yolov5 network model takes a yolov5 network as a main body and comprises a bidirectional feature pyramid structure, a HardSwitch function is taken as an activation function, and the second LOSS function is a CALFO LOSS LOSS function.
A third aspect of the present invention provides a computer apparatus comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to perform the method for detecting behavior of a walking dog according to the first aspect of the present invention.
A fourth aspect of the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the method for detecting dog walking behavior according to the first aspect of the present invention.
The technical scheme of the invention has the following advantages:
after the image to be detected is obtained, if the dog image rectangular frame is obtained by detecting the image to be detected through the pedestrian dog detection model, the dog image rectangular frame is expanded to obtain a dog image expanded image, the dog image expanded image is detected through the pre-trained dog rope detection model, whether a dog rope exists or not is detected, if the dog rope is not detected and a pedestrian exists in the specified range of the dog, the fact that the dog is stroked and not tied is judged to exist, through the implementation of the method and the device for detecting the dog strolling behavior, the dog strolling behavior can be automatically identified, manual identification is not needed, the workload of workers is reduced, and the dog image expanded image obtained by expanding the dog image rectangular frame is used as dog rope detection data, so that the interference of similar objects such as electric wires, ground gaps and the like can be reduced, the understanding of the network to the dog leash is deepened, and therefore the detection accuracy is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a specific example of a method for detecting behavior of walking a dog in an embodiment of the present invention;
fig. 2 is a schematic block diagram of a specific example of the dog walking behavior detection apparatus according to the embodiment of the present invention;
fig. 3 is a schematic block diagram of a specific example of a computer device in the embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In addition, the technical features involved in the different embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
An embodiment of the present invention provides a method for detecting a dog walking behavior, as shown in fig. 1, including:
step S11: and acquiring an image to be detected.
In an optional embodiment, the image to be detected is obtained from a video stream, and the obtaining of the stream data can realize the distinguishing of the front frame image and the back frame image and different stream addresses, so that the dog leash detection model realizes the detection of multiple paths of videos and the function of removing the duplicate based on multiple frames. The input data stream format is:
Figure BDA0003624296870000051
Figure BDA0003624296870000061
step S12: and carrying out pedestrian detection and dog detection on the image to be detected by utilizing a pre-trained pedestrian dog detection model.
In the embodiment of the invention, the pedestrian canine detection model can simultaneously detect pedestrians and canines in the image.
Step S13: and if the dog is detected in the image to be detected, acquiring a dog image rectangular frame, and expanding the dog image rectangular frame to obtain a dog image expanded image.
In an alternative embodiment, if the pedestrian dog detection model detects dogs in the image to be detected, the output of the pedestrian dog detection model includes a dog image rectangular frame.
In an alternative embodiment, each side of the dog image rectangular frame is extended outwards by N pixels to obtain a dog image extended image, where N may be 200 as an example; and if the pixel point between one side of the dog image rectangular frame and the image edge is N, and N is less than N, respectively extending the sides of the dog image rectangular frame outwards by N pixels to obtain the dog image extended image.
In an optional embodiment, if no dog is detected, the dog walking behavior does not need to be detected, and the current flow is ended.
Step S14: and detecting the canine image extension image by using a pre-trained dog rope detection model.
In the embodiment of the invention, the dog image expansion image obtained by expanding the dog image rectangular frame is used as dog leash detection data, so that the interference of similar objects such as electric wires, ground gaps and the like can be reduced, and the understanding of a network to the dog leash can be deepened.
Step S15: if the dog leash is not detected in the dog image expansion image and pedestrians exist in the specified range of the dog, the detection result is judged to be that the dog walking behavior is existed.
In an optional embodiment, in the step S12, if the pedestrian dog detection model detects that there is a pedestrian in the image to be detected, the output of the pedestrian dog detection model further includes a pedestrian rectangular frame, and it is determined whether there is a pedestrian in the specified range of the dogs by determining whether there is a pedestrian rectangular frame in the preset range of the dog image rectangular frame.
In an optional embodiment, if the dog leash is not detected in the dog image expansion image and no pedestrian exists in the specified range of the dog, the detection result is determined to be the existence of the wandering dog.
By implementing the method, the detection of the wandering dog and the walking dog without the rope is clear and definite, and manual secondary classification is not needed.
In an alternative embodiment, after the step S12 is executed, a plurality of images to be detected obtained through the video stream data are detected, and if a plurality of dogs are detected, a plurality of dog image rectangular frames are output, and the plurality of dog image rectangular frames are combined into a list. Storing the dog image rectangular frames in the list into a global dictionary with the length not exceeding a preset value, and deleting the earliest stored dog image rectangular frame when the length exceeds the preset value so as to meet the requirement of being smaller than the preset value, wherein the preset value can be 200 as an example. And comparing the detected dog image rectangular frame with a dog image rectangular frame in the dictionary every time, and if the intersection ratio of the detected dog image rectangular frame and the dog image rectangular frame in the dictionary is more than 0.5, deleting the detected dog image rectangular frame from the list, and not participating in the subsequent judgment of the behavior of not pulling the rope of the wandering dog and the walking dog.
In an alternative embodiment, the pedestrian canine detection model is obtained by training the following steps:
first, a plurality of first training images are acquired.
In an optional implementation, images of pedestrians and canines in practical application scenes are collected, multi-angle samples are collected from multiple scenes and multiple time periods, each picture requires that the pedestrians and the canines are clear in body shape and easy to distinguish, and the voc public data set related data are added to obtain a first training image.
In an alternative embodiment, after acquiring the plurality of first training images, the data set is further enlarged by using a plurality of data enhancement methods (such as mosaic enhancement, random erasure, noise addition, and the like).
And then, carrying out pedestrian detection frame labeling and dog detection frame labeling on each first training image to obtain a first training data set.
And finally, training the yolov5 network model based on the first training data set until the first loss value of the first loss function meets the first loss condition to obtain the pedestrian dog detection model.
In an alternative embodiment, the dog leash detection model is trained by the following steps:
first, a plurality of second training images are acquired.
In an optional implementation, images of pictures around dogs in practical application scenes are collected, pedestrian dog leashes are collected from multiple scenes, multiple time periods and multiple angles to take dog samples for walking, each picture requires that the dog leash is clear and distinguishable, and a second training image is obtained.
In an alternative embodiment, after acquiring the plurality of second training images, the data set is further expanded by using a plurality of data enhancement methods (such as mosaic enhancement, random erasure, noise addition, and the like).
And secondly, acquiring a dog image rectangular frame in the image, and expanding the dog image rectangular frame to obtain a training dog image expanded image.
In an optional embodiment, a manner of obtaining the training canine image extension image is the same as that of obtaining the canine image extension image in the above embodiment, and details refer to the description in the above embodiment, and are not repeated herein.
And then, labeling the dog leash in the training dog image expansion image to obtain a second training data set.
And finally, training the optimized yolov5 network model based on a second training data set until a second LOSS value of a second LOSS function meets a second LOSS condition to obtain a dog leash detection model, wherein the optimized yolov5 network model takes a yolov5 network as a main body and comprises a bidirectional characteristic pyramid structure, a HardSwitch function is taken as an activation function, and the second LOSS function is a FOCAL LOSS LOSS function.
In an alternative embodiment, the input to the optimized yolov5 network model used a three channel image of 608 x 608.
In the embodiment of the invention, the HardSwitch activation function is used for replacing the original Leaky RELU activation function, the activation process is simplified, the calculation speed is increased, the model parameters are reduced, a bidirectional characteristic pyramid network is fused in the optimized yolov5 network model, the structure comprises a down-sampling structure from top to bottom, different layers in the structure are mutually coupled, and finally, the up-sampling from bottom to top is carried out, so that the characteristic expression capability of the model is obviously enhanced. For a small dog sample on a road, the dog leash detection model has strong detection. In addition, the FOCAL LOSS LOSS function is adopted to replace the original LOSS function, the proportion of small target features in the LOSS function is enhanced, and the expression of the relation between the dog target frame and the dog leash target frame is enhanced, so that the dog leash is detected, and the confusion with ground cracks and the like is avoided.
In an optional embodiment, the method for detecting a dog walking behavior provided in the embodiment of the present invention further constructs an output result dictionary, and outputs a judgment confidence, box, and behavior of a dog and a pedestrian, where an event is reported when a wandering dog or a dog walking behavior is not involved in a dog walking, and the output data format is:
Figure BDA0003624296870000091
Figure BDA0003624296870000101
by executing the method for detecting the dog walking behavior provided by the embodiment, the detection of the wandering dog and the rope-walking-free behavior of the dog walking can be quickly and accurately realized under various application scenes and different illumination conditions, the accuracy rate reaches 95% under multiple scenes, and the test speed can reach 0.12s on Tesla p 4.
An embodiment of the present invention provides a device for detecting a dog walking behavior, as shown in fig. 2, including:
the image obtaining module 21 is configured to obtain an image to be detected, and details of the image to be detected refer to the description in the foregoing embodiments, which are not described herein again.
The first detection module 22 is configured to perform pedestrian detection and dog detection on an image to be detected by using a pre-trained pedestrian dog detection model, for details, refer to the description in the foregoing embodiment, and details are not described herein again.
If a dog is detected in the image to be detected, the image extension module 23 is configured to obtain a dog image rectangular frame, and extend the dog image rectangular frame to obtain a dog image extension image, where details are described in the above embodiment and are not described herein again.
The second detection module 24 is configured to detect the dog image expansion image by using a pre-trained dog leash detection model, and the details refer to the description in the foregoing embodiments, which are not described herein again.
If the dog leash is not detected in the dog image extension image and a pedestrian exists in the specified range of the dog, the dog leash behavior detection module 25 is configured to determine that the dog leash-free behavior exists according to the detection result, and the detailed content refers to the description in the above embodiments and is not described herein again.
In an optional embodiment, in the device for detecting the behavior of walking a dog according to the embodiment of the present invention, the image to be detected is obtained by video stream data.
In an optional embodiment, in the device for detecting a dog walking behavior provided in the embodiment of the present invention, the device includes a first training module, configured to train a pedestrian dog detection model, where the first training module includes:
the first training image acquisition sub-module is configured to acquire a plurality of first training images, and details of the first training image acquisition sub-module refer to the description in the foregoing embodiment, which is not described herein again.
And the first training set acquisition submodule is used for performing pedestrian detection frame labeling and dog detection frame labeling on each first training image to obtain a first training data set, and the detailed contents refer to the description in the embodiment and are not repeated herein.
The first model training submodule is configured to train the yolov5 network model based on the first training data set until the first loss value of the first loss function satisfies the first loss condition to obtain the pedestrian dog detection model, and details of the pedestrian dog detection model refer to the description in the foregoing embodiment and are not described herein again.
In an optional embodiment, in the device for detecting a behavior of walking a dog provided in the embodiment of the present invention, the device includes a second training module, configured to train the dog leash detection model, where the second training module includes:
the second training image acquisition sub-module is configured to acquire a plurality of second training images, and details of the second training images refer to the description in the foregoing embodiment, which are not described herein again.
And the second training set acquisition submodule is used for acquiring a dog image rectangular frame in the image, expanding the dog image rectangular frame to obtain a training dog image expansion image, and labeling a dog leash in the training dog image expansion image to obtain a second training data set, wherein the detailed contents refer to the description in the embodiment and are not repeated herein.
And the second model training submodule is used for training the optimized yolov5 network model based on a second training data set until a second LOSS value of a second LOSS function meets a second LOSS condition to obtain a dog leash detection model, the optimized yolov5 network model takes a yolov5 network as a backbone and comprises a bidirectional feature pyramid structure, a HardSwitch function is taken as an activation function, the second LOSS function is a FOCAL LOSS LOSS function, the detailed contents refer to the description in the embodiment, and the detailed contents are not repeated herein.
An embodiment of the present invention provides a computer device, as shown in fig. 3, the computer device mainly includes one or more processors 31 and a memory 32, where one processor 31 is taken as an example in fig. 3.
The computer device may further include: an input device 33 and an output device 34.
The processor 31, the memory 32, the input device 33 and the output device 34 may be connected by a bus or other means, and the bus connection is exemplified in fig. 3.
The processor 31 may be a Central Processing Unit (CPU). The Processor 31 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or any combination thereof. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The memory 32 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created from use of the dog walking behavior detection apparatus, and the like. Further, the memory 32 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 32 optionally includes memory located remotely from processor 31, and these remote memories may be connected to the dog walking behavior detection device via a network. Input device 33 may receive user input of a calculation request (or other numeric or character information) and generate key signal inputs associated with the dog walking behavior detection device. The output device 34 may include a display device such as a display screen for outputting the calculation result.
The embodiment of the invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions can execute the dog walking behavior detection method in any method embodiment. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. This need not be, nor should it be exhaustive of all embodiments. And obvious variations or modifications therefrom are within the scope of the invention.

Claims (10)

1. A dog walking behavior detection method is characterized by comprising the following steps:
acquiring an image to be detected;
carrying out pedestrian detection and canine detection on the image to be detected by utilizing a pre-trained pedestrian canine detection model;
if a dog is detected in the image to be detected, acquiring a dog image rectangular frame, and expanding the dog image rectangular frame to obtain a dog image expanded image;
detecting the dog image expansion image by using a pre-trained dog rope detection model;
and if the dog leash is not detected in the dog image expansion image and the pedestrian exists in the specified range of the dog, judging that the dog leash-free behavior exists according to the detection result.
2. The method of detecting behavior for walking a dog according to claim 1,
and acquiring the image to be detected through video stream data.
3. The method for detecting the behavior of walking dogs according to claim 1, wherein the pedestrian dog detection model is obtained by training through the following steps:
acquiring a plurality of first training images;
carrying out pedestrian detection frame labeling and dog detection frame labeling on each first training image to obtain a first training data set;
training a yolov5 network model based on the first training data set until a first loss value of a first loss function meets a first loss condition to obtain the pedestrian canine detection model.
4. The method for detecting the behavior of walking dogs according to claim 1, wherein the dog leash detection model is obtained by training through the following steps:
acquiring a plurality of second training images;
acquiring a dog image rectangular frame in the image, and expanding the dog image rectangular frame to obtain a training dog image expanded image;
labeling the dog leash in the training dog image expansion image to obtain a second training data set;
training the optimized yolov5 network model based on the second training data set until a second LOSS value of a second LOSS function meets a second LOSS condition to obtain the dog leash detection model, wherein the optimized yolov5 network model takes a yolov5 network as a main body and comprises a bidirectional characteristic pyramid structure, a HardSwitch function is taken as an activation function, and the second LOSS function is a FOCAL LOSS LOSS function.
5. A dog walking behavior detection device, comprising:
the image acquisition module is used for acquiring an image to be detected;
the first detection module is used for carrying out pedestrian detection and canine detection on the image to be detected by utilizing a pre-trained pedestrian canine detection model;
the image expansion module is used for acquiring a dog image rectangular frame and expanding the dog image rectangular frame to obtain a dog image expansion image if dogs are detected in the image to be detected;
the second detection module is used for detecting the dog image expansion image by using a pre-trained dog rope detection model;
and the dog walking behavior detection module is used for judging that the dog walking behavior does not lead if the dog rope is not detected in the dog image extension image and the pedestrian exists in the specified range of the dog, and determining the detection result as the dog walking behavior.
6. The behavior detection device for walking a dog according to claim 5,
and acquiring the image to be detected through video stream data.
7. The device for detecting dog walking behavior according to claim 5, wherein the device comprises a first training module for training the pedestrian dog detection model, the first training module comprising:
the first training image acquisition sub-module is used for acquiring a plurality of first training images;
the first training set acquisition submodule is used for carrying out pedestrian detection frame labeling and dog detection frame labeling on each first training image to obtain a first training data set;
and the first model training submodule is used for training the yolov5 network model based on the first training data set until a first loss value of a first loss function meets a first loss condition to obtain the pedestrian dog detection model.
8. The device for detecting the behavior of walking dogs according to claim 5, wherein the device comprises a second training module for training the dog leash detection model, the second training module comprising:
the second training image acquisition sub-module is used for acquiring a plurality of second training images;
the second training set acquisition submodule is used for acquiring a dog image rectangular frame in the image, expanding the dog image rectangular frame to obtain a training dog image expansion image, and labeling a dog rope in the training dog image expansion image to obtain a second training data set;
and the second model training submodule is used for training the optimized yolov5 network model based on the second training data set until a second LOSS value of a second LOSS function meets a second LOSS condition to obtain the dog leash detection model, the optimized yolov5 network model takes a yolov5 network as a main body and comprises a bidirectional feature pyramid structure, a HardSwitch function is taken as an activation function, and the second LOSS function is a CALFO LOSS LOSS function.
9. A computer device, comprising:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to perform the method of dog walking behavior detection according to any one of claims 1-4.
10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the method for walking dog behavior detection according to any one of claims 1-4.
CN202210473808.6A 2022-04-29 2022-04-29 Dog walking behavior detection method and device Pending CN115035591A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210473808.6A CN115035591A (en) 2022-04-29 2022-04-29 Dog walking behavior detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210473808.6A CN115035591A (en) 2022-04-29 2022-04-29 Dog walking behavior detection method and device

Publications (1)

Publication Number Publication Date
CN115035591A true CN115035591A (en) 2022-09-09

Family

ID=83118536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210473808.6A Pending CN115035591A (en) 2022-04-29 2022-04-29 Dog walking behavior detection method and device

Country Status (1)

Country Link
CN (1) CN115035591A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116863298A (en) * 2023-06-29 2023-10-10 深圳市快瞳科技有限公司 Training and early warning sending method, system, device, equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116863298A (en) * 2023-06-29 2023-10-10 深圳市快瞳科技有限公司 Training and early warning sending method, system, device, equipment and medium
CN116863298B (en) * 2023-06-29 2024-05-10 深圳市快瞳科技有限公司 Training and early warning sending method, system, device, equipment and medium

Similar Documents

Publication Publication Date Title
US11455805B2 (en) Method and apparatus for detecting parking space usage condition, electronic device, and storage medium
WO2022227490A1 (en) Behavior recognition method and apparatus, device, storage medium, computer program, and program product
CN112560999A (en) Target detection model training method and device, electronic equipment and storage medium
CN112329881B (en) License plate recognition model training method, license plate recognition method and device
CN112883921A (en) Garbage can overflow detection model training method and garbage can overflow detection method
CN110599453A (en) Panel defect detection method and device based on image fusion and equipment terminal
CN112163525B (en) Event type prediction method and device, electronic equipment and storage medium
CN113688947B (en) Method and system for identifying faults of infrared image of power distribution equipment
CN110942456B (en) Tamper image detection method, device, equipment and storage medium
CN112906471A (en) Traffic signal lamp identification method and device
CN111435446A (en) License plate identification method and device based on L eNet
CN113221804B (en) Disordered material detection method and device based on monitoring video and application
US11557133B1 (en) Automatic license plate recognition
RU2019136604A (en) PLATFORM FOR MANAGING AND VERIFICATION OF VIDEO CONTENT, PHOTOS OR SIMILAR CONTENT GENERATED BY DIFFERENT DEVICES
CN115035591A (en) Dog walking behavior detection method and device
CN112733666A (en) Method, equipment and storage medium for collecting difficult images and training models
CN114708426A (en) Target detection method, model training method, device, equipment and storage medium
CN116597270A (en) Road damage target detection method based on attention mechanism integrated learning network
CN112101114A (en) Video target detection method, device, equipment and storage medium
CN114037839A (en) Small target identification method, system, electronic equipment and medium
CN117765485A (en) Vehicle type recognition method, device and equipment based on improved depth residual error network
CN110121723B (en) Artificial neural network
CN110855932B (en) Alarm method and device based on video data, electronic equipment and storage medium
CN112837326B (en) Method, device and equipment for detecting carryover
CN112395993A (en) Method and device for detecting ship sheltered based on monitoring video data and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination