Anomaly monitoring model creation and anomaly monitoring methods, devices, and electronic equipment
By using an anomaly detection model trained with residual structures and shallow neural networks in hair transplant surgery, the problem of low training efficiency in existing technologies is solved, achieving efficient real-time anomaly detection and processing, and ensuring surgical safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI SURLOGIC ROBOT CO LTD
- Filing Date
- 2023-04-23
- Publication Date
- 2026-06-30
Smart Images

Figure CN116452952B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of anomaly monitoring, and more specifically, to anomaly monitoring model creation and anomaly monitoring method, apparatus, and electronic equipment. Background Technology
[0002] With the rapid development of automation, fully automated robots are gradually playing an important role in various fields, and even some medical surgeries are increasingly replacing manual operations. For example, in hair transplantation robots, before the procedure begins, medical personnel need to formulate a surgical plan for hair extraction and transplantation based on the patient's condition. Through certain parameter settings, the robot can then automatically complete the entire surgical process. However, during the procedure, some abnormal situations may occur, requiring the machine to monitor these in real time and provide real-time alarms and emergency stops to ensure the patient's safety. With the rapid development of neural network technology, monitoring the situation during surgery using anomaly detection models is becoming increasingly common, making the creation of such models increasingly important. Currently, anomaly detection models are typically trained using magnetic susceptibility maps; however, due to the large data processing volume and slow data transmission of magnetic susceptibility maps, the training efficiency is low. Summary of the Invention
[0003] In view of this, the purpose of this application is to provide an anomaly monitoring model creation and anomaly monitoring method, apparatus, and electronic device, which can improve the training efficiency of the anomaly monitoring model.
[0004] In a first aspect, embodiments of this application provide a method for creating an anomaly monitoring model, comprising: acquiring a scalp image of a region to be monitored, wherein the region to be monitored is the area to be operated on during a hair transplant surgery; establishing a shallow neural network through a residual structure, wherein the residual structure is used to adjust the dimension of the shallow neural network; and training the shallow neural network through the scalp image to determine an anomaly monitoring model.
[0005] In the above implementation process, since the residual structure can adjust the dimension of the shallow neural network, it can increase the dimension when matching features and decrease the dimension when mapping, thereby improving the accuracy of the shallow neural network's matching and enabling more effective and intuitive data training and feature extraction. Furthermore, since the residual structure is a convolutional neural network composed of multiple small convolutional layers, it reduces computational cost, and the shallow neural network model is relatively simple and requires less training time, thus improving the efficiency of model training.
[0006] In one embodiment, training the shallow neural network using the scalp image to determine the anomaly detection model includes: inputting the scalp image and the category label of the scalp image into the shallow neural network respectively, and iteratively optimizing the shallow neural network using a loss function; if the iteration termination condition is met, stopping the iterative optimization of the shallow neural network, and determining the current shallow neural network as the anomaly detection model.
[0007] In the above implementation process, the shallow neural network is iteratively optimized using a loss function. By gradually calculating the difference between the model's predicted values and the true values, the accuracy of the shallow neural network is ensured. Furthermore, when the iteration termination condition is met, the iterative optimization of the shallow neural network is stopped, which ensures the accuracy of the iterated shallow neural network while achieving automated training.
[0008] In one embodiment, the step of establishing a shallow neural network through a residual structure includes: performing a convolution operation on the scalp image and determining a residual network for activation layers based on the convolution operation result; determining convolutional layers based on the residual network and establishing a residual structure based on the convolutional layers; and establishing the shallow neural network through the residual structure.
[0009] In the above implementation process, a shallow neural network is established through the residual structure. Since the residual structure is composed of multiple convolutional layers, and the computational cost of convolutional layers is relatively small, the computational cost of the shallow neural network can be reduced, thereby improving the training efficiency of the anomaly detection model.
[0010] In one embodiment, the shallow neural network includes a first layer, a second layer, a third layer, and a fourth layer; the first layer includes three residual structures; the second layer includes four residual structures; the third layer includes six residual structures; and the fourth layer includes three bottleneck layer residual structures.
[0011] In the above implementation process, this shallow neural network is constructed by setting up multiple layers, each including multiple residual structures. This breaks through the bottleneck that residual structures can only be used in deep neural networks, thus expanding the application scenarios of residual structures. Furthermore, constructing a shallow neural network using residual structures is simple in computation, resulting in a simpler structure for the shallow neural network itself. This significantly reduces the time the anomaly detection model spends processing abnormal data, thereby improving the training efficiency of the anomaly detection model.
[0012] In one embodiment, the formula for calculating the residual network of the activation layer based on the convolution operation on the scalp image is as follows: Where x is the input data, F(x) is the residual part, Conv is the convolution operation, BN is the normalization operation, ReLU is the activation function of the activation layer, and y is the residual network.
[0013] In one embodiment, after acquiring the scalp image of the area to be monitored, the method further includes: preprocessing the scalp image to obtain a preprocessed scalp image; training the shallow neural network using the scalp image to determine the anomaly detection model includes: training the shallow neural network using the preprocessed scalp image to determine the anomaly detection model.
[0014] In the above implementation process, the acquired scalp image is preprocessed to enlarge or reduce it according to the actual hardware conditions, ensuring that the scalp image maintains a uniform size and facilitating feature extraction. Furthermore, for larger scalp images, they can be reduced in size before training the anomaly detection model, reducing the training time using scalp images and thus improving training efficiency.
[0015] In one embodiment, after acquiring the scalp image of the area to be monitored, the method further includes: pre-classifying the scalp image; training the shallow neural network using the scalp image to determine the anomaly detection model includes: training the shallow neural network using the pre-classified scalp image to determine the anomaly detection model.
[0016] In the above implementation process, the scalp image is first pre-classified, and then the model is trained based on the pre-classified scalp image to achieve fine classification of the scalp image. Since the scalp image has already undergone coarse classification before model training, the training difficulty is reduced, the complexity of the model is greatly reduced, and the frequency of real-time response is improved.
[0017] In one embodiment, the shallow neural network is a classification neural network that satisfies real-time response.
[0018] In the above implementation process, by selecting a classification neural network that can meet the requirements of real-time response as the shallow neural network, not only can the classification of scalp images be achieved, but the accuracy and real-time performance of the classification can also be improved.
[0019] Secondly, embodiments of this application also provide an anomaly monitoring method, comprising: acquiring a scalp image of a region to be monitored, wherein the region to be monitored is a hair transplant surgery operation area; inputting the scalp image into an anomaly monitoring model to determine whether there is an anomaly in the scalp image; wherein the anomaly monitoring model is created by the method described in the first aspect above, or any possible implementation of the first aspect.
[0020] In the above implementation process, the anomaly monitoring model is constructed using residual structures and shallow neural networks. The structure and calculation of the anomaly monitoring model are relatively simple, thus improving the efficiency of anomaly monitoring.
[0021] Thirdly, embodiments of this application also provide an anomaly monitoring model creation device, comprising: a first acquisition module, configured to acquire a scalp image of a region to be monitored, wherein the region to be monitored is a hair transplant surgery operation area; an establishment module, configured to establish a shallow neural network through a residual structure, wherein the residual structure is used to adjust the dimension of the shallow neural network; and a training module, configured to train the shallow neural network through the scalp image to determine an anomaly monitoring model.
[0022] In the above implementation process, since the residual structure can adjust the dimension of the shallow neural network, it can increase the dimension when matching features and decrease the dimension when mapping, thereby improving the accuracy of the shallow neural network's matching and enabling more effective and intuitive data training and feature extraction. Furthermore, since the residual structure is a convolutional neural network composed of multiple small convolutional layers, it reduces computational cost, and the shallow neural network model is relatively simple and requires less training time, thus improving the efficiency of model training.
[0023] In one embodiment, the training module is further configured to input the scalp image and the category label of the scalp image into the shallow neural network respectively, so as to iteratively optimize the shallow neural network through a loss function; and if the iteration termination condition is reached, to stop iteratively optimizing the shallow neural network and determine that the current shallow neural network is an anomaly detection model.
[0024] In the above implementation process, the shallow neural network is iteratively optimized using a loss function. By gradually calculating the difference between the model's predicted values and the true values, the accuracy of the shallow neural network is ensured. Furthermore, when the iteration termination condition is met, the iterative optimization of the shallow neural network is stopped, which ensures the accuracy of the iterated shallow neural network while achieving automated training.
[0025] In one embodiment, the establishment module is further configured to perform convolution operations on the scalp image and determine the residual network of the activation layer based on the convolution operation result; determine the convolutional layer based on the residual network and establish the residual structure based on the convolutional layer; and establish the shallow neural network through the residual structure.
[0026] In the above implementation process, a shallow neural network is established through the residual structure. Since the residual structure is composed of multiple convolutional layers, and the computational cost of convolutional layers is relatively small, the computational cost of the shallow neural network can be reduced, thereby improving the training efficiency of the anomaly detection model.
[0027] In one embodiment, the apparatus further includes: a preprocessing module for preprocessing the scalp image to obtain a preprocessed scalp image; and a training module for training the shallow neural network using the preprocessed scalp image to determine an anomaly detection model.
[0028] In the above implementation process, the acquired scalp image is preprocessed to enlarge or reduce it according to the actual hardware conditions, ensuring that the scalp image maintains a uniform size and facilitating feature extraction. Furthermore, for larger scalp images, they can be reduced in size before training the anomaly detection model, reducing the training time using scalp images and thus improving training efficiency.
[0029] In one embodiment, the apparatus further includes: a pre-classification module for pre-classifying the scalp image; and a training module for training the shallow neural network using the pre-classified scalp image to determine an anomaly detection model.
[0030] In the above implementation process, the scalp image is first pre-classified, and then the model is trained based on the pre-classified scalp image to achieve fine classification of the scalp image. Since the scalp image has already undergone coarse classification before model training, the training difficulty is reduced, greatly reducing the complexity of the model and increasing the frequency of real-time response. Fourthly, embodiments of this application also provide an anomaly monitoring model creation device, including: a second acquisition module, used to acquire a scalp image of a region to be monitored, wherein the region to be monitored is a hair transplant surgery operation area; and a determination module, used to input the scalp image into the anomaly monitoring model to determine whether there is an anomaly in the scalp image; wherein the anomaly monitoring model is created by the method described in the first aspect above, or any possible implementation of the first aspect.
[0031] In the above implementation process, the anomaly monitoring model is constructed using residual structures and shallow neural networks. The structure and calculation of the anomaly monitoring model are relatively simple, thus improving the efficiency of anomaly monitoring.
[0032] Fifthly, embodiments of this application also provide an electronic device, including: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of the method described in the first aspect, or any possible implementation of the first aspect, the second aspect, or any possible implementation of the second aspect.
[0033] Sixthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs a method for creating an anomaly monitoring model. The method includes: acquiring a scalp image of a region to be monitored, the region to be monitored being a hair transplant surgery area; establishing a shallow neural network through a residual structure, the residual structure being used to adjust the dimension of the shallow neural network; and training the shallow neural network through the scalp image to determine an anomaly monitoring model.
[0034] In the above implementation process, since the residual structure can adjust the dimension of the shallow neural network, it can increase the dimension when matching features and decrease the dimension when mapping, thereby improving the accuracy of the shallow neural network's matching and enabling more effective and intuitive data training and feature extraction. Furthermore, since the residual structure is a convolutional neural network composed of multiple small convolutional layers, it reduces computational cost, and the shallow neural network model is relatively simple and requires less training time, thus improving the efficiency of model training.
[0035] In one embodiment, training the shallow neural network using the scalp image to determine the anomaly detection model includes: inputting the scalp image and the category label of the scalp image into the shallow neural network respectively, and iteratively optimizing the shallow neural network using a loss function; if the iteration termination condition is met, stopping the iterative optimization of the shallow neural network, and determining the current shallow neural network as the anomaly detection model.
[0036] In the above implementation process, the shallow neural network is iteratively optimized using a loss function. By gradually calculating the difference between the model's predicted values and the true values, the accuracy of the shallow neural network is ensured. Furthermore, when the iteration termination condition is met, the iterative optimization of the shallow neural network is stopped, which ensures the accuracy of the iterated shallow neural network while achieving automated training.
[0037] In one embodiment, the step of establishing a shallow neural network through a residual structure includes: performing a convolution operation on the scalp image and determining a residual network for activation layers based on the convolution operation result; determining convolutional layers based on the residual network and establishing a residual structure based on the convolutional layers; and establishing the shallow neural network through the residual structure.
[0038] In the above implementation process, a shallow neural network is established through the residual structure. Since the residual structure is composed of multiple convolutional layers, and the computational cost of convolutional layers is relatively small, the computational cost of the shallow neural network can be reduced, thereby improving the training efficiency of the anomaly detection model.
[0039] In one embodiment, the shallow neural network includes a first layer, a second layer, a third layer, and a fourth layer; the first layer includes three residual structures; the second layer includes four residual structures; the third layer includes six residual structures; and the fourth layer includes three bottleneck layer residual structures.
[0040] In the above implementation process, this shallow neural network is constructed by setting up multiple layers, each including multiple residual structures. This breaks through the bottleneck that residual structures can only be used in deep neural networks, thus expanding the application scenarios of residual structures. Furthermore, constructing a shallow neural network using residual structures is simple in computation, resulting in a simpler structure for the shallow neural network itself. This significantly reduces the time the anomaly detection model spends processing abnormal data, thereby improving the training efficiency of the anomaly detection model.
[0041] In one embodiment, the formula for calculating the residual network of the activation layer based on the convolution operation on the scalp image is as follows: Where x is the input data, F(x) is the residual part, Conv is the convolution operation, BN is the normalization operation, ReLU is the activation function of the activation layer, and y is the residual network.
[0042] In one embodiment, after acquiring the scalp image of the area to be monitored, the method further includes: preprocessing the scalp image to obtain a preprocessed scalp image; training the shallow neural network using the scalp image to determine the anomaly detection model includes: training the shallow neural network using the preprocessed scalp image to determine the anomaly detection model.
[0043] In the above implementation process, the acquired scalp image is preprocessed to enlarge or reduce it according to the actual hardware conditions, ensuring that the scalp image maintains a uniform size and facilitating feature extraction. Furthermore, for larger scalp images, they can be reduced in size before training the anomaly detection model, reducing the training time using scalp images and thus improving training efficiency.
[0044] In one embodiment, after acquiring the scalp image of the area to be monitored, the method further includes: pre-classifying the scalp image; training the shallow neural network using the scalp image to determine the anomaly detection model includes: training the shallow neural network using the pre-classified scalp image to determine the anomaly detection model.
[0045] In the above implementation process, the scalp image is first pre-classified, and then the model is trained based on the pre-classified scalp image to achieve fine classification of the scalp image. Since the scalp image has already undergone coarse classification before model training, the training difficulty is reduced, the complexity of the model is greatly reduced, and the frequency of real-time response is improved.
[0046] In one embodiment, the shallow neural network is a classification neural network that satisfies real-time response.
[0047] In the above implementation process, by selecting a classification neural network that can meet the requirements of real-time response as the shallow neural network, not only can the classification of scalp images be achieved, but the accuracy and real-time performance of the classification can also be improved.
[0048] In a seventh aspect, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs an anomaly monitoring method, the method comprising: acquiring a scalp image of a region to be monitored, the region to be monitored being a hair transplant surgery area; inputting the scalp image into an anomaly monitoring model to determine whether an anomaly exists in the scalp image; wherein the anomaly monitoring model is created by the method described in the first aspect above, or in any possible implementation of the first aspect.
[0049] In the above implementation process, the anomaly monitoring model is constructed using residual structures and shallow neural networks. The structure and calculation of the anomaly monitoring model are relatively simple, thus improving the efficiency of anomaly monitoring.
[0050] In one embodiment, the anomaly includes foreign objects and adverse bodily reactions. After inputting the scalp image into the anomaly monitoring model to determine whether an anomaly exists in the scalp image, the method further includes: if an anomaly exists in the scalp image, determining the anomaly category of the scalp image based on a category label; if the anomaly category is a foreign object, generating a foreign object removal signal to control a target device to remove the foreign object from the monitored area; if the anomaly category is an adverse bodily reaction, generating corresponding emergency measures based on the type of adverse reaction to handle the adverse reaction.
[0051] In the above implementation process, after the anomaly monitoring model detects anomalies in the scalp image, it can further generate corresponding emergency measures based on the anomaly category to handle the anomaly in a timely manner, thereby improving the safety of the fully automated surgical procedure.
[0052] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, specific embodiments are described below in conjunction with the accompanying drawings. Attached Figure Description
[0053] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 A flowchart illustrating the anomaly monitoring model creation method provided in this application embodiment;
[0055] Figure 2 This is a schematic diagram of a scalp image containing a foreign object, provided in an embodiment of this application.
[0056] Figure 3 This is a schematic diagram of a scalp with bleeding, provided as an embodiment of this application.
[0057] Figure 4 This is a schematic diagram of a scalp image showing the presence of foreign objects and bleeding, provided as an embodiment of this application.
[0058] Figure 5 This is a schematic diagram of the first layer structure of a shallow neural network provided in an embodiment of this application;
[0059] Figure 6 A schematic diagram of the first bottleneck layer structure of the second layer of a shallow neural network provided in an embodiment of this application;
[0060] Figure 7 A schematic diagram of the second bottleneck layer structure of the second layer of the shallow neural network provided in this application embodiment;
[0061] Figure 8 A schematic diagram of the second bottleneck layer structure of the third layer of a shallow neural network provided in an embodiment of this application;
[0062] Figure 9 A flowchart of the anomaly monitoring method provided in the embodiments of this application;
[0063] Figure 10 A schematic diagram of the functional modules of the anomaly monitoring model creation device provided in the embodiments of this application;
[0064] Figure 11 This is a schematic diagram of the functional modules of the anomaly monitoring device provided in the embodiments of this application;
[0065] Figure 12This is a block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0066] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0067] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0068] Through long-term research, the inventors of this application have discovered that various abnormal situations often occur during fully automated hair transplantation procedures. For example, during pre-operative preparation (such as the injection of tumescent fluid), some bleeding may occur, requiring early warning based on the bleeding level. Since the surgical process (hair extraction and transplantation stages) is automatically executed by the hair transplantation robot without human intervention, if a surgeon's hand accidentally enters the operating area, the robot needs to quickly identify the hand and provide a real-time alarm prompt so that it can stop the procedure. Furthermore, if bleeding occurs during the procedure and the doctor fails to stop the machine in time, or if there is human interference such as using tweezers to wipe away blood, real-time monitoring and alarm prompts are also necessary to stop the procedure.
[0069] However, there are currently few methods for real-time monitoring of abnormal situations in medical settings. A relatively common method involves a smart monitoring terminal worn by the injured person. This terminal wirelessly connects to smart gauze and can monitor the patient's wound bleeding and overall condition in real time. It assesses the amount of bleeding based on these factors and generates different levels of alarms accordingly. However, the wearable devices used in this solution lack versatility and are not suitable for medical surgical settings, especially during hair transplant surgery where the field of vision is limited and the devices can easily obstruct the view, affecting the surgical procedure.
[0070] In addition, there is a method for automatically segmenting cerebral microbleeds based on neural networks. The input image used for judgment is a magnetic susceptibility distribution map. Through certain preprocessing, qualitative and quantitative magnetic susceptibility distribution maps are obtained, and data training and judgment are based on these maps. However, this method relies on magnetic susceptibility distribution maps, which require specialized equipment for acquisition. Furthermore, the data volume is large and the process is slow, generally suitable for offline disease analysis, but not for real-time monitoring. The expensive specialized equipment also limits its versatility.
[0071] In view of this, the inventors of this application propose a method for creating an anomaly detection model. This method involves reducing the size of an acquired scalp image before inputting it into a shallow neural network for training, thereby obtaining the anomaly detection model. Because the input image is a reduced size, the image data volume is small, and the transmission is fast. Furthermore, this anomaly detection model is trained on a shallow neural network, which is simple, has low prediction time, and can improve the detection efficiency of the anomaly detection model.
[0072] Please see Figure 1 This is a flowchart of the anomaly monitoring model creation method provided in the embodiments of this application. The following will describe... Figure 1 The specific process shown will be explained in detail.
[0073] Step 201: Obtain scalp images of the area to be monitored.
[0074] The area to be monitored is the area where the hair transplant surgery was performed.
[0075] The scalp images here can be acquired using devices such as industrial cameras, video cameras, and scanners. The scalp images of the area to be monitored can be acquired in real time or at preset intervals. The acquisition time of the scalp images of the area to be monitored can be adjusted according to actual circumstances, and this application does not impose specific limitations.
[0076] Step 202: Establish a shallow neural network using the residual structure.
[0077] The residual structure here is used to adjust the dimensionality of a shallow neural network. This residual structure can be used to increase or decrease the dimensionality of the shallow neural network. For example, increasing the dimensionality is used for matching features, and decreasing it is used for mapping.
[0078] The residual structure described above typically uses a 1x1 convolutional neural network to significantly reduce computational cost.
[0079] Understandably, foreign object detection during surgery requires real-time response. Typically, real-time video sampling is at 30fps, meaning processing one frame should theoretically take less than 33ms. However, deeper neural networks are more complex and time-consuming, making it difficult to meet these real-time requirements. Using shallower neural networks reduces computation time, thus improving real-time response speed.
[0080] Step 203: Train a shallow neural network using scalp images to determine the anomaly detection model.
[0081] In the above implementation process, since the residual structure can adjust the dimension of the shallow neural network, it can increase the dimension when matching features and decrease the dimension when mapping, thereby improving the accuracy of the shallow neural network's matching and enabling more effective and intuitive data training and feature extraction. Furthermore, since the residual structure is a convolutional neural network composed of multiple small convolutional layers, it reduces computational cost, and the shallow neural network model is relatively simple and requires less training time, thus improving the efficiency of model training.
[0082] In one possible implementation, before step 203, the method further includes: classifying the abnormal data in the scalp image to obtain multiple abnormal categories; sorting the abnormal categories in a preset order, and determining the corresponding category label based on the sorting order of the abnormal categories and the status of each category, so as to determine the abnormal category existing in the scalp image through the category label.
[0083] The abnormal data here can include: other interventional objects besides the surgical robot, such as gauze, the surgeon's hand, hemostatic forceps, foreign objects on the tensioner, etc. It can also include data on abnormal situations such as head bleeding caused by patient movement during surgery, or head bleeding caused by problems during the hair transplant process. Understandably, this abnormal data can be data on abnormal situations during the surgery as listed above, or it can be data on other foreign objects or abnormal situations encountered that cause abnormalities in the camera's image capture and recognition, which are included in later processing of abnormal data. This abnormal data includes data on various abnormal situations, and the selection and determination of this abnormal data can be adjusted according to the actual situation; this application does not impose specific limitations.
[0084] Understandably, the aforementioned abnormal data can be categorized into multiple types based on different occurrences and processing methods. For example, abnormal data arising from abnormalities such as gauze, the surgeon's hands, hemostatic forceps, or foreign objects on the tensioner can be classified as foreign objects. Abnormal data arising from head bleeding caused by patient movement during surgery or problems during hair transplantation can be classified as bleeding. Of course, the above situations can be further categorized. For example, gauze and hemostatic forceps can be classified as foreign objects, the surgeon's hands as violations of operating procedures, foreign objects on the tensioner can be separately classified as foreign objects on the tensioner, and bleeding during the procedure can be classified as bleeding, etc. The specific classification method for this abnormal data based on different occurrences and processing methods can be determined according to the actual situation, and this application does not impose specific restrictions.
[0085] After classifying the abnormal data, multiple abnormal categories can be obtained. The abnormal categories are sorted in a preset order, and the abnormal type is assigned a value according to the status of each abnormal category to generate different category labels.
[0086] For example, such as Figure 2 , Figure 3 and Figure 4 As shown in the figure, small black squares represent hair follicles, large black rectangles represent foreign bodies, and irregular black blocks represent bleeding. If the abnormal data can be categorized into foreign bodies and bleeding, the presence of a foreign body or bleeding is marked as 1, and the absence of a foreign body or bleeding is marked as 0. The category labels obtained after classifying the abnormal data are shown in Table 1 below:
[0087] Table 1:
[0088] foreign body Bleeding Category Tags 0 0 00 0 1 01 1 0 10 1 1 11
[0089] In Table 1, 00 indicates no foreign body and no bleeding, and 01 indicates no foreign body but bleeding. Figure 3 (as shown in the image), 10 indicates the presence of a foreign object without bleeding. Figure 2 (As shown in the image), 11 indicates the presence of a foreign object and bleeding. Figure 4 (as shown in the image).
[0090] Understandably, if abnormal categories are identified as shown in Table 1, the total number of categories will increase exponentially with each new category added. For example, if only bleeding and abnormality are monitored, there will be 4 classification results [00, 01, 10, 11]. However, with the addition of tensioner identification monitoring, 8 categories are required, which may result in 8 classification results [000, 001, 010, 011, 100, 101, 110, 111].
[0091] The above-described abnormal data classification is merely exemplary. More classification types and different category labeling methods can be added according to actual circumstances. This application does not impose any specific limitations.
[0092] In the above implementation process, by classifying various abnormal data and determining category labels, the abnormal data can be trained according to different categories. This not only enables the anomaly detection model to detect abnormalities in scalp images but also to identify the corresponding abnormality types, facilitating timely determination of appropriate countermeasures for abnormalities occurring during the surgical procedure. Furthermore, by training the model according to abnormality categories, the same training process is applied to abnormalities of the same type, reducing the number of training iterations and the difficulty of model training, thereby lowering the training difficulty of the anomaly detection model and improving its training efficiency and the accuracy of anomaly detection.
[0093] In one possible implementation, step 204 includes: inputting the scalp image and the category label of the scalp image into the shallow neural network respectively, so as to iteratively optimize the shallow neural network through a loss function; if the iteration termination condition is reached, stop iteratively optimizing the shallow neural network, and determine that the current shallow neural network is an anomaly detection model.
[0094] The loss function here can be an information loss function, an information entropy loss function, a relative entropy loss function, a cross-entropy loss function, etc. The optimization direction of this loss function for shallow neural networks is to iteratively reduce the deviation between the model's predicted values and the true values, thereby increasing the model's accuracy.
[0095] The amount of information conveyed is related to the probability of the event occurring. A higher probability results in a smaller amount of information, and a lower probability results in a larger amount of information. In other words, an event that is certain to occur conveys zero information. This amount of information can be expressed by the following formula:
[0096] I(X) = -ln(P(x));
[0097] Where P(x) is the true distribution of the sample, and I(X) is the information content.
[0098] Information entropy is used to represent the expected amount of information contained within something. The formula for the information entropy function is as follows:
[0099]
[0100] Where n represents all possibilities at a given time, P(x) i Let H(X) be the true distribution of the sample, and H(X) be the information entropy.
[0101] Relative entropy is used to measure the difference between two probability distributions. The formula for the relative entropy function is as follows:
[0102]
[0103] Wherein, P(x i Let be the true distribution of the sample, and Q(x) be the true distribution of the sample. i D is the distribution predicted by the model trained on the sample. KL (||q) represents the relative entropy.
[0104] After transforming the above relative entropy, we can obtain the following formula:
[0105] The formula for relative entropy, after transformation, shows that the relative entropy equals the information entropy plus the cross entropy. Therefore, the cross entropy is:
[0106]
[0107] Wherein, P(x i Let be the true distribution of the sample, and Q(x) be the true distribution of the sample. i H(p,q) represents the distribution predicted by the model trained on the samples, and H(p,q) represents the cross-entropy.
[0108] The iteration termination condition can include a maximum number of iterations and a difference threshold. The difference threshold is the maximum acceptable difference between the model's predicted value and the true value. When the difference between the model's predicted value and the true value is less than this threshold, it indicates that the shallow neural network's prediction accuracy has met the accuracy requirements after multiple iterations. Therefore, iterative optimization of the shallow neural network can be stopped. Of course, in some cases, a maximum number of iterations can also be set as the iteration termination condition; that is, when the shallow neural network has reached a certain number of iterations, it can be determined that the shallow neural network meets the accuracy requirements. Therefore, iterative optimization of the shallow neural network can be stopped.
[0109] In the above implementation process, the shallow neural network is iteratively optimized using a loss function. By gradually calculating the difference between the model's predicted values and the true values, the accuracy of the shallow neural network is ensured. Furthermore, when the iteration termination condition is met, the iterative optimization of the shallow neural network is stopped, which ensures the accuracy of the iterated shallow neural network while achieving automated training.
[0110] In one possible implementation, the loss function is the cross-entropy loss function.
[0111] Understandably, during model training, outlier data and class labels are often already determined, thus the true distribution of the samples is also determined. Therefore, information entropy is usually a constant. Since relative entropy represents the difference between the true probability distribution and the predicted probability distribution, a smaller value indicates a better prediction result. Therefore, it is necessary to minimize relative entropy. Cross-entropy equals relative entropy plus information entropy (a constant). Because the formula for cross-entropy is easier to calculate than that for relative entropy, using the cross-entropy loss function to iteratively optimize this shallow neural network can reduce the difficulty of iterative calculation and improve iterative efficiency.
[0112] In the above implementation process, since the formula of the cross-entropy loss function is relatively simple, it is possible to reduce the difficulty of iterative calculation by using the cross-entropy loss function to iteratively optimize the shallow neural network, thereby improving the efficiency of iterative optimization.
[0113] In one possible implementation, step 203 includes: performing convolution operations on the scalp image and determining the residual network of the activation layer based on the convolution operation result; determining the convolutional layer based on the residual network and establishing the residual structure based on the convolutional layer; and establishing a shallow neural network through the residual structure.
[0114] Understandably, in order for the input scaled-down scalp image data x to be added to F(x) to form a residual network, it is necessary to maintain consistency in data dimensions, which requires performing a convolution operation on x. This can be expressed by the following formula:
[0115]
[0116] Where x is the input data, F(x) is the residual part, Conv is the convolution operation, BN is the normalization operation, ReLU is the activation function of the activation layer, and y is the residual network.
[0117] The residual structure here includes multiple convolutional layers, which can be 1*1 convolutional layers, 3*3 convolutional layers, etc.
[0118] In one implementation, the residual structure is a bottleneck layer.
[0119] For example, such as Figure 5 As shown, the first layer of this shallow neural network is constructed as follows: First, the scalp image is preprocessed to obtain a 224×224×3 scalp image. Then, a 7x7 convolution with a stride of 2 is used for normalization and activation function processing to obtain a 112×112×64 scalp image. Finally, a 3x3 max pooling layer with a stride of 2 is added to obtain a 56×56×64 data point.
[0120] like Figure 6 As shown, the first bottleneck layer of the second layer of this shallow neural network is established in the following way: the 56×56×3 data is normalized and processed by activation function through two 3x3 convolutions with a stride of 1 to obtain a 56×56×64 data.
[0121] like Figure 7 As shown, the second bottleneck layer of the second layer of this shallow neural network is established in the following way: the 56×56×64 data is normalized and activated by a 1x1 convolution with a stride of 1, then normalized and activated by a 3x3 convolution with a stride of 1, and then normalized and activated by a 1x1 convolution with a stride of 1 to obtain a 56×56×256 data.
[0122] like Figure 8As shown, the third bottleneck layer of the second layer of this shallow neural network is established in the following way: the 56×56×256 data is normalized and activated by a 1x1 convolution with a stride of 1, then normalized and activated by a 3x3 convolution with a stride of 1, and then normalized and activated by a 1x1 convolution with a stride of 1 to obtain a 28×28×512 data.
[0123] Understandably, the structure of the second layer and the subsequent third, fourth, and fifth layers of this shallow neural network is roughly the same as that of the first layer, except that the convolution of the first bottleneck layer of each layer is different, while the structure of each other layer is consistent with that of the first layer.
[0124] In the above implementation process, a shallow neural network is established through the residual structure. Since the residual structure is composed of multiple convolutional layers, and the computational cost of convolutional layers is relatively small, the computational cost of the shallow neural network can be reduced, thereby improving the training efficiency of the anomaly detection model.
[0125] In one possible implementation, as shown in the figure, the shallow neural network includes a first layer, a second layer, a third layer, and a fourth layer; the first layer includes three residual structures; the second layer includes four residual structures; the third layer includes six residual structures; and the fourth layer includes three residual structures.
[0126] In this shallow neural network, the stride of the first 3x3 convolutional layer is 2, and the stride of the other convolutional layers is 1. Downsampling is used in this shallow neural network.
[0127] In the above implementation process, this shallow neural network is constructed by setting up multiple layers, each including multiple residual structures. This breaks through the bottleneck that residual structures can only be used in deep neural networks, thus expanding the application scenarios of residual structures. Furthermore, constructing a shallow neural network using residual structures is simple in computation, resulting in a simpler structure for the shallow neural network itself. This significantly reduces the time the anomaly detection model spends processing abnormal data, thereby improving the training efficiency of the anomaly detection model.
[0128] In one possible implementation, after step 201, the method further includes: preprocessing the scalp image to obtain a preprocessed scalp image; step 203 includes: training a shallow neural network using the preprocessed scalp image to determine an anomaly detection model. The preprocessing here includes enlarging or reducing the scalp image. For example, if the acquired scalp image is smaller than an image threshold, it can be enlarged. If the acquired scalp image is larger than an image threshold, it can be reduced.
[0129] For example, typical industrial cameras have a resolution of 500W-1200W pixels, resulting in relatively large scalp images. Directly training or detecting anomalies on these images would increase the time required for model training and prediction. Therefore, the images can be downsized before network training and anomaly prediction, allowing for training and prediction on the reduced-size scalp images, thus reducing the training and prediction time.
[0130] The scaling down or enlarging of the scalp image can be achieved by changing the image size, i.e., changing the image size according to the aspect ratio, or by scaling the image down as needed. Alternatively, operations such as resizing and normalization can be used to process the image. The scaling down or enlarging method for the scalp image in this application can be adjusted according to the actual situation, and this application does not impose specific limitations.
[0131] For example, after obtaining the scalp image, a 224*224*3 scalp image is obtained. Then, after normalization and ReLU activation function processing by a 7×7 convolution with a stride of 2, a 3x3 max pooling layer with a stride of 2 is added to obtain the final 56*56*64 data.
[0132] In some embodiments, the scalp image can also undergo preprocessing for target extraction using computer vision algorithms, making the object to be detected more prominent and resulting in higher accuracy and faster classification by the network. The computer vision algorithms mentioned here include, but are not limited to, CNN, RNN, and other algorithms.
[0133] In the above implementation process, the acquired scalp image is preprocessed to enlarge or reduce it according to the actual hardware conditions, ensuring that the scalp image maintains a uniform size and facilitating feature extraction. Furthermore, for larger scalp images, they can be reduced in size before training the anomaly detection model, reducing the training time using scalp images and thus improving training efficiency.
[0134] In one possible implementation, after step 201, the method further includes: pre-classifying the scalp image; step 203 includes: training a shallow neural network using the pre-classified scalp image to determine an anomaly detection model.
[0135] Understandably, when faced with more complex classification tasks, pre-classification operations can be performed in advance, such as using machine learning methods like SVM and KDTree to pre-classify images first, and then perform neural network learning and training for fine classification, in order to reduce model complexity and improve real-time response frequency.
[0136] In the above implementation process, the scalp image is first pre-classified, and then the model is trained based on the pre-classified scalp image to achieve fine classification of the scalp image. Since the scalp image has already undergone coarse classification before model training, the training difficulty is reduced, the complexity of the model is greatly reduced, and the frequency of real-time response is improved.
[0137] In one possible implementation, the shallow neural network is a classification neural network that satisfies real-time response requirements.
[0138] The classification neural networks that meet the requirements of real-time response can include: ResNet18, ResNet34, ResNet101, etc.
[0139] In the above implementation process, by selecting a classification neural network that can meet the requirements of real-time response as the shallow neural network, not only can the classification of scalp images be achieved, but the accuracy and real-time performance of the classification can also be improved.
[0140] Please see Figure 9 This is a flowchart of the anomaly monitoring method provided in the embodiments of this application. The following will describe... Figure 9 The specific process shown will be explained in detail.
[0141] Step 301: Obtain scalp images of the area to be monitored.
[0142] The area to be monitored is the area where the hair transplant surgery was performed.
[0143] The scalp images here can be acquired using devices such as industrial cameras, video cameras, and scanners. The scalp images of the area to be monitored can be acquired in real time or at preset intervals. The acquisition time of the scalp images of the area to be monitored can be adjusted according to actual circumstances, and this application does not impose specific limitations.
[0144] Step 302: Input the scalp image into the anomaly detection model to determine whether there are any abnormalities in the scalp image.
[0145] The anomaly monitoring model is created using the anomaly monitoring model creation method described above.
[0146] Understandably, after the scalp image is input into the anomaly detection model, the anomaly detection model can extract the abnormal features in the scalp image and output the corresponding anomaly label to determine the corresponding anomaly type based on the anomaly label.
[0147] In the above implementation process, the anomaly monitoring model is constructed using residual structures and shallow neural networks. The structure and calculation of the anomaly monitoring model are relatively simple, thus improving the efficiency of anomaly monitoring.
[0148] Based on the same application concept, this application also provides an anomaly monitoring model creation device corresponding to the anomaly monitoring model creation method. Since the principle of the device in this application is similar to that of the aforementioned anomaly monitoring model creation method, the implementation of the device in this application can refer to the description in the above method embodiments, and the repeated parts will not be repeated.
[0149] Please see Figure 10 This is a functional module diagram of the anomaly monitoring model creation device provided in this application embodiment. Each module in the anomaly monitoring model creation device in this embodiment is used to execute the steps in the above method embodiments. The anomaly monitoring model creation device includes a first acquisition module 401, a creation module 402, and a training module 403; wherein,
[0150] The first acquisition module 401 is used to acquire scalp images of the area to be monitored, which is the area to be operated on during hair transplant surgery.
[0151] The module 402 is used to build a shallow neural network through a residual structure, wherein the residual structure is used to adjust the dimension of the shallow neural network.
[0152] The training module 403 is used to train the shallow neural network using the scalp image to determine an anomaly detection model.
[0153] In one possible implementation, the anomaly monitoring model creation device further includes a classification module for classifying abnormal data in the scalp image to obtain multiple anomaly categories; and for sorting the anomaly categories in a preset order, and determining corresponding category labels based on the sorting order of the anomaly categories and the status of each category, so as to determine the anomaly category present in the scalp image through the category labels.
[0154] In one possible implementation, the training module 403 is further configured to input the scalp image and the category label of the scalp image into the shallow neural network respectively, so as to iteratively optimize the shallow neural network through a loss function; if the iteration termination condition is reached, the iterative optimization of the shallow neural network is stopped, and the current shallow neural network is determined to be an anomaly detection model.
[0155] In one possible implementation, the establishment module 402 is further configured to perform convolution operations on the scalp image and determine the residual network of the activation layer based on the convolution operation result; determine the convolutional layer based on the residual network and establish the residual structure based on the convolutional layer; and establish the shallow neural network through the residual structure.
[0156] In one possible implementation, the anomaly detection model creation device further includes: a preprocessing module for preprocessing the scalp image to obtain a preprocessed scalp image; and a training module for training the shallow neural network using the preprocessed scalp image to determine the anomaly detection model.
[0157] In one possible implementation, the anomaly detection model creation device further includes: a pre-classification module for pre-classifying the scalp image; and a training module for training the shallow neural network using the pre-classified scalp image to determine the anomaly detection model.
[0158] Based on the same application concept, this application also provides an anomaly monitoring device corresponding to the anomaly monitoring method. Since the principle of the device in this application is similar to that of the aforementioned anomaly monitoring method, the implementation of the device in this application can refer to the description in the above method embodiments, and the repeated parts will not be described again.
[0159] Please see Figure 11 This is a functional module diagram of the anomaly monitoring device provided in this application embodiment. Each module in the anomaly monitoring device in this embodiment is used to execute the steps in the above method embodiments. The anomaly monitoring device includes a second acquisition module 501 and a determination module 502; wherein,
[0160] The second acquisition module 501 is used to acquire scalp images of the area to be monitored, which is the area where hair transplant surgery is performed.
[0161] The determination module 502 is used to input the scalp image into the anomaly detection model to determine whether there is an anomaly in the scalp image; wherein, the anomaly detection model is created by any one of the above-described anomaly detection model creation methods.
[0162] To facilitate understanding of this embodiment, the electronic device for implementing the anomaly monitoring model creation method and the anomaly monitoring method disclosed in this application will be described in detail below. It is understood that the anomaly monitoring model creation method and the anomaly monitoring method may use the same electronic device or different electronic devices; this application makes specific limitations. The following description uses the example of the anomaly monitoring model creation method and the anomaly monitoring method using the same electronic device to illustrate this.
[0163] like Figure 12 The diagram shown is a block diagram of an electronic device. The electronic device 100 may include a memory 111, a memory controller 112, a processor 113, and a peripheral interface 114. Those skilled in the art will understand that... Figure 12The structure shown is for illustrative purposes only and does not limit the structure of the electronic device 100. For example, the electronic device 100 may also include components that are more... Figure 12 The more or fewer components shown, or having the same Figure 12 The different configurations shown.
[0164] The aforementioned memory 111, memory controller 112, processor 113, and peripheral interface 114 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The aforementioned processor 113 is used to execute executable modules stored in the memory.
[0165] The memory 111 can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 111 stores programs, and the processor 113 executes these programs upon receiving execution instructions. The methods executed by the electronic device 100 as defined in any embodiment of this application can be applied to or implemented by the processor 113.
[0166] The aforementioned processor 113 may be an integrated circuit chip with signal processing capabilities. The processor 113 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a digital signal processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor.
[0167] The peripheral interface 114 described above couples various input / output devices to the processor 113 and the memory 111. In some embodiments, the peripheral interface 114, the processor 113, and the memory controller 112 can be implemented on a single chip. In other instances, they can be implemented on separate chips.
[0168] The electronic device 100 in this embodiment can be used to perform the various steps in the various methods provided in the embodiments of this application.
[0169] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the anomaly monitoring model creation method described in the above method embodiments.
[0170] The anomaly monitoring model creation method and anomaly monitoring method computer program product provided in the embodiments of this application include a computer-readable storage medium storing program code, wherein the instructions included in the program code can be used to execute the steps of the anomaly monitoring model creation method described in the above method embodiments.
[0171] In one possible implementation, the anomaly detection model creation method includes: acquiring a scalp image of a region to be monitored, the region being the area to be monitored during a hair transplant surgery; establishing a shallow neural network using a residual structure, the residual structure being used to adjust the dimensions of the shallow neural network; and training the shallow neural network using the scalp image to determine an anomaly detection model.
[0172] In one possible implementation, before training the shallow neural network using the reduced scalp image to determine the anomaly detection model, the method further includes: classifying the abnormal data in the scalp image to obtain multiple anomaly categories; sorting the anomaly categories in a preset order, and determining corresponding category labels based on the sorting order of the anomaly categories and the state of each category, so as to determine the anomaly category present in the scalp image through the category labels.
[0173] In one possible implementation, training the shallow neural network using the scalp image to determine the anomaly detection model includes: inputting the scalp image and its category label into the shallow neural network, respectively, to iteratively optimize the shallow neural network using a loss function; if the iteration termination condition is met, stopping the iterative optimization of the shallow neural network and determining the current shallow neural network as the anomaly detection model.
[0174] In one possible implementation, the loss function is the cross-entropy loss function.
[0175] In one possible implementation, establishing a shallow neural network using residual structures includes: performing convolution operations on the scalp image and determining a residual network for activation layers based on the convolution results; determining convolutional layers based on the residual networks and establishing residual structures based on the convolutional layers; and establishing the shallow neural network using the residual structures. In one possible implementation, the shallow neural network includes a first layer, a second layer, a third layer, and a fourth layer; the first layer includes three residual structures; the second layer includes four residual structures; the third layer includes six residual structures; and the fourth layer includes three residual structures. In one possible implementation, the calculation formula for performing convolution operations on the scalp image and determining the residual network for activation layers based on the convolution results is: Where x is the input data, F(x) is the residual part, Conv is the convolution operation, BN is the normalization operation, ReLU is the activation function of the activation layer, and y is the residual network.
[0176] In one possible implementation, after acquiring the scalp image of the area to be monitored, the method further includes: preprocessing the scalp image to obtain a preprocessed scalp image; training the shallow neural network using the scalp image to determine the anomaly detection model includes: training the shallow neural network using the preprocessed scalp image to determine the anomaly detection model.
[0177] In one possible implementation, after acquiring the scalp image of the area to be monitored, the method further includes: pre-classifying the scalp image; and training the shallow neural network using the scalp image to determine the anomaly detection model, which includes: training the shallow neural network using the pre-classified scalp image to determine the anomaly detection model.
[0178] In one possible implementation, the shallow neural network is a classification neural network that satisfies real-time response.
[0179] In some embodiments, the computer-readable storage medium stores an additional computer program that, when executed by a processor, performs the steps of the anomaly monitoring method described in the above method embodiments.
[0180] The computer program product of the anomaly monitoring method provided in this application includes a computer-readable storage medium storing program code, wherein the instructions included in the program code can be used to execute the steps of the anomaly monitoring method described in the above method embodiments.
[0181] In one possible implementation, the anomaly detection method includes: acquiring a scalp image of a region to be monitored, the region to be monitored being the area where a hair transplant surgery is performed; inputting the scalp image into an anomaly detection model to determine whether an anomaly exists in the scalp image; wherein the anomaly detection model is created using any one of the above-described anomaly detection model creation methods.
[0182] Abnormalities here include foreign objects and adverse reactions in the body.
[0183] In one possible implementation, after inputting a scalp image into an anomaly detection model to determine whether an anomaly exists in the scalp image, the method further includes: if an anomaly exists in the scalp image, determining the anomaly category based on a category label; if the anomaly category is a foreign object, generating a foreign object removal signal to control the target device to remove the foreign object from the monitored area; if the anomaly category is an adverse reaction in the body, generating corresponding emergency measures based on the type of adverse reaction to handle the adverse reaction.
[0184] In some embodiments, if there is an abnormality in the scalp image, a pause command can be directly generated to control the surgical device to stop operating.
[0185] In the above implementation process, after the anomaly monitoring model detects anomalies in the scalp image, it can further generate corresponding emergency measures based on the anomaly category to handle the anomaly in a timely manner, thereby improving the safety of the fully automated surgical procedure.
[0186] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. 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 marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive 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 a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0187] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0188] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. It should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0189] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0190] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for creating an anomaly monitoring model, characterized in that, When applied to surgical monitoring scenarios, the method includes: Acquire scalp images of the area to be monitored, which is the area to be operated on during hair transplantation surgery; A shallow neural network is built using a residual structure, which is used to adjust the dimension of the shallow neural network. The shallow neural network is trained using the scalp images to determine an anomaly detection model; The method of establishing a shallow neural network through residual structure includes: The scalp image is subjected to convolution operation, and the residual network of the activation layer is determined based on the convolution operation result; Convolutional layers are determined based on the residual network, and a residual structure is established based on the convolutional layers; wherein, the residual structure includes multiple convolutional layers; The shallow neural network is established using the residual structure.
2. The method according to claim 1, characterized in that, The step of training the shallow neural network using the scalp image to determine the anomaly detection model includes: The scalp image and its category label are input into the shallow neural network, respectively, and the shallow neural network is iteratively optimized using a loss function. If the iteration termination condition is met, stop iteratively optimizing the shallow neural network and determine that the current shallow neural network is an anomaly detection model.
3. The method according to claim 1, characterized in that, The shallow neural network includes a first layer, a second layer, a third layer, and a fourth layer; The first layer includes three residual structures; The second layer includes four residual structures; The third layer includes six residual structures; The fourth layer includes three residual structures.
4. The method according to claim 1, characterized in that, The formula for calculating the residual network of the activation layer based on the convolution operation on the scalp image is as follows: ; in, For input data, For the residual part, Conv is the convolution operation, BN is the normalization operation, and ReLU is the activation function of the activation layer. It is a residual network.
5. The method according to claim 1, characterized in that, After acquiring the scalp image of the area to be monitored, the method further includes: The scalp image is preprocessed to obtain a preprocessed scalp image; The step of training the shallow neural network using the scalp image to determine the anomaly detection model includes: The shallow neural network is trained using the preprocessed scalp images to determine an anomaly detection model.
6. The method according to claim 1, characterized in that, After acquiring the scalp image of the area to be monitored, the method further includes: The scalp images are pre-classified; The step of training the shallow neural network using the scalp image to determine the anomaly detection model includes: The shallow neural network is trained using the pre-classified scalp images to determine the anomaly detection model.
7. The method according to any one of claims 1-6, characterized in that, The shallow neural network is a classification neural network that satisfies real-time response requirements.
8. An anomaly monitoring method, characterized in that, include: Acquire scalp images of the area to be monitored, which is the area to be operated on during hair transplantation surgery; The scalp image is input into an anomaly detection model to determine whether there are any abnormalities in the scalp image; The anomaly monitoring model is created by the method described in any one of claims 1-7.
9. An anomaly monitoring model creation device, characterized in that, The device, used in surgical monitoring scenarios, includes: The first acquisition module is used to acquire scalp images of the area to be monitored, which is the area to be operated on during hair transplantation surgery. A module is established to build a shallow neural network using a residual structure, wherein the residual structure is used to adjust the dimension of the shallow neural network. A training module is used to train the shallow neural network using the scalp images to determine an anomaly detection model; The establishment module is further configured to perform convolution operations on the scalp image and determine the residual network of the activation layer based on the convolution operation result; and Convolutional layers are determined based on the residual network, and a residual structure is established based on the convolutional layers; wherein, the residual structure includes multiple convolutional layers; The shallow neural network is established using the residual structure.
10. The apparatus according to claim 9, characterized in that, The training module is further configured to input the scalp image and the category label of the scalp image into the shallow neural network respectively, so as to iteratively optimize the shallow neural network through a loss function; as well as If the iteration termination condition is met, stop iteratively optimizing the shallow neural network and determine that the current shallow neural network is an anomaly detection model.
11. The apparatus according to claim 9, characterized in that, The device further includes: A preprocessing module is used to preprocess the scalp image to obtain a preprocessed scalp image; The training module is also used to train the shallow neural network using the preprocessed scalp image to determine an anomaly detection model.
12. The apparatus according to claim 9, characterized in that, The device further includes: A pre-classification module is used to pre-classify the scalp images; The training module is also used to train the shallow neural network using the pre-classified scalp images to determine an anomaly detection model.
13. An anomaly monitoring device, characterized in that, include: The second acquisition module is used to acquire scalp images of the area to be monitored, which is the area where hair transplant surgery is performed. The determination module is used to input the scalp image into the anomaly detection model to determine whether there is an anomaly in the scalp image; The anomaly monitoring model is created by the method described in any one of claims 1-7.
14. An electronic device, characterized in that, include: The processor and memory, the memory storing machine-readable instructions executable by the processor, wherein when the electronic device is running, the machine-readable instructions, when executed by the processor, perform the steps of the method as described in any one of claims 1 to 7 or 8.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method as described in any one of claims 1 to 7 or 8.