Random computing edge detection enhancement method, system, medium and equipment
By utilizing the random resonance and random flip characteristics of memory in edge detection, random bit streams are generated for calculation, and edge detection results are optimized through noise signals, the problem of large errors in existing edge detection methods is solved, and more accurate and efficient edge detection is achieved.
Patent Information
- Application Number
- CN202411663596.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2044-11-20
Smart Images

Figure CN119963586A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of integrated circuits, and in particular to a random computing edge detection enhancement method, system, medium and device based on stochastic resonance. Background Art
[0002] Edge detection is a basic and key algorithm in computer vision. In an image, an edge refers to the boundary between different regions, usually containing the outline and detail information of an object. The goal of an edge detection algorithm is to find these edges in an image and extract them, providing a basis for subsequent image analysis and processing. Edge detection has a wide range of applications in image segmentation, object detection, and video object segmentation.
[0003] However, due to many factors, including low image contrast, complex background, blurred edges, etc., the edge detection results have large errors and cannot detect and extract the edges of the image. This poses a huge challenge to edge detection in practical applications. For example, when dealing with road signs and obstacles in autonomous vehicles, inaccurate edge detection may affect the judgment and safety of the vehicle. In addition, in medical diagnostic imaging, accurate edge detection is crucial to correctly identify the lesion area, while incorrect edge detection may lead to misdiagnosis.
[0004] The existing methods for optimizing edge detection results mainly involve preprocessing the input image, enhancing the image contrast, and processing images with complex backgrounds using image denoising, image segmentation, background modeling, etc. However, implementing the above preprocessing in a hardware-based machine learning algorithm chip requires the design of complex peripheral circuits, which will result in additional circuit area and energy consumption.
[0005] Stochastic resonance is a signal enhancement phenomenon. In the process of signal analysis, noise will reduce the signal-to-noise ratio and affect the extraction of useful information. However, when a weak signal passes through a nonlinear system, stochastic resonance is generated when a certain matching relationship is reached between the nonlinear system, the signal and the noise. The presence of noise increases the intensity of the original weak signal, providing a new way to detect weak signals.
[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the invention and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the invention
[0007] The present invention provides a random computing edge detection enhancement method, system, medium and device based on stochastic resonance. The present invention utilizes the noise generated by a memory and can effectively overcome the problem of large errors based on the principle of stochastic resonance.
[0008] A random computing edge detection enhancement method based on stochastic resonance includes:
[0009] S100: collecting an image and using it as an input image, converting the input image into a grayscale image, and normalizing the grayscale values to obtain a grayscale value matrix;
[0010] S200: applying pulse excitation, causing random flipping of the memory to generate a random bit stream, and using the random bit stream to represent each gray value in the gray value matrix;
[0011] S300: performing random calculation on the random bit stream to obtain an edge detection result;
[0012] S400: capturing a noise signal generated when an electronic device for collecting images is working, and sampling to generate a random bit stream with a predetermined probability;
[0013] S500: injecting a noise random bit stream with a predetermined probability into the edge detection result to achieve enhanced optimization.
[0014] In the random computing edge detection enhancement method based on stochastic resonance, in step S200, the pulse excitation is a two-stage pulse, which includes a probability setting pulse that causes the memory to flip with a certain probability and a reset pulse that returns the memory to an initial state within one cycle.
[0015] In the random calculation edge detection enhancement method based on stochastic resonance, in step S200, the state of the memory is compared with the reference resistance value, bit 1 is generated in the high resistance state, and bit 0 is generated in the low resistance state, and the probability of bit 1 in the random bit stream represents the gray value.
[0016] In the random computing edge detection enhancement method based on stochastic resonance, in step S200, the memory includes a magnetic random access memory, a phase change memory, or a ferroelectric memory.
[0017] In the random computing edge detection enhancement method based on stochastic resonance, in step S400, the noise signal includes any one of the following or any combination thereof: a random signal generated by a memory, 1 / f noise, RTN noise and Gaussian noise.
[0018] In the random computing edge detection enhancement method based on stochastic resonance, in step S400, the noise signal is regulated to output a random bit stream with a predetermined probability by controlling the random flip probability of the memory and the threshold of the noise sampling of the electronic device.
[0019] In the random computing edge detection enhancement method based on stochastic resonance, the electronic device includes an autonomous driving vehicle or a medical diagnostic imaging device that recognizes road signs and obstacles.
[0020] A random computing edge detection enhancement system includes:
[0021] An image input unit, which is used to collect an input image and convert it into a grayscale image, and perform normalization processing on pixels to obtain a grayscale value matrix;
[0022] A pulse excitation applying unit, which is used to apply a pulse excitation to the memory;
[0023] A random bit stream generation module is used to randomly flip the memory under pulse excitation, and the generated random bit stream is used to represent each gray value in the gray value matrix;
[0024] An edge detection random calculation unit is used to perform random calculation on a random bit stream of a predetermined grayscale value to obtain an edge detection result;
[0025] A noise capture unit, which is used to capture noise signals generated when the electronic device used to collect images is working;
[0026] The noise control unit is used to control and adjust the noise signal to obtain noise signals representing different random bit streams.
[0027] A computer storage medium includes computer instructions, which, when executed on a computer, cause the computer to execute the method described.
[0028] An electronic device, comprising:
[0029] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein:
[0030] When the processor executes the program, the method described is implemented.
[0031] Compared with the prior art, the present invention has the following advantages: the present invention uses a memory to generate a random bit stream for random calculation, thereby obtaining an edge detection result. At the same time, the method also extracts the noise signal of the memory and injects it into the edge detection result to achieve enhanced optimization of the result. By utilizing random resonance and the random flipping characteristics of the memory, the problem of large errors in the edge detection method can be effectively solved, and more accurate and reliable edge detection results can be provided. The noise generated when the memory is working is extracted and injected into the edge detection result by addition, without the need for complex peripheral circuits, which greatly saves hardware area and power consumption, and provides a new hardware solution for the enhanced optimization of edge detection tasks. By controlling the probability of memory flipping and the sampling threshold, the noise signal is regulated to achieve the output of a random bit stream with a specific probability. By injecting different noise signals into the random calculation edge detection result, different optimization effects are obtained, which is easy to control. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] By reading the detailed description of the preferred specific embodiments below, various other advantages and benefits of the present invention will become clear to those of ordinary skill in the art. The drawings in the specification are only for the purpose of illustrating the preferred embodiments and are not considered to be limitations of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative work. Moreover, the same reference numerals are used to represent the same components throughout the drawings.
[0033] In the attached picture:
[0034] Figure 1 This is a flow chart of the random computing edge detection enhancement method based on stochastic resonance disclosed in the present invention;
[0035] Figure 2 A schematic diagram of the relationship between a sampling threshold and a random bit stream probability generated by a noise signal provided in another embodiment of the present disclosure;
[0036] Figure 3 A schematic diagram of the relationship between the pulse amplitude and the probability of a random bit stream generated by a noise signal provided in another embodiment of the present disclosure;
[0037] Figure 4 A schematic diagram of edge detection enhancement optimization effect provided by another embodiment of the present disclosure;
[0038] Figure 5 A schematic diagram of a random computation edge detection enhancement system based on stochastic resonance is provided for another embodiment of the present disclosure.
[0039] The present invention is further explained below in conjunction with the accompanying drawings and embodiments. DETAILED DESCRIPTION
[0040] The specific embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the specific embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0041] It should be noted that certain words are used in the specification and claims to refer to specific components. Those skilled in the art should understand that technicians may use different nouns to refer to the same component. This specification and claims do not use the difference in nouns as a way to distinguish components, but use the difference in the functions of the components as the criterion for distinction. As mentioned throughout the specification and claims, "including" or "comprising" is an open term, so it should be interpreted as "including but not limited to". The subsequent description of the specification is a preferred embodiment of the present invention, but the description is based on the general principles of the specification and is not intended to limit the scope of the present invention. The scope of protection of the present invention shall be determined by the attached claims.
[0042] To facilitate understanding of the embodiments of the present invention, further explanation will be given below by taking specific embodiments as examples in conjunction with the accompanying drawings, and each of the accompanying drawings does not constitute a limitation on the embodiments of the present invention.
[0043] like Figures 1 to 5 As shown, the random calculation edge detection enhancement method based on stochastic resonance includes the following steps:
[0044] S100: collecting an image and using it as an input image, converting the input image into a grayscale image, and normalizing the grayscale values to obtain a grayscale value matrix;
[0045] S200: applying pulse excitation, causing random flipping of the memory to generate a random bit stream, and using the random bit stream to represent each gray value in the gray value matrix;
[0046] S300: performing random calculation on the random bit stream to obtain an edge detection result;
[0047] S400: capturing a noise signal generated when an electronic device for collecting images is working, and sampling to generate a random bit stream with a predetermined probability;
[0048] S500: injecting a noise random bit stream with a predetermined probability into the edge detection result to achieve enhanced optimization.
[0049] In a preferred implementation of the random computing edge detection enhancement method based on stochastic resonance, in step S200, the pulse excitation is a two-stage pulse, which includes a probability setting pulse that causes the memory to flip with a certain probability and a reset pulse that returns the memory to an initial state within one cycle.
[0050] In a preferred implementation of the random calculation edge detection enhancement method based on stochastic resonance, in step S200, the state of the memory is compared with the reference resistance value, bit 1 is generated in the high resistance state, and bit 0 is generated in the low resistance state, and the probability of bit 1 in the random bit stream represents the grayscale value.
[0051] In a preferred implementation of the random computing edge detection enhancement method based on stochastic resonance, in step S200, the memory includes a magnetic random access memory, a phase change memory, or a ferroelectric memory.
[0052] In a preferred implementation of the random computation edge detection enhancement method based on stochastic resonance, in step S400, the noise signal includes a random signal generated by a memory, 1 / f noise, RTN noise and Gaussian noise.
[0053] In a preferred implementation of the random computing edge detection enhancement method based on stochastic resonance, in step S400, the noise signal is regulated by controlling the random flip probability of the memory and the threshold of the noise sampling of the electronic device to output a random bit stream with a predetermined probability.
[0054] In a preferred implementation of the random computation edge detection enhancement method based on stochastic resonance, the electronic device includes an autonomous driving vehicle or a medical diagnostic imaging device that identifies road markings and obstacles.
[0055] A random computing edge detection enhancement system includes:
[0056] An image input unit, which is used to collect an input image and convert it into a grayscale image, and perform normalization processing on pixels to obtain a grayscale value matrix;
[0057] A pulse excitation applying unit, which is used to apply a pulse excitation to the memory;
[0058] A random bit stream generation module is used to randomly flip the memory under pulse excitation, and the generated random bit stream is used to represent each gray value in the gray value matrix;
[0059] An edge detection random calculation unit is used to perform random calculation on a random bit stream of a predetermined grayscale value to obtain an edge detection result;
[0060] A noise capture unit, which is used to capture noise signals generated when the electronic device used to collect images is working;
[0061] The noise control unit is used to control and adjust the noise signal to obtain noise signals representing different random bit streams.
[0062] A computer storage medium includes computer instructions, which, when executed on a computer, cause the computer to execute the method described.
[0063] An electronic device, comprising:
[0064] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein:
[0065] When the processor executes the program, the method described is implemented.
[0066] In one embodiment, the noise signal is converted into a random bit stream and then injected into the edge detection result by addition.
[0067] In one embodiment, Figure 1 As shown, the present disclosure provides a random calculation edge detection enhancement method based on stochastic resonance, comprising the following steps:
[0068] S100: converting the input image into a grayscale image, and normalizing the grayscale values to obtain a grayscale value matrix;
[0069] A grayscale image is composed of a single pixel matrix, and the value of each pixel matrix is an integer between 0 and 255. The grayscale value of the image is normalized, that is, the grayscale value is scaled to between 0 and 1.
[0070] S200: applying pulse excitation, causing random flipping of the memory to generate a random bit stream, and using the random bit stream to represent each gray value in the pixel matrix;
[0071] In this step, the pulse excitation applied to the memory is current excitation or voltage excitation, and the voltage excitation or current excitation is a second-order excitation within one cycle, including a probability setting pulse and a refresh pulse, wherein the probability setting pulse can cause the memory to randomly flip from a low resistance state (P state) to a high resistance state (AP state) with a certain probability or from a high resistance state (AP state) to a low resistance state (P state) with a certain probability; the refresh pulse can cause the memory to flip from the current state to the low resistance state (P state) or from the current state to the high resistance state (AP state). The state of the memory is compared with the reference resistance value, and a bit "1" is generated in the high resistance state, and a bit "0" is generated in the low resistance state;
[0072] The normalized grayscale value is a decimal between [0,1], and the grayscale value is represented by the probability of "1" in the random bit stream.
[0073] The memory includes magnetic random access memory, phase change memory, ferroelectric memory and other memories.
[0074] In the preferred embodiment, the magnetic random access memory is a sandwich structure, which includes a free layer, a tunneling layer and a pinned layer.
[0075] In the preferred embodiment, the free layer and the pinned layer are composed of ferromagnetic materials, including NiFe, CoFe or CoFeB; the tunneling layer is composed of non-magnetic insulating materials, including MgO, Al2O3, Al2MgO4, ZnO, HfO2 or TaO2.
[0076] S300: performing random calculation on the random bit stream to obtain an edge detection result;
[0077] Random calculation includes random calculation multiplication, random calculation addition, etc. Edge detection uses the template as the kernel to perform convolution and random calculation with each pixel of the image, and then selects a suitable threshold to extract the edge of the image. Common templates include Roberts operator, Sobel operator and Prewitt operator. In another embodiment, the present disclosure uses Roberts operator for edge detection calculation.
[0078] S400: Capture the noise signal generated when the memory is working, and generate a random bit stream with a specific probability.
[0079] The noise signal includes but is not limited to a random signal generated by a memory, 1 / f noise, RTN noise, and Gaussian noise.
[0080] By controlling the random flip probability of the memory and the threshold of the noise sampling of the electronic device, the noise signal is regulated to output a random bit stream with a specific probability.
[0081] In this embodiment, the present disclosure uses Gaussian noise generated by electronic devices during operation as a noise signal, compares the noise signal with a threshold value H, and outputs a bit "1" when it is greater than H, and outputs a bit "0" when it is less than H. The control of the noise signal to generate a bit stream with a specific probability is achieved by adjusting the threshold value. The relationship between the threshold value H and the probability x of the output bit stream is shown in the following formula:
[0082]
[0083] in, is the mean of the Gaussian noise, is the variance of Gaussian noise. Figure 2 As shown, the embodiment provided Schematic diagram of the relationship between H and x, the two show a sigmoid dependency relationship.
[0084] In another embodiment, the present disclosure utilizes the random flipping behavior of the memory under pulse excitation to generate a random signal as a noise signal. The amplitude of the excitation can be controlled to control the probability of flipping, such as Figure 3As shown, the flip probability of the memory is sigmoid-dependent with the applied pulse excitation amplitude, and the control noise signal can be used to generate a bit stream with a specific probability by adjusting the flip probability.
[0085] S500: injecting a noise random bit stream with a specific probability into the edge detection result to achieve an enhanced optimization effect.
[0086] In this embodiment, Figure 4 As shown in the figure, the edge of the input image after edge detection is unclear and indistinguishable. White noise signals with bit stream probabilities of 0.01, 0.08, 0.1 and 0.5 are applied to it in sequence. As the bit stream probability of the injected noise increases, the original edge detection result signal is first enhanced and then submerged. The white noise signal and the original edge detection result signal produce random resonance, and the noise energy is transferred to the edge detection result signal, amplifying the weak signal and enhancing the edge detection result image. When the white noise signal is too strong, it will submerge the original signal.
[0087] In another embodiment, if Figure 5 As shown, the present disclosure also provides a random computing edge detection enhancement hardware device based on stochastic resonance, comprising the following parts:
[0088] The image input unit is used to convert the input image into a grayscale image and normalize the pixels to obtain a pixel matrix.
[0089] A pulse excitation applying unit, used for applying a pulse excitation to the memory;
[0090] A random bit stream generation module, in which the memory is randomly flipped under pulse excitation, and the generated random bit stream is used to represent each gray value in the pixel matrix;
[0091] The edge detection random calculation unit performs random calculation on a random bit stream representing a specific grayscale value to obtain an edge detection result.
[0092] The noise capture unit is used to capture the noise signal generated when the electronic device is working.
[0093] The noise control unit is used to control and adjust the noise signal to obtain noise signals representing different random bit streams.
[0094] Although the embodiments of the present invention are described above in conjunction with the accompanying drawings, the present invention is not limited to the above specific embodiments and application fields, and the above specific embodiments are only illustrative and instructive, rather than restrictive. A person of ordinary skill in the art can also make many forms under the guidance of this specification and without departing from the scope of protection of the claims of the present invention, all of which belong to the protection of the present invention.
Claims
1. A random computing edge detection enhancement method based on stochastic resonance, characterized in that: The steps include: S100: collecting an image and using it as an input image, converting the input image into a grayscale image, and normalizing the grayscale values to obtain a grayscale value matrix; S200: applying pulse excitation, causing random flipping of the memory to generate a random bit stream, and using the random bit stream to represent each gray value in the gray value matrix; S300: performing random calculation on the random bit stream to obtain an edge detection result; S400: capturing a noise signal generated when an electronic device for collecting images is working, and sampling to generate a random bit stream with a predetermined probability; S500: injecting a noise random bit stream with a predetermined probability into the edge detection result to achieve enhanced optimization.
2. The random computing edge detection enhancement method based on stochastic resonance according to claim 1 is characterized in that: Preferably, in step S200, the memory includes a magnetic random access memory.
3. The random computing edge detection enhancement method based on stochastic resonance according to claim 1 is characterized in that: In step S200, the memory includes a phase change memory.
4. The random computing edge detection enhancement method based on stochastic resonance according to claim 1 is characterized in that: In step S200, the memory includes a ferroelectric memory.
5. The random computing edge detection enhancement method based on stochastic resonance according to claim 1 is characterized in that: In step S400, the noise signal includes a random signal generated by a memory.
6. The random computing edge detection enhancement method based on stochastic resonance according to claim 1 is characterized in that: In step S400, the noise signal includes any one of the following or a combination thereof: 1 / f noise, RTN noise and Gaussian noise.
7. The random computing edge detection enhancement method based on stochastic resonance according to claim 1 is characterized in that: Electronic devices include self-driving vehicles or medical diagnostic imaging equipment that recognize road markings and obstacles.
8. A random computing edge detection enhancement system, characterized in that: These include, An image input unit, which is used to collect an input image and convert it into a grayscale image, and perform normalization processing on pixels to obtain a grayscale value matrix; A pulse excitation applying unit, which is used to apply a pulse excitation to the memory; A random bit stream generation module is used to randomly flip the memory under pulse excitation, and the generated random bit stream is used to represent each gray value in the gray value matrix; An edge detection random calculation unit is used to perform random calculation on a random bit stream of a predetermined grayscale value to obtain an edge detection result; A noise capture unit, which is used to capture noise signals generated when the electronic device used to collect images is working; The noise control unit is used to control and adjust the noise signal to obtain noise signals representing different random bit streams.
9. A computer storage medium, characterized in that The storage medium includes computer instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The electronic device comprises: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Image edge detection method based on multiple stochastic resonance mechanisms
CN103729847A
Stochastic resonance method for detecting blood vessels in fundus images based on adaptive scale decomposition
CN109118472A
Bayesian classifier hardware implementation circuit and method
CN117592573A
Stochastic computation using pulse-width modulated signals
US20180204131A1