Cigarette skew posture detection method and device
By obtaining and pretreating the skewed picture set of the cigarette bunker conveying channels, using the DETR target detection model for training, directly predicting the key points or center points of the cigarette bunker, solving the cumbersome and inaccurate detection caused by predefined anchor points in the prior art, and achieving more efficient and accurate cigarette bunker posture detection.
Patent Information
- Application Number
- CN202510576109.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-08-15
AI Technical Summary
The existing smoke stick attitude detection methods rely on predefined anchor points, resulting in cumbersome detection processes and inaccurate results.
By obtaining the skewed picture set in the cigarette bunker conveying channel, marking and enhancing pretreatment, the DETR target detection model is used for training, and the key points or center points of the cigarette bunker are directly predicted for detection.
Reduces the complexity of anchor point setting and parameter adjustment, and improves detection accuracy and efficiency.
Smart Images

Figure CN120495221A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cigarette posture detection, and in particular to a method and device for detecting the tilted posture of a cigarette. Background Art
[0002] During the cigarette conveying process, due to the mismatch between the cigarette detection machine and the conveyor belt, the arrangement direction of some cigarettes introduced into the conveyor belt does not conform to the arrangement direction required by the packaging machine for packaging cigarettes. This not only affects the subsequent packaging process of the packaging machine, but also damages cigarettes with different arrangement directions, resulting in waste of cigarette raw materials.
[0003] Existing methods for detecting skewed cigarette posture generally rely on predefined anchor points used on the monitoring background. However, predefined anchor points have the following defects: not only do they need to be set in advance, but they also need to be extracted and adjusted, which makes the detection process too cumbersome. Moreover, when the anchor point setting and parameter adjustment are inaccurate, the detection results are also inaccurate.
[0004] Therefore, it is necessary to design a method that can detect the arrangement direction of cigarettes on the conveyor belt between the packaging machine and the cigarette making machine, so as to solve the problem that the existing predefined anchor point detection process is too cumbersome, and when the anchor point setting and parameter adjustment are inaccurate, the detection results are also inaccurate. Summary of the Invention
[0005] The purpose of the present invention is to propose a method and device for detecting the tilted posture of a cigarette to solve the problem that the existing pre-defined anchor point detection process is too cumbersome and the detection results are inaccurate when the anchor point setting and parameter adjustment are inaccurate.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present application proposes a method for detecting a skewed cigarette posture, comprising the following steps:
[0008] Obtaining a set of images of skewed cigarette arrangement in a cigarette conveying channel, and marking the skewed cigarettes in each image in the set of images of skewed cigarette arrangement to obtain a marked set of images of skewed cigarette arrangement;
[0009] Performing enhancement preprocessing on the annotated image set of skewed cigarette arrangements to obtain an enhanced preprocessed image set of skewed cigarette arrangements;
[0010] Inputting the enhanced pre-processed image set of skewed cigarette arrangement into the constructed skewed cigarette arrangement posture detection model for training, thereby obtaining a trained skewed cigarette arrangement posture detection model;
[0011] A set of cigarette arrangement pictures in the cigarette conveying channel is collected in real time, preprocessed, and input into the trained cigarette arrangement skew posture detection model to detect pictures with skewed cigarette arrangements in the cigarette arrangement picture set.
[0012] Preferably, the method of obtaining a set of images of skewed cigarette arrangement in a cigarette conveying channel, and marking the skewed cigarettes in each image in the set of images of skewed cigarette arrangement to obtain the marked set of images of skewed cigarette arrangement comprises the following steps:
[0013] Collect multiple pictures of cigarettes previously arranged in a skewed posture in a cigarette conveying channel from the monitoring background to construct a picture set of skewed cigarette arrangements;
[0014] Find the crooked cigarettes in each picture in the picture set of crooked cigarette arrangements, and annotate the crooked cigarettes in each picture with a wireframe to construct a labeled picture set of crooked cigarette arrangements.
[0015] Preferably, the skewed cigarettes in each picture in the skewed cigarette arrangement picture set are found, and the skewed cigarettes in each picture are annotated with a wireframe to construct a labeled skewed cigarette arrangement picture set, as follows:
[0016] Send each picture in the collection of pictures showing skewed cigarette arrangements to a computer, open each picture in turn using the image viewing software on the computer, and find the skewed cigarette in each opened picture;
[0017] Use the brush in the image viewing software to mark the crooked cigarettes in each picture with wireframes in turn, and collect each marked picture to construct a set of marked pictures of crooked cigarette arrangements.
[0018] Preferably, the method of performing enhancement preprocessing on the annotated image set of skewed cigarette arrangement to obtain the enhanced preprocessed image set of skewed cigarette arrangement comprises the following steps:
[0019] Performing noise reduction processing on each image in the annotated image set of skewed cigarette arrangements to obtain a noise-reduced image set of skewed cigarette arrangements;
[0020] Each image in the image set of skewed cigarette arrangement after preliminary noise reduction is cropped to the same size to obtain a set of skewed cigarette arrangement images processed to the same size;
[0021] Each image in the image set of skewed cigarette arrangement processed at the same size is subjected to any one of random horizontal flipping or scaling enhancement preprocessing to obtain the enhanced preprocessed image set of skewed cigarette arrangement.
[0022] Preferably, the method of inputting the enhanced pre-processed cigarette arrangement skew image set into the constructed cigarette arrangement skew posture detection model for training to obtain a trained cigarette arrangement skew posture detection model comprises the following steps:
[0023] Based on the DETR object detection model, a cigarette tilt posture detection model is constructed; the DETR object detection model is an end-to-end object detection model based on Transformer;
[0024] The enhanced pre-processed image set of skewed cigarette arrangements is input into the constructed cigarette skew posture detection model for training to obtain a trained cigarette skew posture detection model.
[0025] Preferably, the DETR target detection model includes:
[0026] transformer encoder, which is used to extract feature information from the image; and
[0027] Transformer decoder, Transformer decoder is used to combine the feature information extracted by the encoder with the prior information in the target set, and finally generate information such as the category, location and quantity of the target.
[0028] Preferably, the real-time collection of a set of pictures of cigarette arrangement in a cigarette conveying channel, preprocessing of the set of pictures of cigarette arrangement in the cigarette conveying channel, inputting the preprocessed set of pictures of cigarette arrangement into a trained model for detecting skewed postures of cigarette arrangement, and detecting pictures of skewed cigarette arrangement in the set of pictures of cigarette arrangement, comprises the following steps:
[0029] Collect multiple pictures of the arrangement of cigarettes in the cigarette conveyor channel in real time from the monitoring background to build a picture set of the arrangement of cigarettes;
[0030] Performing noise reduction preprocessing on each image in the image set of cigarette arrangement postures to obtain a noise-reduced image set of cigarette arrangement postures;
[0031] Performing random horizontal flipping or scaling on each image in the image set of cigarette arrangement postures after noise reduction to obtain a preprocessed cigarette arrangement image set;
[0032] The preprocessed cigarette arrangement image set is input into the trained cigarette arrangement skew posture detection model to detect the images of skewed cigarettes in the cigarette arrangement image set.
[0033] In a second aspect, the present application provides a device for detecting a skewed cigarette posture, comprising:
[0034] An image collection module is used to obtain a set of images of skewed cigarette arrangement in the cigarette conveying channel, and to mark the skewed cigarettes in each image in the set of images to obtain a marked set of images of skewed cigarette arrangement;
[0035] The image enhancement processing module is connected to the image acquisition module and is used to perform enhancement preprocessing on the annotated image set of skewed cigarette arrangements to obtain an enhanced preprocessed image set of skewed cigarette arrangements;
[0036] The cigarette posture detection training module is connected to the image enhancement processing module. The cigarette posture detection training module is used to input the enhanced pre-processed cigarette arrangement skew image set into the constructed cigarette arrangement skew posture detection model for training, thereby obtaining a trained cigarette arrangement skew posture detection model.
[0037] The real-time picture acquisition, detection and processing module is connected to the posture detection training module. The real-time picture acquisition, detection and processing module is used to acquire a set of cigarette arrangement pictures in the cigarette conveying channel in real time, pre-process the set of cigarette arrangement pictures in the cigarette conveying channel, and input the pre-processed set of cigarette arrangement pictures into the trained cigarette arrangement skew posture detection model to detect pictures of skewed cigarette arrangements in the cigarette arrangement picture set.
[0038] Compared with the prior art, the present invention has at least one of the following beneficial effects:
[0039] The present invention first obtains a set of pictures of skewed arrangement of cigarettes in a cigarette conveying channel, and marks the cigarettes with skewed postures in each picture in the set of pictures of skewed arrangement of cigarettes to obtain a marked set of pictures of skewed arrangement of cigarettes, then performs enhancement preprocessing on the marked set of pictures of skewed arrangement of cigarettes to obtain a set of enhanced preprocessed pictures of skewed arrangement of cigarettes, and then inputs the enhanced preprocessed set of pictures of skewed arrangement of cigarettes into a constructed model for training to obtain a trained model for detection of skewed arrangement of cigarettes, and finally collects the set of pictures of cigarette arrangement in the cigarette conveying channel in real time to detect the skewed posture of cigarettes in the cigarette conveying channel. The image set is preprocessed, and the preprocessed cigarette arrangement image set is input into the trained cigarette arrangement skew posture detection model to detect the images of skewed cigarettes in the cigarette arrangement image set. The cigarette arrangement skew posture detection model does not rely on the predefined anchor points in the traditional detection method to detect the cigarette arrangement posture, but instead performs target detection by directly predicting the key points or center points of the target (such as the center and size of the target), reducing the complexity of anchor point setting, matching and parameter adjustment, so as to solve the problem that the existing predefined anchor point detection process is too cumbersome, and when the anchor point setting and parameter adjustment are inaccurate, the detection results are also inaccurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 Schematic diagram of the flow of the method for detecting the tilted posture of a cigarette in the present invention.
[0041] Figure 2 This is a schematic diagram of the structural connection of the cigarette tilt posture detection device in the present invention.
[0042] Figure 3 This is a schematic diagram of using the brush in the image viewing software in the present invention to mark the crooked cigarettes in each picture with wireframes in turn. DETAILED DESCRIPTION
[0043] like Figure 1-3 In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0044] Example 1
[0045] Existing methods for detecting skewed cigarette posture generally rely on predefined anchor points used on the monitoring background. However, predefined anchor points have the following defects: not only do they need to be set in advance, but they also need to be extracted and adjusted, which makes the detection process too cumbersome. Moreover, when the anchor point setting and parameter adjustment are inaccurate, the detection results are also inaccurate.
[0046] Therefore, the present application proposes a method and device for detecting the tilted posture of a cigarette to solve the problem that the existing predefined anchor point detection process is too cumbersome, and when the anchor point setting and parameter adjustment are inaccurate, the detection results are also inaccurate.
[0047] For details, please see Figure 1 , Figure 1 A flowchart of a method for detecting a skewed cigarette posture is provided for embodiment 1 of the present invention. The method can be executed by a device for detecting a skewed cigarette posture. The device can be implemented in the form of hardware and / or software. The device can be configured in a computing device that can execute a method for detecting the arrangement posture of cigarettes.
[0048] like Figure 1 As shown, a method for detecting a skewed cigarette posture includes the following steps:
[0049] S110: Obtain a set of images of skewed cigarette arrangement in a cigarette conveying channel, and annotate the skewed cigarettes in each image in the set of images to obtain an annotated set of images of skewed cigarette arrangement, as follows:
[0050] (1) Collect multiple images of cigarettes in a cigarette conveyor channel with skewed postures from the monitoring background to construct an image set of skewed cigarette arrangements;
[0051] (2) Send each picture in the collection of pictures of skewed cigarette arrangements to a computer, use the computer's image viewing software to open each picture in turn, and find the skewed cigarette in each opened picture;
[0052] (3) Use the brush in the image viewing software to mark the crooked cigarettes in each picture with wireframes (e.g. Figure 3 As shown in the figure), each labeled picture will be collected to construct a labeled picture set of skewed cigarette arrangements.
[0053] In this embodiment, a set of pictures of skewed cigarette arrangements in a cigarette conveying channel is first obtained, and then the cigarettes with skewed postures in each picture in the set of pictures of skewed cigarette arrangements are labeled to obtain a labeled set of pictures of skewed cigarette arrangements. This can provide data support for the subsequent training of a model for detecting skewed cigarette arrangements.
[0054] S120: Perform enhancement preprocessing on the annotated image set of skewed cigarette arrangements to obtain an enhanced preprocessed image set of skewed cigarette arrangements, as follows:
[0055] (1) performing noise reduction processing on each image in the annotated image set of skewed cigarette arrangement to obtain a noise-reduced image set of skewed cigarette arrangement;
[0056] (2) cropping each image in the image set of skewed cigarette arrangement after preliminary noise reduction processing to the same size, thereby obtaining a set of skewed cigarette arrangement images processed to the same size;
[0057] (3) Each image in the image set of skewed cigarette arrangement processed with the same size is subjected to any one of the enhancement preprocessing steps of random horizontal flipping or scaling to obtain the enhanced preprocessed image set of skewed cigarette arrangement.
[0058] In this embodiment, the annotated image set of skewed cigarette arrangements is enhanced and preprocessed to obtain an enhanced preprocessed image set of skewed cigarette arrangements, thereby further increasing the diversity of the image data and providing more extensive data support for subsequent training of a skewed cigarette arrangement posture detection model.
[0059] S130: Input the enhanced pre-processed image set of skewed cigarettes into the constructed skewed cigarette posture detection model for training, to obtain a trained skewed cigarette posture detection model, specifically as follows:
[0060] (1) Based on the DETR object detection model, a cigarette tilt posture detection model is constructed; the DETR object detection model is an end-to-end object detection model based on Transformer;
[0061] Among them, the DETR target detection model includes a transformer encoder and a transformer decoder; the transformer encoder is used to extract feature information from the image; the transformer decoder is used to combine the feature information extracted by the encoder with the prior information in the target set, and finally generate information such as the category, location and quantity of the target.
[0062] It should be noted that the DETR model does not rely on predefined anchor points in traditional detection methods. Instead, it performs target detection by directly predicting the key points or center points of the target (such as the center and size of the target), which not only reduces the complexity of anchor point setting, matching and parameter adjustment.
[0063] (2) The enhanced pre-processed image set of skewed cigarettes is input into the constructed cigarette skew posture detection model for training to obtain a trained cigarette skew posture detection model.
[0064] In this embodiment, the enhanced pre-processed cigarette arrangement skewed posture image set is input into the constructed cigarette arrangement skewed posture detection model for training to obtain a trained cigarette arrangement skewed posture detection model, which can prepare for the subsequent input of real-time collected cigarette arrangement images into the trained cigarette arrangement skewed posture detection model.
[0065] S140: Collect a set of images of cigarette arrangement in the cigarette conveying channel in real time, pre-process the set of images of cigarette arrangement in the cigarette conveying channel, input the pre-processed set of images of cigarette arrangement into the trained model for detecting skewed cigarette arrangement, and detect images of skewed cigarette arrangement in the set of images of cigarette arrangement, as follows:
[0066] (1) Collect multiple pictures of the arrangement of cigarettes in the cigarette conveyor channel in real time from the monitoring background to construct a picture set of the arrangement of cigarettes;
[0067] (2) performing noise reduction preprocessing on each image in the image set of cigarette arrangement postures to obtain a noise reduction processed image set of cigarette arrangement postures;
[0068] (3) performing random horizontal flipping or scaling on each image in the image set of cigarette arrangement postures after noise reduction to obtain a preprocessed cigarette arrangement image set;
[0069] (4) The preprocessed cigarette arrangement image set is input into the trained cigarette arrangement skew posture detection model to detect the images of skewed cigarettes in the cigarette arrangement image set.
[0070] In this embodiment, a set of pictures of cigarette arrangement in the cigarette conveying channel is collected in real time, and the set of pictures of cigarette arrangement in the cigarette conveying channel is preprocessed. The preprocessed set of pictures of cigarette arrangement is input into the trained model for detecting the skewed posture of cigarette arrangement to detect pictures of skewed cigarette arrangement in the set of pictures.
[0071] The technical solution of the embodiment of the present invention is to first obtain a set of pictures of skewed arrangement of cigarettes in a cigarette conveying channel, and mark the cigarettes with skewed postures in each picture in the set of pictures of skewed arrangement of cigarettes to obtain a marked set of pictures of skewed arrangement of cigarettes, and then perform enhanced preprocessing on the marked set of pictures of skewed arrangement of cigarettes to obtain a set of enhanced preprocessed pictures of skewed arrangement of cigarettes, and then input the enhanced preprocessed set of pictures of skewed arrangement of cigarettes into a constructed detection model for skewed arrangement of cigarettes for training to obtain a trained detection model for skewed arrangement of cigarettes, and finally collect the set of pictures of cigarette arrangement in the cigarette conveying channel in real time to detect the skewed posture of cigarettes in the cigarette conveying channel. The cigarette arrangement picture set is preprocessed, and the preprocessed cigarette arrangement picture set is input into the trained cigarette arrangement skew posture detection model to detect pictures of skewed cigarettes in the cigarette arrangement picture set. The cigarette arrangement skew posture detection model does not rely on the predefined anchor points in the traditional detection method to detect the cigarette arrangement posture, but instead performs target detection by directly predicting the key points or center points of the target (such as the center and size of the target), reducing the complexity of anchor point setting, matching and parameter adjustment, so as to solve the problem that the existing predefined anchor point detection process is too cumbersome, and when the anchor point setting and parameter adjustment are inaccurate, the detection results are also inaccurate.
[0072] Example 2
[0073] Figure 2 This is a schematic diagram of the structure of a device for detecting a skewed cigarette posture provided by the second embodiment of the present invention. Figure 2 As shown, a device for detecting the tilted posture of a cigarette includes: an image acquisition module, an image enhancement processing module, a posture detection training module and a real-time image acquisition, detection and processing module.
[0074] The image acquisition module is used to obtain a set of images of skewed cigarette arrangement in the cigarette conveying channel, and mark the skewed cigarettes in each image in the set of images to obtain a marked set of images of skewed cigarette arrangement;
[0075] The image enhancement processing module is connected to the image acquisition module and is used to perform enhancement preprocessing on the annotated image set of skewed cigarette arrangements to obtain an enhanced preprocessed image set of skewed cigarette arrangements;
[0076] The cigarette posture detection training module is connected to the image enhancement processing module. The cigarette posture detection training module is used to input the enhanced pre-processed cigarette arrangement skew image set into the constructed cigarette arrangement skew posture detection model for training, thereby obtaining a trained cigarette arrangement skew posture detection model.
[0077] The real-time picture acquisition, detection and processing module is connected to the posture detection training module. The real-time picture acquisition, detection and processing module is used to acquire a set of cigarette arrangement pictures in the cigarette conveying channel in real time, pre-process the set of cigarette arrangement pictures in the cigarette conveying channel, and input the pre-processed set of cigarette arrangement pictures into the trained cigarette arrangement skew posture detection model to detect pictures of skewed cigarette arrangements in the cigarette arrangement picture set.
[0078] The technical solution of the embodiment of the present invention is to first obtain a set of pictures of skewed arrangement of cigarettes in a cigarette conveying channel, and mark the cigarettes with skewed postures in each picture in the set of pictures of skewed arrangement of cigarettes to obtain a marked set of pictures of skewed arrangement of cigarettes, and then perform enhanced preprocessing on the marked set of pictures of skewed arrangement of cigarettes to obtain a set of enhanced preprocessed pictures of skewed arrangement of cigarettes, and then input the enhanced preprocessed set of pictures of skewed arrangement of cigarettes into a constructed detection model for skewed arrangement of cigarettes for training to obtain a trained detection model for skewed arrangement of cigarettes, and finally collect the set of pictures of cigarette arrangement in the cigarette conveying channel in real time to detect the skewed posture of cigarettes in the cigarette conveying channel. The cigarette arrangement picture set is preprocessed, and the preprocessed cigarette arrangement picture set is input into the trained cigarette arrangement skew posture detection model to detect pictures of skewed cigarettes in the cigarette arrangement picture set. The cigarette arrangement skew posture detection model does not rely on the predefined anchor points in the traditional detection method to detect the cigarette arrangement posture, but instead performs target detection by directly predicting the key points or center points of the target (such as the center and size of the target), reducing the complexity of anchor point setting, matching and parameter adjustment, so as to solve the problem that the existing predefined anchor point detection process is too cumbersome, and when the anchor point setting and parameter adjustment are inaccurate, the detection results are also inaccurate.
[0079] An apparatus for detecting a skewed cigarette posture provided by an embodiment of the present invention can execute a method for detecting a skewed cigarette posture provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0080] Although the present invention has been described herein with reference to a number of illustrative embodiments thereof, it will be understood that numerous other modifications and implementations may be devised by those skilled in the art that fall within the scope and spirit of the principles disclosed herein. More specifically, within the scope of the present disclosure, the drawings, and the claims, numerous variations and modifications may be made to the components and / or layout of the subject combination arrangement. In addition to variations and modifications to the components and / or layout, other uses will also be apparent to those skilled in the art.
Claims
1. A method for detecting a skewed cigarette posture, characterized by: The following steps are involved: Obtaining a set of images of skewed cigarette arrangement in a cigarette conveying channel, and marking the skewed cigarettes in each image in the set of images of skewed cigarette arrangement to obtain a marked set of images of skewed cigarette arrangement; Performing enhancement preprocessing on the annotated image set of skewed cigarette arrangements to obtain an enhanced preprocessed image set of skewed cigarette arrangements; Inputting the enhanced pre-processed image set of skewed cigarette arrangement into the constructed skewed cigarette arrangement posture detection model for training, thereby obtaining a trained skewed cigarette arrangement posture detection model; A set of cigarette arrangement pictures in the cigarette conveying channel is collected in real time, preprocessed, and input into the trained cigarette arrangement skew posture detection model to detect pictures with skewed cigarette arrangements in the cigarette arrangement picture set.
2. The method for detecting a skewed cigarette posture according to claim 1, wherein: The method of obtaining a picture set of skewed cigarette arrangement in a cigarette conveying channel, and marking cigarettes with skewed postures in each picture in the picture set of skewed cigarette arrangement to obtain the marked picture set of skewed cigarette arrangement includes the following steps: Collect multiple pictures of cigarettes previously arranged in a skewed posture in a cigarette conveying channel from the monitoring background to construct a picture set of skewed cigarette arrangements; Find the crooked cigarettes in each picture in the picture set of crooked cigarette arrangements, and annotate the crooked cigarettes in each picture with a wireframe to construct a labeled picture set of crooked cigarette arrangements.
3. The method for detecting a skewed cigarette posture according to claim 2, wherein: The method of finding the skewed cigarettes in each picture in the skewed cigarette arrangement picture set is as follows: marking the skewed cigarettes in each picture with a wireframe to construct a marked skewed cigarette arrangement picture set. Send each picture in the collection of pictures showing skewed cigarette arrangements to a computer, open each picture in turn using the image viewing software on the computer, and find the skewed cigarette in each opened picture; Use the brush in the image viewing software to mark the crooked cigarettes in each picture with wireframes in turn, and collect each marked picture to construct a set of marked pictures of crooked cigarette arrangements.
4. The method for detecting a skewed cigarette posture according to claim 1, wherein: The enhanced preprocessing of the labeled image set of skewed cigarette arrangement to obtain the enhanced preprocessed image set of skewed cigarette arrangement comprises the following steps: Performing noise reduction processing on each image in the annotated image set of skewed cigarette arrangements to obtain a noise-reduced image set of skewed cigarette arrangements; Each image in the image set of skewed cigarette arrangement after preliminary noise reduction is cropped to the same size to obtain a set of skewed cigarette arrangement images processed to the same size; Each image in the image set of skewed cigarette arrangement processed at the same size is subjected to any one of random horizontal flipping or scaling enhancement preprocessing to obtain the enhanced preprocessed image set of skewed cigarette arrangement.
5. The method for detecting a skewed cigarette posture according to claim 1, wherein: The method of inputting the enhanced pre-processed cigarette arrangement skew image set into the constructed cigarette arrangement skew posture detection model for training to obtain a trained cigarette arrangement skew posture detection model comprises the following steps: Based on the DETR object detection model, a cigarette tilt posture detection model is constructed; the DETR object detection model is an end-to-end object detection model based on Transformer; The enhanced pre-processed image set of skewed cigarette arrangements is input into the constructed cigarette skew posture detection model for training to obtain a trained cigarette skew posture detection model.
6. The method for detecting a skewed cigarette posture according to claim 5, wherein: The DETR target detection model includes: transformer encoder, which is used to extract feature information from the image; and Transformer decoder, Transformer decoder is used to combine the feature information extracted by the encoder with the prior information in the target set, and finally generate information such as the category, location and quantity of the target.
7. The method for detecting a skewed cigarette posture according to claim 1, wherein: The method of collecting a set of pictures of cigarette arrangement in a cigarette conveying channel in real time, preprocessing the set of pictures of cigarette arrangement in the cigarette conveying channel, inputting the preprocessed set of pictures of cigarette arrangement into a trained model for detecting skewed posture of cigarette arrangement, and detecting pictures of skewed cigarette arrangement in the set of pictures of cigarette arrangement, comprises the following steps: Collect multiple pictures of the arrangement of cigarettes in the cigarette conveyor channel in real time from the monitoring background to build a picture set of the arrangement of cigarettes; Performing noise reduction preprocessing on each image in the image set of cigarette arrangement postures to obtain a noise-reduced image set of cigarette arrangement postures; Performing random horizontal flipping or scaling on each image in the image set of cigarette arrangement postures after noise reduction to obtain a preprocessed cigarette arrangement image set; The preprocessed cigarette arrangement image set is input into the trained cigarette arrangement skew posture detection model to detect the images of skewed cigarettes in the cigarette arrangement image set.
8. A device for detecting a skewed cigarette posture, characterized in that: include: An image collection module is used to obtain a set of images of skewed cigarette arrangement in the cigarette conveying channel, and to mark the skewed cigarettes in each image in the set of images to obtain a marked set of images of skewed cigarette arrangement; The image enhancement processing module is connected to the image acquisition module and is used to perform enhancement preprocessing on the annotated image set of skewed cigarette arrangements to obtain an enhanced preprocessed image set of skewed cigarette arrangements; The cigarette posture detection training module is connected to the image enhancement processing module. The cigarette posture detection training module is used to input the enhanced pre-processed cigarette arrangement skew image set into the constructed cigarette arrangement skew posture detection model for training, thereby obtaining a trained cigarette arrangement skew posture detection model. The real-time picture acquisition, detection and processing module is connected to the posture detection training module. The real-time picture acquisition, detection and processing module is used to acquire a set of cigarette arrangement pictures in the cigarette conveying channel in real time, pre-process the set of cigarette arrangement pictures in the cigarette conveying channel, and input the pre-processed set of cigarette arrangement pictures into the trained cigarette arrangement skew posture detection model to detect pictures of skewed cigarette arrangements in the cigarette arrangement picture set.