An unattended abnormal behavior detection method and system in an industrial scene
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-03
- Publication Date
- 2026-08-11
AI Technical Summary
[0006]鉴于现有技术的上述缺点、不足,本发明提供一种工业场景下无人值守的异常行为检测方法和系统,其解决了现有技术中存在着的检测效率比较低的技术问题
[0026]本申请实施例提供了一种工业场景下无人值守的异常行为检测方法和系统,通过获取待识别图像,以及对待识别图像进行预处理,以得到预处理后的图像,以及对预处理后的图像进行切片辅助推理,以得到图像特征向量,以及将图像特征向量输入到预先训练好的YOLO模型中进行目标识别,以得到目标边界框的位置,以及基于目标边界框的位置,从待识别图像中裁剪出目标边界框图像,并将目标边界框图像输入到预先训练好的SAM模型中进行分割处理,以得到分割后的图像,以及将分割后的图像与语义库中的参考图像进行相似度比较,以得到相似度得分,并根据相似度得分判断待识别图像所在的工业场景中是否存在异常行为,从而通过对待识别图像进行预处理,能够将待识别图像转换为适合大模型输入的结构化数据,进而能够解决现有技术中存在着的工业场景中非结构化数据难以直接应用于传统的大模型的问题,以及通过将SAM大模型和YOLO模型进行结合,以进行检测目标的高精度分割、识别和标注,进而能够提高工业场景下的图像检测效率。
Smart Images

Figure CN117789109B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer image recognition, and in particular to a method and system for detecting abnormal behavior in unattended industrial settings. Background Technology
[0002] In today's digital and information age, the application scope of image recognition using artificial intelligence is constantly expanding, and image recognition technology is becoming increasingly mature. As one of the important pillars of the national economy, industry relies heavily on artificial intelligence to improve industrial production efficiency and quality, as well as ensure industrial safety. The application of image recognition technology in industrial scenarios can achieve functions such as automated production, equipment fault detection, and quality control, greatly enhancing the level of intelligence in industrial production.
[0003] However, industrial scene images are typically complex, large in size, and subject to noise interference, making traditional image recognition algorithms difficult to apply effectively. To overcome these problems, large models (e.g., large language models like ChatGPT in the text domain) are widely used in everyday life. Furthermore, large models, through neural network structures with numerous parameters, can automatically learn abstract features of images from large-scale data, thereby achieving more accurate and precise image recognition. In industrial scenarios, using large models for image recognition can help companies quickly identify abnormal behaviors in the production process, improve product quality, reduce reliance on manual operations, thereby lowering costs and increasing industrial production efficiency.
[0004] Although large models have brought new development opportunities to industrial image recognition, they still face challenges in practical applications: First, industrial images often exist in the form of unstructured data, which is difficult to apply directly to traditional large models; second, large models require a long time to train and update large-scale data, while industrial production environments have high requirements for real-time performance. Therefore, how to improve recognition efficiency while ensuring accuracy has become an important issue. Summary of the Invention
[0005] (a) Technical problems to be solved
[0006] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a method and system for detecting abnormal behavior without human intervention in industrial scenarios, which solves the technical problem of low detection efficiency in the prior art.
[0007] (II) Technical Solution
[0008] To achieve the above objectives, the main technical solutions adopted by the present invention include:
[0009] In a first aspect, embodiments of the present invention provide a method for detecting abnormal behavior in an unattended industrial setting. The method includes: acquiring an image to be identified; wherein the image to be identified is a monitoring image in an industrial setting; preprocessing the image to be identified to obtain a preprocessed image; performing slice-assisted reasoning on the preprocessed image to obtain an image feature vector; inputting the image feature vector into a pre-trained YOLO model for target recognition to obtain the position of the target bounding box; based on the position of the target bounding box, cropping the target bounding box image from the image to be identified, and inputting the target bounding box image into a pre-trained SAM model for segmentation processing to obtain a segmented image; comparing the similarity of the segmented image with a reference image in a semantic database to obtain a similarity score, and determining whether abnormal behavior exists in the industrial setting where the image to be identified is located based on the similarity score.
[0010] It should be noted that "unattended" in this application refers to the detection process of abnormal behavior without human intervention, and does not mean that there are no personnel on duty in industrial settings.
[0011] In some possible embodiments, the image to be recognized is preprocessed, including: optimizing the image to be recognized based on a preset image processing method to obtain an optimized image; performing pose recognition on the target in the optimized image to obtain a pose recognition result; when the pose recognition result is determined to be a normal pose state, modeling the background in the optimized image to obtain a background model; and using the background model to perform difference calculation on the optimized image to obtain a preprocessed image.
[0012] In some possible embodiments, the abnormal behavior detection method includes: terminating the detection when the pose recognition result is determined to be an abnormal pose state.
[0013] In some possible embodiments, slice-assisted reasoning is performed on the preprocessed image, including: dividing the preprocessed image into blocks to obtain multiple image blocks; adjusting the size of each image block in the multiple image blocks while keeping the aspect ratio fixed, so that it is scaled proportionally to the size of the image to be identified; performing target detection on each image block to obtain prediction results of the target at multiple different locations, and using the NMS non-maximum suppression algorithm to filter the prediction results at overlapping locations, retaining only the prediction result with the highest probability at the same location.
[0014] In some possible embodiments, the similarity score is calculated using the following formula:
[0015]
[0016]
[0017] Where PSNR is the similarity score; n is the number of bits per pixel; MSE is the mean square error between the current segmented image X and the reference image Y in the semantic library; H is the image height; and W is the image width.
[0018] In some possible embodiments, determining whether there is abnormal behavior in the industrial scene where the image to be identified is located based on the similarity score includes: determining whether the similarity score is greater than or equal to a preset score; if the similarity score is greater than or equal to the preset score, then determining that there is abnormal behavior in the industrial scene where the image to be identified is located.
[0019] In some possible embodiments, determining whether there is abnormal behavior in the industrial scene where the image to be identified is located based on the similarity score further includes: if the similarity score is less than a preset score, then determining that there is no abnormal behavior in the industrial scene where the image to be identified is located.
[0020] Secondly, embodiments of this application provide an unattended abnormal behavior detection system in an industrial setting, comprising: an acquisition module for acquiring an image to be identified, wherein the image to be identified is a monitoring image in an industrial setting; a preprocessing module for preprocessing the image to be identified to obtain a preprocessed image; a slice-assisted reasoning module for performing slice-assisted reasoning on the preprocessed image to obtain an image feature vector; an input module for inputting the image feature vector into a pre-trained YOLO model for target recognition to obtain the position of the target bounding box; a cropping and segmentation module for cropping the target bounding box image from the image to be identified based on the position of the target bounding box, and inputting the target bounding box image into a pre-trained SAM model for segmentation processing to obtain a segmented image; and a comparison and judgment module for comparing the similarity of the segmented image with a reference image in a semantic library to obtain a similarity score, and judging whether there is abnormal behavior in the industrial setting where the image to be identified is located based on the similarity score.
[0021] Thirdly, embodiments of this application provide a storage medium storing a computer program, which, when executed by a processor, performs the method described in the first aspect or any optional implementation thereof.
[0022] Fourthly, embodiments of this application provide an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the method described in the first aspect or any optional implementation of the first aspect.
[0023] Fifthly, this application provides a computer program product that, when run on a computer, causes the computer to perform the method in the first aspect or any possible implementation thereof.
[0024] (III) Beneficial Effects
[0025] The beneficial effects of this invention are:
[0026] This application provides a method and system for detecting abnormal behavior in unattended industrial scenarios. The method involves acquiring an image to be identified, preprocessing the image to obtain a preprocessed image, slicing the preprocessed image to aid inference and obtain image feature vectors, inputting these feature vectors into a pre-trained YOLO model for target recognition to obtain the location of the target bounding box, cropping the target bounding box image from the image to be identified based on the location of the target bounding box, and inputting the target bounding box image into a pre-trained SAM model for segmentation to obtain a segmented image. The segmented image is then compared with reference images in a semantic database to obtain a similarity score. Based on the similarity score, it is determined whether abnormal behavior exists in the industrial scenario where the image to be identified is located. By preprocessing the image to be identified, it can be converted into structured data suitable for input to large models, thus solving the problem in existing technologies where unstructured data in industrial scenarios is difficult to directly apply to traditional large models. Furthermore, by combining the SAM large model and the YOLO model, high-precision segmentation, recognition, and annotation of the detected target can be achieved, thereby improving the efficiency of image detection in industrial scenarios.
[0027] To make the above-mentioned objectives, features and advantages to be achieved by the embodiments of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This illustration shows a schematic diagram of an unattended abnormal behavior detection framework in an industrial setting provided by an embodiment of this application;
[0030] Figure 2 The flowchart illustrates a method for detecting abnormal behavior of unattended personnel in an industrial setting, as provided in an embodiment of this application.
[0031] Figure 3 The diagram shows a structural block diagram of an unattended abnormal behavior detection system in an industrial setting, as provided in an embodiment of this application. Detailed Implementation
[0032] To better explain and facilitate understanding of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0033] Existing methods still have the following problems: due to the complexity of training large models and the large number of parameters, their computational costs are high, requiring corresponding hardware support.
[0034] To address the aforementioned issues, this application provides a method for detecting unattended abnormal behavior in industrial scenarios. The method involves acquiring an image to be identified, preprocessing the image to obtain a preprocessed image, slicing the preprocessed image to aid inference, obtaining image feature vectors, inputting these feature vectors into a pre-trained YOLO model for target recognition to determine the location of the target bounding box, cropping the target bounding box image from the image to be identified based on the target bounding box location, and inputting the target bounding box image into a pre-trained SAM model for segmentation to obtain segmented images. The image is segmented and compared with reference images in a semantic database to obtain a similarity score. Based on the similarity score, it is determined whether there is abnormal behavior in the industrial scene where the image to be identified is located. By preprocessing the image to be identified, it can be converted into structured data suitable for input to a large model. This solves the problem that unstructured data in industrial scenes is difficult to directly apply to traditional large models. Furthermore, by combining the SAM large model and the YOLO model, high-precision segmentation, recognition, and annotation of the target can be achieved, thereby improving the efficiency of image detection in industrial scenes.
[0035] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present invention can be understood more clearly and thoroughly, and that the scope of the present invention can be fully conveyed to those skilled in the art.
[0036] First, this application can be implemented based on the following two core mechanisms: First, addressing the problem of unstructured data in industrial scenarios, a set of efficient image preprocessing techniques is proposed, tailored to the characteristics of industrial scenarios, to transform raw images into structured data suitable for large-scale model input. Second, addressing the difficulty in detecting abnormal behavior in industrial scenarios, images are segmented by combining the YOLO model and the SAM image segmentation model, and then matched with an existing semantic database to determine whether anomalies (such as...) occur. Figure 1 As shown, and Figure 1 The image in the image is an example.
[0037] And, please see Figure 2 , Figure 2 The flowchart illustrates a method for detecting abnormal behavior in an unattended industrial setting, as provided in an embodiment of this application. Figure 2 As shown, this abnormal behavior detection method can be executed by an unattended abnormal behavior detection device in an industrial setting, and the specific device can be configured according to actual needs; this application embodiment is not limited thereto. For example, the abnormal behavior detection device can be a computer or a server, etc. Specifically, the abnormal behavior detection method includes:
[0038] Step S210: Obtain the image to be identified. The image to be identified is a surveillance image from an industrial setting.
[0039] It should be understood that the image to be identified may also be called the original image, etc., and the embodiments of this application are not limited thereto.
[0040] It should also be understood that the specific image to be identified and the specific industrial scene can be set according to actual needs, and the embodiments of this application are not limited thereto.
[0041] For example, in an industrial setting where the scene is an industrial assembly line, the image to be identified is an image related to the industrial assembly line.
[0042] Step S220: Preprocess the image to be recognized to obtain a preprocessed image.
[0043] It should be understood that the specific process for preprocessing the image to be recognized can be set according to actual needs, and the embodiments of this application are not limited thereto.
[0044] Optionally, the image to be recognized is optimized based on a preset image processing method to obtain an optimized image; the target in the optimized image is subjected to pose recognition to obtain a pose recognition result; when the pose recognition result is determined to be a normal pose state, the background in the optimized image is modeled to obtain a background model, and the background model is used to perform difference calculation on the optimized image to obtain a preprocessed image; when the pose recognition result is determined to be an abnormal pose state, the detection ends.
[0045] For example, a preset image processing method can be used to optimize the image to be recognized, eliminating the interference of environmental factors such as lighting and smoke on image analysis. Furthermore, human pose estimation methods can be used to capture the human pose features of the target in the optimized image, obtaining human features under different poses and actions. Additionally, it is determined whether the human pose recognition result is an abnormal pose state. If the human pose recognition result is determined to be an abnormal pose state (e.g., the employee's pose is abnormal during a conflict), the detection ends; if the human pose recognition result is determined to be a normal pose state, the background sequence (the background of the image) is modeled to generate a background model, and the background model is used to perform differential calculations on the optimized image to achieve background subtraction, thereby obtaining the preprocessed image (i.e., it is a foreground image feature that has been uniformly modeled).
[0046] It should also be noted that after preprocessing the image to be recognized, the enhanced semantics (e.g., worker, etc.) can be moved from the edge of the image to the center.
[0047] It should also be understood that the specific method of the preset image processing can be set according to actual needs, and the embodiments of this application are not limited thereto.
[0048] Optionally, preprocessing image processing methods may include background noise removal, contrast enhancement, and illumination correction.
[0049] Step S230: Slice the preprocessed image to assist in reasoning in order to obtain the image feature vector.
[0050] It should be understood that the specific process of slicing the preprocessed image to assist in reasoning can be set according to actual needs, and the embodiments of this application are not limited thereto.
[0051] Optionally, the preprocessed image is divided into blocks to obtain multiple image blocks. While keeping the aspect ratio of the image blocks fixed, the size of each image block is adjusted to scale it proportionally to the size of the image to be recognized. Target detection is performed on each image block to obtain prediction results of the target at multiple different locations. Non-Maximum Suppression (NMS) is used to remove prediction results at overlapping locations in the prediction bounding box, retaining only the most probable prediction result at the same location to ensure that each object is recognized only once.
[0052] Step S240: Input the image feature vector into the pre-trained YOLO model for target recognition to obtain the position of the target bounding box.
[0053] It should be understood that the specific model structure of the YOLO model can be set according to actual needs, and the embodiments of this application are not limited thereto.
[0054] Optionally, image feature vectors can be input into the YOLO model, allowing the image to pass through a series of convolutional and pooling layers to gradually extract image features. These features represent different texture, shape, and structural information within the image. Furthermore, the YOLO model can use a Path Aggregation Network (PANet) to fuse feature maps of different scales, thereby capturing information about targets of different sizes. The fused feature maps are then used to predict bounding boxes of different sizes. Each prediction layer of the YOLO model outputs a set of bounding box locations representing selected targets (e.g., workers), class confidence, and class probabilities representing the category of the selected target (e.g., human or animal).
[0055] It should be noted that since YOLO only recognizes images based on the trained model, the model parameters are not changed due to the context of the input image during the actual detection process. Therefore, the position of the predicted box is based on the current input image, thus ensuring the accuracy of the recognition position.
[0056] Furthermore, within the same prediction layer, bounding boxes are filtered to select those with the highest confidence scores, thereby reducing overlapping detection results and ultimately obtaining the location of the target bounding box. The target bounding box is obtained by filtering the bounding boxes output by the YOLO model.
[0057] Step S250: Based on the position of the target bounding box, the target bounding box image is cropped from the image to be identified, and the target bounding box image is input into the pre-trained SAM model for segmentation processing to obtain the segmented image.
[0058] It should be understood that the specific model structure of the SAM model can be set according to actual needs, and the embodiments of this application are not limited thereto.
[0059] Optionally, based on the location of the target bounding box, an image corresponding to the region selected by the target bounding box can be cropped from the image to be recognized, and the image corresponding to the target bounding box can be input into SAM for segmentation. SAM is a cue-based segmentation model. The cue encoder includes two sets of cues: Sparse (points, boxes, and text) and Dense (masks). Points and boxes are represented by positional encoding, which is combined with the learned embeddings for each cue type. Cues such as masks use convolutional embeddings and are combined with image embedding elements. The mask decoder effectively maps the image embeddings, cue embeddings, and output tokens to masks, and its implementation is derived from modifications to the Transformer decoder. The modified decoder updates all embeddings using cue self-attention and cross-attention in both directions. Subsequently, the image embeddings are upsampled, and a Multi-layer Perceptron (MLP) is used to map the output to a dynamic linear classifier to compute the mask probability for each image location.
[0060] Step S260: Compare the similarity between the segmented image and the reference image in the semantic library to obtain a similarity score, and determine whether there is abnormal behavior in the industrial scene where the image to be identified is located based on the similarity score.
[0061] It should be understood that the specific calculation process for similarity scores can be set according to actual needs, and the embodiments of this application are not limited thereto.
[0062] Optionally, when the similarity score is the peak signal-to-noise ratio (PSNR), for each segmented image, the PSNR function can be used to compare its similarity with images in the semantic database under normal conditions:
[0063]
[0064]
[0065] Here, PSNR is the similarity score. The unit of PSNR can be dB, and a higher value indicates less distortion; n is the number of bits per pixel. For example, n is typically 8, meaning 256 gray levels per pixel; MSE is the mean square error between the current segmented image X and the reference image Y in the semantic library; H is the image height; and W is the image width.
[0066] Furthermore, it can be determined whether the similarity score is greater than or equal to a preset score. If the similarity score is greater than or equal to the preset score, it is determined that there is abnormal behavior in the industrial scene where the image to be identified is located (e.g., whether workers are dressed as required or wearing safety helmets, etc.); if the similarity score is less than the preset score, it is determined that there is no abnormal behavior in the industrial scene where the image to be identified is located.
[0067] Therefore, by using the above technical solutions, the embodiments of this application apply the large model to image recognition work in real industrial scenarios, which can achieve accurate target recognition in industrial images, lay the foundation for subsequent downstream tasks such as anomaly detection, and significantly improve the efficiency of image detection in industrial scenarios.
[0068] Furthermore, the embodiments of this application, through industrial image preprocessing technology and efficient image recognition technology based on large models, can perform fine-grained and high-precision detection of targets in industrial scene images, and can determine whether anomalies have occurred in the scene.
[0069] It should be understood that the above-described method for detecting abnormal behavior in industrial scenarios is merely exemplary, and those skilled in the art can make various modifications based on the above method. The modified or altered content is also within the scope of protection of this application.
[0070] Please see Figure 3 , Figure 3 This diagram illustrates a structural block diagram of an unattended abnormal behavior detection system 300 for industrial scenarios, provided in an embodiment of this application. It should be understood that this abnormal behavior detection device 300 corresponds to the method embodiment described above and is capable of executing the various steps involved in the method embodiment. The specific functions of the abnormal behavior detection device 300 can be found in the description above; detailed descriptions are omitted here to avoid repetition. The abnormal behavior detection system 300 includes at least one software function module that can be stored in memory or embedded in the operating system (OS) of the abnormal behavior detection system 300 in the form of software or firmware. Specifically, the abnormal behavior detection system 300 includes:
[0071] The acquisition module 310 is used to acquire the image to be identified; wherein, the image to be identified is a monitoring image in an industrial scene;
[0072] The preprocessing module 320 is used to preprocess the image to be recognized to obtain a preprocessed image;
[0073] The slice-assisted reasoning module 330 is used to perform slice-assisted reasoning on the preprocessed image to obtain the image feature vector;
[0074] The input module 340 is used to input the image feature vector into the pre-trained YOLO model for target recognition in order to obtain the position of the target bounding box;
[0075] The cropping and segmentation module 350 is used to crop the target bounding box image from the image to be recognized based on the position of the target bounding box, and input the target bounding box image into the pre-trained SAM model for segmentation processing to obtain the segmented image;
[0076] The comparison and judgment module 360 is used to compare the similarity of the segmented image with the reference image in the semantic library to obtain a similarity score, and to determine whether there is abnormal behavior in the industrial scene where the image to be identified is located based on the similarity score.
[0077] Since the apparatus described in the above embodiments of the present invention is an apparatus used to implement the methods of the above embodiments of the present invention, those skilled in the art can understand the specific structure and variations of the apparatus based on the methods described in the above embodiments of the present invention, and therefore will not be described again here. All apparatuses used in the methods of the above embodiments of the present invention fall within the scope of protection of the present invention.
[0078] This application also provides a storage medium storing a computer program, which is executed by a processor to perform the method described in the method embodiment.
[0079] This application also provides a computer program product that, when run on a computer, causes the computer to perform the method described in the method embodiment.
[0080] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0081] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions.
[0082] It should be noted that any reference numerals placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In claims that enumerate several means, several of these means may be embodied by the same hardware. The use of the terms first, second, third, etc., is merely for convenience of expression and does not indicate any order. These terms can be understood as part of the component names.
[0083] Furthermore, it should be noted that in the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0084] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the claims should be interpreted to include both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0085] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, then this invention should also include these modifications and variations.
Claims
1. A method and system for detecting abnormal behavior in unattended industrial settings, characterized in that, include: Acquire the image to be identified; wherein the image to be identified is a monitoring image in the industrial scene; The image to be identified is preprocessed to obtain a preprocessed image; The preprocessed image is sliced for inference to obtain the image feature vector; The image feature vector is input into a pre-trained YOLO model for target recognition to obtain the location of the target bounding box; Based on the position of the target bounding box, the target bounding box image is cropped from the image to be identified, and the target bounding box image is input into a pre-trained SAM model for segmentation processing to obtain the segmented image; The segmented image is compared with the reference image in the semantic library to obtain a similarity score, and the similarity score is used to determine whether there is abnormal behavior in the industrial scene where the image to be identified is located. The preprocessing of the image to be identified includes: The image to be identified is optimized based on a preset image processing method to obtain an optimized image; The target in the optimized image is subjected to pose recognition to obtain the pose recognition result; When the pose recognition result is determined to be a normal pose state, the background in the optimized image is modeled to obtain a background model; The optimized image is obtained by performing difference calculations using the background model.
2. The abnormal behavior detection method according to claim 1, characterized in that, The abnormal behavior detection method includes: If the posture recognition result is determined to be an abnormal posture state, the detection ends.
3. The abnormal behavior detection method according to claim 1, characterized in that, The step of slicing the preprocessed image to assist in reasoning includes: The preprocessed image is divided into blocks to obtain multiple image blocks; With a fixed aspect ratio, the size of each of the plurality of image blocks is adjusted so that it is scaled proportionally to the size of the image to be identified; Target detection is performed on each image block to obtain prediction results of the target at multiple different locations. The prediction results at overlapping locations are filtered using the Non-Maximum Suppression (NMS) algorithm, and only the prediction result with the highest probability is retained at the same location.
4. The abnormal behavior detection method according to claim 1, characterized in that, The similarity score is calculated using the following formula: ; ; Wherein, PSNR is the similarity score; n is the number of bits per pixel; MSE is the mean square error between the currently segmented image X and the reference image Y in the semantic library; H is the image height; and W is the image width.
5. The abnormal behavior detection method according to claim 4, characterized in that, The step of determining whether there is abnormal behavior in the industrial scene where the image to be identified is located based on the similarity score includes: Determine whether the similarity score is greater than or equal to a preset score; If the similarity score is greater than or equal to the preset score, it is determined that there is abnormal behavior in the industrial scene where the image to be identified is located.
6. The abnormal behavior detection method according to claim 5, characterized in that, The step of determining whether there is abnormal behavior in the industrial scene where the image to be identified is located based on the similarity score further includes: If the similarity score is less than the preset score, it is determined that there is no abnormal behavior in the industrial scene where the image to be identified is located.
7. A method and system for detecting abnormal behavior in unattended industrial settings, characterized in that, include: An acquisition module is used to acquire an image to be identified; wherein the image to be identified is a monitoring image in the industrial scene; A preprocessing module is used to preprocess the image to be identified to obtain a preprocessed image; The slice-assisted reasoning module is used to perform slice-assisted reasoning on the preprocessed image to obtain the image feature vector; The input module is used to input the image feature vector into a pre-trained YOLO model for target recognition in order to obtain the position of the target bounding box; The cropping and segmentation module is used to crop the target bounding box image from the image to be identified based on the position of the target bounding box, and input the target bounding box image into a pre-trained SAM model for segmentation processing to obtain the segmented image; The comparison and judgment module is used to compare the similarity of the segmented image with the reference image in the semantic library to obtain a similarity score, and to determine whether there is abnormal behavior in the industrial scene where the image to be identified is located based on the similarity score. The preprocessing module is specifically used for: optimizing the image to be recognized based on a preset image processing method to obtain an optimized image; performing pose recognition on the target in the optimized image to obtain a pose recognition result; when the pose recognition result is determined to be a normal pose state, modeling the background in the optimized image to obtain a background model; and using the background model to perform difference calculation on the optimized image to obtain the preprocessed image.
8. A storage medium, characterized in that, The storage medium stores a computer program, which is executed by a processor to perform the abnormal behavior detection method in an industrial scenario as described in any one of claims 1-6.
9. An electronic device, characterized in that, The electronic device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the abnormal behavior detection method in an industrial scenario as described in any one of claims 1-6 is executed.
Citation Information
Patent Citations
Construction site worker mobile phone use detection method based on YOLOv5 and Pose-estimation
CN112580778A
Defect detection method, electronic equipment and computer readable storage medium
CN114897806A