Target detection method and device and electronic equipment
Through wavelet decomposition and subsequent processing, the data to be identified are input to the object detection model, which solves the problem of the model being not robust to environmental changes and improves the recognition accuracy and robustness.
Patent Information
- Application Number
- CN202411530458.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, the object detection model is not robust enough to environmental changes, resulting in a decrease in recognition accuracy.
By performing wavelet decomposition of the image to be detected, high-frequency components and low-frequency components are obtained, and soft thresholding and low-frequency components are performed to generate data to be identified. Then, the data to be identified is input into the pre-trained object detection model for detection.
It improves the accuracy and robustness of object detection, enhances the ability to suppress noise and interference, and is suitable for complex backgrounds and a variety of application scenarios.
Smart Images

Figure CN119478358A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, for example, to a target detection method, device and electronic equipment. Background Art
[0002] During the mining and processing of ore, the ore is mainly transported from the mining point to the subsequent processing link through the belt conveyor system. However, during the transportation process, various foreign objects may appear on the belt, such as detached linings, large stones, tools, branches, etc. These foreign objects will not only damage the belt, but also may have a serious impact on the subsequent processing equipment and even cause safety accidents. Therefore, timely and accurate detection and identification of foreign objects on the belt is of great significance to ensure the safe and efficient operation of the production line.
[0003] In the related art, a method for detecting foreign matter in belt ore is proposed, comprising: obtaining a video frame in at least one ore video stream; inputting the video frame into a foreign matter detection model to obtain a detection result; the foreign matter detection model is constructed and trained based on a jump adversarial network model and a self-attention module; and when the detection result indicates the presence of foreign matter, an alarm is issued.
[0004] Although the self-attention module in the related technology helps the model capture global contextual information, the jump adversarial network model is not robust enough to changes in conditions such as lighting and occlusion, which leads to poor performance of the model in actual applications due to large environmental changes, reducing the recognition accuracy. Summary of the invention
[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0006] The embodiments of the present disclosure provide a target detection method, device, and electronic device, which are more adaptable to environmental changes and more robust, thereby having higher recognition accuracy and reliability.
[0007] In some embodiments, a target detection method is provided, including: obtaining an image to be detected; performing wavelet decomposition on the image to be detected to obtain high-frequency components and low-frequency components; performing soft threshold processing on the high-frequency components and enhancing processing on the low-frequency components to obtain data to be identified; inputting the data to be identified into a pre-trained target detection model to obtain a detection result.
[0008] Optionally, performing wavelet decomposition on the image to be detected to obtain high-frequency components and low-frequency components includes: obtaining environmental parameters of the area to be detected; determining the target decomposition layer number and target wavelet basis function according to the environmental parameters; performing wavelet decomposition on the image to be detected using the target decomposition layer number and target wavelet basis function to obtain high-frequency components and low-frequency components.
[0009] Optionally, soft threshold processing is performed on the high frequency components, including: determining a wavelet threshold; setting high frequency components whose absolute values are less than the wavelet threshold to 0; and reducing high frequency components whose absolute values are greater than or equal to the wavelet threshold according to preset rules.
[0010] Optionally, soft threshold processing is performed on the high-frequency component and enhancement processing is performed on the low-frequency component to obtain data to be identified, including: reconstructing the high-frequency component after soft threshold processing to obtain a high-frequency feature map; reconstructing the low-frequency component after enhancement processing to obtain a low-frequency feature map; reconstructing the high-frequency component after soft threshold processing and the low-frequency component after enhancement processing to obtain an image to be identified; and using the high-frequency feature map, the low-frequency feature map and the image to be identified as data to be identified.
[0011] Optionally, the pre-trained target detection model includes a feature extraction module and a target detection module, the feature extraction module includes multiple convolutional layers; the data to be identified is input into the pre-trained target detection model to obtain a detection result, including: inputting the image to be identified into multiple convolutional layers of the feature extraction module for feature extraction; fusing the high-frequency feature map and the low-frequency feature map with the feature map output by a convolutional layer in the feature extraction module respectively to obtain a first feature map output by the feature extraction module; inputting the first feature map into the target detection module to obtain a detection result.
[0012] Optionally, the pre-trained target detection model also includes a denoising autoencoder; inputting the first feature map output by the feature extraction module into the target detection module to obtain a detection result, including: inputting the image to be identified into the denoising autoencoder to obtain a second feature map; obtaining an average feature map of the first feature map and the second feature map; inputting the average feature map into the target detection module to obtain a detection result.
[0013] Optionally, the method also includes: calculating the accuracy of the detection result; when the accuracy is less than or equal to the accuracy threshold, obtaining target detection data; and retraining a pre-trained target detection model using the target detection data.
[0014] In some embodiments, a target detection device is provided, including: an acquisition module, configured to obtain an image to be detected; a decomposition module, configured to perform wavelet decomposition on the image to be detected to obtain high-frequency components and low-frequency components; a processing module, configured to perform soft threshold processing on the high-frequency components and enhancement processing on the low-frequency components to obtain data to be identified; and an identification module, configured to input the data to be identified into a pre-trained target detection model to obtain a detection result.
[0015] In some embodiments, a target detection device is provided, including a processor and a memory storing program instructions, wherein the processor is configured to execute the target detection method described in the above embodiment when running the program instructions.
[0016] In some embodiments, an electronic device is provided, comprising: a device body; and a target detection device as described in the above embodiments, installed on the device body.
[0017] The target detection method, device, and electronic device provided by the embodiments of the present disclosure can achieve the following technical effects:
[0018] The target detection method, device and electronic device provided by the embodiments of the present disclosure, through wavelet decomposition and subsequent soft threshold processing and low-frequency component enhancement, can more effectively extract and enhance the useful information in the image, and at the same time have a strong suppression ability for noise and interference in the image, and can accurately identify the target in a complex background, thereby improving the accuracy of target detection. In addition, by utilizing the multi-scale characteristics of wavelet decomposition, the method provided by the present disclosure can process images of different scales and resolutions, and is suitable for a variety of application scenarios. Compared with related technologies, it has stronger adaptability to environmental changes and better robustness, thereby having higher recognition accuracy and reliability.
[0019] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0021] Figure 1 is a schematic diagram of an electronic device provided by an embodiment of the present disclosure;
[0022] Figure 2 is a schematic diagram of a target detection method provided by an embodiment of the present disclosure;
[0023] Figure 3is a schematic diagram of another target detection method provided by an embodiment of the present disclosure;
[0024] Figure 4 is a schematic diagram of another target detection method provided by an embodiment of the present disclosure;
[0025] Figure 5 is a schematic diagram of another target detection method provided by an embodiment of the present disclosure;
[0026] Figure 6 is a schematic diagram of a target detection device provided by an embodiment of the present disclosure;
[0027] Figure 7 is a schematic diagram of another target detection device provided in an embodiment of the present disclosure.
[0028] Reference numerals:
[0029] 1. Electronic equipment; 10. Equipment body;
[0030] 60. target detection device; 610. acquisition module; 620. decomposition module; 630. processing module; 640. recognition module;
[0031] 70. Target detection device; 700. Processor; 701. Memory; 702. Communication interface; 703. Bus. DETAILED DESCRIPTION
[0032] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0033] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0034] Unless otherwise stated, the term "plurality" means two or more.
[0035] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0036] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A, B, A and B.
[0037] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0038] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other.
[0039] In some embodiments, Figure 1 As shown, an electronic device 1 is provided, comprising a device body 10 and a target detection device 60 (70). The target detection device 60 (70) is installed on the device body 10.
[0040] In this embodiment, the target detection device 60 (70) is installed in the device body 10. The installation relationship described here is not limited to being placed inside the device body 10, but also includes installation connections with other components of the electronic device 1, including but not limited to physical connection, electrical connection or signal transmission connection, etc. It can be understood by those skilled in the art that the target detection device 60 (70) can be adapted to a feasible electronic device 1, thereby realizing other feasible embodiments.
[0041] Alternatively, if Figure 7 As shown, the target detection device 70 includes a processor 700. The processor 700 can obtain an image to be detected; perform wavelet decomposition on the image to be detected to obtain high-frequency components and low-frequency components; perform soft threshold processing on the high-frequency components and enhance processing on the low-frequency components to obtain data to be identified; and input the data to be identified into a pre-trained target detection model to obtain a detection result.
[0042] Combination Figure 1 The electronic device 1 shown in the present disclosure provides a target detection method, such as Figure 2 As shown, the method includes:
[0043] S201: The processor obtains an image to be detected.
[0044] In this step, an image to be detected, i.e., an image to be detected, can be obtained by an image acquisition device, such as a camera. The image to be detected refers to an image that needs to be identified to determine whether it contains a target. The target can be a desired object and / or a heterogeneous object different from the desired object. In the process of applying the target detection method to the detection of foreign matter on belt ore, the image to be detected can be a top view of the belt in the working state, and the target can be ore and / or foreign matter different from ore.
[0045] S202: The processor performs wavelet decomposition on the image to be detected to obtain high-frequency components and low-frequency components.
[0046] In this step, the image to be detected is decomposed into components of different frequencies, including high-frequency components and low-frequency components, by wavelet decomposition. The high-frequency components contain detailed information of the image, such as edges, textures, etc. The low-frequency components reflect the overall structure and main features of the image.
[0047] S203, the processor performs soft threshold processing on the high frequency components and enhancement processing on the low frequency components to obtain data to be identified.
[0048] In this step, the high-frequency component is soft-thresholded to reduce the impact of noise on the detection results. The low-frequency component contains the main structure and brightness information in the image to be detected, and the low-frequency component is enhanced, including: improving the contrast and / or brightness and / or clarity of the low-frequency component image. By enhancing the low-frequency component, the overall contrast or clarity of the image is improved, the target features are more prominent, and the accuracy of the detection results is improved.
[0049] S204: The processor inputs the data to be identified into a pre-trained target detection model to obtain a detection result.
[0050] In this step, the target detection model outputs the detection results, including the type, location, and quantity of the target. When the identified target is ore, the detection results include ore, the location of ore, the quantity of ore, non-ore, the location of non-ore, the quantity of non-ore, and the size of non-ore. When the identified target is a foreign object other than ore, the detection results include the type of foreign object, the location of each foreign object, the quantity of each foreign object, and the size of each foreign object.
[0051] The target detection method provided by the embodiment of the present disclosure is adopted, through wavelet decomposition and subsequent soft threshold processing and low-frequency component enhancement, so that useful information in the image is more effectively extracted and enhanced, and at the same time, it has a strong suppression ability for noise and interference in the image, and can accurately identify targets in complex backgrounds, thereby improving the accuracy of target detection. In addition, by utilizing the multi-scale characteristics of wavelet decomposition, the method provided by the present disclosure can process images of different scales and resolutions, and is suitable for a variety of application scenarios. Compared with related technologies, it has stronger adaptability to environmental changes and better robustness, thereby having higher recognition accuracy and reliability.
[0052] Optionally, the detection results include ore and / or non-ore; when the detection results include non-ore, the method further includes: obtaining the position, quantity and size of the non-ore; when any one of the quantity and size of the non-ore is greater than the corresponding threshold, issuing an alarm and outputting the position of the non-ore.
[0053] In this embodiment, the position, quantity and size of non-ore can be obtained through the output of the pre-trained target detection model. By distinguishing between ore and non-ore, the state of the ore production line can be comprehensively monitored, the frequency and intensity of manual inspections can be reduced, and maintenance costs can be reduced. When any of the quantity and size of non-ore is greater than the corresponding threshold, timely abnormal alarm and position information output can help operators take quick measures to reduce production line downtime caused by the mixing of non-ore objects, thereby improving production efficiency, and helping to prevent potential safety hazards, such as equipment failure caused by the mixing of non-ore objects, thereby improving the safety of the entire production line.
[0054] Optionally, the detection results include ore and / or foreign matter; when the detection results include foreign matter, the method further includes: obtaining the type, location, quantity and size of the foreign matter; when any one of the type, quantity and size of the foreign matter meets a preset condition, an alarm is issued and the type and location of the foreign matter are output.
[0055] In this embodiment, the type, location, quantity and size of foreign matter can be obtained through the output of a pre-trained target detection model. By distinguishing between ore and foreign matter, the state of the ore production line can be comprehensively monitored, the frequency and intensity of manual inspections can be reduced, and maintenance costs can be reduced. When any of the type, quantity and size of the foreign matter meets the preset conditions (such as the type of the foreign matter is a preset type of dangerous foreign matter, and any of the number and size of the foreign matter is greater than the corresponding threshold), timely abnormal alarms and type and location information outputs help operators to take quick measures to reduce production line downtime caused by foreign matter mixing, thereby improving production efficiency, and at the same time helping to prevent potential safety hazards, such as equipment failures caused by foreign matter mixing, thereby improving the safety of the entire production line.
[0056] Optionally, the image to be detected is obtained in the following manner: controlling the image acquisition device to acquire an initial image at a preset time interval; obtaining the conveying speed of the belt; and fusing two adjacent images according to the preset time interval and the conveying speed of the belt to obtain the image to be detected.
[0057] In this embodiment, the image acquisition device (such as a camera) is controlled to acquire the initial image at a preset time interval. The preset time interval can be adjusted according to factors such as the speed of the ore conveyor belt and the density of the ore to ensure that the acquired image can capture enough information without being redundant due to being too dense. The two adjacent initial images can be fused according to the preset time interval and the conveying speed of the belt through algorithms such as image registration and interpolation to ensure that the fused image can accurately reflect the continuous state of the ore on the conveyor belt, reduce omissions or misjudgments that may be caused by single image acquisition, and further improve the accuracy of target detection. In addition, by acquiring images at preset time intervals and combining image fusion with the conveying speed, continuous real-time monitoring of the ore conveyor belt can be achieved, which enhances the real-time performance of the system. Compared with the method of continuously acquiring and processing a large number of images, the method of acquiring and fusion of images at preset time intervals can significantly reduce the number of image processing and the amount of program calculation.
[0058] Combination Figure 3 As shown, the embodiment of the present disclosure provides another target detection method, including:
[0059] S301: The processor obtains an image to be detected.
[0060] S302: The processor obtains environmental parameters of the area to be detected.
[0061] In this step, environmental parameters include but are not limited to light intensity, noise level, type of ore, etc.
[0062] According to the acquired environmental parameters, a certain algorithm or empirical rule is used to determine the target decomposition layer number and target wavelet basis function of wavelet decomposition. The target decomposition layer number determines the fineness of image decomposition, while the target wavelet basis function determines the mathematical tools used in the decomposition process.
[0063] S303: The processor determines the target decomposition layer number and the target wavelet basis function according to the environmental parameters.
[0064] In this step, the corresponding relationship between the environmental parameters and the target decomposition layer number and the target wavelet basis function is pre-stored. The corresponding relationship between the environmental parameters and the target decomposition layer number and the target wavelet basis function can be specifically defined using algorithms, experiments or empirical rules.
[0065] S304, the processor uses the target decomposition layer number and the target wavelet basis function to perform wavelet decomposition on the image to be detected to obtain high-frequency components and low-frequency components.
[0066] S305, the processor performs soft threshold processing on the high frequency components and enhancement processing on the low frequency components to obtain data to be identified.
[0067] S306: The processor inputs the data to be identified into a pre-trained target detection model to obtain a detection result.
[0068] The target detection method provided by the embodiment of the present disclosure can determine the number of target decomposition layers and the target wavelet basis function according to environmental parameters, so as to flexibly adjust the parameters of the wavelet decomposition to adapt to different application scenarios and needs, such as the current light intensity, noise level, etc., thereby ensuring that the wavelet decomposition can significantly enhance the feature information of the image, reduce the misjudgment rate, improve the accuracy of target detection, and at the same time enhance the adaptability, flexibility and robustness of the program.
[0069] For example, in an ore conveyor belt environment, the light is dim, there is a dark field and uneven lighting. The industrial environment is noisy, with a lot of dust and particles. Foreign objects come in different types, colors, shapes and sizes, and have no fixed characteristics. Some foreign objects are dyed by the ore during transportation, and the colors may be similar, resulting in low contrast. Due to the large changes in lighting and high noise levels, more layers of wavelet decomposition (such as 4 to 5 layers) and Symlet wavelet basis functions (such as sym4) can be selected to adapt to environmental requirements, so as to extract features and remove noise at multiple scales.
[0070] Optionally, soft threshold processing is performed on the high frequency components, including: determining a wavelet threshold; setting high frequency components whose absolute values are less than the wavelet threshold to 0; and reducing high frequency components whose absolute values are greater than or equal to the wavelet threshold according to preset rules.
[0071] In this embodiment, the wavelet threshold is used to distinguish between high-frequency components that need to be retained and high-frequency noise that needs to be suppressed. The high-frequency components whose absolute values are less than the wavelet threshold are mainly noise, and this part of the noise is eliminated by setting it to 0. The high-frequency components whose absolute values are greater than or equal to the wavelet threshold are mainly signals, but may contain some noise, so they are reduced according to preset rules to suppress the noise in this part. The soft threshold processing can optimize the quality of the image, make the image clearer and smoother, thereby improving the performance of the target detection model, so that it can maintain a high detection performance under complex environmental conditions.
[0072] Optionally, the wavelet threshold λ is determined as follows: Among them, σ represents the standard deviation of Gaussian noise, and n represents the number of pixels in the image to be detected.
[0073] In this embodiment, after wavelet decomposition, it can be observed that the high-frequency component mainly contains the edge, texture and noise information of the image. Among them, the standard deviation σ of Gaussian noise can be determined by calculating the statistical characteristics (such as mean and variance) of the high-frequency component, or it can be assumed that the noise is Gaussian distributed and its standard deviation σ is calculated by observing the histogram of the high-frequency component. By calculating the wavelet threshold λ according to the standard deviation σ of Gaussian noise and the number of pixels n of the image to be detected, the program can automatically adjust the wavelet threshold according to the actual noise level and resolution of the image, thereby maintaining a high detection performance in different application scenarios, and having strong adaptability.
[0074] Optionally, high-frequency components whose absolute values are greater than or equal to the wavelet threshold are reduced according to preset rules in the following manner: y=sign(x)×max(|x|-λ,0); wherein x is the original high-frequency component, λ is the wavelet threshold, and y is the high-frequency component after reduction.
[0075] In this embodiment, sign(c) retains the sign of the original component, while max(|x|-λ,0) ensures that the reduced component will not be less than zero, and when |x| is greater than λ, the reduction amplitude is |x|-λ, so as to retain some high-frequency information (especially edge information), avoid the edge loss problem that may be caused by hard threshold processing, and maintain good details and clarity while removing noise.
[0076] Combination Figure 4 As shown, the embodiment of the present disclosure provides another target detection method, including:
[0077] S401: The processor obtains an image to be detected.
[0078] S402: The processor performs wavelet decomposition on the image to be detected to obtain high-frequency components and low-frequency components.
[0079] S403, the processor performs soft threshold processing on the high-frequency component and then reconstructs it to obtain a high-frequency feature map.
[0080] In this step, the high-frequency components after soft threshold processing can be reconstructed back into the image space through inverse transformation (such as inverse wavelet transformation) to obtain a high-frequency feature map.
[0081] S404: The processor performs enhancement processing on the low-frequency component and then reconstructs it to obtain a low-frequency feature map.
[0082] In this step, the enhanced low-frequency components can be reconstructed back into the image space through inverse transformation (such as inverse wavelet transformation) to obtain a low-frequency feature map.
[0083] S405, the processor reconstructs the high-frequency component after the soft threshold processing and the low-frequency component after the enhancement processing to obtain an image to be recognized.
[0084] In this step, the combined components can be reconstructed back into the image space through inverse transformation (such as inverse wavelet transformation) to obtain the image to be recognized.
[0085] S406: The processor uses the high-frequency feature map, the low-frequency feature map, and the image to be identified as data to be identified.
[0086] S407, the processor inputs the data to be identified into a pre-trained target detection model to obtain a detection result.
[0087] The target detection method provided by the embodiment of the present disclosure is used to reconstruct the high-frequency components after soft threshold processing to obtain a high-frequency feature map to reflect the details and edge information of the image to be detected. The low-frequency components after enhancement processing are reconstructed to obtain a low-frequency feature map to reflect the overall structure and main information of the image to be detected. The high-frequency components after soft threshold processing and the low-frequency components after enhancement processing are reconstructed to obtain an image to be identified, so as to obtain an image that retains the details and edge information of the image and enhances the main features and contrast of the image. The high-frequency feature map, the low-frequency feature map and the image to be identified are used as data to be identified to increase the diversity of the data and improve the reliability and accuracy of subsequent detection.
[0088] Optionally, the pre-trained target detection model includes a feature extraction module and a target detection module, the feature extraction module includes multiple convolutional layers; the data to be identified is input into the pre-trained target detection model to obtain a detection result, including: inputting the image to be identified into multiple convolutional layers of the feature extraction module for feature extraction; fusing the high-frequency feature map and the low-frequency feature map with the feature map output by a convolutional layer in the feature extraction module respectively to obtain a first feature map output by the feature extraction module; inputting the first feature map into the target detection module to obtain a detection result.
[0089] In this embodiment, the pre-trained target detection model includes a feature extraction module and a target detection module. The feature extraction module is composed of multiple convolutional layers and is used to extract useful feature information from the input image. The target detection module performs target detection and classification based on the extracted features. The high-frequency feature map mainly reflects the details and edge information of the image, while the low-frequency feature map mainly reflects the overall structure and brightness information of the image. The first feature map refers to the feature map that the feature extraction module finally outputs after the image to be identified, the high-frequency feature map and the low-frequency feature map are input into the feature extraction module.
[0090] In this embodiment, the image to be identified is first input into a plurality of convolutional layers in the feature extraction module for layer-by-layer processing. Each convolutional layer applies a set of convolution kernels to extract local features in the image, and performs nonlinear transformation through an activation function (such as ReLU). As the image to be identified is transmitted in the convolutional layer, a series of feature maps are generated, and this series of feature maps contains feature information of the image to be identified at different scales and positions. Then, a suitable convolutional layer is selected as a fusion point in the plurality of convolutional layers, and the high-frequency feature map and the low-frequency feature map are respectively fused with the output feature map of the selected convolutional layer to further enhance the expression ability of the feature map, thereby improving the accuracy of target detection. The fusion of feature maps can be achieved by element-by-element addition, element-by-element multiplication or splicing. The selection of the convolutional layer and the fusion method of the feature map can be selected according to the actual application scenario. After the fused feature map is processed by the feature extraction module (such as convolution, pooling, etc.), the first feature map output by the feature extraction module is generated, and the first feature map combines the low-frequency structural information, high-frequency detail information and deep features extracted by the convolutional layer of the image to be identified.
[0091] In this embodiment, by fusing the high-frequency feature map and the low-frequency feature map with the feature map output by the convolution layer, the fusion and enhancement of multi-scale features are achieved, so as to make full use of the information of feature maps of different scales, improve the expression ability of feature maps, and thus enhance the performance of the target detection model. Due to the fusion of the information of multi-scale feature maps, the target detection model can more accurately identify the target object. Especially in the case of complex background and noise interference, this fusion method significantly improves the accuracy and robustness of target detection.
[0092] Optionally, the pre-trained target detection model also includes a denoising autoencoder; inputting the first feature map output by the feature extraction module into the target detection module to obtain a detection result, including: inputting the image to be identified into the denoising autoencoder to obtain a second feature map; obtaining an average feature map of the first feature map and the second feature map; inputting the average feature map into the target detection module to obtain a detection result.
[0093] The Denoising Autoencoder (DAE) algorithm is an unsupervised learning algorithm used for denoising and feature extraction of data. The Denoising Autoencoder algorithm removes noise and recovers data by introducing noise into the input data and trying to restore the original data from the noisy data. The Denoising Autoencoder algorithm forces the model to learn the essential characteristics of the data, improves the robustness to noise in the data, and avoids the overfitting problem that may occur in traditional autoencoders. The second feature map refers to the feature map that the Denoising Autoencoder finally outputs after the image to be identified is input into the Denoising Autoencoder.
[0094] In this embodiment, the image to be identified is first input into the denoising autoencoder, which performs encoding and decoding processes on the input image, thereby learning a low-dimensional, robust feature representation of the image in the encoding stage, further removing noise from the image, and extracting feature information useful for target detection to obtain a second feature map. Then calculate the average feature map of the first feature map and the second feature map. Specifically, the first feature map and the second feature map are added element by element, and then divided by 2 to obtain the average feature map. The average feature map combines the information of the first feature map and the second feature map, retaining the features of the image to be identified and incorporating the features of the image to be identified after denoising.
[0095] In this embodiment, a denoising autoencoder is used to further remove noise from the image, and feature information useful for target detection is extracted to improve the performance of the target detection model under complex backgrounds and noise interference. By calculating the average feature map of the first feature map and the second feature map, multi-scale and multi-level feature fusion is achieved. This fusion method further enhances the expressive power of the feature map and improves the accuracy of target detection. In addition, the denoising autoencoder has a certain noise resistance and can cope with noise interference in the input image, thereby further improving the robustness of the target detection model in a noisy environment.
[0096] In some embodiments, the target detection model includes a YOLO model and a denoising autoencoder. The YOLO model includes a feature extraction module and a target detection module. The YOLO model is an algorithm that converts the target detection problem into a regression problem, which can simultaneously predict multiple bounding boxes (Bounding Box) and their categories in a single network. The YOLO series of algorithms include multiple versions such as YOLOv1, YOLOv2 (YOLO9000), YOLOv3, YOLOv4 to YOLOv10, each of which is improved and optimized on the basis of the previous version, thereby improving the detection speed and accuracy. In this embodiment, the feature extraction module refers to the feature extraction network of the YOLO model, and the target detection module refers to the Detect module of the YOLO model. The Detect module is a key component in the YOLO network, and is mainly responsible for the final output processing of target detection. The Detect module is responsible for receiving the feature map from the previous network layer and outputting the results of target detection, including the category, confidence, bounding box coordinates, etc. of the target.
[0097] In some embodiments, the target detection model is trained in the following manner: training samples are obtained; the training samples are labeled image data on the belt conveyor system, including image data without foreign matter and image data containing foreign matter; more training samples are generated through data enhancement to obtain a training data set; data enhancement includes rotation, scaling, translation, brightness adjustment, contrast adjustment, noise addition, etc.; multiple training samples in the training data set are sequentially input into a wavelet transform module to perform wavelet decomposition to obtain a high-frequency feature map, a low-frequency feature map and an image to be identified corresponding to each training sample; the high-frequency feature map, the low-frequency feature map and the image to be identified are input into the target detection model for training to obtain a trained target detection model.
[0098] In some embodiments, a comprehensive loss function is calculated in the process of inputting high-frequency feature maps, low-frequency feature maps and images to be identified into a target detection model for training; wherein the comprehensive loss function is a weighted sum of location loss (LocalizationLoss), confidence loss (Confidence Loss) and classification loss (Classification Loss).
[0099] Combination Figure 5 As shown, the embodiment of the present disclosure provides another target detection method, including:
[0100] S501: The processor obtains an image to be detected.
[0101] S502: The processor performs wavelet decomposition on the image to be detected to obtain high-frequency components and low-frequency components.
[0102] S503, the processor performs soft threshold processing on the high frequency components and enhancement processing on the low frequency components to obtain data to be identified.
[0103] S504: The processor inputs the data to be identified into a pre-trained target detection model to obtain a detection result.
[0104] S505: The processor calculates the accuracy of the detection result.
[0105] S506: When the accuracy is less than or equal to the accuracy threshold, the processor obtains target detection data.
[0106] S507: The processor retrains the pre-trained target detection model using the target detection data.
[0107] In the target detection method provided by the embodiment of the present disclosure, the accuracy reflects the ability of the model to correctly identify the target object. The performance of the current target detection model is evaluated by comparing the calculated accuracy with the preset accuracy threshold. If the accuracy is less than or equal to the accuracy threshold, it means that the current target detection model has poor performance and needs further optimization. At this time, the target detection data is obtained, and the target detection data refers to all the detection data after the current target detection model is deployed to the actual environment, including the data corrected after the detection error. The pre-trained target detection model is retrained by using the target detection data to improve the accuracy, robustness and adaptability of the model to the current application environment.
[0108] Combination Figure 6 As shown, the embodiment of the present disclosure provides a target detection device 60, including an acquisition module 610, a decomposition module 620, a processing module 630 and a recognition module 640. The acquisition module 610 is configured to obtain an image to be detected; the decomposition module 620 is configured to perform wavelet decomposition on the image to be detected to obtain high-frequency components and low-frequency components; the processing module 630 is configured to perform soft threshold processing on the high-frequency components and enhance processing on the low-frequency components to obtain data to be recognized; the recognition module 640 is configured to input the data to be recognized into a pre-trained target detection model to obtain a detection result.
[0109] The target detection device 60 provided by the embodiment of the present disclosure can execute the target detection method described in the above embodiment. Therefore, the technical effects possessed by the target detection method described in the above embodiment are also possessed by the embodiment of the present disclosure and will not be repeated here.
[0110] Optionally, the decomposition module 620 is further configured to obtain environmental parameters of the area to be detected; determine the target decomposition layer number and the target wavelet basis function according to the environmental parameters; and perform wavelet decomposition on the image to be detected using the target decomposition layer number and the target wavelet basis function to obtain high-frequency components and low-frequency components.
[0111] Optionally, the processing module 630 is further configured to determine a wavelet threshold; set high-frequency components whose absolute values are less than the wavelet threshold to 0; and reduce high-frequency components whose absolute values are greater than or equal to the wavelet threshold according to preset rules.
[0112] Optionally, the processing module 630 is further configured to determine the wavelet threshold λ in the following manner: Among them, σ represents the standard deviation of Gaussian noise, and n represents the number of pixels in the image to be detected.
[0113] Optionally, the processing module 630 is also configured to reduce the high-frequency components whose absolute values are greater than or equal to the wavelet threshold according to preset rules in the following manner: y=sign(x)×max(|x|-λ,0); wherein x is the original high-frequency component, λ is the wavelet threshold, and y is the high-frequency component after reduction.
[0114] Optionally, the processing module 630 is also configured to reconstruct the high-frequency component after soft threshold processing to obtain a high-frequency feature map; reconstruct the low-frequency component after enhancement processing to obtain a low-frequency feature map; reconstruct the high-frequency component after soft threshold processing and the low-frequency component after enhancement processing to obtain an image to be identified; and use the high-frequency feature map, the low-frequency feature map and the image to be identified as data to be identified.
[0115] Optionally, the recognition module 640 is also configured to input the image to be recognized into multiple convolutional layers of the feature extraction module for feature extraction; fuse the high-frequency feature map and the low-frequency feature map with the feature map output by a convolutional layer in the feature extraction module respectively to obtain a first feature map output by the feature extraction module; input the first feature map into the target detection module to obtain a detection result.
[0116] Optionally, the recognition module 640 is also configured to input the image to be recognized into the denoising autoencoder to obtain a second feature map; obtain an average feature map of the first feature map and the second feature map; and input the average feature map into the target detection module to obtain a detection result.
[0117] Optionally, the target detection device 60 further includes a training module. The training module is configured to calculate the accuracy of the detection result; when the accuracy is less than or equal to the accuracy threshold, obtain target detection data; and use the target detection data to retrain the pre-trained target detection model.
[0118] Combination Figure 7 As shown, the embodiment of the present disclosure provides a target detection device 70, including a processor (processor) 700 and a memory (memory) 701. Optionally, the device 70 may also include a communication interface (CommunicationInterface) 702 and a bus 703. Among them, the processor 700, the communication interface 702, and the memory 701 can communicate with each other through the bus 703. The communication interface 702 can be used for information transmission. The processor 700 can call the logic instructions in the memory 701 to execute the target detection method of the above embodiment.
[0119] In addition, the logic instructions in the memory 701 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.
[0120] The memory 701 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 700 executes the function application and data processing by running the program instructions / modules stored in the memory 701, that is, implementing the target detection method in the above embodiment.
[0121] The memory 701 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 701 may include a high-speed random access memory and may also include a non-volatile memory.
[0122] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned target detection method.
[0123] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes.
[0124] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0125] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0126] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0127] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A target detection method, characterized in that: include: Obtaining an image to be detected; Perform wavelet decomposition on the image to be detected to obtain high-frequency components and low-frequency components; Perform soft threshold processing on high-frequency components and enhance low-frequency components to obtain data to be identified; Input the data to be identified into the pre-trained target detection model to obtain the detection results.
2. The method according to claim 1, characterized in that: Perform wavelet decomposition on the image to be detected to obtain high-frequency components and low-frequency components, including: Obtain environmental parameters of the area to be detected; Determine the target decomposition layer number and target wavelet basis function according to environmental parameters; The target decomposition layer and target wavelet basis function are used to perform wavelet decomposition on the image to be detected to obtain high-frequency components and low-frequency components.
3. The method according to claim 1 or 2, characterized in that: Perform soft threshold processing on high-frequency components, including: Determine the wavelet threshold; Set the high-frequency components whose absolute values are less than the wavelet threshold to 0; The high-frequency components whose absolute values are greater than or equal to the wavelet threshold are reduced according to preset rules.
4. The method according to claim 1 or 2, characterized in that: Perform soft threshold processing on high-frequency components and enhance low-frequency components to obtain the data to be identified, including: The high-frequency components are reconstructed after soft threshold processing to obtain a high-frequency feature map; After enhancing the low-frequency component, reconstruct it to obtain a low-frequency feature map; Reconstruct the high-frequency component after soft threshold processing and the low-frequency component after enhancement processing to obtain the image to be recognized; The high-frequency feature map, the low-frequency feature map and the image to be identified are used as the data to be identified.
5. The method according to claim 4, characterized in that The pre-trained target detection model includes a feature extraction module and a target detection module. The feature extraction module includes multiple convolutional layers. The data to be identified is input into the pre-trained target detection model to obtain the detection results, including: Input the image to be recognized into multiple convolutional layers of the feature extraction module for feature extraction; The high-frequency feature map and the low-frequency feature map are respectively fused with a feature map output by a convolutional layer in the feature extraction module to obtain a first feature map output by the feature extraction module; The first feature map is input into the target detection module to obtain the detection result.
6. The method according to claim 5, characterized in that The pre-trained target detection model also includes a denoising autoencoder; the first feature map output by the feature extraction module is input into the target detection module to obtain a detection result, including: Input the image to be recognized into the denoising autoencoder to obtain a second feature map; Obtain an average feature map of the first feature map and the second feature map; The average feature map is input into the target detection module to obtain the detection result.
7. The method according to claim 1 or 2, characterized in that: Also includes: Calculate the accuracy of the test results; When the accuracy is less than or equal to the accuracy threshold, target detection data is obtained; Retrain the pre-trained object detection model using object detection data.
8. A target detection device, characterized in that: include: An acquisition module is configured to obtain an image to be detected; A decomposition module is configured to perform wavelet decomposition on the image to be detected to obtain a high-frequency component and a low-frequency component; A processing module is configured to perform soft threshold processing on high-frequency components and enhance processing on low-frequency components to obtain data to be identified; The recognition module is configured to input the data to be recognized into a pre-trained target detection model to obtain a detection result.
9. A target detection device, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the target detection method according to any one of claims 1 to 7 when running the program instructions.
10. An electronic device, characterized in that: include: Equipment body; The target detection device as described in claim 8 or 9 is installed on the device body.
Citation Information
Cited By
Method and device for detecting foreign matters in glass bottle and storage medium
CN119880962A