Farming status monitoring method and system based on visual monitoring
By applying a deep learning abnormal diagnosis network in breeding status monitoring, combined with the diagnostic boundary offset enhancement amount, and optimizing network parameters, the problem of high false alarm and misreport rates in the existing technology and difficulty in distinguishing between normal and abnormal states is solved, and more efficient and accurate breeding status monitoring is achieved.
Patent Information
- Application Number
- CN202411090345.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-08-09
AI Technical Summary
The existing artificial intelligence visual monitoring technology faces high false alarms and underreport rates in breeding status monitoring, and it is difficult to accurately distinguish between normal and abnormal states, especially when dealing with edge cases and rare abnormalities, and the model is prone to overfitting or underfitting, which affects the accuracy and stability of monitoring.
A breeding state abnormality diagnosis network based on deep learning is adopted. By obtaining visual data of the breeding area, feature vectors are extracted, and compared with expert detection content, combined with the diagnostic boundary offset enhancement amount, the boundaries between abnormal diagnosis labels are strengthened, network parameters are optimized, and monitoring accuracy and efficiency are improved.
It significantly improves the accuracy and efficiency of breeding status monitoring, can more accurately identify subtle changes in breeding status, generate more accurate abnormal diagnosis tags, support timely intervention and management decisions of the breeding farm, improve the level of automated management, and ensure animal health and production efficiency.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and more specifically, to a farming status monitoring method and system based on visual monitoring. Background Art
[0002] In modern farming, ensuring the health and production efficiency of farmed animals is crucial. Traditional farming status monitoring methods often rely on manual inspections, which is not only time-consuming and labor-intensive, but also difficult to achieve all-weather, all-angle monitoring of the farming environment. With the rapid development of artificial intelligence technologies such as computer vision and deep learning, farming status monitoring methods based on visual monitoring have gradually attracted attention from the industry.
[0003] However, existing AI-based visual monitoring technology still faces many challenges in the field of aquaculture status monitoring. On the one hand, the aquaculture environment is complex and changeable, and factors such as lighting conditions, obstructions, and animal behavior will affect the visual detection effect, resulting in high false alarm and missed alarm rates. On the other hand, the aquaculture status of different aquaculture areas varies significantly, and traditional monitoring methods are difficult to accurately distinguish between normal and abnormal states, especially when dealing with edge cases and rare anomalies.
[0004] In order to overcome these challenges, relevant technologies have begun to explore the use of deep learning networks for aquaculture status monitoring. Deep learning networks have powerful feature extraction and classification capabilities, and can automatically learn and identify key features of aquaculture status from visual data. However, existing deep learning monitoring methods mostly focus on model construction and optimization, while ignoring the strengthening of diagnostic boundaries and the effective use of training errors, which makes the model prone to overfitting or underfitting in practical applications, affecting the accuracy and stability of monitoring. Summary of the invention
[0005] In view of the above-mentioned problems, in combination with the first aspect of the present application, an embodiment of the present application provides a farming status monitoring method based on visual monitoring, the method comprising:
[0006] Obtaining visual detection content of farming status and expert detection content of farming status of each sample farming area visual data in X sample farming area visual data, and extracting farming status feature vectors of visual detection content of farming status and expert detection content of farming status of each sample farming area visual data by using farming status abnormality diagnosis network, wherein X is a positive integer;
[0007] According to the previously defined diagnostic boundary offset reinforcement amount, as well as the farming state feature vector of the farming state visual detection content and the farming state feature vector of the farming state expert detection content of each sample farming area visual data, the diagnostic boundary between the sample farming area visual data with different abnormal diagnosis labels in the X sample farming area visual data is reinforced to generate the network training error of the farming state abnormal diagnosis network;
[0008] According to the network training error, updating the network parameters of the abnormal breeding status diagnosis network;
[0009] Obtain visual detection content of the breeding status after visual detection of the visual data of the target breeding area, perform abnormal diagnosis label diagnosis on the visual detection content of the breeding status of the visual data of the target breeding area according to the breeding status abnormal diagnosis network after network parameters are updated, and generate abnormal diagnosis label diagnosis results of the visual data of the target breeding area.
[0010] On the other hand, an embodiment of the present application also provides a breeding monitoring system, including a processor and a machine-readable storage medium, wherein the machine-readable storage medium is connected to the processor, the machine-readable storage medium is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the machine-readable storage medium to implement the above method.
[0011] Based on the above aspects, the embodiments of the present application significantly improve the accuracy and efficiency of farming status monitoring by integrating advanced deep learning technology and refined diagnostic boundary reinforcement strategies. Specifically, the breeding status abnormality diagnosis network is used to automatically extract the feature vectors of the visual data of the breeding area, and compare them with the detection content of the breeding status expert, which effectively integrates artificial intelligence and the wisdom of human experts. By introducing the diagnostic boundary offset reinforcement amount, the boundary between different abnormal diagnosis labels is strengthened, so that the network can more accurately identify subtle changes in the breeding status during the training process, thereby generating a more accurate network training error. Based on the network training error, the parameters of the breeding status abnormality diagnosis network are updated to continuously optimize the classification ability of the network. Finally, the updated network is used to perform real-time abnormal diagnosis of the target breeding area, and the abnormal diagnosis label diagnosis results can be generated quickly and accurately, providing data support for timely intervention and management decisions of the farm, which not only improves the level of automated management of the farm, but also effectively guarantees the health and production benefits of farmed animals. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a schematic diagram of the execution flow of the farming status monitoring method based on visual monitoring provided in an embodiment of the present application.
[0013] Figure 2It is a schematic diagram of the hardware architecture of the breeding monitoring system provided in the embodiment of the present application. DETAILED DESCRIPTION
[0014] The present application will be described in detail below with reference to the accompanying drawings. Figure 1 This is a flow chart of a farming status monitoring method based on visual monitoring provided by an embodiment of the present application. The farming status monitoring method based on visual monitoring is introduced in detail below.
[0015] Step S110, obtaining the visual detection content of the breeding state and the expert detection content of the breeding state of each sample breeding area visual data in X sample breeding area visual data, and using the breeding state abnormality diagnosis network to extract the breeding state feature vector of the visual detection content of the breeding state of each sample breeding area visual data and the breeding state feature vector of the breeding state expert detection content, where X is a positive integer.
[0016] In detail, the sample breeding area visual data refers to visual information captured from a specific breeding area of a large pig farm, in the form of a video stream or image sequence, reflecting the breeding status of pigs at different time points. For example, a large pig farm, where area A is a sample breeding area. The server captures a video stream over a period of time from the high-definition camera of the sample breeding area as the sample breeding area visual data, which contains key information such as the pigs' activities, eating status, and body changes.
[0017] The farming status visual detection content refers to the pig farming status information, such as activity level, eating conditions, health status, etc., identified after the visual monitoring system automatically analyzes the visual data of the sample farming area. For example, the server uses the visual monitoring system to analyze the video stream of area A, and automatically identifies the farming status visual detection content such as the frequency of pig activities, whether the eating is normal, and whether the body is healthy. The farming status expert detection content refers to the pig farming status information manually marked by experienced farming experts based on field observations or video playback. These pig farming status information serves as a reference standard for network learning. For example, by watching the video playback of area A, the farming expert manually marks the pig's health status, behavior patterns and other detailed information to form the farming status expert detection content. These farming status expert detection contents are compared with the automatic detection results of the visual monitoring system to evaluate the accuracy of the system.
[0018] The abnormal breeding status diagnosis network is a deep learning-based model that automatically analyzes visual data in the breeding area, identifies the breeding status of pigs, and predicts potential abnormal problems. For example, the server deploys a abnormal breeding status diagnosis network based on a convolutional neural network (CNN). The network automatically determines whether the breeding status of pigs is normal by extracting feature vectors from visual data, and predicts possible abnormal problems such as disease, malnutrition, etc.
[0019] The breeding state feature vector refers to a numerical vector obtained by extracting features from the visual detection content of the breeding state or the expert detection content through the breeding state abnormality diagnosis network, and contains key information characterizing the breeding state. For example, the server uses the breeding state abnormality diagnosis network to extract features from the visual detection content of the breeding state in area A, and obtains a set of breeding state feature vectors containing information such as pig activity, body shape, and color distribution. These feature vectors are used in subsequent network training and optimization processes.
[0020] That is, in this embodiment, a large pig farm is distributed with multiple breeding areas, each of which is equipped with a high-definition camera for real-time monitoring of the pig breeding status. In order to ensure the health and production efficiency of the pigs, the farm has introduced a visual monitoring system that can automatically analyze the visual data captured by the camera, identify the pig breeding status, such as activity level, eating conditions, health status, etc., and compare it with the expert detection content to find potential abnormal problems.
[0021] Specifically, the server first obtains X sample breeding area visual data from the farm database. Assume that X=10, that is, the visual data of 10 different breeding areas are selected as training samples. Each sample breeding area visual data includes a video stream or image sequence of a certain period of time in the breeding area, and these sample breeding area visual data reflect the breeding status of pigs at different time points.
[0022] The server then calls the abnormal breeding status diagnosis network to process the visual data of each breeding area. Specifically, the abnormal breeding status diagnosis network first extracts features from the visual detection content through models such as convolutional neural networks (CNNs) to generate breeding status feature vectors of the visual detection content of the breeding status. These breeding status feature vectors can contain information such as the activity, body shape, and color distribution of the pigs, which are used to characterize the breeding status detected by vision.
[0023] At the same time, the server also obtains the expert detection content of the breeding status of each sample breeding area. These expert detection contents are manually annotated by experienced breeding experts based on field observations or video playback, including detailed information such as the health status and behavior patterns of the pigs. The server also uses the breeding status abnormality diagnosis network to extract features from the expert detection content and generate the corresponding breeding status feature vector.
[0024] For example, suppose the visual inspection content of the first sample breeding area (area A) shows that the pigs are active and eat normally, and the expert inspection content also confirms this observation. The visual inspection feature vector extracted by the server through the abnormal diagnosis network can include high activity coefficients, normal body coefficients, etc.; the corresponding expert inspection feature vector also contains similar information.
[0025] Step S120, based on the previously defined diagnostic boundary offset reinforcement amount, and the farming state feature vector of the farming state visual detection content of each sample farming area visual data and the farming state feature vector of the farming state expert detection content, the diagnostic boundary between the sample farming area visual data with different abnormal diagnosis labels in the X sample farming area visual data is reinforced to generate a network training error of the farming state abnormal diagnosis network.
[0026] In detail, the diagnostic boundary offset reinforcement amount is a preset parameter used to adjust the distance between samples of different categories in the feature space to enhance the classification ability of the network. By strengthening the boundaries between different abnormal diagnostic labels, the sensitivity of the network to changes in complex breeding states can be improved. For example, the server sets a diagnostic boundary offset reinforcement amount δ to adjust the distance between samples of different categories in the feature space. If the similarity between the visual detection feature vector and the expert detection feature vector of the visual data of a sample breeding area is high (meaning that the network prediction is consistent with the expert judgment), the server can slightly reduce this similarity value (by subtracting a small positive number) to avoid the network from being overconfident; on the contrary, if the similarity is low, the server will increase this value (by adding a small positive number) to prompt the network to pay more attention to such inconsistencies.
[0027] The network training error refers to the difference between the network prediction results and the expert judgment or the true label during the network training process. This error is used to guide the update of network parameters to minimize the prediction error. For example, during the training of the abnormal breeding status diagnosis network, the server calculates the difference between the network prediction results and the expert detection content to obtain the network training error. The network training error reflects the current learning state of the network. The server adjusts the network parameters through the back propagation algorithm according to this error to optimize the network performance.
[0028] Therefore, in this embodiment, the diagnostic boundary offset reinforcement amount defined previously is then used to strengthen the diagnostic boundary between samples with different abnormal diagnostic labels in the visual data of the X sample breeding areas. The diagnostic boundary offset reinforcement amount is a preset parameter used to adjust the distance between samples of different categories in the feature space to enhance the classification ability of the network.
[0029] For each sample of farming area visual data, the server calculates the distance (or similarity) between the feature vector of its farming status visual detection content and the feature vector of the farming status expert detection content. Then, this distance is adjusted according to the diagnostic boundary offset reinforcement amount to strengthen the boundaries between different abnormal diagnostic labels.
[0030] For example, if the similarity between the visual detection feature vector and the expert detection feature vector of a sample breeding area visual data is already very high (meaning that the network prediction is consistent with the expert judgment), the server can slightly reduce this similarity value to avoid the network being overconfident; on the contrary, if the similarity is low, the server will increase this value to encourage the network to pay more attention to such inconsistencies.
[0031] Through this enhanced processing, the server generates a network training error for the breeding status abnormality diagnosis network, which reflects the difference between the network prediction and the expert judgment and is the basis for updating the network parameters.
[0032] For example, assuming that the original similarity between the visual detection feature vector and the expert detection feature vector of region A is 0.9 (out of 1), the server adjusts this similarity to 0.85 based on the diagnostic boundary offset reinforcement. If the visual detection and expert detection similarity of another sample region B is only 0.6, the server may adjust it to 0.65 to strengthen the network's attention to this inconsistency.
[0033] Step S130: updating the network parameters of the abnormal breeding status diagnosis network according to the network training error.
[0034] Based on the network training error generated in step S120, the server updates the parameters of the abnormal breeding status diagnosis network. This process is implemented through the back propagation algorithm, that is, the weights and biases of the network are adjusted layer by layer according to the error signal to minimize the training error.
[0035] In a possible implementation, the server first performs pre-network learning, and optimizes the initial parameters of the network using the first pre-network learning error (i.e., the error generated in step S120). Pre-network learning mainly focuses on improving the network's ability to recognize basic farming states, such as distinguishing between normal and abnormal states.
[0036] Subsequently, the server may further perform advanced optimization by obtaining more sample data (such as K samples, K>X) and using the first advanced optimization error to make more detailed adjustments to the network. Advanced optimization aims to enhance the sensitivity of the abnormal breeding state diagnosis network to complex breeding state changes and improve the accuracy of diagnosis.
[0037] For example, in the pre-network learning stage, the server adjusted the convolution kernel weights of the CNN layer and the parameters of the pooling layer in the abnormal breeding status diagnosis network based on the training errors of areas A to J (a total of 10 areas), so that the abnormal breeding status diagnosis network can more accurately identify the activity levels and body changes of pigs.
[0038] In the advanced optimization stage, the server obtained visual data of an additional five sample breeding areas (area K to area O) and performed feature extraction and similarity calculation on these new data. By comparing the feature differences between these new data and the original data, the server further fine-tuned the parameters of the breeding status abnormality diagnosis network, especially in dealing with edge cases and rare abnormal states.
[0039] Step S140, obtaining the visual detection content of the breeding status after visual detection of the visual data of the target breeding area, performing abnormal diagnosis label diagnosis on the visual detection content of the breeding status of the visual data of the target breeding area according to the breeding status abnormal diagnosis network after the network parameters are updated, and generating abnormal diagnosis label diagnosis results of the visual data of the target breeding area.
[0040] After pre-network learning and advanced optimization, the server's breeding status abnormality diagnosis network has achieved a high diagnostic accuracy. At this point, the server can receive new visual data of the target breeding area and perform abnormality diagnosis.
[0041] For the target breeding area, the server first performs visual inspection on it to obtain the visual inspection content of the breeding status. Then, the updated breeding status abnormality diagnosis network is used to extract features and perform abnormality diagnosis label diagnosis on the visual inspection content. Finally, the server generates the abnormality diagnosis label diagnosis results of the target breeding area and feeds back the results to the farm manager or automatic control system.
[0042] For example, suppose the server receives visual data of a new target breeding area (area P), which shows that some pigs in the target breeding area are less active and thin. The server processes the visual data of these target breeding areas through the abnormal diagnosis network, extracts the corresponding breeding status feature vector, and after diagnosis, the breeding status abnormal diagnosis network outputs an abnormal diagnosis label that indicates that the target breeding area has potential health problems, and specifically points out that it may be malnutrition or early symptoms of disease.
[0043] Based on the diagnostic results of the server, the management quickly organized professionals to go to area P for on-site inspection and took corresponding measures to solve the problem, thus ensuring the health and production efficiency of the pigs.
[0044] Based on the above steps, the embodiment of the present application significantly improves the accuracy and efficiency of farming status monitoring by integrating advanced deep learning technology and refined diagnostic boundary reinforcement strategy. Specifically, the breeding state abnormality diagnosis network is used to automatically extract the feature vector of the visual data of the breeding area, and compare it with the detection content of the breeding state expert, which effectively integrates artificial intelligence and the wisdom of human experts. By introducing the diagnostic boundary offset reinforcement amount, the boundary between different abnormal diagnosis labels is strengthened, so that the network can more accurately identify subtle changes in the breeding state during the training process, thereby generating a more accurate network training error. Based on the network training error, the parameters of the breeding state abnormality diagnosis network are updated to continuously optimize the classification ability of the network. Finally, the updated network is used to perform real-time abnormal diagnosis of the target breeding area, and the abnormal diagnosis label diagnosis results can be generated quickly and accurately, providing data support for timely intervention and management decisions of the farm, which not only improves the level of automated management of the farm, but also effectively guarantees the health and production benefits of farmed animals.
[0045] In a possible implementation, the network parameter updating step of the abnormal breeding status diagnosis network includes pre-network learning, and the network training error includes a first pre-network learning error.
[0046] Step S120 includes: strengthening the diagnostic boundary between the farming status feature vector of the farming status visual detection content of the farming status visual data of each sample farming area and the farming status feature vector of the farming status expert detection content according to the diagnostic boundary offset reinforcement amount, and determining the first front network learning error.
[0047] Step S130 includes: performing pre-network learning on the abnormal breeding status diagnosis network according to the first pre-network learning error.
[0048] In this embodiment, it is assumed that the server retrieves 10 sample breeding area visual data from the database of the breeding farm. These sample breeding area visual data include video streams or image sequences, covering the breeding status of pigs at different time points.
[0049] In detail, for each sample (such as area A), the server calls the feature extraction module in the abnormal breeding status diagnosis network to process the visual detection content. Through models such as CNN, the server extracts the breeding status visual detection feature vectors V_A_visual from the visual data. These feature vectors contain key information such as the activity, body shape, and color distribution of the pigs. At the same time, the server also obtains the expert detection content of the corresponding sample, and uses the same feature extraction module to extract the breeding status expert detection feature vectors V_A_expert. These feature vectors represent the judgment of the breeding experts on the breeding status of the pigs.
[0050] Next, the server calculates the similarity between the visual detection feature vector of the farming status of each sample farming area visual data and the expert detection feature vector of the farming status. This is usually achieved by calculating the dot product similarity coefficient of the two feature vectors and performing appropriate transformations (such as inverse tangent transformations) to obtain a feature space cost between -π / 2 and π / 2, which represents the degree of similarity between the two feature vectors.
[0051] For example, for region A, the server calculates the original similarity (expressed in the form of feature space cost) between V_A_visual and V_A_expert as C_A_original.
[0052] The server then applies a predefined diagnostic boundary offset reinforcement amount (assumed to be δ) to strengthen the boundaries between different abnormal diagnostic labels. The specific operation is to add the reinforcement amount to the original feature space cost, thereby increasing or decreasing the distance between feature vectors.
[0053] For region A, the enhanced feature space cost C_A_enhanced = C_A_original + δ. If the original similarity is high (i.e., the C_A_original value is small, indicating that the network prediction is more consistent with the expert judgment), the enhancement amount may slightly reduce this value to avoid the network being overconfident; conversely, if the original similarity is low, the enhancement amount will increase this value, prompting the network to pay more attention to this inconsistency.
[0054] The server performs the above operations on all samples (regions A to J) to obtain a set of enhanced feature space costs. Then, the server aggregates these feature space costs and calculates the average or weighted average to form the first pre-network learning error E_pre_training, which reflects the degree of difference between the network in the initial learning stage and the expert judgment.
[0055] Therefore, the server uses the back propagation algorithm to adjust the weights and biases of the abnormal breeding status diagnosis network layer by layer according to the first pre-network learning error E_pre_training. During the back propagation process, the error signal is back propagated from the output layer to the input layer, and the weights and biases of each layer are updated according to the gradient of the error signal to minimize the training error.
[0056] In detail, the server uses the gradient descent method or its variants (such as the Adam optimizer) to perform parameter optimization. In each iteration, the server calculates the gradient of the error with respect to the network parameters and updates these parameters according to the learning rate. Through multiple iterations, the server's breeding status abnormality diagnosis network gradually converges to a relatively stable state, and its parameter configuration minimizes the difference between the network prediction and the expert judgment.
[0057] In a possible implementation manner, the diagnostic limit offset enhancement amount includes a feature space offset enhancement amount, and according to the diagnostic limit offset enhancement amount, the diagnostic limit between the farming state feature vector of the farming state visual detection content of the farming state visual data of each sample farming area and the farming state feature vector of the farming state expert detection content is enhanced to determine the first front network learning error, including:
[0058] Step S121, for the mth sample breeding area visual data among the X sample breeding area visual data, determine the first feature space cost between the breeding state feature vector of the breeding state expert detection content of the mth sample breeding area visual data and the breeding state feature vector of the breeding state visual detection content, where m is a positive integer not greater than X.
[0059] In this embodiment, the server first selects the mth sample of the X sample farming area visual data (for example, area A is the first sample, m=1). Then, the visual detection content of area A is feature extracted to obtain the farming state visual detection feature vector V_A_visual. At the same time, the server also obtains the expert detection content of area A and performs feature extraction to obtain the farming state expert detection feature vector V_A_expert.
[0060] Thus, the server calculates the similarity between V_A_visual and V_A_expert, usually measured by the dot product similarity coefficient, and performs appropriate transformation (such as arc tangent transformation) to obtain the first feature space cost C_A_original, which reflects the initial similarity between the network prediction and the expert judgment.
[0061] Step S122, based on the feature space offset enhancement amount, the first feature space cost is subjected to feature space offset enhancement to generate a second feature space cost between the farming status feature vector of the farming status expert detection content of the m-th sample farming area visual data and the farming status feature vector of the farming status visual detection content.
[0062] In this embodiment, the server obtains a predefined feature space offset enhancement amount (assuming it is δ), which is used to adjust the distance between samples of different categories in the feature space to enhance the classification ability of the network. The server adds the enhancement amount δ to the first feature space cost C_A_original to obtain the enhanced second feature space cost C_A_enhanced = C_A_original + δ. If the original similarity is high (that is, the C_A_original value is small), the enhancement amount may slightly reduce this value; conversely, if the original similarity is low, the enhancement amount will increase this value.
[0063] Step S123, determining the first front network learning error according to the second feature space cost corresponding to each sample breeding area visual data in the X sample breeding area visual data.
[0064] In this embodiment, the server repeatedly executes step S121 and step S122 for each sample (from area A to area J) in the X sample breeding area visual data to obtain the second feature space cost (C_A_enhanced, C_B_enhanced, ..., C_J_enhanced) corresponding to each sample.
[0065] The server aggregates the second feature space costs of all sample farming area visual data. According to the specific implementation, the server may calculate the average or weighted average of these second feature space costs.
[0066] Based on the aggregated second feature space cost, the server calculates a first pre-network learning error E_pre_training, which reflects the degree of difference between the network in the preliminary learning stage and the expert judgment and is the basis for updating network parameters.
[0067] In a possible implementation, step S121 includes:
[0068] Step S1211, determine the first dot product similarity coefficient between the farming status feature vector of the farming status expert detection content of the m-th sample farming area visual data and the farming status feature vector of the farming status visual detection content, and perform an inverse tangent transformation on the first dot product similarity coefficient to generate the first feature space cost between the farming status feature vector of the farming status expert detection content of the m-th sample farming area visual data and the farming status feature vector of the farming status visual detection content.
[0069] Step S1212, determine the second dot product similarity coefficient between the farming status feature vector of the visual detection content of the farming status of the m-th sample farming area visual data and the farming status feature vector of the farming status expert detection content, and perform an inverse tangent transformation on the second dot product similarity coefficient to generate the first feature space cost between the farming status feature vector of the visual detection content of the farming status of the m-th sample farming area visual data and the farming status feature vector of the farming status expert detection content.
[0070] Step S122 includes:
[0071] Step S1221, the sum of the diagnostic boundary offset enhancement amount and the first feature space cost between the farming status feature vector of the farming status expert detection content of the m-th sample farming area visual data to the farming status feature vector of the farming status visual detection content, is output as the second feature space cost between the farming status feature vector of the farming status expert detection content of the m-th sample farming area visual data to the farming status feature vector of the farming status visual detection content.
[0072] Step S1222, the sum of the diagnostic boundary offset enhancement amount and the first feature space cost between the farming status feature vector of the visual detection content of the farming status of the m-th sample farming area visual data to the farming status feature vector of the farming status expert detection content is output as the second feature space cost between the farming status feature vector of the visual detection content of the farming status of the m-th sample farming area visual data to the farming status feature vector of the farming status expert detection content.
[0073] In this embodiment, the server first calculates the dot product similarity coefficient between the farming status expert detection feature vector (denoted as E_A) and the farming status visual detection feature vector (denoted as V_A) of area A. The dot product similarity coefficient measures the degree of similarity between the two feature vectors in direction. The larger the value, the more similar it is.
[0074] In order to obtain a value between -π / 2 and π / 2, the server performs an inverse tangent transformation on the calculated dot product similarity coefficient. The value after the inverse tangent transformation is defined as the first feature space cost from the expert detection feature vector to the visual detection feature vector (denoted as C_A_to_V_A).
[0075] In addition, the server obtains a predefined feature space offset enhancement amount (denoted as δ), which is used to adjust the distance between samples of different categories in the feature space to enhance the classification ability of the network. The server adds the feature space offset enhancement amount δ to the first feature space cost C_A_to_V_A to obtain an enhanced second feature space cost (denoted as C_A_enhanced_to_V_A), which reflects the feature space distance from the expert detection feature vector to the visual detection feature vector after considering the diagnostic limit offset enhancement.
[0076] In a possible implementation, step S123 includes:
[0077] Step S1231, determining the third feature space cost between the breeding state feature vector of the breeding state expert detection content of the m-th sample breeding area visual data and the breeding state feature vector of the breeding state visual detection content of each sample breeding area visual data in the X-1 sample breeding area visual data, and the fourth feature space cost between the breeding state feature vector of the breeding state visual detection content of the m-th sample breeding area visual data and the breeding state feature vector of the breeding state expert detection content of each sample breeding area visual data in the X-1 sample breeding area visual data, wherein the X-1 sample breeding area visual data are the sample breeding area visual data among the X sample breeding area visual data except the m-th sample breeding area visual data.
[0078] Step S1232, performing sinusoidal calculation and then logarithmic calculation on the second feature space cost between the farming status feature vector of the farming status expert detection content of the m-th sample farming area visual data and the farming status feature vector of the farming status visual detection content, to generate the first feature matching degree between the farming status expert detection content of the m-th sample farming area visual data and the farming status visual detection content.
[0079] Step S1233, performing sinusoidal calculation and then logarithmic calculation on the third feature space cost between the breeding state feature vector of the breeding state expert detection content of the m-th sample breeding area visual data and the breeding state feature vector of the breeding state visual detection content of each sample breeding area visual data in the X-1 sample breeding area visual data, to generate the second feature matching degree between the breeding state expert detection content of the m-th sample breeding area visual data and the breeding state visual detection content of each sample breeding area visual data in the X-1 sample breeding area visual data.
[0080] Step S1234, determines the first feature loss corresponding to the mth sample breeding area visual data based on the first feature matching degree between the breeding status expert detection content of the mth sample breeding area visual data and the breeding status visual detection content, and the second feature matching degree between the breeding status expert detection content of the mth sample breeding area visual data and the breeding status visual detection content of each sample breeding area visual data in the X-1 sample breeding area visual data.
[0081] Step S1235, determines the second feature loss between the visual detection content of the breeding status of the m-th sample breeding area visual data and the expert detection content of the breeding status of the X-1 sample breeding area visual data based on the second feature space cost between the breeding status feature vector of the visual detection content of the breeding status of the m-th sample breeding area visual data to the breeding status feature vector of the expert detection content of the breeding status, and the fourth feature space cost corresponding to the m-th sample breeding area visual data.
[0082] Step S1236, determining the first front network learning error according to the first feature loss and the second feature loss corresponding to each sample breeding area visual data in the X sample breeding area visual data.
[0083] In this embodiment, in the monitoring system of a large pig farm, the server processes and analyzes the visual data from each breeding area and uses the breeding state abnormality diagnosis network to automatically identify the breeding state of the pigs. In order to optimize the network parameters, the server needs to calculate the first pre-network learning error, which is based on the feature space cost and feature matching degree of the visual data of each sample breeding area.
[0084] In detail, for the mth sample (region A), the server calculates the feature space cost between the farming status feature vector of its farming status expert detection content and the farming status feature vectors of the farming status visual detection content of the remaining X-1 samples (region B to region J). These costs reflect the difference between the expert detection and the visual detection of the remaining samples, which are recorded as the third feature space cost set {C_A_to_V_B, C_A_to_V_C, ..., C_A_to_V_J}.
[0085] Similarly, the server calculates the feature space cost between the farming status feature vector of the farming status visual detection content of the mth sample (area A) and the farming status feature vectors of the farming status expert detection content of the remaining X-1 samples (area B to area J), recorded as the fourth feature space cost set {C_V_A_to_E_B, C_V_A_to_E_C, ..., C_V_A_to_E_J}.
[0086] The server performs a sine calculation on the second feature space cost (denoted as C_A_enhanced_to_V_A) between the farming status expert detection content and the farming status visual detection content of the mth sample (area A), and then performs a logarithmic transformation on the result to obtain the first feature matching degree M_A_to_V_A, which measures the similarity between expert detection and visual detection.
[0087] For each cost in the third feature space cost set (such as C_A_to_V_B), the server also performs sine calculation and logarithmic transformation to generate a second feature matching degree set {M_A_to_V_B, M_A_to_V_C, ..., M_A_to_V_J} between the expert detection content of the mth sample (region A) and the visual detection content of the visual data of each remaining sample breeding area.
[0088] Based on the first feature matching degree M_A_to_V_A and the second feature matching degree set, the server calculates the first feature loss L_A_feature_1 corresponding to the mth sample (region A) through a certain loss function (such as cross entropy loss). This loss reflects the inconsistency between expert detection and visual detection, and between expert detection and visual detection of other samples.
[0089] Similarly, the server calculates the second feature loss L_A_feature_2 based on the second feature space cost between the visual detection content of the mth sample (area A) and the expert detection content (also recorded as C_A_enhanced_to_V_A because it is symmetrical) and the fourth feature space cost set. This loss measures the inconsistency between visual detection and expert detection, and between visual detection and expert detection of the remaining samples.
[0090] The server executes the above steps 1 to 3 for each of the X samples (regions A to J) to obtain the first feature loss and the second feature loss corresponding to each sample.
[0091] Finally, the server aggregates the first feature loss and the second feature loss of all sample breeding area visual data (possibly by averaging or weighted averaging) to obtain the first pre-network learning error E_pre_training, which reflects the overall difference between the network in the initial learning stage and the expert judgment and is a key indicator for updating network parameters.
[0092] Therefore, after calculating the second feature space cost of the visual data of each sample breeding area, the additional feature space cost and feature matching degree are further calculated, and the feature loss of the visual data of each sample breeding area is determined accordingly. Finally, the first front network learning error is summarized. This process provides a comprehensive evaluation and optimization basis for the front network learning of the breeding status abnormality diagnosis network.
[0093] In a possible implementation, the network parameter updating step of the abnormal breeding status diagnosis network includes advanced optimization, the network training error includes a first advanced optimization error, and step S130 includes:
[0094] Step S131, obtaining the visual detection content of the breeding status and the expert detection content of the breeding status of each sample breeding area visual data in the K sample breeding area visual data, and extracting the breeding status feature vector of the visual detection content of the breeding status and the expert detection content of the breeding status of each sample breeding area visual data in the K sample breeding area visual data through the breeding status abnormality diagnosis network after pre-network learning, where K is a positive integer.
[0095] Step S132, for the x-th sample breeding area visual data among the K sample breeding area visual data, obtain Q sample breeding area visual data having the same abnormal diagnosis label as the x-th sample breeding area visual data from the K sample breeding area visual data, where Q is a positive integer less than K.
[0096] Step S133, based on the diagnostic boundary offset enhancement amount, the diagnostic boundary between the breeding status feature vector of the breeding status visual detection content of the x-th sample breeding area visual data and the breeding status feature vector of the breeding status visual detection content of the Q sample breeding area visual data is enhanced to determine the first advanced optimization error.
[0097] Step S134, performing advanced optimization on the abnormal breeding status diagnosis network after the pre-network learning according to the first advanced optimization error.
[0098] In this embodiment, in the monitoring system of a large pig farm, the server has completed the pre-network learning phase of the abnormal breeding status diagnosis network. Through this phase of training, the network has initially acquired the ability to identify abnormal pig breeding status. However, in order to further improve the classification performance and generalization ability of the network, the server needs to be further optimized.
[0099] In detail, the server retrieves K new sample farming area visual data (area P to area U) from the farm database.
[0100] The server uses the aquaculture status abnormality diagnosis network that has been optimized through pre-network learning to extract features from the newly acquired K sample aquaculture area visual data. For each sample (such as area P), the server extracts the aquaculture status feature vector V_P_visual of its aquaculture status visual detection content and the aquaculture status feature vector V_P_expert of its aquaculture status expert detection content.
[0101] The server then checks the anomaly diagnosis label of each sample (such as region P) and finds Q samples (assuming Q = 3, i.e., regions R, S, and T) that have the same anomaly diagnosis label as region P from the K samples.
[0102] For the xth sample (region P), the server calculates the feature space cost between its farming status visual detection feature vector V_P_visual and the farming status visual detection feature vectors of Q samples with the same label (regions R, S, T). These costs reflect the distance between samples with the same abnormal diagnosis label in the feature space.
[0103] The server applies the diagnostic boundary offset enhancement amount to enhance the calculated feature space cost to increase or decrease the distance between samples with the same label, thereby enhancing the diagnostic boundary. The enhanced feature space cost is used to generate a portion of the first advanced optimization error.
[0104] The server repeats the above steps for each of the K samples, summarizes the enhanced feature space costs of all samples, and combines other possible loss terms (such as regularization loss) to calculate the first advanced optimization error E_advanced_training, which reflects the degree of difference between the network in the advanced optimization stage and the expert judgment.
[0105] The server uses the back propagation algorithm and the gradient descent method (or its variants) to update the parameters of the abnormal breeding status diagnosis network according to the first advanced optimization error E_advanced_training. During the parameter update process, the server adjusts the weights and biases of the network to minimize the advanced optimization error.
[0106] To ensure the effectiveness of advanced optimization, the server can use a portion of the validation data to evaluate network performance. If the validation error is too large, the server may need to adjust the learning rate, optimizer parameters, or add regularization terms, and perform advanced optimization again.
[0107] Therefore, after the abnormal breeding status diagnosis network completes the pre-network learning, the classification performance and generalization ability of the network are further improved through advanced optimization. In the advanced optimization process, the server first obtains new sample data and extracts features, then finds samples with the same abnormal diagnosis label, determines the advanced optimization error through diagnostic boundary reinforcement, and finally updates the network parameters based on this error. This process provides strong support for the continuous optimization and practical application of the abnormal breeding status diagnosis network.
[0108] In a possible implementation, step S133 includes:
[0109] Step S1331, for the y-th sample breeding area visual data among the Q sample breeding area visual data, determine the fifth feature space cost between the breeding status feature vector of the breeding status visual detection content of the x-th sample breeding area visual data and the breeding status feature vector of the breeding status visual detection content of the y-th sample breeding area visual data, where y is a positive integer not greater than Q.
[0110] Step S1332, based on the feature space offset enhancement amount, the fifth feature space cost is subjected to feature space offset enhancement, so as to generate a sixth feature space cost between the breeding state feature vector of the breeding state visual detection content of the x-th sample breeding area visual data and the breeding state feature vector of the breeding state visual detection content of the y-th sample breeding area visual data.
[0111] Step S1333: determining the first advanced optimization error according to the sixth feature space cost corresponding to each sample breeding area visual data in the K sample breeding area visual data.
[0112] In the monitoring system of a large pig farm, the server is performing an advanced optimization process for the abnormal breeding status diagnosis network. This process aims to further improve the network's ability to identify abnormal pig breeding status by adjusting network parameters. One of the key steps is to use the diagnostic boundary offset reinforcement to strengthen the diagnostic boundary between samples with the same abnormal diagnostic label, and determine the first advanced optimization error accordingly.
[0113] In detail, the server selects the yth sample from the Q samples with the same label (regions R, S, T) (assuming that region R is selected first, i.e., y=1).
[0114] Next, the feature space cost between the farming status feature vector V_P_visual of the farming status visual detection content of the x-th sample (area P) and the farming status feature vector V_R_visual of the farming status visual detection content of the y-th sample (area R) is calculated. This cost reflects the distance or similarity between the two feature vectors in the feature space, and is recorded as C_P_to_R (the fifth feature space cost).
[0115] The server obtains a predefined feature space offset enhancement amount (denoted as δ). The enhancement amount δ is added to the fifth feature space cost C_P_to_R to obtain the enhanced sixth feature space cost C_P_enhanced_to_R = C_P_to_R + δ, which reflects the new distance or similarity between the two feature vectors in the feature space after considering the diagnostic boundary offset.
[0116] The server repeats steps 1 and 2 for each of the Q samples with the same label (regions R, S, T), calculates the fifth feature space cost between the xth sample (region P) and them, and performs feature space offset enhancement to obtain the corresponding sixth feature space cost set {C_P_enhanced_to_R, C_P_enhanced_to_S, C_P_enhanced_to_T}.
[0117] The server not only needs to perform the above operation on the xth sample (region P), but also needs to perform similar operations on each of the K samples to obtain the sixth feature space cost between each sample and its sample with the same label. Based on the sixth feature space cost of the visual data of all sample breeding areas, the server calculates a loss function (such as cross entropy loss, mean square error, etc.), which measures the degree of difference between the network prediction and the expert judgment, and takes into account the feature space cost after the diagnostic boundary shift is strengthened.
[0118] The output value of the loss function is the first advanced optimization error E_advanced_training, which reflects the overall difference between the network in the advanced optimization stage and the expert judgment, and is the basis for further updating of network parameters.
[0119] Therefore, in the advanced optimization process, for each sample and the samples with the same abnormal diagnosis label, the feature space cost is calculated, the feature space offset enhancement amount is applied for enhancement, and finally the first advanced optimization error is determined based on the enhanced feature space cost of the visual data of the breeding areas of all samples. This process provides key data support and error evaluation for the continuous optimization of the breeding status abnormal diagnosis network.
[0120] In a possible implementation, step S1333 includes:
[0121] Step S1333-1, for the x-th sample breeding area visual data, determine the seventh feature space cost between the breeding state feature vector of the breeding state visual detection content of the x-th sample breeding area visual data and the breeding state feature vector of the breeding state visual detection content of each sample breeding area visual data in the K-1 sample breeding area visual data, the K-1 sample breeding area visual data are the sample breeding area visual data in the K sample breeding area visual data except the x-th sample breeding area visual data.
[0122] Step S1333-2, determines the advanced optimization feature loss corresponding to the x-th sample breeding area visual data based on the sixth feature space cost between the breeding status feature vector of the breeding status visual detection content of the x-th sample breeding area visual data and the breeding status feature vector of the breeding status visual detection content of the y-th sample breeding area visual data, and the seventh feature space cost corresponding to the x-th sample breeding area visual data.
[0123] Step S1333-3, determining the first advanced optimization error according to the advanced optimization feature loss corresponding to each sample breeding area visual data in the K sample breeding area visual data.
[0124] In the monitoring system of a large pig farm, the server is performing an advanced optimization process for the abnormal breeding status diagnosis network. In order to adjust the network parameters more accurately, the server needs to calculate the first advanced optimization error, which is based on the feature space cost between the visual data of each sample breeding area. The following is a detailed scenario example of each step in the process of determining the first advanced optimization error.
[0125] In this embodiment, for the xth sample (region P), the server selects a sample (assuming it is region Q) from K-1 other samples to calculate the feature space cost.
[0126] Next, the feature space cost between the farming status feature vector V_P_visual of the farming status visual detection content of area P and the farming status feature vector V_Q_visual of the farming status visual detection content of area Q is calculated. This cost reflects the distance or similarity between two different examples in the feature space, which is recorded as C_P_to_Q (the seventh feature space cost).
[0127] The server performs the above operation on each of the K-1 other samples, and calculates the seventh feature space cost between region P and them respectively, and obtains a cost set {C_P_to_Q1, C_P_to_Q2, ..., C_P_to_QK-1}.
[0128] For the xth sample (region P), the server has calculated the sixth feature space cost set {C_P_enhanced_to_R, C_P_enhanced_to_S, C_P_enhanced_to_T} between it and the samples with the same abnormal diagnosis label (such as regions R, S, T) through the previous steps. The server now needs to combine the sixth feature space cost with the seventh feature space cost to evaluate the position of region P in the feature space and its relationship with the visual data of all other sample breeding regions.
[0129] The server calculates a loss function based on the sixth feature space cost and the seventh feature space cost. The loss function may take into account the similarity, distance and diagnostic boundary enhancement effect between different examples. The output of the loss function is the advanced optimization feature loss L_P_advanced corresponding to the x-th example (region P), which reflects the contribution of region P to the network parameter adjustment in the advanced optimization stage.
[0130] The server performs the operations of step 1 and step 2 for each of the K samples, and calculates their corresponding advanced optimization feature losses. Then, the advanced optimization feature losses of the visual data of all sample breeding areas are aggregated (possibly by averaging or weighted averaging) to obtain the first advanced optimization error E_advanced_training.
[0131] The first advanced optimization error reflects the overall difference between the network and all sample data in the advanced optimization stage. The server can evaluate the performance of the network based on this error and decide whether it is necessary to further adjust the network parameters or optimization algorithm.
[0132] Therefore, in the process of advanced optimization, the feature space cost between the visual data of each sample breeding area is calculated, and the advanced optimization feature loss corresponding to each sample is determined by combining the enhanced feature space cost. Finally, the server summarizes the advanced optimization feature loss of the visual data of all sample breeding areas to obtain the first advanced optimization error, which provides key data support and error evaluation for the continuous optimization of the network.
[0133] In a possible implementation, the performing pre-network learning on the abnormal breeding status diagnosis network according to the first pre-network learning error includes:
[0134] Step A110, using the breeding state abnormality diagnosis network, extracting the state node feature vector of the breeding state visual detection content and the state node feature vector of the breeding state expert detection content of each sample breeding area visual data in the X sample breeding area visual data.
[0135] Step A120, for the mth sample breeding area visual data among the X sample breeding area visual data, determine the first optimal mapping allocation cost between the state node feature vector of the breeding state expert detection content of the mth sample breeding area visual data to the state node feature vector of the breeding state visual detection content, and the second optimal mapping allocation cost between the state node feature vector of the breeding state visual detection content of the mth sample breeding area visual data to the state node feature vector of the breeding state expert detection content.
[0136] Step A130, determining the third optimal mapping allocation cost between the state node feature vector of the farming status expert detection content of the m-th sample farming area visual data and the state node feature vector of the farming status visual detection content of each sample farming area visual data in the X-1 sample farming area visual data, and determining the fourth optimal mapping allocation cost between the state node feature vector of the farming status visual detection content of the m-th sample farming area visual data and the state node feature vector of the farming status expert detection content of each sample farming area visual data in the X-1 sample farming area visual data, wherein the X-1 sample farming area visual data are the sample farming area visual data among the X sample farming area visual data except the m-th sample farming area visual data.
[0137] Step A140, outputting a second front network learning error based on the first best mapping allocation cost, the second best mapping allocation cost, the third best mapping allocation cost and the fourth best mapping allocation cost corresponding to each sample breeding area visual data in the X sample breeding area visual data.
[0138] Step A150, performing pre-network learning on the abnormal breeding status diagnosis network according to the first pre-network learning error and the second pre-network learning error.
[0139] In the monitoring system of large pig farms, the server is responsible for running the abnormal breeding status diagnosis network and preliminarily optimizing the network parameters through the pre-network learning step. The core of the pre-network learning is to evaluate the difference between the network prediction and the expert judgment by calculating the optimal mapping allocation cost, and adjust the network parameters accordingly.
[0140] Specifically, the server loads X sample breeding area visual data from the database. Then, using the breeding state abnormality diagnosis network, the server extracts features from the visual detection content and expert detection content of each sample breeding area visual data to obtain the corresponding state node feature vectors, which contain key information of the breeding state, such as the activity level, body shape, color distribution, etc. of the pigs.
[0141] Take the mth sample (assuming it is region A) as an example. The server calculates the optimal mapping allocation cost between the state node feature vector of the farming status expert detection content in region A and the state node feature vector of the farming status visual detection content, denoted as C_A_expert_to_visual. This cost reflects the optimal matching cost of the state node features between expert detection and visual detection. Similarly, the server also calculates the optimal mapping allocation cost between the state node feature vector of the farming status visual detection content in region A and the state node feature vector of the farming status expert detection content, denoted as C_A_visual_to_expert. This cost is the optimal matching cost of the reverse mapping.
[0142] For region A, the server also needs to calculate the optimal mapping allocation cost set between the state node feature vector of its expert detection content and the state node feature vector of the visual detection content of the remaining X-1 samples (region B to region J), which is recorded as {C_A_expert_to_V_B, C_A_expert_to_V_C, ..., C_A_expert_to_V_J} (third optimal mapping allocation cost). Similarly, the server also calculates the optimal mapping allocation cost set between the state node feature vector of the visual detection content of region A and the state node feature vector of the expert detection content of the visual data of the remaining X-1 samples of the breeding area, which is recorded as {C_A_visual_to_E_B, C_A_visual_to_E_C, ..., C_A_visual_to_E_J} (fourth optimal mapping allocation cost).
[0143] The server sums up all four best mapping assignment costs (C_A_expert_to_visual, C_A_visual_to_expert, {C_A_expert_to_V_}, {C_A_visual_to_E_}) for the mth example (region A).
[0144] Repeat the operations of step A110 to step A130 for each of the X samples to obtain the optimal mapping allocation cost set of the visual data of the breeding areas of all samples. Based on the optimal mapping allocation cost set of the visual data of the breeding areas of all samples, the server calculates a comprehensive error value, namely the second pre-network learning error E_pre_training_2, which reflects the overall performance of the network at the feature node mapping level.
[0145] The server combines the first pre-network learning error E_pre_training_1 (calculated based on the feature space cost) and the second pre-network learning error E_pre_training_2 to jointly guide the parameter adjustment of the abnormal breeding status diagnosis network. Using the back propagation algorithm, the server adjusts the weights and biases of the network layer by layer according to the comprehensive error value to minimize the error. Through multiple iterations, the server continuously optimizes the network parameters until the error converges to an acceptable range.
[0146] Therefore, in the pre-network learning process of the breeding status abnormality diagnosis network, a series of steps such as extracting the state node feature vector, calculating the optimal mapping allocation cost, summarizing the error value and adjusting the network parameters are used to preliminarily optimize the network performance, laying the foundation for subsequent advanced optimization and practical application.
[0147] In a possible implementation, step S134 includes:
[0148] Step S1341, using the breeding state abnormality diagnosis network learned by the previous network, extracting the state node feature vector of the breeding state visual detection content of each sample breeding area visual data in the K sample breeding area visual data.
[0149] Step S1342, for the jth sample breeding area visual data among the Q sample breeding area visual data, determine the fifth optimal mapping allocation cost between the state node feature vector of the breeding status visual detection content of the xth sample breeding area visual data and the breeding status feature vector of the breeding status visual detection content of the jth sample breeding area visual data.
[0150] Step S1343, determine the sixth optimal mapping allocation cost between the state node feature vector of the farming status visual detection content of the x-th sample farming area visual data and the state node feature vector of the farming status visual detection content of each sample farming area visual data in the K-1 sample farming area visual data, and the K-1 sample farming area visual data are the sample farming area visual data in the K sample farming area visual data except the x-th sample farming area visual data.
[0151] Step S1344, determining a second advanced optimization error according to the fifth best mapping allocation cost and the sixth best mapping allocation cost corresponding to each sample breeding area visual data in the K sample breeding area visual data.
[0152] Step S1345, performing advanced optimization on the abnormal breeding status diagnosis network after the pre-network learning according to the first advanced optimization error and the second advanced optimization error.
[0153] In this embodiment, in the monitoring system of a large pig farm, the server has completed the pre-network learning phase of the abnormal breeding status diagnosis network and now enters the advanced optimization phase to further improve the classification performance and generalization ability of the network. The core of advanced optimization is to fine-tune the network parameters by calculating the optimal mapping allocation cost.
[0154] In detail, the server uses the breeding status abnormality diagnosis network learned by the previous network to perform feature extraction on the visual detection content of the visual data of each sample breeding area, especially extracting the state node feature vectors. These state node feature vectors contain the key information nodes of the breeding status, which are used for the subsequent optimal mapping allocation cost calculation.
[0155] For the xth sample (region P), the server selects the jth sample from the Q samples with the same label (assuming that region R is selected first, that is, j=1).
[0156] The server calculates the optimal mapping allocation cost between the state node feature vector of the farming state visual detection content of region P and the farming state feature vector of the farming state visual detection content of region R. Since this involves a mixture of state node feature vectors and farming state feature vectors, it is assumed that the server has unified them into the same feature space in some way (such as feature conversion or mapping). The cost reflects the cost of the state node mapping relationship between two samples with the same label in the feature space, recorded as C_P_to_R_node_feature (fifth optimal mapping allocation cost). The server performs the above operation on each of the Q samples with the same label, and calculates the fifth optimal mapping allocation cost between region P and them respectively.
[0157] For the xth sample (region P), the server selects a sample from K-1 other samples (i.e., all samples except region P) for mapping cost calculation. The server calculates the optimal mapping allocation cost between the state node feature vector of the farming status visual detection content of region P and the state node feature vector of the farming status visual detection content of the sample. This cost reflects the state node mapping relationship cost of samples with different labels in the feature space, which is recorded as C_P_to__node (where represents the identifier of other samples, and not all samples are listed here to simplify the description).
[0158] The server performs the above operation on each of the K-1 other samples, and calculates the sixth best mapping allocation cost between region P and them, and obtains a cost set. The server summarizes all the fifth and sixth best mapping allocation costs of the xth sample (region P).
[0159] Repeat the operations of step S1341 to step S1343 for each of the K samples to obtain a set of mapping costs for the visual data of all sample breeding areas. Based on the set of mapping costs for the visual data of all sample breeding areas, the server calculates a comprehensive error value, namely the second advanced optimization error E_advanced_training_2, which reflects the overall performance of the network on the state node feature mapping relationship in the advanced optimization stage.
[0160] The server combines the first advanced optimization error E_advanced_training_1 (calculated based on the feature space cost) and the second advanced optimization error E_advanced_training_2 as a comprehensive guide for adjusting network parameters. Using the back propagation algorithm, the server adjusts the weights and biases of the network layer by layer according to the comprehensive error value to minimize the error. Through multiple iterations, the server continuously optimizes the network parameters until the error converges to an acceptable range, completing the advanced optimization process.
[0161] Therefore, in the advanced optimization process of the breeding status abnormality diagnosis network, a series of steps such as extracting the state node feature vector, calculating the optimal mapping allocation cost, summarizing the error value and adjusting the network parameters are used to finely optimize the network performance to improve its recognition and generalization capabilities for breeding status abnormalities.
[0162] Figure 2 The hardware structure of the farming monitoring system 100 provided in the embodiment of the present application for implementing the farming status monitoring method based on visual monitoring is shown as follows: Figure 2 As shown, the farming monitoring system 100 may include a processor 110 , a machine-readable storage medium 120 , a bus 130 , and a communication unit 140 .
[0163] In one possible design, the farming monitoring system 100 can be a single server or a server group. The server group can be centralized or distributed (for example, the farming monitoring system 100 can be a distributed system). In some embodiments, the farming monitoring system 100 can be local or remote. For example, the farming monitoring system 100 can access information and / or data stored in a machine-readable storage medium 120 via a network. For another example, the farming monitoring system 100 can be directly connected to the machine-readable storage medium 120 to access the stored information and / or data. In some embodiments, the farming monitoring system 100 can be implemented on a farming monitoring system. As an example only, the farming monitoring system can include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-layer cloud, etc. or any aggregation thereof.
[0164] The machine-readable storage medium 120 can store data and / or instructions. In some embodiments, the machine-readable storage medium 120 can store data obtained from an external terminal. In some embodiments, the machine-readable storage medium 120 can store data and / or instructions that the farming monitoring system 100 uses to execute or use to complete the exemplary methods described in this application.
[0165] During the specific implementation process, one or more processors 110 execute computer executable instructions stored in the machine-readable storage medium 120, so that the processor 110 can execute the farming status monitoring method based on visual monitoring in the above method embodiment. The processor 110, the machine-readable storage medium 120 and the communication unit 140 are connected through the bus 130, and the processor 110 can be used to control the sending and receiving actions of the communication unit 140.
[0166] The specific implementation process of the processor 110 can refer to the various method embodiments executed by the above-mentioned breeding monitoring system 100. The implementation principles and technical effects are similar, and this embodiment will not be repeated here.
[0167] In addition, an embodiment of the present application also provides a readable storage medium, in which computer executable instructions are set. When a processor executes the computer executable instructions, the above-mentioned farming status monitoring method based on visual monitoring is implemented.
[0168] It should be noted that in order to simplify the description disclosed in this application and thus help understand one or more embodiments of the invention, in the foregoing description of the embodiments of the present application, multiple features are sometimes combined into one embodiment, drawings, or descriptions thereof. Similarly, it should be noted that in order to simplify the description disclosed in this application and thus help understand one or more embodiments of the invention, in the foregoing description of the embodiments of the present application, multiple features are sometimes combined into one embodiment, drawings, or descriptions thereof.
Claims
1. A method for monitoring aquaculture status based on visual monitoring, characterized in that: The method comprises: Obtaining visual detection content of farming status and expert detection content of farming status of each sample farming area visual data in X sample farming area visual data, and extracting farming status feature vectors of visual detection content of farming status and expert detection content of farming status of each sample farming area visual data by using farming status abnormality diagnosis network, wherein X is a positive integer; According to the previously defined diagnostic boundary offset reinforcement amount, as well as the farming state feature vector of the farming state visual detection content and the farming state feature vector of the farming state expert detection content of each sample farming area visual data, the diagnostic boundary between the sample farming area visual data with different abnormal diagnosis labels in the X sample farming area visual data is reinforced to generate the network training error of the farming state abnormal diagnosis network; According to the network training error, updating the network parameters of the abnormal breeding status diagnosis network; Obtain visual detection content of the breeding state after visual detection of visual data of the target breeding area, perform abnormal diagnosis label diagnosis on the visual detection content of the breeding state of the visual data of the target breeding area according to the breeding state abnormal diagnosis network after network parameters are updated, and generate abnormal diagnosis label diagnosis results of the visual data of the target breeding area; The network parameter updating step of the abnormal breeding status diagnosis network includes pre-network learning, and the network training error includes a first pre-network learning error; The method of strengthening the diagnostic boundary offset reinforcement amount defined previously, and the farming state feature vector of the farming state visual detection content of each sample farming area visual data and the farming state feature vector of the farming state expert detection content, strengthening the diagnostic boundary between the sample farming area visual data with different abnormal diagnosis labels in the X sample farming area visual data, and generating the network training error of the farming state abnormal diagnosis network, comprises: Strengthening the diagnostic boundary between the farming state feature vector of the farming state visual detection content and the farming state feature vector of the farming state expert detection content of the farming state visual data of each sample farming area according to the diagnostic boundary offset reinforcement amount, and determining the first front network learning error; The updating of network parameters of the abnormal breeding status diagnosis network according to the network training error includes: Performing pre-network learning on the abnormal breeding status diagnosis network according to the first pre-network learning error; The diagnostic limit offset enhancement amount includes a feature space offset enhancement amount, and according to the diagnostic limit offset enhancement amount, the diagnostic limit between the farming state feature vector of the farming state visual detection content of the farming state visual data of each sample farming area and the farming state feature vector of the farming state expert detection content is enhanced to determine the first front network learning error, including: For the mth sample breeding area visual data among the X sample breeding area visual data, determine a first feature space cost between a breeding state feature vector of a breeding state expert detection content of the mth sample breeding area visual data and a breeding state feature vector of a breeding state visual detection content, where m is a positive integer not greater than X; According to the feature space offset enhancement amount, the first feature space cost is subjected to feature space offset enhancement to generate a second feature space cost between the farming state feature vector of the farming state expert detection content of the m-th sample farming area visual data and the farming state feature vector of the farming state visual detection content; The first front network learning error is determined according to the second feature space cost corresponding to each sample breeding area visual data in the X sample breeding area visual data.
2. The method for monitoring aquaculture status based on visual monitoring according to claim 1, characterized in that: The determining of the first feature space cost between the farming state feature vector of the farming state expert detection content of the m-th sample farming area visual data and the farming state feature vector of the farming state visual detection content comprises: Determine a first dot product similarity coefficient between the farming state feature vector of the farming state expert detection content of the m-th sample farming area visual data and the farming state feature vector of the farming state visual detection content, and perform an arc tangent transformation on the first dot product similarity coefficient to generate a first feature space cost between the farming state feature vector of the farming state expert detection content of the m-th sample farming area visual data and the farming state feature vector of the farming state visual detection content; Determine a second dot product similarity coefficient between the farming state feature vector of the farming state visual detection content of the m-th sample farming area visual data and the farming state feature vector of the farming state expert detection content, and perform an arc tangent transformation on the second dot product similarity coefficient to generate a first feature space cost between the farming state feature vector of the farming state visual detection content of the m-th sample farming area visual data and the farming state feature vector of the farming state expert detection content; The first feature space cost is subjected to feature space offset enhancement according to the feature space offset enhancement amount to generate a second feature space cost between the farming state feature vector of the farming state expert detection content of the m-th sample farming area visual data and the farming state feature vector of the farming state visual detection content, including: The sum of the diagnostic limit offset reinforcement amount and the first feature space cost between the farming state feature vector of the farming state expert detection content of the m-th sample farming area visual data and the farming state feature vector of the farming state visual detection content is output as the second feature space cost between the farming state feature vector of the farming state expert detection content of the m-th sample farming area visual data and the farming state feature vector of the farming state visual detection content; The sum of the diagnostic limit offset reinforcement amount and the first feature space cost between the farming state feature vector of the farming state visual detection content of the m-th sample farming area visual data to the farming state feature vector of the farming state expert detection content is output as the second feature space cost between the farming state feature vector of the farming state visual detection content of the m-th sample farming area visual data to the farming state feature vector of the farming state expert detection content; The determining the first front network learning error according to the second feature space cost corresponding to each sample breeding area visual data in the X sample breeding area visual data comprises: Determine a third feature space cost between a breeding state feature vector of a breeding state expert detection content of the m-th sample breeding area visual data and a breeding state feature vector of a breeding state visual detection content of each sample breeding area visual data in X-1 sample breeding area visual data, and a fourth feature space cost between a breeding state feature vector of a breeding state visual detection content of the m-th sample breeding area visual data and a breeding state feature vector of a breeding state expert detection content of each sample breeding area visual data in the X-1 sample breeding area visual data, wherein the X-1 sample breeding area visual data are the sample breeding area visual data in the X sample breeding area visual data except the m-th sample breeding area visual data; Performing a sine calculation and then a logarithmic calculation on the second feature space cost between the farming state feature vector of the farming state expert detection content of the farming state visual detection content of the m-th sample farming area visual data and the farming state feature vector of the farming state visual detection content, to generate a first feature matching degree between the farming state expert detection content of the farming state visual data of the m-th sample farming area and the farming state visual detection content; Performing a sine calculation and then a logarithmic calculation on the third feature space cost between the breeding state feature vector of the breeding state expert detection content of the m-th sample breeding area visual data and the breeding state feature vector of the breeding state visual detection content of each sample breeding area visual data in the X-1 sample breeding area visual data, to generate a second feature matching degree between the breeding state expert detection content of the m-th sample breeding area visual data and the breeding state visual detection content of each sample breeding area visual data in the X-1 sample breeding area visual data; Determine the first feature loss corresponding to the m-th sample breeding area visual data according to the first feature matching degree between the breeding state expert detection content and the breeding state visual detection content of the m-th sample breeding area visual data, and the second feature matching degree between the breeding state expert detection content of the m-th sample breeding area visual data and the breeding state visual detection content of each sample breeding area visual data in the X-1 sample breeding area visual data; Determine the second feature loss between the visual detection content of the farming state of the m-th sample farming area visual data and the expert detection content of the farming state of the X-1 sample farming area visual data according to the second feature space cost between the farming state feature vector of the visual detection content of the farming state of the m-th sample farming area visual data to the farming state feature vector of the expert detection content of the farming state, and the fourth feature space cost corresponding to the m-th sample farming area visual data; The first front network learning error is determined according to the first feature loss and the second feature loss corresponding to each sample breeding area visual data in the X sample breeding area visual data.
3. The method for monitoring aquaculture status based on visual monitoring according to any one of claims 1 to 2, characterized in that: The network parameter updating step of the abnormal breeding state diagnosis network includes advanced optimization, the network training error includes a first advanced optimization error, and the network parameter updating of the abnormal breeding state diagnosis network based on the network training error includes: Obtaining visual detection content of farming status and expert detection content of farming status of each sample farming area visual data from K sample farming area visual data, and extracting farming status feature vectors of visual detection content of farming status and expert detection content of farming status of each sample farming area visual data from the K sample farming area visual data through a farming status abnormality diagnosis network learned by a pre-network, wherein K is a positive integer; For the x-th sample breeding area visual data among the K sample breeding area visual data, Q sample breeding area visual data having the same abnormal diagnosis label as the x-th sample breeding area visual data are obtained from the K sample breeding area visual data, where Q is a positive integer less than K; Strengthening the diagnostic boundary between the farming state feature vector of the farming state visual detection content of the x-th sample farming area visual data and the farming state feature vector of the farming state visual detection content of the Q-th sample farming area visual data according to the diagnostic boundary offset reinforcement amount, and determining the first advanced optimization error; According to the first advanced optimization error, the breeding status abnormal diagnosis network after the front network learning is advanced optimized.
4. The method for monitoring aquaculture status based on visual monitoring according to claim 3, characterized in that: The step of strengthening the diagnostic boundary between the farming state feature vector of the farming state visual detection content of the x-th sample farming area visual data and the farming state feature vector of the farming state visual detection content of the Q-th sample farming area visual data according to the diagnostic boundary offset strengthening amount, and determining the first advanced optimization error includes: For the yth sample breeding area visual data among the Q sample breeding area visual data, determine the fifth feature space cost between the breeding state feature vector of the breeding state visual detection content of the xth sample breeding area visual data and the breeding state feature vector of the breeding state visual detection content of the yth sample breeding area visual data, where y is a positive integer not greater than Q; According to the feature space offset enhancement amount, the fifth feature space cost is feature space offset enhanced to generate a sixth feature space cost between the breeding state feature vector of the breeding state visual detection content of the x-th sample breeding area visual data and the breeding state feature vector of the breeding state visual detection content of the y-th sample breeding area visual data; The first advanced optimization error is determined according to the sixth feature space cost corresponding to each sample breeding area visual data in the K sample breeding area visual data.
5. The method for monitoring aquaculture status based on visual monitoring according to claim 4, characterized in that: The determining the first advanced optimization error according to the sixth feature space cost corresponding to each sample breeding area visual data in the K sample breeding area visual data comprises: For the x-th sample breeding area visual data, determine the seventh feature space cost between the breeding state feature vector of the breeding state visual detection content of the x-th sample breeding area visual data and the breeding state feature vector of the breeding state visual detection content of each sample breeding area visual data in K-1 sample breeding area visual data, wherein the K-1 sample breeding area visual data are the sample breeding area visual data in the K sample breeding area visual data except the x-th sample breeding area visual data; Determine the advanced optimization feature loss corresponding to the x-th sample breeding area visual data according to the sixth feature space cost between the breeding state feature vector of the breeding state visual detection content of the x-th sample breeding area visual data and the breeding state feature vector of the breeding state visual detection content of the y-th sample breeding area visual data, and the seventh feature space cost corresponding to the x-th sample breeding area visual data; The first advanced optimization error is determined according to the advanced optimization feature loss corresponding to each sample breeding area visual data in the K sample breeding area visual data.
6. The method for monitoring aquaculture status based on visual monitoring according to claim 1, characterized in that: The method of performing pre-network learning on the abnormal breeding status diagnosis network according to the first pre-network learning error includes: Utilizing the breeding state abnormality diagnosis network, extracting the state node feature vector of the breeding state visual detection content and the state node feature vector of the breeding state expert detection content of each sample breeding area visual data in the X sample breeding area visual data; For the mth sample breeding area visual data among the X sample breeding area visual data, determine a first optimal mapping allocation cost between a state node feature vector of a breeding state expert detection content of the mth sample breeding area visual data and a state node feature vector of a breeding state visual detection content, and a second optimal mapping allocation cost between a state node feature vector of a breeding state visual detection content of the mth sample breeding area visual data and a state node feature vector of a breeding state expert detection content; Determine a third optimal mapping allocation cost between a state node feature vector of a farming state expert detection content of the m-th sample farming area visual data and a state node feature vector of a farming state visual detection content of each sample farming area visual data in X-1 sample farming area visual data, and determine a fourth optimal mapping allocation cost between a state node feature vector of a farming state visual detection content of the m-th sample farming area visual data and a state node feature vector of a farming state expert detection content of each sample farming area visual data in X-1 sample farming area visual data, wherein the X-1 sample farming area visual data are the sample farming area visual data in the X sample farming area visual data except the m-th sample farming area visual data; Outputting a second front network learning error according to the first best mapping allocation cost, the second best mapping allocation cost, the third best mapping allocation cost and the fourth best mapping allocation cost corresponding to each sample breeding area visual data in the X sample breeding area visual data; Based on the first front-end network learning error and the second front-end network learning error, the breeding status abnormality diagnosis network is subjected to front-end network learning.
7. The method for monitoring aquaculture status based on visual monitoring according to claim 3, characterized in that: The method of performing advanced optimization on the abnormal breeding status diagnosis network after the front network learning according to the first advanced optimization error includes: Utilizing the aquaculture status abnormality diagnosis network learned by the pre-network, extracting the state node feature vector of the aquaculture status visual detection content of each sample aquaculture area visual data in the K sample aquaculture area visual data; For the j-th sample breeding area visual data among the Q sample breeding area visual data, determining a fifth optimal mapping allocation cost between the state node feature vector of the breeding state visual detection content of the x-th sample breeding area visual data and the breeding state feature vector of the breeding state visual detection content of the j-th sample breeding area visual data; Determine a sixth optimal mapping allocation cost between a state node feature vector of a farming state visual detection content of the x-th sample farming area visual data and a state node feature vector of a farming state visual detection content of each sample farming area visual data in K-1 sample farming area visual data, wherein the K-1 sample farming area visual data are the sample farming area visual data in the K sample farming area visual data except the x-th sample farming area visual data; Determining a second advanced optimization error according to a fifth best mapping allocation cost and a sixth best mapping allocation cost corresponding to each sample breeding area visual data in the K sample breeding area visual data; According to the first advanced optimization error and the second advanced optimization error, the breeding status abnormal diagnosis network after the front network learning is advanced optimized.
8. A breeding monitoring system, characterized in that: The breeding monitoring system includes a processor and a memory, the memory is connected to the processor, the memory is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the memory to implement the breeding status monitoring method based on visual monitoring as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Video scene text detection method and system based on deep learning, medium and equipment
CN109919025A
Feed production equipment defect identification method and system based on video monitoring inspection
CN116050807A