Image edge detection method based on adaptive neighborhood search

By optimizing the convolution kernel parameters for image edge detection using an adaptive neighborhood search strategy, the problem of insufficient accuracy in traditional flower pollination algorithms is solved, achieving higher accuracy and effectiveness in image edge detection.

CN122492740APending Publication Date: 2026-07-31JIANGXI UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGXI UNIV OF SCI & TECH
Filing Date
2026-05-27
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

When traditional flower pollination algorithms are used to optimize the convolution kernel parameters for image edge detection, they are prone to insufficient edge detection accuracy.

Method used

An adaptive neighborhood search strategy is adopted to optimize the convolution kernel parameters of image edge detection. By combining global search with Levy distribution and neighborhood search with adaptive step size, an adaptive parameter adjustment mechanism is designed to improve the adaptability and accuracy of the algorithm.

Benefits of technology

It improves the accuracy of image edge detection, enhances global exploration capabilities, maintains the convergence and diversity of the population, avoids the algorithm getting trapped in local optima, and achieves higher edge detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122492740A_ABST
    Figure CN122492740A_ABST
Patent Text Reader

Abstract

This invention discloses an image edge detection method based on adaptive neighborhood search. The invention utilizes an adaptive neighborhood search algorithm to optimize the convolution kernel parameters for image edge detection, and then uses these optimized kernel parameters to perform edge detection on the image. This invention employs an adaptive neighborhood search strategy to improve the optimization accuracy of the flower pollination algorithm. First, a global search strategy based on the Levy distribution is executed according to the cross-pollination probability, while simultaneously executing a neighborhood search strategy based on an adaptive step size to generate new solutions. Then, the fitness of the new solution is calculated, and the cross-pollination probability, cross-pollination coefficient, and adaptive step size are adaptively updated based on the fitness of the new solution. This invention, by utilizing adaptive neighborhood search and parameter adaptive adjustment mechanisms, effectively maintains the balance between population convergence and diversity, thereby improving the accuracy of image edge detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital image processing, and more specifically to an image edge detection method based on adaptive neighborhood search. Background Technology

[0002] Image edge detection is a key technology in the field of digital image processing. Its core task is to accurately locate the positions where pixels in an image undergo drastic changes and connect these abrupt changes into continuous boundary lines, thereby effectively outlining the contours between different target areas. Image edge detection plays an important role in many engineering practices such as medical image analysis, industrial defect detection, and video surveillance. However, traditional image edge detection methods mostly rely on manual experience to set convolution kernel parameters, which significantly limits further improvements in image edge detection accuracy.

[0003] Therefore, automatically optimizing the convolution kernel parameters for image edge detection using intelligent optimization algorithms has become an effective way to improve edge detection accuracy. The flower pollination algorithm is an intelligent optimization algorithm that simulates natural laws and has achieved good results in many engineering optimization problems. However, traditional flower pollination algorithms are prone to insufficient edge detection accuracy when used to optimize the convolution kernel parameters for image edge detection. Summary of the Invention

[0004] This invention provides an image edge detection method based on adaptive neighborhood search. It utilizes an adaptive neighborhood search strategy to improve the optimization accuracy of the flower pollination algorithm, overcoming to some extent the problem of insufficient edge detection accuracy that often occurs when traditional flower pollination algorithms are used to optimize convolution kernel parameters for image edge detection. This invention can improve the accuracy of image edge detection.

[0005] The technical solution of this invention: an image edge detection method based on adaptive neighborhood search, comprising the following steps:

[0006] Step 1, Input the image to be edge detected ;

[0007] Step 2, Input training images and training images Reference edge image ;

[0008] Step 3, Input the convolution kernel size Population size Maximum number of iterations ;

[0009] Step 4, set the number of convolution kernel parameters ;

[0010] Step 5, set the current algebra ;

[0011] Step 6, generate randomly Individuals constitute a population ,in It is the first in the population Individual, subscript Each individual in the population stores There are convolutional kernel parameters; among which, Indicates the first in the population The first stored in each individual Each convolutional kernel parameter, index ;

[0012] Step 7, Calculate individual fitness value ;

[0013] Step 8: Record the individual with the smallest fitness value in the population as the current best individual. ;

[0014] Step 9, set the cross-pollination probability Cross-pollination coefficient and adaptive step size ;

[0015] Step 10: Generate a random real number in the range [0, 1]. ,like Less than If yes, proceed to step 11; otherwise, proceed to step 14.

[0016] Step 11, calculate the disturbance term according to formula (1) :

[0017] (1)

[0018] in It is a random real number that follows a Levy distribution;

[0019] Step 12, generate a new solution according to formula (2) :

[0020] (2)

[0021] Step 13, proceed to step 15;

[0022] Step 14: Perform a neighborhood search based on an adaptive step size to generate a new solution. ;

[0023] Step 15, Calculate the new solution fitness value ,if Smaller than an individual in the population fitness value Then use Replace individuals in the population Otherwise, maintain individuality within the population. constant;

[0024] Step 16, Update Individual cross-pollination probability Cross-pollination coefficient and adaptive step size ;

[0025] Step 17, if a new solution The fitness value is less than the current best individual. If the fitness value is not found, then the new solution is used. Replace the current best individual ;

[0026] Step 18, Set the current algebra ;

[0027] Step 19, if the current algebra Less than the maximum number of iterations If yes, proceed to step 10; otherwise, proceed to step 20.

[0028] Step 20, starting from the current best individual Take out Each convolutional kernel parameter is used to obtain... Each convolution kernel parameter is used to perform edge detection on the image. Perform convolution operations to obtain the image to be edge detected. Edge detection results;

[0029] Furthermore, in step 7, the individual is calculated fitness value The steps are as follows:

[0030] Step 7.1, from the individual Take out Each convolutional kernel parameter is used to obtain... Each convolution kernel parameter affects the training image. Perform convolution operations to obtain the current predicted edge image. ;

[0031] Step 7.2, calculate the individual according to formula (3). fitness value :

[0032] (3)

[0033] in For training images height, For training images width, For the current predicted edge image pixels, For the reference edge image pixels, For height subscripts, The width subscript;

[0034] Furthermore, in step 14, a neighborhood search based on an adaptive step size is performed to generate a new solution. The steps are as follows:

[0035] Step 14.1, in [0, Randomly generate two distinct positive integers within the range. and ;

[0036] Step 14.2: Generate a random real number in the range [0, 1]. ;

[0037] Step 14.3: Generate a new solution based on formula (4). :

[0038] (4)

[0039] in The first in the population Individual, The first in the population Individuals, real numbers The result is calculated according to formula (5):

[0040] (5)

[0041] in, It is a random real number in the range [0,1]. It is an adaptive step size;

[0042] Furthermore, in step 16, the cross-pollination probability of the current individual is updated. Cross-pollination coefficient and adaptive step size The steps are as follows:

[0043] Step 16.1, if a new solution The fitness value is less than that of an individual in the population. If the value is suitable, proceed to step 16.2; otherwise, proceed to step 16.4.

[0044] Step 16.2, Keep , ,as well as constant;

[0045] Step 16.3, proceed to step 17;

[0046] Step 16.4, settings ,in It is a random real number in the range [0, 1].

[0047] Step 16.5, Settings ,in It is a random real number in the range [0, 1].

[0048] Step 16.6, update according to formula (6) :

[0049] (6)

[0050] Where sin is the sine function and cos is the cosine function. Pi The adaptive midpoint is calculated according to formula (7). Value:

[0051] (7)

[0052] Step 16.7, if If the value is less than 1.0, proceed to step 17; otherwise, proceed to step 16.8.

[0053] Step 16.8, update according to formula (8) :

[0054] (8)

[0055] in It is a random real number in the range [0, 1].

[0056] Step 16.9, proceed to step 17.

[0057] The beneficial effects of this invention are as follows: This invention discloses an image edge detection method based on adaptive neighborhood search. This invention utilizes an adaptive neighborhood search algorithm to optimize the convolution kernel parameters for image edge detection, integrating the adaptive neighborhood search strategy into the flower pollination algorithm to improve the accuracy of image edge detection. On one hand, a global search strategy based on the Levy distribution is designed, leveraging the long-tail characteristic of the Levy distribution to enhance global exploration capabilities; simultaneously, a neighborhood search strategy based on adaptive step size is designed, improving the efficiency of neighborhood search through adaptive step size, effectively maintaining the balance between population convergence and diversity, and avoiding the algorithm from getting trapped in local optima; on the other hand, a parameter adaptive adjustment mechanism is designed, which can dynamically update the cross-pollination probability, cross-pollination coefficient, and adaptive step size according to the fitness of new solutions, improving the adaptability of the algorithm in different scenarios, thereby improving the accuracy of image edge detection. Attached Figure Description

[0058] Figure 1 The image shown is the one to be edge detected in this embodiment.

[0059] Figure 2 This refers to the adaptive step size in the embodiments.

[0060] Figure 3 The image edge detection results are obtained by applying a traditional flower pollination algorithm.

[0061] Figure 4 The image edge detection results obtained by applying the present invention. Detailed Implementation

[0062] The technical solution of the present invention will be further described in detail below through embodiments and in conjunction with the accompanying drawings.

[0063] Example:

[0064] With reference to the accompanying drawings, the specific implementation steps of the present invention are as follows:

[0065] Step 1, Input Figure 1 The image shown is for edge detection. ;

[0066] Step 2, Input training images and training images Reference edge image ;

[0067] Step 3, Input the convolution kernel size Population size Maximum number of iterations ;

[0068] Step 4, set the number of convolution kernel parameters ;

[0069] Step 5, set the current algebra ;

[0070] Step 6, generate randomly Individuals constitute a population ,in It is the first in the population Individual, subscript Each individual in the population stores There are convolutional kernel parameters; among which, Indicates the first in the population The first stored in each individual Each convolutional kernel parameter, index ;

[0071] Step 7, Calculate individual fitness value ;

[0072] Step 8: Record the individual with the smallest fitness value in the population as the current best individual. ;

[0073] Step 9, set the cross-pollination probability Cross-pollination coefficient and adaptive step size ;

[0074] Step 10: Generate a random real number in the range [0, 1]. ,like Less than If yes, proceed to step 11; otherwise, proceed to step 14.

[0075] Step 11, calculate the disturbance term according to formula (1) :

[0076] (1)

[0077] in It is a random real number that follows a Levy distribution;

[0078] Step 12, generate a new solution according to formula (2) :

[0079] (2)

[0080] Step 13, proceed to step 15;

[0081] Step 14: Perform a neighborhood search based on an adaptive step size to generate a new solution. ;

[0082] Step 15, Calculate the new solution fitness value ,if Smaller than an individual in the population fitness value Then use Replace individuals in the population Otherwise, maintain individuality within the population. constant;

[0083] Step 16, Update Individual cross-pollination probability Cross-pollination coefficient and adaptive step size ;

[0084] Step 17, if a new solution The fitness value is less than the current best individual. If the fitness value is not found, then the new solution is used. Replace the current best individual ;

[0085] Step 18, Set the current algebra ;

[0086] Step 19, if the current algebra Less than the maximum number of iterations If yes, proceed to step 10; otherwise, proceed to step 20.

[0087] Step 20, starting from the current best individual Take out Each convolutional kernel parameter is used to obtain... Each convolution kernel parameter is used to perform edge detection on the image. Performing a convolution operation yields... Figure 4 The image shown is for edge detection. The edge detection results; among them, Figure 3 The image edge detection results obtained by applying traditional flower pollination algorithms; from Figure 3 and Figure 4 It can be seen that the present invention can obtain image edge detection results with higher accuracy than traditional flower pollination algorithms;

[0088] Furthermore, in step 7, the individual is calculated fitness value The steps are as follows:

[0089] Step 7.1, from the individual Take out Each convolutional kernel parameter is used to obtain... Each convolution kernel parameter affects the training image. Perform convolution operations to obtain the current predicted edge image. ;

[0090] Step 7.2, calculate the individual according to formula (3). fitness value :

[0091] (3)

[0092] in For training images height, For training images width, For the current predicted edge image pixels, For the reference edge image pixels, For height subscripts, The width subscript;

[0093] Furthermore, in step 14, a neighborhood search based on an adaptive step size is performed to generate a new solution. The steps are as follows:

[0094] Step 14.1, in [0, Randomly generate two distinct positive integers within the range. and ;

[0095] Step 14.2: Generate a random real number in the range [0, 1]. ;

[0096] Step 14.3: Generate a new solution based on formula (4). :

[0097] (4)

[0098] in The first in the population Individual, The first in the population Individuals, real numbers The result is calculated according to formula (5):

[0099] (5)

[0100] in, It is a random real number in the range [0,1]. It is an adaptive step size;

[0101] Furthermore, in step 16, the cross-pollination probability of the current individual is updated. Cross-pollination coefficient and adaptive step size The steps are as follows:

[0102] Step 16.1, if a new solution The fitness value is less than that of an individual in the population. If the value is suitable, proceed to step 16.2; otherwise, proceed to step 16.4.

[0103] Step 16.2, Keep , ,as well as constant;

[0104] Step 16.3, proceed to step 17;

[0105] Step 16.4, settings ,in It is a random real number in the range [0, 1].

[0106] Step 16.5, Settings ,in It is a random real number in the range [0, 1].

[0107] Step 16.6, update according to formula (6) :

[0108] (6)

[0109] Where sin is the sine function and cos is the cosine function. Pi The adaptive midpoint is calculated according to formula (7). Value:

[0110] (7)

[0111] Step 16.7, if If the value is less than 1.0, proceed to step 17; otherwise, proceed to step 16.8.

[0112] Step 16.8, update according to formula (8) :

[0113] (8)

[0114] in It is a random real number in the range [0, 1]; in the embodiment, the adaptive step size is... The result of one calculation is as follows Figure 2 As shown;

[0115] Step 16.9, proceed to step 17.

Claims

1. An image edge detection method based on adaptive neighborhood search, characterized in that, Includes the following steps: Step 1, Input the image to be edge detected ; Step 2, Input training images and training images Reference edge image ; Step 3, Input the convolution kernel size Population size Maximum number of iterations ; Step 4, set the number of convolution kernel parameters ; Step 5, set the current algebra ; Step 6, generate randomly Individuals constitute a population ,in It is the first in the population Individual, subscript ; Each individual in the population stores There are convolutional kernel parameters; among which, Indicates the first in the population The first stored in each individual Each convolutional kernel parameter, index ; Step 7, Calculate individual fitness value ; Step 8: Record the individual with the smallest fitness value in the population as the current best individual. ; Step 9, set the cross-pollination probability Cross-pollination coefficient and adaptive step size ; Step 10: Generate a random real number in the range [0, 1]. ,like Less than If yes, proceed to step 11; otherwise, proceed to step 14. Step 11, calculate the disturbance term according to formula (1) : (1) in It is a random real number that follows a Levy distribution; Step 12, generate a new solution according to formula (2) : (2) Step 13, proceed to step 15; Step 14: Perform a neighborhood search based on an adaptive step size to generate a new solution. ; Step 15, Calculate the new solution fitness value ,if Smaller than an individual in the population fitness value Then use Replace individuals in the population Otherwise, maintain individuality within the population. constant; Step 16, Update Individual cross-pollination probability Cross-pollination coefficient and adaptive step size ; Step 17, if a new solution The fitness value is less than the current best individual If the fitness value is not found, then the new solution is used. Replace the current best individual ; Step 18, Set the current algebra ; Step 19, if the current algebra Less than the maximum number of iterations If yes, proceed to step 10; otherwise, proceed to step 20. Step 20, starting from the current best individual Take out Each convolutional kernel parameter is used to obtain... Each convolution kernel parameter is used to detect edges in the image. Perform convolution operations to obtain the image to be edge detected. The edge detection results.

2. The image edge detection method based on adaptive neighborhood search according to claim 1, characterized in that, In step 7, the individual is calculated. fitness value The steps are as follows: Step 7.1, from the individual Take out Each convolutional kernel parameter is used to obtain... Each convolution kernel parameter affects the training image. Perform convolution operations to obtain the current predicted edge image. ; Step 7.2, calculate the individual according to formula (3). fitness value : (3) in For training images height, For training images width, For the current predicted edge image pixels, For the reference edge image pixels, For height subscripts, This is a width subscript.

3. The image edge detection method based on adaptive neighborhood search according to claim 1, characterized in that, In step 14, a neighborhood search based on adaptive step size is performed to generate a new solution. The steps are as follows: Step 14.1, in [0, Randomly generate two distinct positive integers within the range. and ; Step 14.2: Generate a random real number in the range [0, 1]. ; Step 14.3: Generate a new solution based on formula (4). : (4) in The first in the population Individual, The first in the population Individuals, real numbers The result is calculated according to formula (5): (5) in, It is a random real number in the range [0,1]. It is an adaptive step size.

4. The image edge detection method based on adaptive neighborhood search according to claim 1, characterized in that, In step 16, the cross-pollination probability of the current individual is updated. Cross-pollination coefficient and adaptive step size The steps are as follows: Step 16.1, if a new solution The fitness value is less than that of an individual in the population. If the value is suitable, proceed to step 16.2; otherwise, proceed to step 16.

4. Step 16.2, Keep , ,as well as constant; Step 16.3, proceed to step 17; Step 16.4, settings ,in It is a random real number in the range [0, 1]. Step 16.5, Settings ,in It is a random real number in the range [0, 1]. Step 16.6, update according to formula (6) : (6) Where sin is the sine function and cos is the cosine function. Pi The adaptive midpoint is calculated according to formula (7). Value: (7) Step 16.7, if If the value is less than 1.0, proceed to step 17; otherwise, proceed to step 16.

8. Step 16.8, update according to formula (8) : (8) in It is a random real number in the range [0, 1]. Step 16.9, proceed to step 17.