Matrix generation method, image classification method, device, electronic equipment and medium
By generating and processing random pulse matrices of electronic noise signals and image pixel information, the problem of insufficient true randomness of random pulse matrices in existing technologies is solved, thereby improving the processing speed and accuracy of image classification models and reducing the waste of computing resources.
Patent Information
- Application Number
- CN202411079488.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-08-07
AI Technical Summary
In existing technologies, the random pulse matrix obtained by directly encoding pixel values in an image has low true randomness, resulting in poor performance of image classification models, slow processing speed, and low accuracy, thus wasting computational resources.
By acquiring an electronic noise signal set, a random noise signal is generated, and an image probability matrix is generated based on image pixel information. Through multiple loop processing, a random pulse sub-matrix is generated to improve the true randomness of the random pulse matrix. Finally, it is stored in a database for image classification model training.
It improves the performance of image classification models, increases processing speed and accuracy, and reduces the waste of computing resources.
Smart Images

Figure CN119068203B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of this disclosure relate to the field of computer technology, and more specifically to matrix generation methods, image classification methods, apparatus, electronic devices, and media. Background Technology
[0002] Image classification is an image processing method that distinguishes different categories of image targets based on the different features reflected in image information. Currently, the common approach for image classification is as follows: First, the pixel values in the image are encoded to obtain a random pulse matrix. Then, feature extraction is performed on the obtained random pulse matrix, and the extracted features are fused. Next, the fused features are used to train a classifier. Finally, the trained classifier is used to classify the image.
[0003] However, when classifying images using the above method, the following technical problems often arise:
[0004] First, the random pulse matrix obtained by directly encoding the pixel values in the image has low true randomness, which leads to poor performance of the image classification model generated by the random pulse matrix. Consequently, the processing speed and accuracy of image classification using the model are slow, resulting in a waste of computing resources.
[0005] Second, generating a random pulse matrix based solely on pixel values in an image results in low true randomness of the generated random pulse matrix, which in turn leads to low accuracy and reliability of image classification processing, resulting in a waste of computational resources.
[0006] Third, the random pulse matrix obtained by directly encoding the pixel values in the image has poor image information capture ability, resulting in image information loss or repeated capture, which in turn leads to poor performance of the generated image classification model, low accuracy when using the model for image classification, and waste of computing resources.
[0007] The information disclosed in this background section is only intended to enhance the understanding of the background of the inventive concept, and therefore may contain information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0008] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0009] Some embodiments of this disclosure provide a method for generating random pulse matrices for training image classification models, an image classification method, a device for generating random pulse matrices for training image classification models, an image classification device, an electronic device, and a computer-readable medium to solve one or more of the technical problems mentioned in the background section above.
[0010] In a first aspect, some embodiments of this disclosure provide a method for generating a random pulse matrix for training an image classification model. The method includes: acquiring an electronic noise signal set; generating various random noise signals based on at least one electronic noise signal in the electronic noise signal set; generating an image probability matrix corresponding to the image pixel information based on pre-stored image pixel information, wherein the image pixel information corresponds to image category information; and performing the following first cyclic steps based on each random noise signal: updating a preset number of pulse matrix generation times based on a preset value; and inputting a preset number of random noise signals from each random noise signal into a noise signal acquisition unit to obtain each noise signal corresponding to the preset number of random noise signals. Based on the aforementioned image probability matrix, activation signals are generated; based on the aforementioned noise signals and activation signals, probability signal groups are generated; based on the aforementioned probability signal groups, random pulse sub-matrices are generated; in response to the determination that the number of times the updated pulse matrix has been generated does not meet a preset loop condition, the random pulse sub-matrices are added to the random pulse sub-matrices set to update the random pulse sub-matrices set; in response to the determination that the number of times the updated pulse matrix has been generated meets the preset loop condition, the first loop step is executed again; based on the updated random pulse sub-matrices set, a random pulse matrix is generated; the random pulse matrix and the image category information corresponding to the aforementioned image pixel information are stored in a preset database for use in training an image classification model.
[0011] Secondly, some embodiments of this disclosure provide an image classification method, which includes: acquiring an image dataset; segmenting foreground target images of each image data in the image dataset to obtain a foreground target image set; for each foreground target image in the foreground target image set, performing the following steps: determining each pixel in the foreground target image as a corresponding foreground target image pixel matrix; generating a random pulse matrix corresponding to the foreground target image pixel matrix based on the foreground target image pixel matrix; inputting the generated random pulse matrix into a pre-trained image classification model to obtain image category information corresponding to the random pulse matrix, wherein the image classification model is trained based on random pulse matrices stored in a preset database, and the random pulse matrices stored in the preset database are generated by the method described in any implementation of the first aspect; and determining the category corresponding to the foreground target image based on the image category information.
[0012] Thirdly, some embodiments of this disclosure provide a random pulse matrix generation apparatus for training an image classification model. The apparatus includes: an acquisition unit configured to acquire an electronic noise signal set; a first generation unit configured to generate random noise signals based on at least one electronic noise signal in the electronic noise signal set; a second generation unit configured to generate an image probability matrix corresponding to the image pixel information based on pre-stored image pixel information, wherein the image pixel information corresponds to image category information; and an execution unit configured to perform the following first cyclic steps based on each random noise signal: updating a preset number of pulse matrix generation times based on a preset value; and inputting a preset number of random noise signals from each random noise signal into a noise signal acquisition unit to obtain the preset number of random noise signals. The corresponding noise signals are generated; based on the above image probability matrix, activation signals are generated; based on the above noise signals and activation signals, probability signal groups are generated; based on the above probability signal groups, random pulse sub-matrices are generated; in response to determining that the number of times the updated pulse matrix is generated does not meet the preset loop condition, the random pulse sub-matrices are added to the random pulse sub-matrices set to update the random pulse sub-matrices set; in response to determining that the number of times the updated pulse matrix is generated meets the preset loop condition, the first loop step is executed again; the third generation unit is configured to generate a random pulse matrix based on the updated random pulse sub-matrices set; the storage unit is configured to store the random pulse matrix and the image category information corresponding to the above image pixel information in a preset database for training of an image classification model.
[0013] Fourthly, some embodiments of this disclosure provide an image classification apparatus, comprising: an acquisition unit configured to acquire an image dataset; a segmentation unit configured to segment foreground target images of each image data in the image dataset to obtain a foreground target image set; and an execution unit configured to perform the following steps for each foreground target image in the foreground target image set: determining each pixel in the foreground target image as a corresponding foreground target image pixel matrix; generating a random pulse matrix corresponding to the foreground target image pixel matrix based on the foreground target image pixel matrix; inputting the generated random pulse matrix into a pre-trained image classification model to obtain image category information corresponding to the random pulse matrix, wherein the image classification model is trained based on random pulse matrices stored in a preset database, and the random pulse matrices stored in the preset database are generated by the method described in any implementation of the first aspect; and determining the category corresponding to the foreground target image based on the image category information.
[0014] Fifthly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first or second aspect above.
[0015] Sixthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first or second aspect above.
[0016] The above embodiments of this disclosure have the following beneficial effects: The random pulse matrix generation method for image classification model training according to some embodiments of this disclosure can improve the performance of image classification models generated using random pulse matrices, increase the processing speed of image data processing using the model, and improve the accuracy of image classification. Specifically, the reason for poor performance of image classification models, leading to slow processing speed and low accuracy in image data processing, is that the true randomness of the random pulse matrix obtained by directly encoding pixel values in the image is low. This results in poor performance of the image classification model generated using the random pulse matrix, leading to slow processing speed and low accuracy in image classification, thus wasting computational resources. Based on this, the random pulse matrix generation method for image classification model training according to some embodiments of this disclosure first obtains an electronic noise signal set. This provides the data basis for generating random noise signals. Then, based on at least one electronic noise signal in the electronic noise signal set, various random noise signals are generated. This allows for various processing of the electronic noise signals, increasing the complexity and diversity of the signals, thereby enhancing the true randomness of the obtained random pulse matrix. Then, based on the pre-stored image pixel information, an image probability matrix corresponding to the aforementioned image pixel information is generated, where the aforementioned image pixel information corresponds to image category information. This allows image data to be converted into a probability matrix, better capturing image pixel information, thereby improving the true randomness of the generated random pulse matrix and enhancing the performance of the image classification model generated using the random pulse matrix. Based on each random noise signal, the following first loop step is executed: First, based on a preset value, the preset number of pulse matrix generation iterations is updated. This allows the loop count to be controlled by adjusting the number of pulse matrix generation iterations. Then, a preset number of random noise signals from each random noise signal are input into a noise signal acquisition unit to obtain each noise signal corresponding to the preset number of random noise signals. This allows the preset number of noise signals to be processed to be obtained from each random noise signal. Then, based on the aforementioned image probability matrix, each activation signal is generated. This allows image data to be converted into signal form, and each probability signal group is generated using the activation signals converted from the image and the aforementioned noise signals, thereby generating a random pulse sub-matrix. Then, based on the aforementioned noise signals and the aforementioned activation signals, each probability signal group is generated. Therefore, by randomly processing each noise signal and each activation signal, random probability signals can be obtained, which can effectively improve the true randomness of the subsequently generated random pulse matrix, improve the performance of the image classification model generated using the random pulse matrix, and thus improve the processing speed and accuracy when using the model for image classification. Then, based on the above probability signal groups, a random pulse sub-matrix is generated.Therefore, by randomly combining the obtained random pulse sub-matrices, the final random pulse matrix can be obtained, thus improving the true randomness of the generated random pulse matrix. Then, in response to the determination that the number of times the updated pulse matrix has been generated does not meet the preset loop condition, the random pulse sub-matrices are added to the random pulse sub-matrice set to update the set. This allows the random pulse sub-matrice set to reflect the updated noise and activation signals, thereby improving the performance of the image classification model generated using the random pulse matrix and increasing the processing speed and accuracy of the subsequently generated image classification model. Then, in response to the determination that the number of times the updated pulse matrix has been generated meets the preset loop condition, the first loop step is executed again. Based on the updated random pulse sub-matrice set, a random pulse matrix is generated. This results in a random pulse matrix with even higher true randomness, further improving the performance of the subsequently trained image classification model, increasing the processing speed and accuracy of image classification, and reducing computational resource waste. Finally, the random pulse matrix and the image category information corresponding to the image pixel information are stored in a preset database for use in training the image classification model. Therefore, training the model using a random pulse matrix with higher true randomness can improve the processing speed and accuracy of the image classification model generated by the random pulse matrix, thereby reducing computational resource waste. Because the noise signal used to generate the random pulse matrix is obtained through multiple optimization processes on the electronic noise signal, and the activation signal is obtained through random processing of image pixel information, the random pulse matrix generated using these noise and activation signals has high true randomness. Furthermore, since the random pulse matrix is generated by randomly processing each noise and activation signal, its high true randomness leads to higher performance of the trained image classification model, thus improving the processing speed and accuracy of image classification. In summary, by processing image pixel information and electronic noise signals, the true randomness of the random pulse matrix can be improved, enhancing the performance of the image classification model generated by the random pulse matrix, thereby increasing the processing speed and accuracy of image classification and reducing computational resource waste. Attached Figure Description
[0017] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0018] Figure 1This is a flowchart of some embodiments of the random impulse matrix generation method for training image classification models according to the present disclosure;
[0019] Figure 2 This is a flowchart of some embodiments of the image classification method according to the present disclosure;
[0020] Figure 3 This is a schematic diagram of the structure of some embodiments of the random pulse matrix generation apparatus for training image classification models according to the present disclosure;
[0021] Figure 4 These are schematic diagrams illustrating the structure of some embodiments of the image classification apparatus according to the present disclosure;
[0022] Figure 5 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation
[0023] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0024] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0025] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0026] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0027] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0028] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0029] Figure 1A flow 100 of some embodiments of a random impulse matrix generation method for training an image classification model according to the present disclosure is shown. The random impulse matrix generation method for training an image classification model includes the following steps:
[0030] Step 101: Obtain the electronic noise signal set.
[0031] In some embodiments, the execution entity (e.g., a computing device) of the random impulse matrix generation method for training an image classification model can acquire a set of electronic noise signals. The execution entity can be a server that generates the random impulse matrix. The electronic noise signals in the electronic noise signal set can be analog signals corresponding to noise generated by resistors in a circuit. In practice, the execution entity can acquire the electronic noise signal set from a data storage server. The data storage server can be a server used for managing and storing electronic noise signals.
[0032] Step 102: Generate various random noise signals based on at least one electronic noise signal in the electronic noise signal set.
[0033] In some embodiments, the execution entity may generate various random noise signals based on at least one electronic noise signal from an electronic noise signal set. These random noise signals may be digital signals obtained by processing the electronic noise signals.
[0034] In some optional implementations of certain embodiments, the aforementioned execution entity may generate various random noise signals based on at least one electronic noise signal from an electronic noise signal set through the following steps:
[0035] First, based on the electronic noise signal set, perform the following second loop step:
[0036] The first sub-step involves amplifying the electronic noise signal within the electronic noise signal concentration to obtain a current noise signal. This current noise signal can be an analog signal obtained by amplifying the current in the electronic noise signal. In practice, the executing entity can first input the electronic noise signal into a common-collector amplifier circuit. Then, the common-collector amplifier circuit can amplify the current in the electronic noise signal to obtain the current noise signal.
[0037] The second sub-step involves stepping down the current noise signal to obtain a stepped-down noise signal. This stepped-down noise signal can be an analog signal obtained by processing the current noise signal. In practice, firstly, the executing entity can input the current noise signal output from the common-collector amplifier circuit into a diode. Then, utilizing the reverse breakdown property of the diode, the signal corresponding to a voltage below the regulated voltage value in the current noise signal is forward-biased, while the signal corresponding to a voltage above the regulated voltage value is reverse-biased, thereby achieving voltage limiting of the current noise signal and obtaining a stepped-down noise signal. The regulated voltage value can be a preset value. The specific setting of the regulated voltage value is not limited here.
[0038] The third sub-step involves amplifying the aforementioned stepped-down noise signal to obtain an amplified noise signal. This amplified noise signal can be an analog signal obtained by amplifying the stepped-down noise signal. In practice, the executing entity first inputs the stepped-down noise signal into a transistor amplifier circuit. Then, the amplitude of the stepped-down noise signal is amplified by the transistor amplifier circuit, thereby achieving the purpose of amplifying the stepped-down noise signal and obtaining the amplified noise signal.
[0039] The fourth sub-step involves performing signal conversion processing on the amplified noise signal to obtain a binary noise signal. This binary noise signal can be a digital signal obtained by signal conversion of the amplified noise signal. In practice, the executing entity can use a signal converter to convert the amplified noise signal into the binary noise signal. This signal converter can be any electronic component capable of converting analog signals into digital signals. For example, the signal converter can be an analog-to-digital converter.
[0040] The fifth sub-step involves performing digital extraction processing on the aforementioned binary noise signal to obtain a binary digit. This binary digit can be any digit in the aforementioned binary noise signal. For example, the binary digit can be 0 or 1. In practice, the executing entity can use bit manipulation instructions in a programming language to extract the last bit of each of the aforementioned binary signal information to obtain the binary signal. For example, when the aforementioned binary noise signal is '10010010', the extracted binary signal is a 0 at the last bit of the binary noise signal. When the aforementioned binary noise signal is '10001111', the extracted binary signal is a 1 at the last bit of the binary noise signal.
[0041] The sixth sub-step involves adding the aforementioned binary digits to the binary digit sequence to update it. In practice, the executing entity can switch between storing and sending data in the register using a clock signal of a preset frequency. This allows the extracted binary digits to be stored in the register and sent to the binary digit sequence. The preset frequency can be a pre-defined value. The specific setting of this preset frequency is not limited here.
[0042] The seventh sub-step, in response to determining that the updated binary code sequence satisfies a preset sequence condition, identifies the updated binary code sequence as a random noise signal and clears the updated binary signal sequence. The preset sequence condition can be that the number of binary codes in the updated binary code sequence equals a preset number of codes. This preset number of codes can be a pre-set value. The specific setting of the preset number of codes is not limited here.
[0043] The eighth sub-step, in response to the determination that the number of times the second loop step has been executed does not meet a preset number condition, uses unused electronic noise signals to form an electronic noise signal set, and executes the second loop step again. The preset number condition can be that the number of times the second loop step has been executed is greater than or equal to a preset number. The preset number can be a pre-set value. Here, the specific setting of the preset number is not limited.
[0044] Step 103: Generate an image probability matrix corresponding to the image pixel information based on the pre-stored image pixel information.
[0045] In some embodiments, the execution entity can generate an image probability matrix corresponding to the pre-stored image pixel information. The image pixel information corresponds to image category information. The image pixel information can be information corresponding to each pixel in the image. The image pixel information can include, but is not limited to: image size, each pixel in the image, the pixel value corresponding to each pixel in the image, and the coordinates of each pixel in the image. The length and width corresponding to the image size can be obtained in pixels. The coordinates of each pixel in the image can be obtained with the first pixel at the top left corner of the image as the origin, the horizontal direction to the right of the image as the x-axis, and the vertical direction downwards of the image as the y-axis. The image probability matrix can be a matrix obtained by normalizing the image pixel matrix corresponding to the image pixel information. The image pixel matrix can be a matrix corresponding to the pixels and pixel values in the image pixel information. The image category information can be a label used to characterize the category of the image. For example, the image category information can be "fruit".
[0046] In some optional implementations of certain embodiments, the execution entity can generate an image probability matrix corresponding to the image pixel information based on pre-stored image pixel information through the following steps:
[0047] The first step is to generate an image pixel matrix based on pre-stored image pixel information. In practice, firstly, the execution entity can determine the number of rows and columns of the image pixel matrix using the image size included in the image pixel information. For example, when the image size is 20*30, the image pixel matrix can be a 30-row, 20-column matrix. Then, for each pixel in the image pixel information, the execution entity can determine the pixel's position in the matrix using its coordinates. Then, the pixel value corresponding to the pixel can be determined as the element value at the corresponding position. Finally, the resulting matrix can be defined as the image pixel matrix. As an example: when a pixel's coordinates are (0, 1) and its corresponding pixel value is 255, the element value at the position in the second row of the first column of the matrix is 255. When a pixel's coordinates are (3, 6) and its corresponding pixel value is 100, the element value at the position in the seventh row of the fourth column of the matrix is 100.
[0048] The second step involves normalizing each element of the image pixel matrix based on a preset normalization value to obtain an image probability matrix. This preset normalization value can be a pre-defined numerical value. The specific setting of this preset normalization value is not limited. For example, it could be 255. The image probability matrix can be the same size as the image pixel matrix, obtained by processing each element of the image pixel matrix. In practice, the executing entity can divide the value of each element in the image pixel matrix by the preset normalization value to obtain the image probability matrix. For example, if the value of the element in the 3rd row and 5th column of the image probability matrix is 204, and the preset normalization value is 255, dividing 204 by 255 yields 0.8, which is the element in the 3rd row and 5th column of the image probability matrix.
[0049] Step 104: Based on each random noise signal, perform the following first loop step:
[0050] Step 1041: Update the preset number of pulse matrix generation times based on preset values.
[0051] In some embodiments, the execution entity can update a preset pulse matrix generation count based on a preset value. The preset value can be a pre-defined value. Here, the specific setting of the preset value is not limited. The preset pulse matrix generation count can be a pre-defined value representing the number of cycles. Here, the specific setting of the preset pulse matrix generation count is not limited. In practice, the execution entity can determine the updated pulse matrix generation count by summing the pulse matrix generation count and the preset value. For example, when the pulse matrix generation count is 2 and the preset value is 1, 2 plus 1 can be used to obtain 3 as the updated pulse matrix generation count.
[0052] Step 1042: Input a preset number of random noise signals from each random noise signal into the noise signal acquisition device to obtain each noise signal corresponding to the preset number of random noise signals.
[0053] In some embodiments, the execution entity can input a preset number of random noise signals from among the various random noise signals into a noise signal acquisition device to obtain each noise signal corresponding to the preset number of random noise signals. The preset number can be a pre-set value. Here, the specific setting of the preset number is not limited. The noise signal acquisition device can be an electronic device for receiving noise signals. For example, the noise signal acquisition device can be a microcontroller. The noise signal can be a random noise signal input into the noise signal acquisition device.
[0054] Step 1043: Generate each activation signal based on the image probability matrix.
[0055] In some embodiments, the execution entity may generate various activation signals based on the image probability matrix. These activation signals may be binary data obtained from the image probability matrix.
[0056] In some optional implementations of certain embodiments, the execution entity may generate each activation signal based on the aforementioned image probability matrix through the following steps:
[0057] The first step is to determine a preset number of probability matrix elements in the aforementioned image probability matrix that satisfy a preset selection condition as each target probability matrix element. The preset selection condition can be that the probability matrix element has not been selected before. The preset number can be a pre-set value. Here, the specific setting of the preset number is not limited. The preset selection number can be a pre-set value. Here, the specific setting of the preset selection number is not limited. The probability matrix element can be one element in the aforementioned image probability matrix.
[0058] The second step is to perform the following steps for each element of the target probability matrix mentioned above:
[0059] The first sub-step involves determining the activation signal probability value by multiplying the elements of the target probability matrix by a preset activation probability value. This preset activation probability value can be a pre-defined value. The specific setting of this preset activation probability value is not limited here.
[0060] The second sub-step involves performing signal conversion processing on the aforementioned activation probability values to obtain the activation signal. In practice, the executing entity can convert the activation probability values into binary data and use the converted binary data as the activation signal.
[0061] The above-described technical solution and its related content, as an inventive point of this disclosure, solve the third technical problem mentioned in the background: "The random pulse matrix obtained by directly encoding pixel values in an image has poor image information capture capability, leading to image information loss or repeated image information capture, which in turn results in poor performance of the generated image classification model, low accuracy when using the model for image classification, and waste of computational resources." The factors leading to low accuracy in image classification and wasted computational resources are often as follows: The random pulse matrix obtained by directly encoding pixel values in an image has poor image information capture capability, leading to image information loss or repeated image information capture, which in turn results in poor performance of the generated image classification model, low accuracy when using the model for image classification, and waste of computational resources. Solving these factors can improve model performance, increase the accuracy when using the model for image classification, and reduce wasted computational resources. To achieve this effect, this disclosure determines a preset number of probability matrix elements in the above-described image probability matrix that meet preset selection conditions as each target probability matrix element. Therefore, previously unselected probability matrix elements can be selected from the image probability matrix, avoiding the selection of duplicate probability matrix elements and preventing the problem of repeated acquisition of image information. Then, for each element of the aforementioned target probability matrix, the following steps are performed: First, the product of the aforementioned target probability matrix element and a preset activation probability value is determined as the activation signal probability value. This allows for control of the intensity of subsequently generated activation signals by introducing a preset activation probability value, thereby improving the effectiveness of the generated activation signals. The activation probability value is then subjected to signal conversion processing to obtain the activation signal. Thus, the corresponding activation signal can be generated from the probability matrix elements in the image probability matrix. Furthermore, because previously unselected probability matrix elements can be selected first, and then the selected probability matrix elements are processed, the problem of repeatedly acquiring image information can be avoided, improving the performance of the generated image classification model. Also, because the above steps can be iteratively executed until all probability matrix elements have been processed before generating the random pulse matrix, the problem of image information loss can be avoided, improving the performance of the generated image classification model, increasing the accuracy of image classification using the model, and reducing computational resource waste.
[0062] Step 1044: Generate each probability signal group based on each noise signal and each activation signal.
[0063] In some embodiments, the execution entity can generate various probability signal groups based on the noise signals and activation signals. The probability signals in each probability signal group can be level signals representing high and low voltage levels in a circuit. These probability signals can be either high-level or low-level signals.
[0064] In some optional implementations of certain embodiments, the execution entity may generate various probability signal groups based on the noise signals and activation signals through the following steps:
[0065] The first step is to perform bit-separation processing on each of the aforementioned noise signals to obtain separate bit-separated signals. These separate bit-separated signals can be digital signals obtained after bit-separating the noise signals. In practice, the executing entity can use a splitter to perform bit-separation processing on the high and low bits of the noise signals to obtain separate bit-separated signals. For example, when a noise signal is '1010110111010101', the executing entity can use a splitter to perform bit-separation processing on the high eight bits and low eight bits of the noise signal, resulting in '10101101' and '11010101', which are the two separate bit-separated signals.
[0066] The second step is to perform the following steps for each of the activation signals:
[0067] The first sub-step involves bit-separation processing of the activation signal to obtain the high-order bits and the mantissa of the activation signal. The high-order bits can be any digit in the activation signal. The mantissa can be the binary data obtained after bit-separation processing. In practice, the execution entity can use a splitter to perform bit-separation processing on the activation signal to obtain the high-order bits and the mantissa. For example, when an activation signal is '111010101', the execution entity can first use a splitter to separate the high-order bit and the low-order octets. Then, the resulting '1' can be determined as the high-order bits of the activation signal, and the resulting '11010101' can be determined as the mantissa.
[0068] The second sub-step involves performing the following steps for every two bit-separated signals in each bit-separated signal:
[0069] Sub-step one involves determining the sum of the two bit-separated signals as the summation noise signal. In practice, the execution entity can use an arithmetic logic unit to perform binary addition on the two bit-separated signals. The resulting sum can then be determined as the summation noise signal. For example, when one bit-separated signal is "10101101" and the other is "11010101", the summation noise signal obtained through binary addition is "110000010".
[0070] Sub-step two involves performing bit separation processing on the aforementioned summed noise signal to obtain the noise signal carry and noise signal mantissa. The noise signal carry can be a binary signal obtained after bit separation processing of the aforementioned summed noise signal. The noise signal mantissa can also be a binary signal obtained after bit separation processing of the aforementioned summed noise signal. In practice, the executing entity can use a splitter to perform bit separation processing on the aforementioned summed noise signal to obtain the noise signal carry and noise signal mantissa. For example, when the aforementioned summed noise signal is '110010101', the executing entity can use a splitter to determine the separated high-order bit '1' as the noise signal carry. Then, the separated '10010101' can be determined as the noise signal mantissa.
[0071] Sub-step three involves comparing the carry-in number of the noise signal with the high-order number of the activation signal to obtain a first comparison result. This first comparison result can be label information characterizing the relationship between the carry-in number of the noise signal and the high-order number of the activation signal. For example, the first comparison result could be "the carry-in number of the noise signal is greater than the high-order number of the activation signal".
[0072] Sub-step four: Based on the first comparison result, generate a level signal corresponding to the first comparison result as a first level signal. The first level signal can be a level signal used to characterize the first comparison result. For example, when the first comparison result is "the noise signal carry-in is greater than the high-order bits of the activation signal" or "the noise signal carry-in is equal to the high-order bits of the activation signal," the output first level signal is a low-level signal. When the first comparison result is "the noise signal carry-in is less than the high-order bits of the activation signal," the output first level signal is a high-level signal.
[0073] Sub-step five involves comparing the tail number of the noise signal and the tail number of the activation signal to obtain a second comparison result. This second comparison result can be label information characterizing the relationship between the tail number of the noise signal and the tail number of the activation signal. For example, the second comparison result could be "the tail number of the noise signal is greater than the tail number of the activation signal".
[0074] Sub-step six: Based on the second comparison result, generate a level signal corresponding to the second comparison result as a second level signal. This second level signal can be a level signal used to characterize the second comparison result. For example, when the second comparison result is "the tail of the noise signal is greater than the tail of the active signal," a high-level signal is output. When the second comparison result is "the tail of the noise signal is less than the tail of the active signal" or "the tail of the noise signal is equal to the tail of the active signal," a low-level signal is output.
[0075] Sub-step seven: Based on the aforementioned first-level signal and second-level signal, generate a probability signal. This probability signal can be a level signal used to characterize the logical relationship between the first-level signal and the second-level signal. In practice, the executing entity can perform an AND operation on the first-level signal and the second-level signal to obtain the probability signal.
[0076] The third sub-step involves determining the generated probability signals into a probability signal group.
[0077] The above-described technical solution and its related content, as an inventive point of this disclosure, solve the second technical problem mentioned in the background: "Generating a random pulse matrix solely based on pixel values in an image results in low true randomness of the generated random pulse matrix, leading to low accuracy and reliability in image classification processing and wasting computational resources." Factors leading to low accuracy and reliability in image classification processing and wasting computational resources often include: generating a random pulse matrix solely based on pixel values in an image results in low true randomness of the generated random pulse matrix, leading to low accuracy and reliability in image classification processing and wasting computational resources. Solving these factors can improve the model's generalization ability and prediction accuracy. To achieve this effect, this disclosure performs the following steps for each sample user-item interaction feature information in each sample user-item interaction feature information: First, bit separation processing is performed on each of the above noise signals to obtain bit-separated signals. Therefore, by introducing noise signals with high true randomness and performing bit separation processing on the noise signals, the true randomness of the subsequently generated probability signals can be improved, thereby improving the true randomness of the random pulse matrix generated using the probability signals and enhancing the accuracy and reliability of image classification processing. Then, for each activation signal, the following steps are performed: First, bit separation processing is performed on the activation signal to obtain the high-order bits and the mantissa of the activation signal. This provides a data basis for subsequent processing. Next, for every two bit-separated signals, the following steps are performed: First, the sum of the two bit-separated signals is determined as an additive noise signal. This increases the diversity and complexity of the noise signal, resulting in a higher degree of true randomness in the generated activation signal. Then, bit separation processing is performed on the additive noise signal to obtain the noise signal carry-in and noise signal mantissa. This provides a data basis for subsequent processing. Then, the noise signal carry-in and the activation signal high-order bits are compared to obtain a first comparison result. This comparison allows for better signal control, improves the true randomness of the generated activation signal, and ultimately enhances the true randomness of the random pulse matrix. Next, based on the first comparison result, a level signal corresponding to the first comparison result is generated as a first level signal. Thus, a level signal corresponding to the first comparison result can be obtained. Then, the tail number of the noise signal and the tail number of the activation signal are compared to obtain a second comparison result. Therefore, by comparing the tail number of the noise signal and the tail number of the activation signal, subtle differences in the signal can be better captured, further improving the true randomness of the random pulse matrix.Then, based on the second comparison result, a level signal corresponding to the second comparison result is generated as the second level signal. Thus, the level signal corresponding to the second comparison result can be obtained. Next, based on the first level signal and the second level signal, a probability signal is generated. Thus, through the first level signal and the second level signal, a probability signal with higher true randomness can be obtained, leading to a random pulse matrix with higher true randomness, improving the accuracy and reliability of image classification processing, and reducing computational resource waste. Finally, the generated probability signals are defined as probability signal groups. Because the noise signal is obtained through continuous optimization processing of the analog signal corresponding to the noise generated by the resistor in the circuit, the noise signal has high true randomness, which can improve the true randomness of the generated random pulse matrix, thereby effectively improving the accuracy and reliability of image classification processing. Furthermore, because each noise signal and each activation signal undergoes multiple processing steps to obtain various probability signal groups, and a random pulse matrix is obtained from these probability signal groups, the resulting random pulse matrix has high true randomness, effectively improving the accuracy and reliability of image classification processing and saving computational resources.
[0078] Step 1045: Generate a random pulse submatrix based on each probability signal group.
[0079] In some embodiments, the execution entity can generate a random pulse sub-matrix based on the aforementioned probability signal groups. The random pulse sub-matrix can be a three-dimensional matrix obtained from the aforementioned probability signal groups. In practice, firstly, the execution entity can determine any one of the aforementioned probability signal groups as the target probability signal group. Then, it can determine each probability signal group other than the target probability signal group as a pair of comparison probability signal groups. Next, for each target probability signal in the target probability signal group, the target probability signal can be determined as a probability signal to be added. Then, for each pair of comparison probability signal groups, the comparison probability signal corresponding to the probability signal to be added in the comparison probability signal group can be determined as a probability signal to be combined. Finally, the probability signal to be added and the determined probability signals to be combined can be randomly combined into a matrix with one row per row and the number of columns equal to the sum of the number of the probability signals to be combined and the probability signals to be added, serving as a signal matrix. Then, for any one of the obtained signal matrices, the execution entity can use a library function to determine the direction perpendicular to the rows and columns of the signal matrix as the superposition direction. Next, the execution entity can use the same library function to superimpose another signal matrix onto the first signal matrix along the superposition direction, resulting in a two-layer signal matrix. Then, the execution entity can superimpose a third signal matrix onto the two-layer signal matrix along the same superposition direction, resulting in a three-layer signal matrix. This process continues until all signal matrices are superimposed, and the resulting matrix is determined as a random pulse submatrix. The library function mentioned above can be the `np.stack` function.
[0080] Step 1046: In response to the determination that the number of times the updated pulse matrix is generated does not meet the preset loop condition, the set of random pulse submatrices is updated by adding random pulse submatrices to the set of random pulse submatrices.
[0081] In some embodiments, the execution entity may update the random pulse submatrix set by adding the random pulse submatrix to the random pulse submatrix set in response to determining that the number of times the updated pulse matrix is generated does not meet a preset loop condition. The preset loop condition may be that the number of times the updated pulse matrix is generated is less than or equal to a preset loop number. The preset loop number may be a pre-set value. Here, the specific setting of the preset loop number is not limited.
[0082] Step 1047: In response to the determination that the number of times the updated pulse matrix is generated satisfies the preset loop condition, the first loop step is executed again.
[0083] In some embodiments, the execution entity may, in response to determining that the number of times the updated pulse matrix has been generated satisfies a preset loop condition, execute the first loop step again.
[0084] Step 105: Generate a random pulse matrix based on the updated set of random pulse submatrices.
[0085] In some embodiments, the execution entity can generate a random pulse matrix based on the updated set of random pulse sub-matrices. This random pulse matrix can be a three-dimensional matrix obtained by processing each random pulse sub-matrice in the set. In practice, for each random pulse sub-matrice, the execution entity can determine any one of them as the initial random pulse sub-matrice. Then, the execution entity can determine the horizontal rightward direction corresponding to each row element of the initial random pulse sub-matrice as the first combined direction. Then, the execution entity can randomly select one random pulse sub-matrice from the remaining random pulse sub-matrices as the second random pulse sub-matrice. Then, the second random pulse sub-matrice can be concatenated to the initial random pulse sub-matrice along the first combined direction using library functions. Then, unconcatenated random pulse sub-matrices can be concatenated to the second random pulse sub-matrice along the first combined direction. This process continues until the number of columns in the resulting concatenated matrix equals a preset number of columns. At this point, the vertical downward direction corresponding to each row element of the initial random pulse sub-matrice can be determined as the second combined direction using library functions. Then, a random pulse submatrix can be selected from the unjoined random pulse submatrixes as the third random pulse submatrix. Next, this third random pulse submatrix can be joined along the second combination direction. Then, the horizontal rightward direction corresponding to each row element of the third random pulse submatrix can be determined as the third combination direction. Then, the unjoined random pulse submatrixes can be joined along the third combination direction. When the number of columns in the joined matrix is again equal to the preset number of columns, the vertical downward direction corresponding to each row element of the third random pulse submatrix can be determined as the fourth combination direction. Then, an unjoined random pulse submatrix can be determined as the fourth random pulse submatrix. Then, the fourth random pulse submatrix can be joined to the third random pulse submatrix along the fourth combination direction using the library function. Then, the horizontal rightward direction corresponding to each row element of the fourth random pulse submatrix can be determined as the fifth combination direction. Then, the unjoined random pulse submatrixes can be joined along the fifth combination direction. This process continues until the last random pulse submatrix is joined. Finally, the resulting concatenated matrix is determined to be a random pulse matrix. The preset number of columns can be a pre-defined value. Here, the specific setting of the preset number of columns is not limited. The library function mentioned above can be the `np.stack` function.
[0086] Step 106: Store the image category information corresponding to the random pulse matrix and image pixel information into a preset database for use in training the image classification model.
[0087] In some embodiments, the execution entity may store the random pulse matrix in a preset database for training an image classification model. The preset database may be a pre-defined database for storing random pulse matrices. The image classification model may be a neural network that takes the random pulse matrix corresponding to the image as input and the feature vector corresponding to the image as output. For example, the neural network may be a spiking neural network.
[0088] In some optional implementations of certain embodiments, the image classification model described above can be trained by the aforementioned execution entity through the following steps:
[0089] The first step is to obtain a sample set from the aforementioned preset database. The samples in the sample set include images, sample random pulse matrices corresponding to the image pixel information within the images, and sample image category information. The sample random pulse matrix can be the random pulse matrix corresponding to the images in the samples. The sample image category information can be the image category information corresponding to the images in the samples.
[0090] The second step involves performing the following training steps based on the sample set:
[0091] The first sub-step involves inputting the random impulse matrices corresponding to the images of at least one sample in the sample set into an initial neural network to obtain image category information for each of the at least one sample. The initial neural network includes a feature extraction network and an output layer. The feature extraction network can be any neural network capable of extracting features from the random impulse matrices. For example, the feature extraction network can be a spiking neural network. The output layer can be an activation function that maps the extracted features to the probability that the image belongs to each image label. For example, the activation function can be a normalized exponential function (softmax).
[0092] The second sub-step involves comparing the image category information corresponding to each of the at least one sample with the corresponding sample image category information. In practice, firstly, the executing entity can generate a probability distribution of the image category information corresponding to each of the at least one sample using a normalized exponential function. Then, the executing entity can generate a probability distribution of the sample image category information corresponding to each of the at least one sample using a normalized exponential function. Finally, the executing entity can generate a loss value between the probability distribution of the image category information corresponding to each of the at least one sample and the probability distribution of the corresponding sample image category information using a cross-entropy loss function.
[0093] The third sub-step determines whether the initial neural network has reached the preset optimization objective based on the comparison results. For example, when the loss value between the image category information corresponding to a sample and the corresponding sample image category information is less than a preset loss threshold, the sample is identified as a positive sample. Here, the positive sample can be used to represent samples that meet the loss value condition. The loss value condition can be that the loss value between the image category information corresponding to a sample and the corresponding sample image category information is less than a preset loss threshold. The optimization objective can be that the proportion of positive samples in all samples is greater than a preset accuracy threshold. The loss threshold can be a pre-set value. Here, the specific setting of the loss threshold is not limited. The accuracy threshold can also be a pre-set value. Here, the specific setting of the accuracy threshold is not limited.
[0094] The fourth sub-step, in response to determining that the initial neural network achieves the above optimization objective, identifies the feature extraction network included in the initial neural network as an image classification model.
[0095] The fifth sub-step, in response to the determination that the initial neural network has not achieved the above optimization objective, adjusts the network parameters of the initial neural network, uses unused samples to form a sample set, uses the adjusted initial neural network as the initial neural network, and executes the above training steps again. In practice, the above execution entity can use the backpropagation algorithm (BP algorithm) and gradient descent methods (such as mini-batch gradient descent algorithm) to adjust the network parameters of the initial neural network.
[0096] The above embodiments of this disclosure have the following beneficial effects: The random pulse matrix generation method for image classification model training according to some embodiments of this disclosure can improve the performance of image classification models generated using random pulse matrices, increase the processing speed of image data processing using the model, and improve the accuracy of image classification. Specifically, the reason for poor performance of image classification models, leading to slow processing speed and low accuracy in image data processing, is that the true randomness of the random pulse matrix obtained by directly encoding pixel values in the image is low. This results in poor performance of the image classification model generated using the random pulse matrix, leading to slow processing speed and low accuracy in image classification, thus wasting computational resources. Based on this, the random pulse matrix generation method for image classification model training according to some embodiments of this disclosure first obtains an electronic noise signal set. This provides the data basis for generating random noise signals. Then, based on at least one electronic noise signal in the electronic noise signal set, various random noise signals are generated. This allows for various processing of the electronic noise signals, increasing the complexity and diversity of the signals, thereby enhancing the true randomness of the obtained random pulse matrix. Then, based on the pre-stored image pixel information, an image probability matrix corresponding to the aforementioned image pixel information is generated, where the aforementioned image pixel information corresponds to image category information. This allows image data to be converted into a probability matrix, better capturing image pixel information, thereby improving the true randomness of the generated random pulse matrix and enhancing the performance of the image classification model generated using the random pulse matrix. Based on each random noise signal, the following first loop step is executed: First, based on a preset value, the preset number of pulse matrix generation iterations is updated. This allows the loop count to be controlled by adjusting the number of pulse matrix generation iterations. Then, a preset number of random noise signals from each random noise signal are input into a noise signal acquisition unit to obtain each noise signal corresponding to the preset number of random noise signals. This allows the preset number of noise signals to be processed to be obtained from each random noise signal. Then, based on the aforementioned image probability matrix, each activation signal is generated. This allows image data to be converted into signal form, and each probability signal group is generated using the activation signals converted from the image and the aforementioned noise signals, thereby generating a random pulse sub-matrix. Then, based on the aforementioned noise signals and the aforementioned activation signals, each probability signal group is generated. Therefore, by randomly processing each noise signal and each activation signal, random probability signals can be obtained, which can effectively improve the true randomness of the subsequently generated random pulse matrix, improve the performance of the image classification model generated using the random pulse matrix, and thus improve the processing speed and accuracy when using the model for image classification. Then, based on the above probability signal groups, a random pulse sub-matrix is generated.Therefore, by randomly combining the obtained random pulse sub-matrices, the final random pulse matrix can be obtained, thus improving the true randomness of the generated random pulse matrix. Then, in response to the determination that the number of times the updated pulse matrix has been generated does not meet the preset loop condition, the random pulse sub-matrices are added to the random pulse sub-matrice set to update the set. This allows the random pulse sub-matrice set to reflect the updated noise and activation signals, thereby improving the performance of the image classification model generated using the random pulse matrix and increasing the processing speed and accuracy of the subsequently generated image classification model. Then, in response to the determination that the number of times the updated pulse matrix has been generated meets the preset loop condition, the first loop step is executed again. Based on the updated random pulse sub-matrice set, a random pulse matrix is generated. This results in a random pulse matrix with even higher true randomness, further improving the performance of the subsequently trained image classification model, increasing the processing speed and accuracy of image classification, and reducing computational resource waste. Finally, the random pulse matrix and the image category information corresponding to the image pixel information are stored in a preset database for use in training the image classification model. Therefore, training the model using a random pulse matrix with higher true randomness can improve the processing speed and accuracy of the image classification model generated by the random pulse matrix, thereby reducing computational resource waste. Because the noise signal used to generate the random pulse matrix is obtained through multiple optimization processes on the electronic noise signal, and the activation signal is obtained through random processing of image pixel information, the random pulse matrix generated using these noise and activation signals has high true randomness. Furthermore, since the random pulse matrix is generated by randomly processing each noise and activation signal, its high true randomness leads to higher performance of the trained image classification model, thus improving the processing speed and accuracy of image classification. In summary, by processing image pixel information and electronic noise signals, the true randomness of the random pulse matrix can be improved, enhancing the performance of the image classification model generated by the random pulse matrix, thereby increasing the processing speed and accuracy of image classification and reducing computational resource waste.
[0097] Continue to refer to Figure 2 The diagram illustrates a flow 200 of some embodiments of an image classification method according to the present disclosure. The image classification method includes the following steps:
[0098] Step 201: Obtain the image dataset.
[0099] In some embodiments, the entity executing the image classification method (e.g., a computing device) can acquire an image dataset. This entity can be a terminal or server performing image classification. The image category information corresponding to each image data in the image dataset is different.
[0100] Step 202: Segment the foreground target images of each image data in the image dataset to obtain a foreground target image set.
[0101] In some embodiments, the execution entity can segment the foreground target images of each image data in the image dataset to obtain a foreground target image set. The foreground target images can be images distinct from the background images. In practice, the execution entity can use a foreground target segmentation model to segment the foreground target images of each image data in the image dataset to obtain a foreground target image set. The foreground target segmentation model can be any segmentation model.
[0102] Step 203: For each foreground target image in the foreground target image set, perform the following steps:
[0103] Step 2031: Determine each pixel in the foreground target image as the corresponding foreground target image pixel matrix.
[0104] In some embodiments, the execution entity can determine each pixel in the foreground target image as a corresponding foreground target image pixel matrix. The foreground target image pixel matrix can be a matrix obtained from the foreground target image. In practice, firstly, the execution entity can determine the first pixel in the upper left corner of the foreground target image as the origin. Then, the foreground target image can be horizontally to the right as the x-axis and vertically downwards as the y-axis. Thus, a coordinate system can be determined. Then, the execution entity can use the coordinate system to determine the coordinates corresponding to each pixel in the foreground target image. Then, for each pixel in the foreground target image, the execution entity can use the coordinates corresponding to the pixel to determine the position of the pixel in the matrix. Then, the pixel value corresponding to the pixel can be determined as the element value at the corresponding position. Finally, the resulting matrix can be determined as the foreground target image pixel matrix. As an example: when the coordinates of a pixel are (0, 1) and the corresponding pixel value is 255, then the element value at the position in the second row of the first column of the matrix is 255. When the coordinates of a pixel are (3, 6) and the corresponding pixel value is 100, the element in the fourth column and seventh row of the matrix has a value of 100.
[0105] Step 2032: Based on the pixel matrix of the foreground target image, generate a random pulse matrix corresponding to the pixel matrix of the foreground target image.
[0106] In some embodiments, the execution entity may generate a random pulse matrix corresponding to the foreground target image pixel matrix based on the foreground target image pixel matrix. The method for generating the random pulse matrix corresponding to the foreground target image pixel matrix can be referred to... Figure 1 Steps 103 to 105 in the corresponding embodiments will not be repeated here.
[0107] Step 2033: Input the generated random pulse matrix into the pre-trained image classification model to obtain the image category information corresponding to the random pulse matrix.
[0108] In some embodiments, the execution entity can input the random pulse matrix into a pre-trained image classification model to obtain image category information corresponding to the random pulse matrix. The image classification model is trained based on random pulse matrices stored in a preset database, which are obtained through... Figure 1 The steps in the corresponding embodiments are used to generate the image classification model. The image classification model described above can be a pre-trained neural network model that takes a random pulse matrix corresponding to the image as input and outputs image category information corresponding to the image. For example, the neural network model described above can be a spiking neural network.
[0109] Step 2034: Determine the category corresponding to the foreground target image based on the image category information.
[0110] In some embodiments, the executing entity may determine the category corresponding to the foreground target image based on the image category information. In practice, the executing entity can determine the category corresponding to the foreground target image using the image category information. For example, when the image category information is "fruit," the category corresponding to the foreground target image is fruit. When the image category information is "animal," the category corresponding to the foreground target image is animal.
[0111] The various embodiments of this disclosure have the following beneficial effects: the image classification method of some embodiments of this disclosure can improve the performance of the image classification model generated using a random pulse matrix, increase the processing speed when using the model to process image data, and improve the accuracy of image classification. Specifically, the reason why the image classification model has poor performance, resulting in slow processing speed and low accuracy when using the model to process image data, is that the random pulse matrix obtained by directly encoding the pixel values in the image has low true randomness, leading to poor performance of the image classification model generated using the random pulse matrix, which in turn leads to slow processing speed and low accuracy when using the model to classify images, resulting in a waste of computing resources. Based on this, the image classification method of some embodiments of this disclosure first obtains an image dataset. This provides image data for model training. Then, the foreground target images of each image data in the image dataset are segmented to obtain a foreground target image set. This allows for rapid localization of the foreground target, improving the processing speed and accuracy of subsequent image classification. Then, for each foreground target image in the aforementioned foreground target image set, the following steps are performed: First, each pixel in the aforementioned foreground target image is determined as the corresponding foreground target image pixel matrix. This converts the image data into an image pixel matrix, providing a data foundation for generating the random pulse matrix corresponding to the image data. Then, based on the aforementioned foreground target image pixel matrix, a random pulse matrix corresponding to the aforementioned foreground target image pixel matrix is generated. Thus, through various processing methods, the foreground target image pixel matrix corresponding to the image data can be converted into a random pulse matrix with high true randomness, improving the processing speed and accuracy of image classification while saving computational resources. Then, the generated random pulse matrix is input into a pre-trained image classification model to obtain the image category information corresponding to the aforementioned random pulse matrix. The aforementioned image classification model is trained based on random pulse matrices stored in a preset database, which are obtained through... Figure 1 The steps in the corresponding embodiments are generated. Therefore, the image category information corresponding to the image can be obtained through the random pulse matrix corresponding to the image. Finally, based on the above image category information, the category corresponding to the above foreground target image is determined. Thus, the final image category information can be determined, completing the image classification task. Also, because the foreground target images of each image data in the above image dataset can be segmented to obtain a foreground target image set, and then image classification processing can be performed on the images in the foreground target image set, the images that need to be classified can be quickly located during image classification, improving the processing speed and accuracy of image classification processing and saving computational resources.
[0112] Further reference Figure 3 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of a random pulse matrix generation device for training image classification models. These device embodiments are similar to... Figure 1 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.
[0113] like Figure 3 As shown, a random pulse matrix generation device 300 for training an image classification model in some embodiments includes: an acquisition unit 301, a first generation unit 302, a second generation unit 303, an execution unit 304, a third generation unit 305, and a storage unit 306. The acquisition unit 301 is configured to acquire a set of electronic noise signals; the first generation unit 302 is configured to generate random noise signals based on at least one electronic noise signal in the electronic noise signal set; the second generation unit 303 is configured to generate an image probability matrix corresponding to the image pixel information based on pre-stored image pixel information, wherein the image pixel information corresponds to image category information; the execution unit 304 is configured to perform the following first loop steps based on each random noise signal: updating a preset number of pulse matrix generation times based on a preset value; inputting a preset number of random noise signals from each random noise signal into a noise signal acquisition unit to obtain each noise signal corresponding to the preset number of random noise signals; and based on the image probability matrix... The system generates various activation signals; based on the noise signals and activation signals, it generates various probability signal groups; based on the probability signal groups, it generates random pulse sub-matrices; in response to determining that the number of times the updated pulse matrix has been generated does not meet a preset loop condition, it updates the random pulse sub-matrices by adding the random pulse sub-matrices to the random pulse sub-matrices set; in response to determining that the number of times the updated pulse matrix has been generated meets the preset loop condition, it executes the first loop step again; the third generation unit 305 is configured to generate a random pulse matrix based on the updated random pulse sub-matrices set; the storage unit 306 is configured to store the random pulse matrix and the image category information corresponding to the image pixel information in a preset database for training an image classification model.
[0114] It is understandable that the units described in the device 300 are related to the reference. Figure 1 The steps in the described method correspond accordingly. Therefore, the operations, features, and beneficial effects described above for the method also apply to the device 300 and the units contained therein, and will not be repeated here.
[0115] Further reference Figure 4 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of an image classification device, which are similar to... Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.
[0116] like Figure 4 As shown, an image classification apparatus 400 in some embodiments includes: an acquisition unit 401, a segmentation unit 402, and an execution unit 403. The acquisition unit 401 is configured to acquire an image dataset; the segmentation unit 402 is configured to segment the foreground target images of each image data in the image dataset to obtain a foreground target image set; the execution unit 403 is configured to perform the following steps for each foreground target image in the foreground target image set: determining each pixel in the foreground target image as a corresponding foreground target image pixel matrix; generating a random pulse matrix corresponding to the foreground target image pixel matrix based on the foreground target image pixel matrix; inputting the generated random pulse matrix into a pre-trained image classification model to obtain image category information corresponding to the random pulse matrix, wherein the image classification model is trained based on random pulse matrices stored in a preset database, and the random pulse matrices stored in the preset database are obtained through... Figure 1 The steps in the corresponding embodiments are generated; based on the above image category information, the category corresponding to the above foreground target image is determined.
[0117] It is understandable that the units described in the device 400 are related to the reference. Figure 2 The steps in the described method correspond accordingly. Therefore, the operations, features, and beneficial effects described above for the method also apply to device 400 and the units contained therein, and will not be repeated here.
[0118] The following is for reference. Figure 5 It shows a schematic diagram of the structure of an electronic device 500 suitable for implementing some embodiments of the present disclosure. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0119] like Figure 5 As shown, the electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0120] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 5 Each box shown can represent a device or multiple devices as needed.
[0121] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 509, or installed from storage device 508, or installed from ROM 502. When the computer program is executed by processing device 501, it performs the functions defined in the methods of some embodiments of this disclosure.
[0122] It should be noted that, in some embodiments of this disclosure, the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0123] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0124] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire a set of electronic noise signals; generate various random noise signals based on at least one electronic noise signal in the electronic noise signal set; generate an image probability matrix corresponding to the image pixel information based on pre-stored image pixel information, wherein the image pixel information corresponds to image category information; and, based on each random noise signal, perform the following first loop step: update a preset number of pulse matrix generation times based on a preset value; input a preset number of random noise signals from the various random noise signals to a noise signal acquisition device to obtain various noise signals corresponding to the preset number of random noise signals. Based on the aforementioned image probability matrix, generate each activation signal; based on the aforementioned noise signals and each activation signal, generate each probability signal group; based on the aforementioned probability signal groups, generate a random pulse sub-matrix; in response to determining that the number of times the updated pulse matrix has been generated does not meet a preset loop condition, add the aforementioned random pulse sub-matrix to the random pulse sub-matrix set to update the random pulse sub-matrix set; in response to determining that the number of times the updated pulse matrix has been generated meets the preset loop condition, execute the aforementioned first loop step again; based on the updated random pulse sub-matrix set, generate a random pulse matrix; store the aforementioned random pulse matrix and the image category information corresponding to the aforementioned image pixel information in a preset database for use in training an image classification model.
[0125] Alternatively, the electronic device may: acquire an image dataset; segment the foreground target images of each image data in the image dataset to obtain a foreground target image set; for each foreground target image in the foreground target image set, perform the following steps: determine each pixel in the foreground target image as a corresponding foreground target image pixel matrix; generate a random pulse matrix corresponding to the foreground target image pixel matrix based on the foreground target image pixel matrix; input the generated random pulse matrix into a pre-trained image classification model to obtain the image category information corresponding to the random pulse matrix, wherein the image classification model is trained based on random pulse matrices stored in a preset database, and the random pulse matrices stored in the preset database are obtained through... Figure 1 The steps in the corresponding embodiments are generated; based on the above image category information, the category corresponding to the above foreground target image is determined.
[0126] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0127] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0128] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including an acquisition unit, a first generation unit, a second generation unit, an execution unit, a third generation unit, and a storage unit. The names of these units do not necessarily limit the specific unit; for example, an acquisition unit may also be described as a "unit for acquiring a set of electronic noise signals."
[0129] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0130] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A method for generating a random impulse matrix for training an image classification model, comprising: Acquire electronic noise signal set; Based on at least one electronic noise signal in the electronic noise signal set, generate various random noise signals; Based on pre-stored image pixel information, an image probability matrix corresponding to the image pixel information is generated, wherein the image pixel information corresponds to image category information; Based on each random noise signal, perform the following first loop step: Based on preset values, the preset number of pulse matrix generation times is updated; A preset number of random noise signals from each random noise signal are input into a noise signal acquisition device to obtain each noise signal corresponding to the preset number of random noise signals; Based on the image probability matrix, each activation signal is generated; Based on the noise signals and the activation signals, generate each probability signal group; Based on the aforementioned probability signal groups, a random pulse submatrix is generated; In response to the determination that the number of times the updated pulse matrix is generated does not meet the preset loop condition, the random pulse submatrix is added to the random pulse submatrix set to update the random pulse submatrix set; In response to the determination that the number of times the updated pulse matrix has been generated satisfies the preset loop condition, the first loop step is executed again; Based on the updated set of random pulse submatrices, generate a random pulse matrix; The random pulse matrix and the image category information corresponding to the image pixel information are stored in a preset database for use in training the image classification model.
2. The method according to claim 1, wherein, The process of generating various random noise signals based on at least one electronic noise signal from an electronic noise signal set includes: Based on the electronic noise signal set, perform the following second loop step: The electronic noise signal with concentrated electronic noise signal is amplified by current boosting to obtain the current noise signal; The current noise signal is de-voltage processed to obtain a de-voltage noise signal; The reduced noise signal is amplified to obtain an amplified noise signal; The amplified noise signal is subjected to signal conversion processing to obtain a binary noise signal; The binary noise signal is subjected to digital extraction processing to obtain binary digital data; The binary digits are added to the binary digit sequence to update the binary digit sequence; In response to determining that the updated binary code sequence meets the preset sequence conditions, the updated binary code sequence is identified as a random noise signal, and the updated binary signal sequence is cleared. In response to the determination that the number of times the second loop step has been executed does not meet the preset number condition, an electronic noise signal set is formed using unused electronic noise signals, and the second loop step is executed again.
3. The method according to claim 1, wherein, The step of generating an image probability matrix corresponding to the pre-stored image pixel information includes: Generate an image pixel matrix based on pre-stored image pixel information; Based on a preset normalization value, each matrix element in the image pixel matrix is normalized to obtain the image probability matrix.
4. The method according to claim 1, wherein, The image classification model was trained in the following way: A sample set is obtained from the preset database, wherein the samples in the sample set include images, sample random pulse matrices corresponding to image pixel information in the images, and sample image category information; Perform the following training steps based on the sample set: The random pulse matrix corresponding to the image of at least one sample in the sample set is input into the initial neural network to obtain the image category information corresponding to each sample in the at least one sample. The initial neural network includes a feature extraction network and an output layer. Compare the image category information corresponding to each sample in the at least one sample with the corresponding sample image category information; Based on the comparison results, determine whether the initial neural network has achieved the preset optimization objective; In response to determining that the initial neural network has achieved the optimization objective, the feature extraction network included in the initial neural network is determined as an image classification model; In response to the determination that the initial neural network has not achieved the optimization objective, the network parameters of the initial neural network are adjusted, and a sample set is formed using unused samples. The adjusted initial neural network is then used as the initial neural network, and the training steps are performed again.
5. An image classification method, comprising: Obtain the image dataset; The foreground target image of each image data in the image dataset is segmented to obtain a foreground target image set; For each foreground target image in the foreground target image set, perform the following steps: Each pixel in the foreground target image is determined as the corresponding foreground target image pixel matrix; Based on the pixel matrix of the foreground target image, a random pulse matrix corresponding to the pixel matrix of the foreground target image is generated; The generated random pulse matrix is input into a pre-trained image classification model to obtain the image category information corresponding to the random pulse matrix. The image classification model is trained based on random pulse matrices stored in a preset database, and the random pulse matrices stored in the preset database are generated by the method described in any one of claims 1-4. Based on the image category information, the category corresponding to the foreground target image is determined.
6. A random impulse matrix generation device for training an image classification model, comprising: The acquisition unit is configured to acquire a set of electronic noise signals; The first generation unit is configured to generate various random noise signals based on at least one electronic noise signal in the electronic noise signal set; The second generation unit is configured to generate an image probability matrix corresponding to the pre-stored image pixel information, wherein the image pixel information corresponds to image category information. The execution unit is configured to perform the following first loop steps based on each random noise signal: updating a preset number of pulse matrix generation times based on a preset value; inputting a preset number of random noise signals from each random noise signal into a noise signal acquisition unit to obtain each noise signal corresponding to the preset number of random noise signals; generating each activation signal based on the image probability matrix; generating each probability signal group based on each noise signal and each activation signal; generating a random pulse sub-matrix based on each probability signal group; in response to determining that the updated pulse matrix generation times do not meet a preset loop condition, updating the random pulse sub-matrix set by adding the random pulse sub-matrix to the random pulse sub-matrix set; in response to determining that the updated pulse matrix generation times meet the preset loop condition, executing the first loop step again. The third generation unit is configured to generate a random pulse matrix based on the updated set of random pulse submatrices; The storage unit is configured to store the random pulse matrix and the image category information corresponding to the image pixel information into a preset database for use in training an image classification model.
7. An image classification device, comprising: The acquisition unit is configured to acquire an image dataset; The segmentation unit is configured to segment the foreground target image of each image data in the image dataset to obtain a foreground target image set. The execution unit is configured to perform the following steps for each foreground target image in the foreground target image set: determining each pixel in the foreground target image as a corresponding foreground target image pixel matrix; Based on the pixel matrix of the foreground target image, a random pulse matrix corresponding to the pixel matrix of the foreground target image is generated; The generated random pulse matrix is input into a pre-trained image classification model to obtain image category information corresponding to the random pulse matrix. The image classification model is trained based on random pulse matrices stored in a preset database, and the random pulse matrices stored in the preset database are generated by the method described in any one of claims 1-4. Based on the image category information, the category corresponding to the foreground target image is determined.
8. An electronic device, comprising: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 4 or 5.
9. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 4 or 5.
Citation Information
Patent Citations
Semi-supervised semantic segmentation method based on self-adaptive false label correction
CN115761735A
Method for image segmentation
WO2024141204A1