why my training do not make sense?

3 ビュー (過去 30 日間)
Shuai Wu
Shuai Wu 2023 年 6 月 26 日
回答済み: Piyush Dubey 2023 年 9 月 5 日
The training of the CNN involves data set labeling, class weight balance, network training, and result evaluation. Figure S13 shows the schematic of the data annotation workflow for training data set labeling. For the training data set, we selected 252 representative dark-field images that covered a wide range of cytokine concentrations from assay blank to 0 pg mL−1 to 10,000 pg mL−1. To enhance the data set labeling speed, we wrote a thresholding algorithm that computed a global threshold T from a grayscale image, using Otsu’s method.57 Using this global threshold together with the standard image erosions and dilations, we labeled the recognized AgNC spot pixel as class “1” and the background pixel as class “0” to generate a binary image mask called “Labeled image”. Note that this labeled image was still preliminary and failed to detect the AgNC spots that had large intensity variance or that were aggregated. We then used several correction algorithms to manually add or remove the falsely recognized area. We used a 5 × 5 pixel unit size for normalizing the labeling of all the recognized AgNC spots including individual, aggregated, bright, and dim spots. In addition to the average individual spots, this normalization labeling process would not only help the neutral network to recognize the very deem spots but also be able to separate the aggregated spots with strong intensity comparing to the global thresholding method (Otsu’s method). The human corrected “Labeled image” was later used to train the neural network. In addition, we considered the class weight balance using the inverse frequency weighting method which gives more weight to less frequently appearing classes (AgNC class).
this was my code below, why it is not work?
  1 件のコメント
Shreeya
Shreeya 2023 年 8 月 22 日
Hello Shuai Wu
Can you please clarify that by results not making sense, do you mean overfitting ?

サインインしてコメントする。

回答 (1 件)

Piyush Dubey
Piyush Dubey 2023 年 9 月 5 日
Hi Shuai,
I understand that you are trying to train a CNN model which involves data set labelling, class weight balance and result evaluation. After a couple of iterations, the accuracy attains saturation and the model stops learning henceforth. There seems to be no syntactical error in the code attached by you.
Please know that accuracy of about 100% in first couple iterations points to the situation where the batches are of different sizes or the same batch has been fed for training multiple times. Insufficient records in dataset might as well account for this problem. Apart from these, there could be several reasons why the CNN training may not be working effectively.
Please refer to the following methods that might help resolve the issue:
  • Insufficient or biased training data: The quality and representativeness of the training data are crucial for the success of a CNN. If the dataset is too small or biased, meaning it does not adequately cover the range of variations and scenarios that the model may encounter, the CNN may struggle to generalize well. Ensure that the dataset is diverse, includes enough samples from each class, and covers a wide range of cytokine concentrations.
  • Inaccurate labeling: If the labeling process, including the thresholding algorithm and manual correction, is not accurate, it can negatively impact the training process. If the labeled image fails to detect certain AgNC spots or contains false positives/negatives, the CNN will learn from incorrect information. Double-check the labeling process and consider alternative methods or additional preprocessing steps to improve accuracy.
  • Imbalanced class distribution: Class imbalance occurs when certain classes have significantly fewer samples compared to others. In this case, the AgNC class may be less frequent. Imbalanced class distribution can lead to biased learning and poor performance in minority classes. The inverse frequency weighting method is a good approach to address this issue, but make sure the weights are properly calculated and applied during training.
  • Inappropriate network architecture or hyperparameters: The choice of network architecture, such as the number and type of layers, can greatly impact the performance of a CNN. Additionally, hyperparameters such as learning rate, batch size, and regularization techniques need to be appropriately tuned. Experiment with different architectures and hyperparameter settings to find the optimal configuration for your specific problem.
  • Insufficient training iterations: CNNs often require a sufficient number of training iterations to converge and learn the underlying patterns in the data. If the training process is terminated too early, the model may not have learned enough and could result in poor performance. Ensure that the network is trained for an adequate number of epochs or iterations.
Hope this helps.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by